Interface Sequence
- All Known Implementing Classes:
AbstractSequence
,InboundSequence
,OutboundSequence
- Author:
- Marek Potociar (marek.potociar at sun.com)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static enum
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final long
static final long
static final long
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acknowledgeMessageNumber
(long messageNumber) Marks given message number with the sequence as aknowledgedvoid
Marks given message numbers with the sequence as aknowledgedvoid
This method should be called to clear the AckRequested flag, which indicates that any pending requests for acknowledgement of all message identifiers registered with this sequence were satisfied.void
close()
Closes the sequence.Provides a collection of ranges of message numbers acknowledged with the sequenceProvides information on a security session to which this sequence is bound to.Updates a delivery queue for this sequence with any unacknowledged messages that should be sent and returns the delivery queue instance.getId()
Returns unique identifier of the sequencelong
Provides information on the last activity time of this sequence.long
Provides information on the message number of the last message registered on this sequencegetState()
Provides information on the state of the message sequenceboolean
The method may be called to determine whether the sequence has some unacknowledged messages or notboolean
isAcknowledged
(long messageNumber) Is this message number acknowledged with the sequence?boolean
Provides information on the actual AckRequested flag statusboolean
isClosed()
Provides information on the sequence closed status.boolean
Provides information on the sequence expiration status.boolean
isFailedOver
(long messageNumber) Determines whether a given message number is registered as received, unacknowledged and failed over.boolean
isStandaloneAcknowledgementRequestSchedulable
(long delayPeriod) Determines whether a standalone acnowledgement request can be scheduled or not based on thehasUnacknowledgedMessages()
value, last acknowledgement request time (seeupdateLastAcknowledgementRequestTime()
) anddelayPeriod
parameter.void
The method is called during the sequence termination to allow sequence object to release its allocated resourcesvoid
registerMessage
(ApplicationMessage message, boolean storeMessageFlag) Registers given message with the sequenceretrieveMessage
(String correlationId) Retrieves a message stored within the sequence under the providedcorrelationId
if avalable.void
This method should be called to set the AckRequested flag, which indicates a pending request for acknowledgement of all message identifiers registered with this sequence.void
Updates information on when was the last acknowledgement request for this sequence sent to current time.
-
Field Details
-
UNSPECIFIED_MESSAGE_ID
static final long UNSPECIFIED_MESSAGE_ID- See Also:
-
MIN_MESSAGE_ID
static final long MIN_MESSAGE_ID- See Also:
-
MAX_MESSAGE_ID
static final long MAX_MESSAGE_ID- See Also:
-
NO_EXPIRY
static final long NO_EXPIRY- See Also:
-
-
Method Details
-
getId
Returns unique identifier of the sequence- Returns:
- unique sequence identifier
-
getLastMessageNumber
@ManagedAttribute @Description("Last message identifier register on this sequence") long getLastMessageNumber()Provides information on the message number of the last message registered on this sequence- Returns:
- message number of the last message registered on this sequence
-
registerMessage
void registerMessage(@NotNull ApplicationMessage message, boolean storeMessageFlag) throws DuplicateMessageRegistrationException, AbstractSoapFaultException Registers given message with the sequence- Parameters:
message
- application message to be registeredstoreMessageFlag
- boolean flag indicating whether message should be stored until acknowledged or not- Throws:
DuplicateMessageRegistrationException
- in case a message with such message number has already been registered with the sequenceAbstractSoapFaultException
- in a case the sequence is closed or terminated
-
retrieveMessage
Retrieves a message stored within the sequence under the providedcorrelationId
if avalable. May returnnull
if no stored message under givencorrelationId
is available.Availability of the message depends on the message identifier acknowledgement. Message, if stored (see
registerMessage(com.sun.xml.ws.rx.rm.runtime.ApplicationMessage, boolean)
remains available for retrieval until it is acknowledged. Once the message identifier associated with the stored message has been acknowledged, availability of the stored message is no longer guaranteed and stored message becomes eligible for garbage collection (if stored in memory) or removal.Note however, that message MAY still be available even after it has been acknowledged. Thus it is NOT safe to use this method as a test of a message acknowledgement.
- Parameters:
correlationId
- correlation identifier of the storedApplicationMessage
- Returns:
- the message that is stored in the sequence if available,
null
otherwise.
-
getDeliveryQueue
DeliveryQueue getDeliveryQueue()Updates a delivery queue for this sequence with any unacknowledged messages that should be sent and returns the delivery queue instance. Messages in the queue are the ones currently waiting for a delivery.- Returns:
- delivery queue with a messages waiting for a delivery on this particular sequence
-
acknowledgeMessageNumbers
Marks given message numbers with the sequence as aknowledged- Parameters:
ranges
- message number ranges to be acknowledged- Throws:
InvalidAcknowledgementException
- is generated when acked ranges contain a SequenceAcknowledgement covering messages that have not been sent.AbstractSoapFaultException
- in case the sequence is terminated
-
acknowledgeMessageNumber
Marks given message number with the sequence as aknowledged- Parameters:
messageNumber
- message number to be acknowledged- Throws:
AbstractSoapFaultException
- in case the sequence is terminated
-
isFailedOver
boolean isFailedOver(long messageNumber) Determines whether a given message number is registered as received, unacknowledged and failed over.- Parameters:
messageNumber
- message number to be tested- Returns:
true
if the message number is registered as received, unacknowledged and failed over,false
otherwise
-
getAcknowledgedMessageNumbers
List<Sequence.AckRange> getAcknowledgedMessageNumbers()Provides a collection of ranges of message numbers acknowledged with the sequence- Returns:
- collection of ranges of message numbers registered with the sequence
-
isAcknowledged
boolean isAcknowledged(long messageNumber) Is this message number acknowledged with the sequence?- Parameters:
messageNumber
- in a sequence- Returns:
- true if acknowledged, otherwise false
-
hasUnacknowledgedMessages
@ManagedAttribute @Description("True if the sequence has unacknowledged message identifiers") boolean hasUnacknowledgedMessages()The method may be called to determine whether the sequence has some unacknowledged messages or not- Returns:
true
if the sequence has any unacknowledged message identifiers,false
otherwise
-
getState
Provides information on the state of the message sequence- Returns:
- current state of the message sequence
-
setAckRequestedFlag
void setAckRequestedFlag()This method should be called to set the AckRequested flag, which indicates a pending request for acknowledgement of all message identifiers registered with this sequence. -
clearAckRequestedFlag
void clearAckRequestedFlag()This method should be called to clear the AckRequested flag, which indicates that any pending requests for acknowledgement of all message identifiers registered with this sequence were satisfied. -
isAckRequested
Provides information on the actual AckRequested flag status- Returns:
true
if the AckRequested flag is set,false
otherwise
-
updateLastAcknowledgementRequestTime
void updateLastAcknowledgementRequestTime()Updates information on when was the last acknowledgement request for this sequence sent to current time. -
isStandaloneAcknowledgementRequestSchedulable
boolean isStandaloneAcknowledgementRequestSchedulable(long delayPeriod) Determines whether a standalone acnowledgement request can be scheduled or not based on thehasUnacknowledgedMessages()
value, last acknowledgement request time (seeupdateLastAcknowledgementRequestTime()
) anddelayPeriod
parameter. Returnstrue
if the sequence has any pending acknowledgements is set and last acknowledgement request time is older than delay period substracted from the current time. Returnsfalse
otherwise.- Parameters:
delayPeriod
- delay period that should pass since the last acknowledgement request before an autonomous acnowledgement request is sent.- Returns:
true
orfalse
depending on whether
-
getBoundSecurityTokenReferenceId
@ManagedAttribute @Description("The security token reference identifier to which this sequence is bound") String getBoundSecurityTokenReferenceId()Provides information on a security session to which this sequence is bound to.- Returns:
- security token reference identifier to which this sequence is bound to.
-
close
void close()Closes the sequence. Subsequent calls to this method have no effect.Once this method is called, any subsequent calls to the
#getNextMessageId()
method will result in aIllegalStateException
being raised. It is however still possible to accept message identifier acknowledgements, as well as retrieve any other information on the sequence. -
isClosed
Provides information on the sequence closed status.- Returns:
true
if the sequence has been closed,false
otherwise
-
isExpired
Provides information on the sequence expiration status.- Returns:
true
if the sequence has already expired,false
otherwise
-
getLastActivityTime
@ManagedAttribute @Description("Last activity time on the sequence in milliseconds") long getLastActivityTime()Provides information on the last activity time of this sequence. Following is the list of operations invocation of which causes an update of last activity time:- Returns:
- last activity time on the sequence in milliseconds
-
preDestroy
void preDestroy()The method is called during the sequence termination to allow sequence object to release its allocated resources
-