de.fhhannover.inform.trust.ifmapj.messages
Class Requests

java.lang.Object
  extended by de.fhhannover.inform.trust.ifmapj.messages.Requests

public class Requests
extends Object

Provides access to Request associated classes.

Since:
0.1.4
Author:
aw

Nested Class Summary
static class Requests.Helpers
          This class provides helpers for custom request implementations.
 
Method Summary
static EndSessionRequest createEndSessionReq()
           
static NewSessionRequest createNewSessionReq()
           
static PollRequest createPollReq()
           
static PublishDelete createPublishDelete()
          Create a new, empty PublishDelete instance.
static PublishDelete createPublishDelete(Identifier i1)
          Create a new PublishDelete instance for a specific Identifier in order to delete all of its metadata.
static PublishDelete createPublishDelete(Identifier i1, Identifier i2)
          Create a new PublishDelete instance for a link between two Identifier instances in order to delete all metadata of the link.
static PublishDelete createPublishDelete(Identifier i1, Identifier i2, String filter)
          Create a new PublishDelete instance for a link between two Identifier instances in order to delete its metadata that matches the given filter.
static PublishDelete createPublishDelete(Identifier i1, String filter)
          Create a new PublishDelete instance for a specific Identifier in order to delete its metadata that matches the given filter.
static PublishNotify createPublishNotify()
          Create a new, empty PublishNotify instance.
static PublishNotify createPublishNotify(Identifier i1, Collection<Document> mdlist)
          Create a new PublishNotify instance that is used to publish a list of metadata instances.
static PublishNotify createPublishNotify(Identifier i1, Document md)
          Create a new PublishNotify instance that is used to publish metadata to an Identifier.
static PublishNotify createPublishNotify(Identifier i1, Identifier i2, Collection<Document> mdlist)
          Create a new PublishNotify instance that is used to publish a list of metadata on a link between two Identifier instances.
static PublishNotify createPublishNotify(Identifier i1, Identifier i2, Document md)
          Create a new PublishNotify instance that is used to publish metadata on a link between two Identifier instances.
static PublishRequest createPublishReq()
          Create an empty PublishRequest
static PublishRequest createPublishReq(List<PublishElement> list)
          Create a new PublishRequest that contains the given list of PublishElement instances.
static PublishRequest createPublishReq(PublishElement el)
          Create a new PublishRequest that contains the given PublishElement
static PublishUpdate createPublishUpdate()
           
static PublishUpdate createPublishUpdate(Identifier i1, Collection<Document> mdlist)
          Create a new PublishUpdate instance that is used to publish a list of metadata instances.
static PublishUpdate createPublishUpdate(Identifier i1, Collection<Document> mdlist, MetadataLifetime lifetime)
          Create a new PublishUpdate instance that is used to publish a list of metadata instances with a specific MetadataLifetime.
static PublishUpdate createPublishUpdate(Identifier i1, Document md)
          Create a new PublishUpdate instance that is used to publish metadata to an Identifier.
static PublishUpdate createPublishUpdate(Identifier i1, Document md, MetadataLifetime lifetime)
          Create a new PublishUpdate instance that is used to publish metadata on an Identifier with a specific MetadataLifetime.
static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2, Collection<Document> mdlist)
          Create a new PublishUpdate instance that is used to publish a list of metadata on a link between two Identifier instances.
static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2, Collection<Document> mdlist, MetadataLifetime lifetime)
          Create a new PublishUpdate instance that is used to publish a list of metadata on a link between two Identifier instances with a specific MetadataLifetime.
static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2, Document md)
          Create a new PublishUpdate instance that is used to publish metadata on a link between two Identifier instances.
static PublishUpdate createPublishUpdate(Identifier i1, Identifier i2, Document md, MetadataLifetime lifetime)
          Create a new PublishUpdate instance that is used to publish metadata on a link between two Identifier instances with a specific MetadataLifetime.
