001 package crisp.wbwiki.client;
002
003 import com.google.gwt.user.client.rpc.RemoteService;
004
005 public interface WikiService extends RemoteService {
006 /**
007 * Synchronizes the state between client and server.
008 * More specifically, saves the given new content (if any) to the server and
009 * returns an up-to-date Page if necessary. <p>
010 *
011 * If the currently saved version of the page is the same
012 * as lastVersionLoadedByClient, then null is returned since the
013 * client's version is up-to-date already.
014 * In that case, if modifiedContentInClient is not null
015 * the client should increment his lastVersionLoadedByClient,
016 * effectively "pretending" that it has received an updated from the server.
017 * <p>
018 *
019 * If the currently saved version of the page is NOT the
020 * same as lastVersionLoadedByClient, some interference has occurred.
021 * Probably someone else has edited the page concurrently.
022 * In that case a new, up-to-date Page object will be returned to
023 * the client.
024 *
025 * @param lastVersionLoadedByClient ¨
026 * which version the client last loaded from the server, or null if nothing has been loaded yet.
027 * @param modifiedContentInClient
028 * which content to save, or null if nothing has been changed in the client.
029 * in the client since lastVersionLoadedByClient
030 * @return
031 * an up-to-date Page object or null if the client is already up-to-date.
032 */
033 public Page synchronize(Integer lastVersionLoadedByClient, String modifiedContentInClient);
034
035 }