public void save() throws IOException { getConfigFile().write(monitors); SaveableListener.fireOnChange(this, getConfigFile()); } };
/** * Save the settings to a file. * @throws IOException Save error */ public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; long start=0; if(logger.isLoggable(Level.FINE)) start = System.currentTimeMillis(); File file = getFingerprintFile(md5sum); save(file); SaveableListener.fireOnChange(this, getConfigFile(file)); if(logger.isLoggable(Level.FINE)) logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms"); }
/** * Save the settings to a file. */ public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; if (initLevel == InitMilestone.COMPLETED) { LOGGER.log(FINE, "setting version {0} to {1}", new Object[] {version, VERSION}); version = VERSION; } else { LOGGER.log(FINE, "refusing to set version {0} to {1} during {2}", new Object[] {version, VERSION, initLevel}); } getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); }
public void save() throws IOException { if(BulkChange.contains(this)) return; XmlFile config = getXmlFile(); config.write(this); SaveableListener.fireOnChange(this, config); }
/** * Saves serializable fields of this instance to the persisted storage. * * @since 1.245 */ public void save() throws IOException { if(BulkChange.contains(this)) return; XmlFile config = getConfigXml(); config.write(this); SaveableListener.fireOnChange(this, config); }
/** * {@inheritDoc} */ @Override public void save() throws IOException { if (BulkChange.contains(this)) { return; } final File nodesDir = getNodesDir(); final Set<String> existing = new HashSet<String>(); for (Node n : nodes.values()) { if (n instanceof EphemeralNode) { continue; } existing.add(n.getNodeName()); XmlFile xmlFile = new XmlFile(Jenkins.XSTREAM, new File(new File(nodesDir, n.getNodeName()), "config.xml")); xmlFile.write(n); SaveableListener.fireOnChange(this, xmlFile); } for (File forDeletion : nodesDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isDirectory() && !existing.contains(pathname.getName()); } })) { Util.deleteRecursive(forDeletion); } }
/** * Actually persists a node on disk. * * @param node the node to be persisted. * @throws IOException if the node could not be persisted. */ private void persistNode(final @Nonnull Node node) throws IOException { // no need for a full save() so we just do the minimum if (node instanceof EphemeralNode) { Util.deleteRecursive(new File(getNodesDir(), node.getNodeName())); } else { XmlFile xmlFile = new XmlFile(Jenkins.XSTREAM, new File(new File(getNodesDir(), node.getNodeName()), "config.xml")); xmlFile.write(node); SaveableListener.fireOnChange(this, xmlFile); } jenkins.getQueue().scheduleMaintenance(); }
public void save() throws IOException { if(BulkChange.contains(this)) return; try { getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save "+getConfigFile(),e); } }
/** * Saves the configuration info to the disk. */ public synchronized void save() { if(BulkChange.contains(this)) return; try { getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save "+getConfigFile(),e); } }
/** * Saves the configuration info to the disk. */ public synchronized void save() { if(BulkChange.contains(this)) return; try { getConfigFile().write(sites); SaveableListener.fireOnChange(this, getConfigFile()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save "+getConfigFile(),e); } }
/** * Save the settings to a file. */ public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getDataFile().write(this); SaveableListener.fireOnChange(this, getDataFile()); }
/** * Save the settings to a file. */ public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); }
/** * Save the settings to a file. */ public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); }
/** * Persists the queue contents to the disk. */ public void save() { if(BulkChange.contains(this)) return; if (Jenkins.getInstanceOrNull() == null) { return; } XmlFile queueFile = new XmlFile(XSTREAM, getXMLQueueFile()); lock.lock(); try { // write out the queue state we want to save State state = new State(); state.counter = WaitingItem.COUNTER.longValue(); // write out the tasks on the queue for (Item item: getItems()) { if(item.task instanceof TransientTask) continue; state.items.add(item); } try { queueFile.write(state); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to write out the queue file " + getXMLQueueFile(), e); } } finally { lock.unlock(); } SaveableListener.fireOnChange(this, queueFile); }
try { configFile.write(this); SaveableListener.fireOnChange(this, configFile); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save " + configFile, e);
/** * Save the user configuration. */ public synchronized void save() throws IOException { if (!isIdOrFullnameAllowed(id)) { throw FormValidation.error(Messages.User_IllegalUsername(id)); } if (!isIdOrFullnameAllowed(fullName)) { throw FormValidation.error(Messages.User_IllegalFullname(fullName)); } if (BulkChange.contains(this)) { return; } XmlFile xmlFile = new XmlFile(XSTREAM, constructUserConfigFile()); xmlFile.write(this); SaveableListener.fireOnChange(this, xmlFile); }
SaveableListener.fireOnChange(this, getConfigFile());
/** * Reloads this job from the disk. * * Exposed through CLI as well. * * TODO: think about exposing this to UI * * @since 1.556 */ @RequirePOST public void doReload() throws IOException { checkPermission(CONFIGURE); // try to reflect the changes by reloading getConfigFile().unmarshal(this); Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @Override public Void call() throws IOException { onLoad(getParent(), getRootDir().getName()); return null; } }); Jenkins.getInstance().rebuildDependencyGraphAsync(); SaveableListener.fireOnChange(this, getConfigFile()); }
public void save() throws IOException { getConfigFile().write(monitors); SaveableListener.fireOnChange(this, getConfigFile()); } };
public void save() throws IOException { if(BulkChange.contains(this)) return; try { getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to save "+getConfigFile(),e); } }