static PurgePublisherRequest createPurgePublisherReq()
           
static RenewSessionRequest createRenewSessionReq()
           
static SearchRequest createSearchReq()
          Create a SearchRequest with default values.
static SearchRequest createSearchReq(String matchLinks, Integer maxDepth, String termIdents, Integer maxSize, String resultFilter, Identifier start)
          Create a new SearchRequest in order to perform an IF-MAP search.
static SubscribeDelete createSubscribeDelete()
          Create a SubscribeDelete instance with default values.
static SubscribeDelete createSubscribeDelete(String name)
          Create a new SubscribeDelete instance with the given name.
static SubscribeRequest createSubscribeReq()
          Create an empty SubscribeRequest
static SubscribeRequest createSubscribeReq(List<SubscribeElement> list)
          Create a SubscribeRequest with a list of SubscribeElement instances.
static SubscribeRequest createSubscribeReq(SubscribeElement el)
          Create a SubscribeRequest with one SubscribeElement.
static SubscribeUpdate createSubscribeUpdate()
          Create a SubscribeUpdate instance with default values.
static SubscribeUpdate createSubscribeUpdate(String name, String matchLinks, Integer maxDepth, String termIdents, Integer maxSize, String resultFilter, Identifier start)
          Create a SubscribeUpdate instance with the given parameters.
static RequestHandler<? extends Request> getHandlerFor(Request req)
           
static RequestFactory getRequestFactory()
          Deprecated. Don't use. Will be gone soon.
static void registerRequestHandler(RequestHandler<? extends Request> rh)
          Register a custom request handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerRequestHandler

public static void registerRequestHandler(RequestHandler<? extends Request> rh)
Register a custom request handler.

Parameters:
rh -

getHandlerFor

public static RequestHandler<? extends Request> getHandlerFor(Request req)

getRequestFactory

public static RequestFactory getRequestFactory()
Deprecated. Don't use. Will be gone soon.

Returns:

createPublishReq

public static PublishRequest createPublishReq()
Create an empty PublishRequest

Returns:
the new PublishRequest

createPublishReq

public static PublishRequest createPublishReq(PublishElement el)
Create a new PublishRequest that contains the given PublishElement

Parameters:
el - the PublishElement that is added to the new PublishRequest
Returns:
the new PublishRequest

createPublishReq

public static PublishRequest createPublishReq(List<PublishElement> list)
Create a new PublishRequest that contains the given list of PublishElement instances.

Parameters:
list - the list of PublishElement instances that are added to the new PublishRequest
Returns:
the new PublishRequest

createNewSessionReq

public static NewSessionRequest createNewSessionReq()

createEndSessionReq

public static EndSessionRequest createEndSessionReq()

createRenewSessionReq

public static RenewSessionRequest createRenewSessionReq()

createPurgePublisherReq

public static PurgePublisherRequest createPurgePublisherReq()

createPollReq

public static PollRequest createPollReq()

createSubscribeReq

public static SubscribeRequest createSubscribeReq()
Create an empty SubscribeRequest

Returns:
the new SubscribeRequest instance

createSubscribeReq

public static SubscribeRequest createSubscribeReq(SubscribeElement el)
Create a SubscribeRequest with one SubscribeElement.

Parameters:
el - the SubscribeElement that is added to the new SubscribeRequest. This can either be SubscribeUpdate or SubscribeDelete.
Returns:
the new SubscribeRequest

createSubscribeReq

public static SubscribeRequest createSubscribeReq(List<SubscribeElement> list)
Create a SubscribeRequest with a list of SubscribeElement instances.

Parameters:
list - the list of SubscribeElement instances that are added to the new SubscribeRequest. The SubscribeElement instances are either SubscribeUpdate or SubscribeDelete instances.
Returns:
the new SubscribeRequest

createSearchReq

public static SearchRequest createSearchReq()
Create a SearchRequest with default values. You need to set at least the start Identifier with SearchHolder.setStartIdentifier(Identifier) afterwards!

