4A Server -
2.0
|
Class represent thread of Storyscope Interface that sends messages to StoryScopes. More...
Public Member Functions | |
StoryscopeInterfaceSender (RequestInfo requestInfo) | |
StoryscopeInterfaceSender (String name) | |
ArrayList< Annotation > | getAddedAnnotations () |
void | setAddedAnnotations (ArrayList< Annotation > addedAnnotations) |
ArrayList< Annotation > | getEditedAnnotations () |
void | setEditedAnnotations (ArrayList< Annotation > editedAnnotations) |
ArrayList< Annotation > | getRemovedAnnotations () |
void | setRemovedAnnotations (ArrayList< Annotation > removedAnnotations) |
void | run () |
ArrayList< Annotation > | getRelatedAnnots (ArrayList< Annotation > approvedAnnot, ArrayList< Annotation > unapprovedAnnot, ArrayList< SubscribedSource > subscribed, ArrayList< SubscribedSource > unsubscribed) |
String | AnnotationToXMLStringL (Annotation annot, Document doc) |
String | fragmentsToXMLStringL (Annotation annot, Document doc) |
String | attributesToXMLStringL (Annotation annot, boolean proto11, boolean tmpIdForNested, Document doc) |
Package Functions | |
void | startModule () |
String | AnnotationTypeAncestors (Annotation annot) |
Package Attributes | |
ArrayList< Annotation > | addedAnnotations |
ArrayList< Annotation > | editedAnnotations |
ArrayList< Annotation > | removedAnnotations |
boolean | runAsModule |
Private Member Functions | |
boolean | sendAndCheck (StoryScope storyScope, String data) |
int | checkBranch (AnnotType rootType, Annotation annot, ArrayList< SubscribedSource > unsubscribedSources, ArrayList< SubscribedSource > subscribedSources, ArrayList< String > sources, ArrayList< SubscribedSource > unsubResult, ArrayList< SubscribedSource > subResult) |
boolean | isSubscribed (Annotation annot, ArrayList< SubscribedSource > unsubscribedSources, ArrayList< SubscribedSource > subscribedSources, ArrayList< String > sources) |
ArrayList< Annotation > | getLinkedAnnotations (Annotation annot) |
ArrayList< Annotation > | getLinkedAnnotationsDB (Annotation annot) |
ArrayList< Annotation > | decomposeLinked (ArrayList< Annotation > mainAnnotList, ArrayList< Annotation > secondaryAnnotList, Annotation annot) |
ArrayList< Annotation > | getRelatedAnnotations (ArrayList< Annotation > approvedAnnot, ArrayList< Annotation > unapprovedAnnot, ArrayList< SubscribedSource > subscribed, ArrayList< SubscribedSource > unsubscribed) |
Private Attributes | |
List< StoryScope > | storyScopes |
RequestInfo | requestInfo |
Static Private Attributes | |
static final String | answerTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ok/>" |
Class represent thread of Storyscope Interface that sends messages to StoryScopes.
Class that represents a thread that sends annotations from all documents according to the rules composed of Subscribed and unsubscribed sources, types and users.
Definition at line 53 of file StoryscopeInterfaceSender.java.
cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.StoryscopeInterfaceSender | ( | RequestInfo | requestInfo | ) |
Constructor
requestInfo | informations about current request |
Definition at line 75 of file StoryscopeInterfaceSender.java.
cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.StoryscopeInterfaceSender | ( | String | name | ) |
Constructor (not run in thread).
name | of thread |
Definition at line 100 of file StoryscopeInterfaceSender.java.
String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.AnnotationToXMLStringL | ( | Annotation | annot, |
Document | doc | ||
) |
Info: Methods below are copied from Annotations, they are modified, because modifed protocol is used between Storyscope Interface and SEC Client. Returns serialized and linearized informations about annotation in XML
annot | annotation that will be represented by XML |
doc | anotated document |
Definition at line 723 of file StoryscopeInterfaceSender.java.
|
package |
Method finds all ancestors of type annotation of annotation given as attribute.
annot | annotation which will be processed |
Definition at line 692 of file StoryscopeInterfaceSender.java.
String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.attributesToXMLStringL | ( | Annotation | annot, |
boolean | proto11, | ||
boolean | tmpIdForNested, | ||
Document | doc | ||
) |
Returns serialized informations about annotation attributes in XML
annot | Annotation which attributes should be serialized |
proto11 | If true, protocol version is greather then 1.0 |
tmpIdForNested | If true, nested annotations will have attribute tmpId |
doc | Annotated document |
Definition at line 833 of file StoryscopeInterfaceSender.java.
|
private |
Method finds every rule for all given annotation's type ancestors and returns if is subscribed or unsubscribed.
rootType | type where will checking begin |
annot | annotation that is checked |
unsubscribedSources | unsubscribed sources for current user |
subscribedSources | subscribed sources for current user |
sources | sources for current user |
unsubResult | list of finded unsubscribed rules |
subResult | list of finded subscribed files |
Definition at line 405 of file StoryscopeInterfaceSender.java.
|
private |
Method check if annotation have any linked type parameter and all this parameters add to list with secondaryAnnotList. But check if isn't inside main or secondary annotations list before add it.
mainAnnotList | array list of approved annotations |
secondaryAnnotList | secondary list of approved annotations |
annot | annotatihon thats linked type attributes will be add to list |
Definition at line 552 of file StoryscopeInterfaceSender.java.
String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.fragmentsToXMLStringL | ( | Annotation | annot, |
Document | doc | ||
) |
Returns serialized and linearized informations about annotated fragments in XML
annot | annotation which fragments should be serialized |
doc | document tahat fragments belongs |
Definition at line 784 of file StoryscopeInterfaceSender.java.
ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getAddedAnnotations | ( | ) |
Gets array of added annotations to send to Storyscope
Definition at line 113 of file StoryscopeInterfaceSender.java.
ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getEditedAnnotations | ( | ) |
Gets array of edited annotations to send to Storyscope
Definition at line 131 of file StoryscopeInterfaceSender.java.
|
private |
Method returns all linked annotations of this annotation.
annot | annotation which will be processed |
Definition at line 499 of file StoryscopeInterfaceSender.java.
|
private |
Method returns all annotations that are link annotation given as parameter.
annot | annotation which will be processed |
Definition at line 522 of file StoryscopeInterfaceSender.java.
|
private |
Method checks if approved and unapproved annotations have linked type attributes when there are any, add annotations that are linked with approved or if they are subscribed.
approvedAnnot | annotations that are approved (they are subscribed) |
unapprovedAnnot | annotations that are unapproved (others annotations) |
subscribed | list of subscribed sources for current StoryScope |
unsubscribed | list of unsubscribed sources for current StoryScope |
Definition at line 593 of file StoryscopeInterfaceSender.java.
ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getRelatedAnnots | ( | ArrayList< Annotation > | approvedAnnot, |
ArrayList< Annotation > | unapprovedAnnot, | ||
ArrayList< SubscribedSource > | subscribed, | ||
ArrayList< SubscribedSource > | unsubscribed | ||
) |
Method gets related annotations that links given annotation.
approvedAnnot | list od approved annotations |
unapprovedAnnot | list of unapproved annotations |
subscribed | subecribed rules |
unsubscribed | unsubscribed rules |
Definition at line 649 of file StoryscopeInterfaceSender.java.
ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getRemovedAnnotations | ( | ) |
Gets array of removed annotations to send to Storyscope
Definition at line 149 of file StoryscopeInterfaceSender.java.
|
private |
Method will check if the given annotation meets the criteria for sending to StoryScope
annot | Checked annotation |
unsubscribedSources | list of unsubscribed sources |
subscribedSources | list of subscribed sources |
sources | List of sources to which annotation belongs to |
Definition at line 461 of file StoryscopeInterfaceSender.java.
void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.run | ( | ) |
Method locks documents for read and run main method.
Definition at line 167 of file StoryscopeInterfaceSender.java.
|
private |
Method sends a message for each StoryScope in list and check if the StoryScope sent correct answer.
storyScope | StoryScopes whose message will be sent. |
data | Data to send |
Definition at line 351 of file StoryscopeInterfaceSender.java.
void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.setAddedAnnotations | ( | ArrayList< Annotation > | addedAnnotations | ) |
Sets array of added annotations to send to Storyscope
addedAnnotations | array of added annotations to send to Storyscope |
Definition at line 122 of file StoryscopeInterfaceSender.java.
void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.setEditedAnnotations | ( | ArrayList< Annotation > | editedAnnotations | ) |
Sets array of edited annotations to send to Storyscope
editedAnnotations | array of edited annotations to send to Storyscope |
Definition at line 140 of file StoryscopeInterfaceSender.java.
void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.setRemovedAnnotations | ( | ArrayList< Annotation > | removedAnnotations | ) |
Sets array of removed annotations to send to Storyscope
removedAnnotations | array of removed annotations to send to Storyscope |
Definition at line 158 of file StoryscopeInterfaceSender.java.
|
package |
Method check added, edited and deleted annotations and set them to configured StoryScopes. If is StoryScope unreachable, method save its messages and send them when will be reachable.
Definition at line 207 of file StoryscopeInterfaceSender.java.
|
package |
Array of added annotations to send to Storyscope
Definition at line 60 of file StoryscopeInterfaceSender.java.
|
staticprivate |
Pattern of response from StoryScope
Definition at line 68 of file StoryscopeInterfaceSender.java.
|
package |
Array of edited annotations to send to Storyscope
Definition at line 62 of file StoryscopeInterfaceSender.java.
|
package |
Array of removed annotations to send to Storyscope
Definition at line 64 of file StoryscopeInterfaceSender.java.
|
private |
Object with informations about current request
Definition at line 58 of file StoryscopeInterfaceSender.java.
|
package |
Indicates if this code will be started as module (in therad) or not
Definition at line 66 of file StoryscopeInterfaceSender.java.
|
private |
List of avaibel StoryScopes
Definition at line 56 of file StoryscopeInterfaceSender.java.