com.sun.xml.ws.rm.runtime.sequence.persistent
Class PersistentSequenceManager

java.lang.Object
  extended by com.sun.xml.ws.rm.runtime.sequence.persistent.PersistentSequenceManager
All Implemented Interfaces:
SequenceManager

public final class PersistentSequenceManager
extends java.lang.Object
implements SequenceManager


Constructor Summary
PersistentSequenceManager()
           
 
Method Summary
 void bindSequences(java.lang.String referenceSequenceId, java.lang.String boundSequenceId)
          Binds two sequences together.
 void closeSequence(java.lang.String sequenceId)
          Closes an existing sequence.
 Sequence createInboundSequence(java.lang.String sequenceId, java.lang.String strId, long expirationTime)
          Creates a new inbound sequence object
 Sequence createOutboundSequence(java.lang.String sequenceId, java.lang.String strId, long expirationTime)
          Creates a new outbound sequence object with a given Id.
 java.lang.String generateSequenceUID()
          Generates a unique identifier of a sequence
 Sequence getBoundSequence(java.lang.String referenceSequenceId)
          Retrieves a sequence previously bound to the reference sequence
 Sequence getSequence(java.lang.String sequenceId)
          Retrieves an existing sequence from the internal sequence storage
 boolean isValid(java.lang.String sequenceId)
          Provides information on whether the sequence identifier is a valid identifier that belongs to an existing sequence registered with the sequence manager.
 Sequence terminateSequence(java.lang.String sequenceId)
          Terminates an existing sequence by calling the Sequence.preDestroy() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentSequenceManager

public PersistentSequenceManager()
Method Detail

closeSequence

public void closeSequence(java.lang.String sequenceId)
                   throws UnknownSequenceException
Description copied from interface: SequenceManager
Closes an existing sequence. The closed sequence is still kept in the internal sequence storage

Specified by:
closeSequence in interface SequenceManager
Parameters:
sequenceId - the unique sequence identifier
Throws:
UnknownSequenceException

createOutboundSequence

public Sequence createOutboundSequence(java.lang.String sequenceId,
                                       java.lang.String strId,
                                       long expirationTime)
                                throws DuplicateSequenceException
Description copied from interface: SequenceManager
Creates a new outbound sequence object with a given Id. It is assumed that RM handshake has been alrady established, thus no RM handshake is performed.

Specified by:
createOutboundSequence in interface SequenceManager
Parameters:
sequenceId - identifier of the new sequence
strId - security reference token identifier which this session is bound to
expirationTime - expiration time of the sequence in milliseconds; value of com.sun.xml.ws.rm.policy.Configuration#UNSPECIFIED means that this sequence never expires.
Returns:
newly created inbound sequence
Throws:
DuplicateSequenceException

createInboundSequence

public Sequence createInboundSequence(java.lang.String sequenceId,
                                      java.lang.String strId,
                                      long expirationTime)
                               throws DuplicateSequenceException
Description copied from interface: SequenceManager
Creates a new inbound sequence object

Specified by:
createInboundSequence in interface SequenceManager
Parameters:
sequenceId - identifier of the new sequence
strId - security reference token identifier which this session is bound to
expirationTime - expiration time of the sequence in milliseconds; value of com.sun.xml.ws.rm.policy.Configuration#UNSPECIFIED means that this sequence never expires.
Returns:
newly created inbound sequence
Throws:
DuplicateSequenceException

generateSequenceUID

public java.lang.String generateSequenceUID()
Description copied from interface: SequenceManager
Generates a unique identifier of a sequence

Specified by:
generateSequenceUID in interface SequenceManager
Returns:
new unique sequence identifier which can be used to construct a new sequence.

getSequence

public Sequence getSequence(java.lang.String sequenceId)
                     throws UnknownSequenceException
Description copied from interface: SequenceManager
Retrieves an existing sequence from the internal sequence storage

Specified by:
getSequence in interface SequenceManager
Parameters:
sequenceId - the unique sequence identifier
Returns:
sequence identified with the sequenceId identifier
Throws:
UnknownSequenceException

isValid

public boolean isValid(java.lang.String sequenceId)
Description copied from interface: SequenceManager
Provides information on whether the sequence identifier is a valid identifier that belongs to an existing sequence registered with the sequence manager.

Specified by:
isValid in interface SequenceManager
Parameters:
sequenceId - sequence identifier to be checked
Returns:
true in case the sequence identifier is valid, false otherwise

terminateSequence

public Sequence terminateSequence(java.lang.String sequenceId)
                           throws UnknownSequenceException
Description copied from interface: SequenceManager
Terminates an existing sequence by calling the Sequence.preDestroy() method. In addition to this, the terminated sequence is removed from the internal sequence storage

Specified by:
terminateSequence in interface SequenceManager
Parameters:
sequenceId - the unique sequence identifier
Returns:
terminated sequence object
Throws:
UnknownSequenceException

bindSequences

public void bindSequences(java.lang.String referenceSequenceId,
                          java.lang.String boundSequenceId)
                   throws UnknownSequenceException
Description copied from interface: SequenceManager
Binds two sequences together. This method is mainly intended to be used for binding together request and response sequences.

Specified by:
bindSequences in interface SequenceManager
Parameters:
referenceSequenceId - a reference sequence indentifier to which the other sequence shall be bound.
boundSequenceId - a bound sequence identifier
Throws:
UnknownSequenceException - in case any of the sequence identifiers does not represent a valid sequence

getBoundSequence

public Sequence getBoundSequence(java.lang.String referenceSequenceId)
                          throws UnknownSequenceException
Description copied from interface: SequenceManager
Retrieves a sequence previously bound to the reference sequence

Specified by:
getBoundSequence in interface SequenceManager
Parameters:
referenceSequenceId - a reference sequence indentifier to which the other sequence has been bound.
Returns:
bound sequence or null in case no sequence is bound to the reference sequence
Throws:
UnknownSequenceException