cgl.narada.wsinfra.wsr.storage.impl
Class WsrProtocolStorageOperationsImpl

java.lang.Object
  extended by cgl.narada.wsinfra.wsr.storage.impl.WsrProtocolStorageOperationsImpl
All Implemented Interfaces:
WsrProtocolStorageOperations

public class WsrProtocolStorageOperationsImpl
extends Object
implements WsrProtocolStorageOperations


Constructor Summary
WsrProtocolStorageOperationsImpl()
           
WsrProtocolStorageOperationsImpl(Connection connection)
           
 
Method Summary
 void deleteGroupTerminationInfo(String groupId)
          Delete the GroupTerminationInfo object.
 void deleteStoredElement(String groupId, long sequenceNumber)
          Removes stored WsrStorageWidget from storage.
 long[] getAcknowledgedSequenceNumbers(String groupId)
          Retrieves the list of sequence numbers that have been acknowledged This method throws WsrStorageException.
 WsrGroupTerminationInfoImpl getGroupTerminationInfo(String groupId)
          Retrieves the GroupTerminationInfo object.
 String getMessageFault(String groupId, long sequenceNumber)
          Gets the Fault associate with the message if message is faulted from storage
 byte getMessageStatus(String groupId, long sequenceNumber)
          Gets the Status of the Message from storage
 long getSequenceNumberLastAssigned(String groupId)
          Retrieves the sequence number that was last assigned on a given group.
 long[] getSequenceNumbers(String groupId)
          Retrieves the list of all sequence numbers
 WsrStorageWidgetImpl getStoredElement(String groupId, long sequenceNumber)
          Retrieves a stored WsrStorageWidget from storage.
 WsrStorageWidgetImpl[] getStoredElements(String groupId, long[] sequenceNumbers)
          Retrieves stored WsrStorageWidgets from storage.
 long[] getUnacknowledgedSequenceNumbers(String groupId)
          Retrieves the list of sequence numbers that have NOT been acknowledged and not faulted for a given group.This method throws an exception if the group specified by groupId is an unknown one or if there are other storage problems.
 long[] getUnacknowledgedSequenceNumbers(String groupId, long upUntilSequenceNumber)
          Retrieves the list of sequence numbers that have NOT been acknowledged, up until the sequence number specified in upUntilSequenceNumber This method throws an exception under the following conditions.
 long[] getUnDeliveredSequenceNumbers(String groupId)
          Retrieves the list of sequence numbers that have NOT been Delivered for a given group.This method throws an exception if the group specified by groupId is an unknown one or if there are other storage problems.
 long[] getUnDeliveredSequenceNumbers(String groupId, long sequenceNumber)
          Retrieves the list of sequence numbers that have NOT been Delivered, and have sequenceNumber greater than specified sequenceNumber This method throws an exception under the following conditions.
 boolean hasStoredElement(String groupId, long sequenceNumber)
          Check to see if there is a widget that has been stored for a specific sequence number in a given group
 boolean hasStoredElements(String groupId)
          Checks to see if there are widgets that have been stored for the group in question.
static void main(String[] args)
           
 void processAcknowledgementOnGroup(String groupId, long ackSequenceNumber)
          Processes an acknowledgement received on a given group for a specific sequence number.
 void processAcknowledgementsOnGroup(String groupId, long[] ackSequenceNumbers)
          Processes a set of acknowledgements received on a given group.
 void processFaultOnGroup(String groupId, long sequenceNumber, QName fault)
          Processes Fault received on a given group for a specific sequence number.
 void resetNumberOfRetries(WsrStorageWidgetImpl wsrStorageWidgetImpl, byte numberOfRetries)
          Reset the Number Of Retries associated with the retransmission of the message
 void resetRetransmissionTime(WsrStorageWidgetImpl wsrStorageWidgetImpl, long retransmissionTime)
          Reset the Retranmission Time associated with the message
 void store(WsrStorageWidgetImpl widget)
          Store a WSR message to storage.
 void storeGroupTerminationInfo(WsrGroupTerminationInfoImpl groupTerminationInfo)
          Stores the GroupTerminationInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrProtocolStorageOperationsImpl

public WsrProtocolStorageOperationsImpl()

WsrProtocolStorageOperationsImpl

public WsrProtocolStorageOperationsImpl(Connection connection)
Method Detail

processAcknowledgementsOnGroup

public void processAcknowledgementsOnGroup(String groupId,
                                           long[] ackSequenceNumbers)
                                    throws WsrStorageException
Processes a set of acknowledgements received on a given group. This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
One or more of the acknowledgements refer to non-existent sequence numbers.
Storage related problems

Specified by:
processAcknowledgementsOnGroup in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

processAcknowledgementOnGroup

public void processAcknowledgementOnGroup(String groupId,
                                          long ackSequenceNumber)
                                   throws WsrStorageException
Processes an acknowledgement received on a given group for a specific sequence number. This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
The acknowledgement refers to non-existent sequence number
Storage related problems

Specified by:
processAcknowledgementOnGroup in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

processFaultOnGroup

public void processFaultOnGroup(String groupId,
                                long sequenceNumber,
                                QName fault)
                         throws WsrStorageException
Processes Fault received on a given group for a specific sequence number. This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
The fault refers to non-existent sequence number
Storage related problems

Specified by:
processFaultOnGroup in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getUnacknowledgedSequenceNumbers

public long[] getUnacknowledgedSequenceNumbers(String groupId,
                                               long upUntilSequenceNumber)
                                        throws WsrStorageException
Retrieves the list of sequence numbers that have NOT been acknowledged, up until the sequence number specified in upUntilSequenceNumber This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
The specified sequence number is a non-existent one.
Storage related problems

Specified by:
getUnacknowledgedSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getUnacknowledgedSequenceNumbers

