/** * 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; }
@Override @SuppressWarnings("deprecation") public boolean isEligible(Node node) { final Computer c = getComputer(node); if (c != null) { boolean isonline = !c.isTemporarilyOffline(); return isonline && c.getNumExecutors() > 0; } return false; }
@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)); } } };
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
@Override public String getIconFileName() { String icon = null; if (computer != null && !computer.isTemporarilyOffline()) { PluginImpl plugin = PluginImpl.getInstance(); if (plugin.isNodeShuttingDown(computer.getName()) && computer.hasPermission(Computer.CONNECT)) { icon = DISABLE_ICON; } else if (computer.hasPermission(Computer.DISCONNECT)) { icon = Functions.getResourcePath() + "/plugin/" + getUrlName() + ENABLE_ICON; } } return icon; }