/** * @deprecated as of 1.320. * Use {@link #setTemporarilyOffline(boolean, OfflineCause)} */ @Deprecated public void setTemporarilyOffline(boolean temporarilyOffline) { setTemporarilyOffline(temporarilyOffline,null); }
/** * @deprecated Implementation of CLI command "online-node" moved to {@link hudson.cli.OnlineNodeCommand}. */ @Deprecated public void cliOnline() throws ExecutionException, InterruptedException { checkPermission(CONNECT); setTemporarilyOffline(false, null); }
/** * @deprecated Implementation of CLI command "offline-node" moved to {@link hudson.cli.OfflineNodeCommand}. * * @param cause * Record the note about why you are disconnecting this node */ @Deprecated public void cliOffline(String cause) throws ExecutionException, InterruptedException { checkPermission(DISCONNECT); setTemporarilyOffline(true, new ByCLI(cause)); }
@Override public void onOnline(Computer c, TaskListener listener) { Node node = c.getNode(); // At startup, we need to restore any previously in-effect temp offline cause. // We wait until the computer is started rather than getting the data to it sooner // so that the normal computer start up processing works as expected. if (node!= null && node.temporaryOfflineCause != null && node.temporaryOfflineCause != c.getOfflineCause()) { c.setTemporarilyOffline(true, node.temporaryOfflineCause); } } }
/** * Utility method to mark the computer online for derived classes. * * @return true * if the node was actually taken online by this act (as opposed to us deciding not to do it, * or the computer was already online.) */ protected boolean markOnline(Computer c) { if(isIgnored() || c.isOnline()) return false; // noop c.setTemporarilyOffline(false,null); return true; }
@RequirePOST public HttpResponse doToggleOffline(@QueryParameter String offlineMessage) throws IOException, ServletException { if(!temporarilyOffline) { checkPermission(DISCONNECT); offlineMessage = Util.fixEmptyAndTrim(offlineMessage); setTemporarilyOffline(!temporarilyOffline, new OfflineCause.UserCause(User.current(), offlineMessage)); } else { checkPermission(CONNECT); setTemporarilyOffline(!temporarilyOffline,null); } return HttpResponses.redirectToDot(); }
@RequirePOST public HttpResponse doChangeOfflineCause(@QueryParameter String offlineMessage) throws IOException, ServletException { checkPermission(DISCONNECT); offlineMessage = Util.fixEmptyAndTrim(offlineMessage); setTemporarilyOffline(true, new OfflineCause.UserCause(User.current(), offlineMessage)); return HttpResponses.redirectToDot(); }
/** * Utility method to mark the computer offline for derived classes. * * @return true * if the node was actually taken offline by this act (as opposed to us deciding not to do it, * or the computer already marked offline.) */ protected boolean markOffline(Computer c, OfflineCause oc) { if(isIgnored() || c.isTemporarilyOffline()) return false; // noop c.setTemporarilyOffline(true, oc); // notify the admin MonitorMarkedNodeOffline no = AdministrativeMonitor.all().get(MonitorMarkedNodeOffline.class); if(no!=null) no.active = true; return true; }
/** * @deprecated as of 1.320. Use * {@link #setTemporarilyOffline(boolean, OfflineCause)} */ public void setTemporarilyOffline(boolean temporarilyOffline) { setTemporarilyOffline(temporarilyOffline, null); }
/** * @deprecated Implementation of CLI command "online-node" moved to {@link hudson.cli.OnlineNodeCommand}. */ @Deprecated public void cliOnline() throws ExecutionException, InterruptedException { checkPermission(CONNECT); setTemporarilyOffline(false, null); }
/** * @deprecated Implementation of CLI command "offline-node" moved to {@link hudson.cli.OfflineNodeCommand}. * * @param cause * Record the note about why you are disconnecting this node */ @Deprecated public void cliOffline(String cause) throws ExecutionException, InterruptedException { checkPermission(DISCONNECT); setTemporarilyOffline(true, new ByCLI(cause)); }
@Override public void onOnline(Computer c, TaskListener listener) { Node node = c.getNode(); if (null != node.offlineCause && node.offlineCause != c.getOfflineCause()) { c.setTemporarilyOffline(true, node.offlineCause); } } }
@CLIMethod(name="online-node") public void cliOnline() throws ExecutionException, InterruptedException { checkPermission(Hudson.ADMINISTER); setTemporarilyOffline(false,null); }
@Override public void onOnline(Computer c, TaskListener listener) { Node node = c.getNode(); if (null != node.offlineCause && node.offlineCause != c.getOfflineCause()) { c.setTemporarilyOffline(true, node.offlineCause); } } }
@Override public void onOnline(Computer c, TaskListener listener) { Node node = c.getNode(); if (null != node.offlineCause && node.offlineCause != c.getOfflineCause()) { c.setTemporarilyOffline(true, node.offlineCause); } } }
@Override public void onOnline(Computer c, TaskListener listener) { Node node = c.getNode(); if (null != node.offlineCause && node.offlineCause != c.getOfflineCause()) { c.setTemporarilyOffline(true, node.offlineCause); } } }
/** * CLI command to mark the node offline. */ @CLIMethod(name="offline-node") public void cliOffline(@Option(name="-m",usage="Record the note about why you are disconnecting this node") String cause) throws ExecutionException, InterruptedException { checkPermission(Hudson.ADMINISTER); setTemporarilyOffline(true,new ByCLI(cause)); }
/** * CLI command to mark the node offline. */ @CLIMethod(name = "offline-node") public void cliOffline(@Option(name = "-m", usage = "Record the note about why you are disconnecting this node") String cause) throws ExecutionException, InterruptedException { checkPermission(CONFIGURE); setTemporarilyOffline(true, new ByCLI(cause)); }
/** * CLI command to mark the node offline. */ @CLIMethod(name="offline-node") public void cliOffline(@Option(name="-m",usage="Record the note about why you are disconnecting this node") String cause) throws ExecutionException, InterruptedException { checkPermission(Hudson.ADMINISTER); setTemporarilyOffline(true,new ByCLI(cause)); }
@Override public void run() { if (plugin.isNodeShuttingDown(nodeName) && !computer.isTemporarilyOffline() && !QueueUtils.isBuilding(computer) && !QueueUtils.hasNodeExclusiveItemInQueue(computer)) { logger.log(Level.INFO, "Node {0} idle; setting offline since lenient " + "shutdown was active for this node", nodeName); User user = plugin.getOfflineByUser(nodeName); computer.setTemporarilyOffline(true, new LenientOfflineCause(user)); } } };