Returns:
the new SearchRequest instance

createSearchReq

public static SearchRequest createSearchReq(String matchLinks,
                                            Integer maxDepth,
                                            String termIdents,
                                            Integer maxSize,
                                            String resultFilter,
                                            Identifier start)
Create a new SearchRequest in order to perform an IF-MAP search.

Parameters:
matchLinks - the match-links filter (null means match-all, an empty String means match-nothing)
maxDepth - max-depth of the search (default is left out)
terminalIdentifiers - comma separated list of terminal identifier types (for example 'identity,device')
maxSize - max-size of search result (default is left out)
resultFilter - the result-filter filter (null means match-all, an empty String means match-nothing)
start - the start Identifier
Returns:
the new SearchRequest instance

createPublishUpdate

public static PublishUpdate createPublishUpdate()
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Document md)
Create a new PublishUpdate instance that is used to publish metadata to an Identifier. The MetadataLifetime of the new metadata is set to MetadataLifetime.session.

Parameters:
i1 - the Identifier to which the given metadata is published to
md - the metadata that shall be published
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Document md,
                                                MetadataLifetime lifetime)
Create a new PublishUpdate instance that is used to publish metadata on an Identifier with a specific MetadataLifetime.

Parameters:
i1 - the Identifier to which the given metadata is published to
md - the metadata that shall be published
lifetime - the lifetime of the new metadata
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Identifier i2,
                                                Document md)
Create a new PublishUpdate instance that is used to publish metadata on a link between two Identifier instances. The MetadataLifetime of the new metadata is set to MetadataLifetime.session.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
md - the metadata that shall be published
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Identifier i2,
                                                Document md,
                                                MetadataLifetime lifetime)
Create a new PublishUpdate instance that is used to publish metadata on a link between two Identifier instances with a specific MetadataLifetime.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
md - the metadata that shall be published
lifetime - the lifetime of the new metadata
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Collection<Document> mdlist,
                                                MetadataLifetime lifetime)
Create a new PublishUpdate instance that is used to publish a list of metadata instances with a specific MetadataLifetime.

Parameters:
i1 - the Identifier to which the given metadata is published to
mdlist - a list of metadata objects
lifetime - the lifetime of the new metadata
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Collection<Document> mdlist)
Create a new PublishUpdate instance that is used to publish a list of metadata instances. The MetadataLifetime of the new metadata is set to MetadataLifetime.session.

Parameters:
i1 - the Identifier to which the given metadata is published to
mdlist - a list of metadata objects
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Identifier i2,
                                                Collection<Document> mdlist)
Create a new PublishUpdate instance that is used to publish a list of metadata on a link between two Identifier instances. The MetadataLifetime of the new metadata is set to MetadataLifetime.session.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
mdlist - a list of metadata objects
Returns:
the new PublishUpdate instance

createPublishUpdate

public static PublishUpdate createPublishUpdate(Identifier i1,
                                                Identifier i2,
                                                Collection<Document> mdlist,
                                                MetadataLifetime lifetime)
Create a new PublishUpdate instance that is used to publish a list of metadata on a link between two Identifier instances with a specific MetadataLifetime.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
mdlist - a list of metadata objects
lifetime - the lifetime of the new metadata
Returns:
the new PublishUpdate instance

createPublishNotify

public static PublishNotify createPublishNotify()
Create a new, empty PublishNotify instance.

Returns:
the new PublishNotify instance

createPublishNotify

public static PublishNotify createPublishNotify(Identifier i1,
                                                Document md)
Create a new PublishNotify instance that is used to publish metadata to an Identifier.

Parameters:
i1 - the Identifier to which the given metadata is published to
md - the metadata that shall be published
Returns:
the new PublishNotify instance

createPublishNotify

public static PublishNotify createPublishNotify(Identifier i1,
                                                Collection<Document> mdlist)
Create a new PublishNotify instance that is used to publish a list of metadata instances.

