4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender Class Reference

Class represent thread of Storyscope Interface that sends messages to StoryScopes. More...

Inheritance diagram for cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender:
Inheritance graph
Collaboration diagram for cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender:
Collaboration graph

Public Member Functions

 StoryscopeInterfaceSender (RequestInfo requestInfo)
 
 StoryscopeInterfaceSender (String name)
 
ArrayList< AnnotationgetAddedAnnotations ()
 
void setAddedAnnotations (ArrayList< Annotation > addedAnnotations)
 
ArrayList< AnnotationgetEditedAnnotations ()
 
void setEditedAnnotations (ArrayList< Annotation > editedAnnotations)
 
ArrayList< AnnotationgetRemovedAnnotations ()
 
void setRemovedAnnotations (ArrayList< Annotation > removedAnnotations)
 
void run ()
 
ArrayList< AnnotationgetRelatedAnnots (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< AnnotationaddedAnnotations
 
ArrayList< AnnotationeditedAnnotations
 
ArrayList< AnnotationremovedAnnotations
 
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< AnnotationgetLinkedAnnotations (Annotation annot)
 
ArrayList< AnnotationgetLinkedAnnotationsDB (Annotation annot)
 
ArrayList< AnnotationdecomposeLinked (ArrayList< Annotation > mainAnnotList, ArrayList< Annotation > secondaryAnnotList, Annotation annot)
 
ArrayList< AnnotationgetRelatedAnnotations (ArrayList< Annotation > approvedAnnot, ArrayList< Annotation > unapprovedAnnot, ArrayList< SubscribedSource > subscribed, ArrayList< SubscribedSource > unsubscribed)
 

Private Attributes

List< StoryScopestoryScopes
 
RequestInfo requestInfo
 

Static Private Attributes

static final String answerTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ok/>"
 

Detailed Description

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.

Author
Martin Petr (xpetrm05)

Definition at line 53 of file StoryscopeInterfaceSender.java.

Constructor & Destructor Documentation

cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.StoryscopeInterfaceSender ( RequestInfo  requestInfo)

Constructor

Parameters
requestInfoinformations about current request

Definition at line 75 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.StoryscopeInterfaceSender ( String  name)

Constructor (not run in thread).

Parameters
nameof thread

Definition at line 100 of file StoryscopeInterfaceSender.java.

Member Function Documentation

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

Parameters
annotannotation that will be represented by XML
docanotated document
Returns
Returns serialized informations about annotation in XML

Definition at line 723 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.AnnotationTypeAncestors ( Annotation  annot)
package

Method finds all ancestors of type annotation of annotation given as attribute.

Parameters
annotannotation which will be processed
Returns
string with uri of all ancestors of annotation's type

Definition at line 692 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
annotAnnotation which attributes should be serialized
proto11If true, protocol version is greather then 1.0
tmpIdForNestedIf true, nested annotations will have attribute tmpId
docAnnotated document
Returns
Returns serialized informations about annotation attributes in XML

Definition at line 833 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

int cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.checkBranch ( AnnotType  rootType,
Annotation  annot,
ArrayList< SubscribedSource unsubscribedSources,
ArrayList< SubscribedSource subscribedSources,
ArrayList< String >  sources,
ArrayList< SubscribedSource unsubResult,
ArrayList< SubscribedSource subResult 
)
private

Method finds every rule for all given annotation's type ancestors and returns if is subscribed or unsubscribed.

Parameters
rootTypetype where will checking begin
annotannotation that is checked
unsubscribedSourcesunsubscribed sources for current user
subscribedSourcessubscribed sources for current user
sourcessources for current user
unsubResultlist of finded unsubscribed rules
subResultlist of finded subscribed files
Returns
value that represent if is current annotation subscribed unsubscribed or method don't find any rule

Definition at line 405 of file StoryscopeInterfaceSender.java.

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.decomposeLinked ( ArrayList< Annotation mainAnnotList,
ArrayList< Annotation secondaryAnnotList,
Annotation  annot 
)
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.

Parameters
mainAnnotListarray list of approved annotations
secondaryAnnotListsecondary list of approved annotations
annotannotatihon thats linked type attributes will be add to list
Returns
return list thats contain secodary annotation list and linked type annotations from annotation

Definition at line 552 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.fragmentsToXMLStringL ( Annotation  annot,
Document  doc 
)

Returns serialized and linearized informations about annotated fragments in XML

Parameters
annotannotation which fragments should be serialized
docdocument tahat fragments belongs
Returns
Returns serialized informations about annotated fragments in XML

Definition at line 784 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getAddedAnnotations ( )

Gets array of added annotations to send to Storyscope

Returns
array of added annotations

Definition at line 113 of file StoryscopeInterfaceSender.java.

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getEditedAnnotations ( )

Gets array of edited annotations to send to Storyscope

Returns
array of edited annotations

Definition at line 131 of file StoryscopeInterfaceSender.java.

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getLinkedAnnotations ( Annotation  annot)
private

Method returns all linked annotations of this annotation.

Parameters
annotannotation which will be processed
Returns
list of annotations that are linked with this annotation

Definition at line 499 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getLinkedAnnotationsDB ( Annotation  annot)
private

Method returns all annotations that are link annotation given as parameter.

Parameters
annotannotation which will be processed
Returns
list of annotations that links this anotation

Definition at line 522 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getRelatedAnnotations ( ArrayList< Annotation approvedAnnot,
ArrayList< Annotation unapprovedAnnot,
ArrayList< SubscribedSource subscribed,
ArrayList< SubscribedSource unsubscribed 
)
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.

Parameters
approvedAnnotannotations that are approved (they are subscribed)
unapprovedAnnotannotations that are unapproved (others annotations)
subscribedlist of subscribed sources for current StoryScope
unsubscribedlist of unsubscribed sources for current StoryScope
Returns
approved annotations and added annotations together in one list

Definition at line 593 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
approvedAnnotlist od approved annotations
unapprovedAnnotlist of unapproved annotations
subscribedsubecribed rules
unsubscribedunsubscribed rules
Returns
list of realted annotations

Definition at line 649 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.getRemovedAnnotations ( )

Gets array of removed annotations to send to Storyscope

Returns
array of removed annotations

Definition at line 149 of file StoryscopeInterfaceSender.java.

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.isSubscribed ( Annotation  annot,
ArrayList< SubscribedSource unsubscribedSources,
ArrayList< SubscribedSource subscribedSources,
ArrayList< String >  sources 
)
private

Method will check if the given annotation meets the criteria for sending to StoryScope

Parameters
annotChecked annotation
unsubscribedSourceslist of unsubscribed sources
subscribedSourceslist of subscribed sources
sourcesList of sources to which annotation belongs to
Returns
If annotation matches to subscriptions, returns true, false otherwise

Definition at line 461 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.sendAndCheck ( StoryScope  storyScope,
String  data 
)
private

Method sends a message for each StoryScope in list and check if the StoryScope sent correct answer.

Parameters
storyScopeStoryScopes whose message will be sent.
dataData to send

Definition at line 351 of file StoryscopeInterfaceSender.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.setAddedAnnotations ( ArrayList< Annotation addedAnnotations)

Sets array of added annotations to send to Storyscope

Parameters
addedAnnotationsarray 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

Parameters
editedAnnotationsarray 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

Parameters
removedAnnotationsarray of removed annotations to send to Storyscope

Definition at line 158 of file StoryscopeInterfaceSender.java.

void cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.startModule ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.addedAnnotations
package

Array of added annotations to send to Storyscope

Definition at line 60 of file StoryscopeInterfaceSender.java.

final String cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.answerTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ok/>"
staticprivate

Pattern of response from StoryScope

Definition at line 68 of file StoryscopeInterfaceSender.java.

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.editedAnnotations
package

Array of edited annotations to send to Storyscope

Definition at line 62 of file StoryscopeInterfaceSender.java.

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.removedAnnotations
package

Array of removed annotations to send to Storyscope

Definition at line 64 of file StoryscopeInterfaceSender.java.

RequestInfo cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.requestInfo
private

Object with informations about current request

Definition at line 58 of file StoryscopeInterfaceSender.java.

boolean cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.runAsModule
package

Indicates if this code will be started as module (in therad) or not

Definition at line 66 of file StoryscopeInterfaceSender.java.

List<StoryScope> cz.vutbr.fit.knot.annotations.modules.StoryscopeInterface.StoryscopeInterfaceSender.storyScopes
private

List of avaibel StoryScopes

Definition at line 56 of file StoryscopeInterfaceSender.java.


The documentation for this class was generated from the following file: