org.systinet.wasp.wsrm.sequence
Interface DuplexSequenceRegistry


public interface DuplexSequenceRegistry

Registry of duplex 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();
   DuplexSequenceRegistry registry = factory.getDuplexSequenceRegistry();
   // load persistent sequence or create a new one (if it was not stored yet)
   DuplexSequence sequence = registry.loadSequence(PERSISTENT_SEQUENCE_PREFIX, sc);
   if (sequence == null) {
       sequence = registry.createSequence(PERSISTENT_SEQUENCE_PREFIX, sc, true);
   }
   OutputSequence outputSequence = sequence.getOutputSequence();
   InputSequence inputSequence = sequence.getInputSequence();
 

Since:
SSJ 6.5
Component:
WS Reliable Messaging Interfaces

Method Summary
 DuplexSequence createSequence(ServiceClient serviceClient)
          Returns a newly created sequence with a uniquely generated id.
 DuplexSequence createSequence(java.lang.String id, ServiceClient serviceClient)
          Returns a newly created sequence with a unique id.
 DuplexSequence 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.
 DuplexSequence getSequence(java.lang.String id)
          Returns an existing sequence or null if this sequence does not exist.
 DuplexSequence[] getSequences()
          Returns all existing sequences.
 DuplexSequence[] getSequences(java.lang.String prefix)
          Returns existing sequences whose ids start with the provided prefix.
 DuplexSequence loadSequence(java.lang.String id, ServiceClient serviceClient)
          Returns a sequence loaded from the persistent store and associates it with the provided ServiceClient.
 DuplexSequence[] loadSequences(ServiceClient serviceClient)
          Returns all existing sequences and associates them with the provided ServiceClient.
 DuplexSequence[] 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 DuplexSequence createSequence(ServiceClient serviceClient)
                              throws SequenceException
Returns a newly created sequence with a uniquely generated id. The sequence is associated with the provided ServiceClient.
Note: If the created sequence is 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

createSequence

public DuplexSequence 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.
Note: If the created sequence is 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)).

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

createSequence

public DuplexSequence 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.
Note: If the created sequence is 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)).

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 DuplexSequence 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 DuplexSequence loadSequence(java.lang.String id,
                                   ServiceClient serviceClient)
                            throws SequenceException
Returns a sequence loaded from the persistent store and associates it with the provided ServiceClient.
Note: If the loaded sequence is 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

getSequences

public DuplexSequence[] 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 DuplexSequence[] 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.
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)).

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

getSequences

public DuplexSequence[] 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 DuplexSequence[] 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