cgl.narada.wsinfra.wsrm.storage.impl
Class WsrmProtocolStorageOperationsImpl

java.lang.Object
  extended by cgl.narada.wsinfra.wsrm.storage.impl.WsrmProtocolStorageOperationsImpl
All Implemented Interfaces:
WsrmProtocolStorageOperations

public class WsrmProtocolStorageOperationsImpl
extends Object
implements WsrmProtocolStorageOperations

Title:WsrmProtocolStorageOperationsImpl

Description: Handles Protocol Storage Operations which is defined in interface WsrmProtocolStorageOperations


Constructor Summary
WsrmProtocolStorageOperationsImpl()
           
WsrmProtocolStorageOperationsImpl(Connection connection)
           
 
Method Summary
 long[] getAcknowledgedMessageNumbers(String sequenceIdentifier)
          Retrieves the list of message numbers that have been acknowledged This method throws WsrmStorageException.
 long getMessageNumberLastAssigned(String sequenceIdentifier)
          Retrieves the message number that was last assigned on a given sequence.
 WsrmStorageWidget getStoredElement(String sequenceIdentifier, long messageNumber)
          Retrieves a stored WsrmStorageWidget from storage.
 WsrmStorageWidget[] getStoredElements(String sequenceIdentifier, long[] messageNumbers)
          Retrieves stored WsrmStorageWidgets from storage.
 long[] getUnacknowledgedMessageNumbers(String sequenceIdentifier, boolean ackRequested)
          Retrieves the list of message numbers that have NOT been acknowledged for a given Sequence.
 long[] getUnacknowledgedMessageNumbers(String sequenceIdentifier, long upUntilMessageNumber)
          Retrieves the list of message numbers that have NOT been acknowledged, up until the message number specified in upUntilMessageNumber This method throws an exception under the following conditions.
 boolean hasStoredElement(String sequenceIdentifier, long messageNumber)
          Check to see if there is a widget that has been stored for a specific message number in a given Sequence
 boolean hasStoredElements(String sequenceIdentifier)
          Checks to see if there are widgets that have been stored for the sequence in question.
static void main(String[] args)
           
 void processAcknowledgementOnSequence(String sequenceIdentifier, long ackMessageNumber)
          Processes an acknowledgement received on a given sequence for a specific message number.
 void processAcknowledgementsOnSequence(String sequenceIdentifier, long[] ackMessageNumbers)
          Processes a set of acknowledgements received on a given sequence.
 void resetAckInterval(WsrmStorageWidget wsrmStorageWidget, long ackInterval)
          Reset the ack interval associated with the message
 void store(WsrmStorageWidget widget)
          Store a WSRM message to storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrmProtocolStorageOperationsImpl

public WsrmProtocolStorageOperationsImpl()

WsrmProtocolStorageOperationsImpl

public WsrmProtocolStorageOperationsImpl(Connection connection)
Method Detail

processAcknowledgementsOnSequence

public void processAcknowledgementsOnSequence(String sequenceIdentifier,
                                              long[] ackMessageNumbers)
                                       throws WsrmStorageException
Processes a set of acknowledgements received on a given sequence. This method throws an exception under the following conditions.
The Sequence specified in sequenceIdentifier is an unknown one.
One or more of the acknowledgements refer to non-existent message numbers.
Storage related problems

Specified by:
processAcknowledgementsOnSequence in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

processAcknowledgementOnSequence

public void processAcknowledgementOnSequence(String sequenceIdentifier,
                                             long ackMessageNumber)
                                      throws WsrmStorageException
Processes an acknowledgement received on a given sequence for a specific message number. This method throws an exception under the following conditions.
The Sequence specified in sequenceIdentifier is an unknown one.
The acknowledgement refers to non-existent message number
Storage related problems

Specified by:
processAcknowledgementOnSequence in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getUnacknowledgedMessageNumbers

public long[] getUnacknowledgedMessageNumbers(String sequenceIdentifier,
                                              long upUntilMessageNumber)
                                       throws WsrmStorageException
Retrieves the list of message numbers that have NOT been acknowledged, up until the message number specified in upUntilMessageNumber This method throws an exception under the following conditions.
The Sequence specified in sequenceIdentifier is an unknown one.
The specified message number is a non-existent one.
Storage related problems

Specified by:
getUnacknowledgedMessageNumbers in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getUnacknowledgedMessageNumbers

public long[] getUnacknowledgedMessageNumbers(String sequenceIdentifier,
                                              boolean ackRequested)
                                       throws WsrmStorageException
Retrieves the list of message numbers that have NOT been acknowledged for a given Sequence. This method throws an exception if the Sequence specified in sequenceIdentifier is an unknown one or if there are other storage problems.

Specified by:
getUnacknowledgedMessageNumbers in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getAcknowledgedMessageNumbers

public long[] getAcknowledgedMessageNumbers(String sequenceIdentifier)
                                     throws WsrmStorageException
Retrieves the list of message numbers that have been acknowledged This method throws WsrmStorageException.

Specified by:
getAcknowledgedMessageNumbers in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getMessageNumberLastAssigned

public long getMessageNumberLastAssigned(String sequenceIdentifier)
                                  throws WsrmStorageException
Retrieves the message number that was last assigned on a given sequence. This method throws an exception if the Sequence specified in sequenceIdentifier is an unknown one or if there are storage related problems.

Specified by:
getMessageNumberLastAssigned in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

store

public void store(WsrmStorageWidget widget)
           throws WsrmStorageException
Store a WSRM message to storage. This method throws an exception if there are storage related problems.

Specified by:
store in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

hasStoredElements

public boolean hasStoredElements(String sequenceIdentifier)
                          throws WsrmStorageException
Checks to see if there are widgets that have been stored for the sequence in question.

Specified by:
hasStoredElements in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

hasStoredElement

public boolean hasStoredElement(String sequenceIdentifier,
                                long messageNumber)
                         throws WsrmStorageException
Check to see if there is a widget that has been stored for a specific message number in a given Sequence

Specified by:
hasStoredElement in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getStoredElement

public WsrmStorageWidget getStoredElement(String sequenceIdentifier,
                                          long messageNumber)
                                   throws WsrmStorageException
Retrieves a stored WsrmStorageWidget from storage. This method throws an exception under the following conditions.
The Sequence specified in sequenceIdentifier is an unknown one.
The specified message number is a non-existent one.
Storage related problems

Specified by:
getStoredElement in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

getStoredElements

public WsrmStorageWidget[] getStoredElements(String sequenceIdentifier,
                                             long[] messageNumbers)
                                      throws WsrmStorageException
Retrieves stored WsrmStorageWidgets from storage. This method throws an exception under the following conditions.
The Sequence specified in sequenceIdentifier is an unknown one.
One or more of the specified message numbers are non-existent.
Storage related problems

Specified by:
getStoredElements in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

resetAckInterval

public void resetAckInterval(WsrmStorageWidget wsrmStorageWidget,
                             long ackInterval)
                      throws WsrmStorageException
Reset the ack interval associated with the message

Specified by:
resetAckInterval in interface WsrmProtocolStorageOperations
Throws:
WsrmStorageException

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project