4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
StoryscopeInterfaceModule.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: StoryscopeInterfaceModule.java
5  * Description: Class implements AnotServerModule calss for prupose
6  * of Storyscope Interface module.
7  */
8 
9 /**
10  * @file StoryscopeInterfaceModule.java
11  *
12  * @brief Class provides connection of Storyscope Interface module with server.
13  */
14 
15 /**
16  * @package cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface
17  *
18  * @brief Classes responsible for export of data (annotations and types) to StoryScope
19  */
20 package cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface;
21 
26 
27 /**
28  * Class implements AnotServerModule calss for prupose of Storyscope Interface module.
29  *
30  * @brief Class provides connection of Storyscope Interface module with server.
31  * @author Martin Petr (xpetrm05)
32  */
34 
35  /**
36  * Constructor
37  */
39  }
40 
41  /**
42  * This method is called when client sent message and these message
43  * has been processed. Changes in types, annotations and in other entities
44  * are persisted after calling this method from all modules.
45  *
46  * @param requestInfo Informations about client request
47  * @return String with messages for client or empty string
48  */
49  @Override
50  public String processRequestBeforePersist(RequestInfo requestInfo){
51  return "";
52  }
53 
54  /**
55  * This method is called when client sent message, these message
56  * has been processed and changes in entities are persisted.
57  * Composed response is sent to client after calling this method from
58  * all modules.
59  *
60  * @param requestInfo Informations about client request
61  * @param persistFailed True if changes not persisted, false otherwise.
62  * @return String with messages for client or empty string
63  */
64  @Override
65  public String processRequestAfterPersist(RequestInfo requestInfo, boolean persistFailed){
66  if(persistFailed) return ""; //nothing to do here if perist failed
67  StoryscopeInterfaceSender sender = new StoryscopeInterfaceSender(requestInfo);
68  sender.start();
69  return "";
70  }
71 
72  /**
73  * This method is called for each sleeping comet handler when he receives
74  * flier (part of informations about this or another client request).
75  *
76  * @param flier Flier, which has been sent to all comet handlers.
77  * @param session Session associated with comet handler.
78  * @return If this handler hasn't react to this flier (not interested) return
79  * null, else return messages for client in single string.
80  */
81  @Override
82  public String messagesFromFlier(Flier flier, EditorSession session){
83  return "";
84  }
85 
86  /**
87  * Returns name of this module. Name will be included in XML element
88  * attribute so usable characters are restricted.
89  *
90  * @param lang Requested language of name
91  * @return Name of this module
92  */
93  @Override
94  public String getModuleName(int lang){
95  return "StoryscopeInterface";
96  }
97 
98  /**
99  * Returns description of this module. It will be part of information
100  * about server functions.
101  *
102  * @param lang Requested language of description
103  * @return Description of this module
104  */
105  @Override
106  public String getModuleDescription(int lang){
107  return "StoryscopeInterface";
108  }
109 } // public class StoryscopeInterfaceModule
110 
Class represent thread of Storyscope Interface that sends messages to StoryScopes.
Class provides connection of Storyscope Interface module with server.
Flier with informations for comet handlers.
Definition: Flier.java:31
Processed informations about client request.
Informations about client session.