public synchronized SessionToken checkForUpdate(String currentVersion) {ensureOpen();if (currentRevision == null) { return null;}if (currentVersion != null && currentRevision.revision.compareTo(currentVersion) <= 0) {return null;}currentRevision.incRef();final String sessionID = Integer.toString(sessionToken.incrementAndGet());final SessionToken sessionToken = new SessionToken(sessionID, currentRevision.revision);final ReplicationSession timedSessionToken = new ReplicationSession(sessionToken, currentRevision);sessions.put(sessionID, timedSessionToken);return sessionToken;}

public virtual SessionToken CheckForUpdate(string currentVersion){lock (padlock){EnsureOpen();if (currentRevision == null)return null; if (currentVersion != null && currentRevision.Revision.CompareTo(currentVersion) <= 0)return null; currentRevision.IncRef();string sessionID = sessionToken.IncrementAndGet().ToString();SessionToken token = new SessionToken(sessionID, currentRevision.Revision);sessions[sessionID] = new ReplicationSession(token, currentRevision);return token;}}
