org.filteredpush.client.jsf
Class MessengerBean

java.lang.Object
  extended by org.filteredpush.client.jsf.MessengerBean
All Implemented Interfaces:
java.io.Serializable

public class MessengerBean
extends java.lang.Object
implements java.io.Serializable

A class responsible for the interacting with the messaging system.

Author:
Lei Dou $Id:$
See Also:
Serialized Form

Constructor Summary
MessengerBean()
           
 
Method Summary
 java.lang.String getAnnotation(java.lang.String annotationURI)
          Get the full annotation in rdf/xml with the specific uri.
 java.util.List<FPAnnotationDigest> getAnnotationReponses(java.lang.String uri)
          Get the annotation response for the specific annotation.
 java.util.List<FPAnnotationDigest> getInterestedAnnotations(java.lang.String interestHandle)
          Get the annotation digests that pertains to the specific interest.
 java.util.List<FPAnnotationDigest> getNewInterestedAnnotations(java.lang.String interestHandle, java.util.Date lastTime)
          Get the annotation digests that pertains to the specific interest and sent into the FPush network after the specific time stamp.
 java.lang.String registerInterest(java.lang.String interest)
          Register the interest in FPush network.
 void resetUpdateTimestamp()
           
 java.util.List<FPAnnotationDigest> searchAnnotations(java.util.List<java.lang.String> interestHandles, java.util.Map<java.lang.String,java.lang.String> paramMap)
          Search annotations in the FPush network that pertaining the specified interests and also the search parameters.
 void sendAnnotationResponse(FPAnnotation respondedAnnotation, FPUser respondant)
          Send the response annotation to FPush network.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessengerBean

public MessengerBean()
Method Detail

resetUpdateTimestamp

public void resetUpdateTimestamp()

registerInterest

public java.lang.String registerInterest(java.lang.String interest)
                                  throws ServiceAccessException
Register the interest in FPush network.

Parameters:
interest - The interest in key-value pairs, like "collectionCode=A, catalogNumber=00107080".
Returns:
The handle to retrieve the annotations pertaining to this interest from the FPush network later.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

getInterestedAnnotations

public java.util.List<FPAnnotationDigest> getInterestedAnnotations(java.lang.String interestHandle)
                                                            throws ServiceAccessException
Get the annotation digests that pertains to the specific interest.

Parameters:
interestHandle - The handle returned from the FPush network when the interest is registered.
Returns:
The list of annotation digest pertaining to this interest.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

getNewInterestedAnnotations

public java.util.List<FPAnnotationDigest> getNewInterestedAnnotations(java.lang.String interestHandle,
                                                                      java.util.Date lastTime)
                                                               throws ServiceAccessException
Get the annotation digests that pertains to the specific interest and sent into the FPush network after the specific time stamp. It's used for incremental annotation update. Usually, the time stamp is the last update time. If the time stamp is null, then all the annotations pertaining to this interest will be returned.

Parameters:
interestHandle - The handle returned from the FPush network when the interest is registered.
lastTime - The time stamp.
Returns:
The list of annotation digests.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

getAnnotation

public java.lang.String getAnnotation(java.lang.String annotationURI)
                               throws ServiceAccessException
Get the full annotation in rdf/xml with the specific uri.

Parameters:
annotationURI - The annotation uri.
Returns:
The full annotation in rdf/xml.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

searchAnnotations

public java.util.List<FPAnnotationDigest> searchAnnotations(java.util.List<java.lang.String> interestHandles,
                                                            java.util.Map<java.lang.String,java.lang.String> paramMap)
                                                     throws ServiceAccessException
Search annotations in the FPush network that pertaining the specified interests and also the search parameters. The request sent to the FPush is encoded in json format like: { "procedureName" : "search", "parameter" :{ "interestHandles":["1","2"], "searchConditions":{ "annotatorName":"Paul", "annotateDateFrom:"2012-08-24T11:24:43EDT" } } }

Parameters:
interestHandles - List of the handle of the interest.
paramMap - Map containing the search conditions, like annotatorName, annotationDateFrom etc. For more details @see org.filteredpush.client.jsf#getQueryParamMap()
Returns:
The list of annotation digest matched the condition and pertaining the interests.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

getAnnotationReponses

public java.util.List<FPAnnotationDigest> getAnnotationReponses(java.lang.String uri)
                                                         throws ServiceAccessException
Get the annotation response for the specific annotation.

Parameters:
uri - The uri of the annotation for which the responses are requested.
Returns:
The list of annotation response.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.

sendAnnotationResponse

public void sendAnnotationResponse(FPAnnotation respondedAnnotation,
                                   FPUser respondant)
                            throws ServiceAccessException,
                                   AnnotationCreationException
Send the response annotation to FPush network.

Parameters:
respondedAnnotation - The annotation from which the response will be composed.
respondant - The human user composing this response.
Throws:
ServiceAccessException - If the FPush network can't be accessed successfully or correctly.
AnnotationCreationException - If fails to create an annotation successfully.