synchronized void incrementSequence() { // prevent infinite loop on configuration update if (updating) return; try { updating = true; GeoServerInfo gsInfo = geoServer.getGlobal(); gsInfo.setUpdateSequence(gsInfo.getUpdateSequence() + 1); geoServer.save(gsInfo); } finally { updating = false; } }
info.setNumDecimals(get(global, "numDecimals", int.class, 4)); info.setCharset((String) global.get("charSet")); info.setUpdateSequence(get(global, "updateSequence", int.class).longValue()); info.setOnlineResource(get(global, "onlineResource", String.class)); info.setProxyBaseUrl(get(global, "ProxyBaseUrl", String.class));
g1.setUpdateSequence(123); g1.setVerbose(true); g1.setVerboseExceptions(true);
/** Compare two GeoServer info objects ignoring the update sequence. */ private static boolean checkEquals(GeoServerInfo infoA, GeoServerInfo infoB) { // for GeoServer infos to have the same update sequence infoA = ModificationProxy.unwrap(infoA); infoB = ModificationProxy.unwrap(infoB); long updateSequenceB = infoB.getUpdateSequence(); try { infoB.setUpdateSequence(infoA.getUpdateSequence()); // check that the two infos are equal return checkEquals((Info) infoA, infoB); } finally { // restore the original update sequence infoB.setUpdateSequence(updateSequenceB); } }