4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
AnnotServerModule.java
Go to the documentation of this file.
1 /*
2  * Project: Server for annotations sharing
3  * Author: Ing. Jaroslav Dytrych idytrych@fit.vutbr.cz
4  * File: AnnotServerModule.java
5  * Description: Interface for server module
6  */
7 
8 /**
9  * @file AnnotServerModule.java
10  *
11  * @brief Interface for server module
12  */
13 
14 package cz.vutbr.fit.knot.annotations.comet;
15 
16 /**
17  * Interface for server module
18  *
19  * @brief Interface for server module
20  * @author idytrych
21  */
22 public interface AnnotServerModule {
23  /**
24  * This method is called when client sent message and these message
25  * has been processed. Changes in types, annotations and in other entities
26  * are persisted after calling this method from all modules.
27  *
28  * @param requestInfo Informations about client request
29  * @return String with messages for client or empty string
30  */
31  public String processRequestBeforePersist(RequestInfo requestInfo);
32 
33  /**
34  * This method is called when client sent message, these message
35  * has been processed and changes in entities are persisted.
36  * Composed response is sent to client after calling this method from
37  * all modules.
38  *
39  * @param requestInfo Informations about client request
40  * @param persistFailed True if changes not persisted, false otherwise.
41  * @return String with messages for client or empty string
42  */
43  public String processRequestAfterPersist(RequestInfo requestInfo, boolean persistFailed);
44 
45  /**
46  * This method is called for each sleeping comet handler when he receives
47  * flier (part of informations about this or another client request).
48  *
49  * @param flier Flier, which has been sent to all comet handlers.
50  * @param session Session associated with comet handler.
51  * @return If this handler hasn't react to this flier (not interested) return
52  * null, else return messages for client in single string.
53  */
54  public String messagesFromFlier(Flier flier, EditorSession session);
55 
56  /**
57  * Returns name of this module. Name will be included in XML element
58  * attribute so usable characters are restricted.
59  *
60  * @param lang Requested language of name
61  * @return Name of this module
62  */
63  public String getModuleName(int lang);
64 
65  /**
66  * Returns description of this module. It will be part of information
67  * about server functions.
68  *
69  * @param lang Requested language of description
70  * @return Description of this module
71  */
72  public String getModuleDescription(int lang);
73 
74 } // interface AnnotServerModule
String processRequestBeforePersist(RequestInfo requestInfo)
String processRequestAfterPersist(RequestInfo requestInfo, boolean persistFailed)
Flier with informations for comet handlers.
Definition: Flier.java:31
String messagesFromFlier(Flier flier, EditorSession session)
Processed informations about client request.
Informations about client session.