org.systinet.wasp.wsrm.sequence
Interface OutputSequenceRegistry


public interface OutputSequenceRegistry

Registry of output sequences.
Typical use of this registry is shown as follows:

   ServiceClient sc = ServiceClient.create(WSDL_URL);
   Service service = (Service) sc.createProxy(Service.class);

   RegistryFactory factory = RegistryFactory.getInstance();
   OutputSequenceRegistry registry = factory.getOutputSequenceRegistry();
   // load persistent sequence or create a new one (if it was not stored yet)
   OutputSequence sequence = registry.loadSequence(PERSISTENT_SEQUENCE_PREFIX, sc);
   if (sequence == null) {
       sequence = registry.createSequence(PERSISTENT_SEQUENCE_PREFIX, sc, true);
   }
 

Since:
SSJ 6.5
Component:
WS Reliable Messaging Interfaces

Method Summary
 OutputSequence createSequence(ServiceClient serviceClient)
          Returns a newly created sequence with a uniquely generated id.
 OutputSequence createSequence(java.lang.String id, ServiceClient serviceClient)
          Returns a newly created sequence with a unique id.
 OutputSequence createSequence(java.lang.String prefix, ServiceClient serviceClient, boolean generateSuffix)
          Returns a newly created sequence with a unique id that begins with the provided prefix and ends with a uniquely generated suffix.
 OutputSequence getSequence(java.lang.String id)
          Returns an existing sequence or null if this sequence does not exist.
 OutputSequence[] getSequences()
          Returns all existing sequences.
 OutputSequence[] getSequences(java.lang.String prefix)
          Returns existing sequences whose ids start with the provided prefix.
 OutputSequence loadSequence(java.lang.String id, ServiceClient serviceClient)
          Returns a sequence loaded from the persistent store and associates it with the provided ServiceClient.
 OutputSequence[] loadSequences(ServiceClient serviceClient)
          Returns all existing sequences and associates them with the provided ServiceClient.
 OutputSequence[] loadSequences(java.lang.String prefix, ServiceClient serviceClient)
          Returns existing sequences whose ids start with the provided prefix and associates them with the provided ServiceClient.
 

Method Detail

createSequence

public OutputSequence createSequence(ServiceClient serviceClient)
                              throws SequenceException
Returns a newly created sequence with a uniquely generated id. The sequence is associated with the provided ServiceClient.

Throws:
SequenceException

createSequence

public OutputSequence createSequence(java.lang.String id,
                                     ServiceClient serviceClient)
                              throws SequenceException
Returns a newly created sequence with a unique id. The sequence is associated with the provided ServiceClient.

Parameters:
id - the unique id.
Throws:
SequenceException - when non-unique id is provided.

createSequence

public OutputSequence createSequence(java.lang.String prefix,
                                     ServiceClient serviceClient,
                                     boolean generateSuffix)
                              throws SequenceException
Returns a newly created sequence with a unique id that begins with the provided prefix and ends with a uniquely generated suffix. The sequence is associated with the provided ServiceClient.
Use this method to create a set of application related sequences.

Parameters:
prefix - beginning of the sequence id.
generateSuffix - if false no suffix is added to the sequence id.
Throws:
SequenceException - when non-unique id is provided.

getSequence

public OutputSequence getSequence(java.lang.String id)
                           throws SequenceException
Returns an existing sequence or null if this sequence does not exist. This must be called for the second and other times (when this sequence has already been associated with a ServiceClient).

Throws:
SequenceException - when the returned sequence has not been associated with ServiceClient.
See Also:
loadSequence(String, org.systinet.wasp.webservice.ServiceClient)

loadSequence

public OutputSequence loadSequence(java.lang.String id,
                                   ServiceClient serviceClient)
                            throws SequenceException
Returns a sequence loaded from the persistent store and associates it with the provided ServiceClient.

Throws:
SequenceException

getSequences

public OutputSequence[] getSequences(java.lang.String prefix)
                              throws SequenceException
Returns existing sequences whose ids start with the provided prefix. This must be called for the second and other times (when this sequence has already been associated with a ServiceClient).

Parameters:
prefix - ids of returned sequences start with this prefix.
Throws:
SequenceException - when the returned sequences have not been associated with ServiceClient.
See Also:
loadSequences(String, org.systinet.wasp.webservice.ServiceClient)

loadSequences

public OutputSequence[] loadSequences(java.lang.String prefix,
                                      ServiceClient serviceClient)
                               throws SequenceException
Returns existing sequences whose ids start with the provided prefix and associates them with the provided ServiceClient.

Parameters:
prefix - ids of returned sequences start with this prefix.
Throws:
SequenceException

getSequences

public OutputSequence[] getSequences()
                              throws SequenceException
Returns all existing sequences. This must be called for the second and other times (when this sequence has already been associated with a ServiceClient).

Throws:
SequenceException - when the returned sequences have not been associated with ServiceClient.
See Also:
loadSequences(org.systinet.wasp.webservice.ServiceClient)

loadSequences

public OutputSequence[] loadSequences(ServiceClient serviceClient)
                               throws SequenceException
Returns all existing sequences and associates them with the provided ServiceClient.
Note: If the loaded sequences are to be used with non-anonymous invocation, make sure that the call-back service has been published prior to call this method (see ServiceClient.setAsyncEndpointPath(String)).

Throws:
SequenceException