public long[] getUnacknowledgedSequenceNumbers(String groupId)
                                        throws WsrStorageException
Retrieves the list of sequence numbers that have NOT been acknowledged and not faulted for a given group.This method throws an exception if the group specified by groupId is an unknown one or if there are other storage problems.

Specified by:
getUnacknowledgedSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getUnDeliveredSequenceNumbers

public long[] getUnDeliveredSequenceNumbers(String groupId,
                                            long sequenceNumber)
                                     throws WsrStorageException
Retrieves the list of sequence numbers that have NOT been Delivered, and have sequenceNumber greater than specified sequenceNumber This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
Storage related problems

Specified by:
getUnDeliveredSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getUnDeliveredSequenceNumbers

public long[] getUnDeliveredSequenceNumbers(String groupId)
                                     throws WsrStorageException
Retrieves the list of sequence numbers that have NOT been Delivered for a given group.This method throws an exception if the group specified by groupId is an unknown one or if there are other storage problems.

Specified by:
getUnDeliveredSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getAcknowledgedSequenceNumbers

public long[] getAcknowledgedSequenceNumbers(String groupId)
                                      throws WsrStorageException
Retrieves the list of sequence numbers that have been acknowledged This method throws WsrStorageException.

Specified by:
getAcknowledgedSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getSequenceNumbers

public long[] getSequenceNumbers(String groupId)
                          throws WsrStorageException
Retrieves the list of all sequence numbers

Specified by:
getSequenceNumbers in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getSequenceNumberLastAssigned

public long getSequenceNumberLastAssigned(String groupId)
                                   throws WsrStorageException
Retrieves the sequence number that was last assigned on a given group. This method throws an exception if the group specified by groupId is an unknown one or if there are storage related problems.

Specified by:
getSequenceNumberLastAssigned in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getMessageStatus

public byte getMessageStatus(String groupId,
                             long sequenceNumber)
                      throws WsrStorageException
Gets the Status of the Message from storage

Specified by:
getMessageStatus in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getMessageFault

public String getMessageFault(String groupId,
                              long sequenceNumber)
                       throws WsrStorageException
Gets the Fault associate with the message if message is faulted from storage

Specified by:
getMessageFault in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

store

public void store(WsrStorageWidgetImpl widget)
           throws WsrStorageException
Store a WSR message to storage. This method throws an exception if there are storage related problems.

Specified by:
store in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

hasStoredElements

public boolean hasStoredElements(String groupId)
                          throws WsrStorageException
Checks to see if there are widgets that have been stored for the group in question.

Specified by:
hasStoredElements in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

hasStoredElement

public boolean hasStoredElement(String groupId,
                                long sequenceNumber)
                         throws WsrStorageException
Check to see if there is a widget that has been stored for a specific sequence number in a given group

Specified by:
hasStoredElement in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getStoredElement

public WsrStorageWidgetImpl getStoredElement(String groupId,
                                             long sequenceNumber)
                                      throws WsrStorageException
Retrieves a stored WsrStorageWidget from storage. This method throws an exception under the following conditions.
The group specified in groupId is an unknown one.
The specified sequenceNumber is a non-existent one.
Storage related problems

Specified by:
getStoredElement in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getStoredElements

public WsrStorageWidgetImpl[] getStoredElements(String groupId,
                                                long[] sequenceNumbers)
                                         throws WsrStorageException
Retrieves stored WsrStorageWidgets from storage. This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
One or more of the specified sequence numbers are non-existent.
Storage related problems

Specified by:
getStoredElements in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

deleteStoredElement

public void deleteStoredElement(String groupId,
                                long sequenceNumber)
                         throws WsrStorageException
Removes stored WsrStorageWidget from storage. This method throws an exception under the following conditions.
The group specified by groupId is an unknown one.
Storage related problems

Specified by:
deleteStoredElement in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

storeGroupTerminationInfo

public void storeGroupTerminationInfo(WsrGroupTerminationInfoImpl groupTerminationInfo)
                               throws WsrStorageException
Stores the GroupTerminationInfo object. This method stores the groupTerminationInfo object in storage If groupId in groupTerminationInfo object is already exist then it updates the GroupTerminationInfo Object in storage. This method throws exception if
Storage related problems

Specified by:
storeGroupTerminationInfo in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

getGroupTerminationInfo

public WsrGroupTerminationInfoImpl getGroupTerminationInfo(String groupId)
                                                    throws WsrStorageException
Retrieves the GroupTerminationInfo object. This method retrieves the groupTerminationInfo object for particular groupId from storage This method throws an exception under the following circumstances
The groupId in the GroupTerminationInfo not exists.
Storage related problems

Specified by:
getGroupTerminationInfo in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

deleteGroupTerminationInfo

public void deleteGroupTerminationInfo(String groupId)
                                throws WsrStorageException
Delete the GroupTerminationInfo object. This method deletes the groupTerminationInfo object for particular groupId from storage This method throws an exception under the following circumstances
The groupId in the GroupTerminationInfo not exists.
Storage related problems

Specified by:
deleteGroupTerminationInfo in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

resetRetransmissionTime

public void resetRetransmissionTime(WsrStorageWidgetImpl wsrStorageWidgetImpl,
                                    long retransmissionTime)
                             throws WsrStorageException
Reset the Retranmission Time associated with the message

Specified by:
resetRetransmissionTime in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

resetNumberOfRetries

public void resetNumberOfRetries(WsrStorageWidgetImpl wsrStorageWidgetImpl,
                                 byte numberOfRetries)
                          throws WsrStorageException
Reset the Number Of Retries associated with the retransmission of the message

Specified by:
resetNumberOfRetries in interface WsrProtocolStorageOperations
Throws:
WsrStorageException

main

public static void main(String[] args)


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