1
2
3
4
5
6 package net.kwfgrid.gworkflowdl.protocol.server;
7
8 import net.kwfgrid.gworkflowdl.protocol.IncompatibleVersionsException;
9 import net.kwfgrid.gworkflowdl.protocol.IllegalModificationException;
10 import net.kwfgrid.gworkflowdl.protocol.IMethodCallStrategy;
11
12 /***
13 Interface for a delegation object used by implementations of <code>IServerRootObject</code>
14 to delegate the protocol operations to.
15 */
16 public interface IServerDelegate extends IMethodCallStrategy {
17 /***
18 Get the modifications necessary to update a client with the specified version.
19 @param structure The root object of the structure.
20 @param clientversion The version of the client.
21 @return An array of modifications necessary to update the client to the version of the server.
22 */
23 String[][] getModificationsForUpdate(IServerRootObject structure, int clientversion);
24
25 /***
26 Commit a modification from a client to a server.
27 @param structure The structure to apply the modification to.
28 @param clientversion The current version of the client (before the modification is applied).
29 @param modification The modification to apply.
30 @return The version number of the structure after the modification has been applied.
31 @exception IncompatibleVersionsException If the specified version of the client is not equal to the version of the server.
32 @exception IllegalModificationsException If one the specified modification could not be applied.
33 */
34 int commitModification(IServerRootObject structure, int clientversion, String modification) throws IncompatibleVersionsException, IllegalModificationException;
35
36 /***
37 Get the XML description of the specified structure.
38 @param structure The structure.
39 @param currentxml The current XML description referenced by the structure.
40 */
41 String getXML(IServerRootObject structure, String currentxml);
42 }