Parameters:
i1 - the Identifier to which the given metadata is published to
mdlist - a list of metadata objects
Returns:
the new PublishNotify instance

createPublishNotify

public static PublishNotify createPublishNotify(Identifier i1,
                                                Identifier i2,
                                                Document md)
Create a new PublishNotify instance that is used to publish metadata on a link between two Identifier instances.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
md - the metadata that shall be published
Returns:
the new PublishNotify instance

createPublishNotify

public static PublishNotify createPublishNotify(Identifier i1,
                                                Identifier i2,
                                                Collection<Document> mdlist)
Create a new PublishNotify instance that is used to publish a list of metadata on a link between two Identifier instances. The MetadataLifetime of the new metadata is set to MetadataLifetime.session.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
mdlist - a list of metadata objects
Returns:
the new PublishNotify instance

createPublishDelete

public static PublishDelete createPublishDelete()
Create a new, empty PublishDelete instance.

Returns:
the new PublishDelete instance

createPublishDelete

public static PublishDelete createPublishDelete(Identifier i1)
Create a new PublishDelete instance for a specific Identifier in order to delete all of its metadata.

Parameters:
i1 - the Identifier that is the target of the delete request
Returns:
the new PublishDelete instance

createPublishDelete

public static PublishDelete createPublishDelete(Identifier i1,
                                                Identifier i2)
Create a new PublishDelete instance for a link between two Identifier instances in order to delete all metadata of the link.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
Returns:
the new PublishDelete instance

createPublishDelete

public static PublishDelete createPublishDelete(Identifier i1,
                                                String filter)
Create a new PublishDelete instance for a specific Identifier in order to delete its metadata that matches the given filter.

Parameters:
i1 - the Identifier that is the target of the delete request
filter - a filter that expresses the metadata that shall be deleted
Returns:
the new PublishDelete instance

createPublishDelete

public static PublishDelete createPublishDelete(Identifier i1,
                                                Identifier i2,
                                                String filter)
Create a new PublishDelete instance for a link between two Identifier instances in order to delete its metadata that matches the given filter.

Parameters:
i1 - the first Identifier of the link
i2 - the second Identifier of the link
filter - a filter that expresses the metadata that shall be deleted
Returns:
the new PublishDelete instance

createSubscribeUpdate

public static SubscribeUpdate createSubscribeUpdate()
Create a SubscribeUpdate instance with default values. You need to add the start Identifier with SearchHolder.setStartIdentifier(Identifier) and the name with SubscribeElement.setName(String) afterwards!

Returns:
the new SubscribeUpdate instance

createSubscribeUpdate

public static SubscribeUpdate createSubscribeUpdate(String name,
                                                    String matchLinks,
                                                    Integer maxDepth,
                                                    String termIdents,
                                                    Integer maxSize,
                                                    String resultFilter,
                                                    Identifier start)
Create a SubscribeUpdate instance with the given parameters.

Parameters:
name - the name of the subscription
matchLinks - the match-links filter (null means match-all, an empty String means match-nothing)
maxDepth - max-depth of the search (default is left out)
terminalIdentifiers - comma separated list of terminal identifier types (for example 'identity,device')
maxSize - max-size of search result (default is left out)
resultFilter - the result-filter filter (null means match-all, an empty String means match-nothing)
start - the start Identifier
Returns:
the new SubscribeUpdate instance

createSubscribeDelete

public static SubscribeDelete createSubscribeDelete()
Create a SubscribeDelete instance with default values. You need to set the name with SubscribeElement.setName(String) afterwards!

Returns:
the new SubscribeDelete instance

createSubscribeDelete

public static SubscribeDelete createSubscribeDelete(String name)
Create a new SubscribeDelete instance with the given name.

Parameters:
name - the name of the subscription that shall be deleted on the MAPS.
Returns:
the new SubscribeDelete instance


Copyright © 2012 Trust@FHH. All Rights Reserved.