Functional Specification

Community Grids Lab, Indiana University

 

1.         Introduction

The FIRMS implementation will provide Grid and Web Service applications with ability to interact reliably with each other based on the implementation of the WS-ReliableMessaging (WSRM) and the WS-Reliability (WSR) specification. FIRMS provide an implementation of the WSRM specification that was released in March 2004 and WSR specification that was released on August 2004. The WSRM protocol developed jointly by IBM, Microsoft and BEA can be found at

ftp://www6.software.ibm.com/software/developer/library/ws-reliablemessaging200403.pdf

The specification for WS-Reliability -- developed jointly by Fujitsu, Novell, Oracle, and Sun -- can be found at http://docs.oasis-open.org/wsrm/2004/06/WS-Reliability-CD1.086.pdf.

 

Please note that what we briefly describe in the subsequent section is a background and overview to the WS-ReliableMessaging and WS-Reliability specification. If one is looking for comprehensive details the best place for this is the corresponding specification. Any attempt to describe the specifications in detail, will end up making this document similar to the specification: which would be pointless.

 

1.1         A background on acknowledgements and reliable delivery

Entities involved in reliable messaging need to facilitate easy detection of errors in received sequences while also being able to fix these errors in sequences. In sender-initiated protocols a sender gets positive acknowledgments (ACKs) from all receivers periodically. A positive acknowledgement confirms the receipt of a specific event by a given receiver. This information along with the knowledge of the events, which an entity is supposed to receive, allows the identification of holes in the delivery sequence at any given node. The sender can then initiate retransmissions to fix these errors.

In receiver-initiated protocols errors in received sequences are detected at the receivers, This detection in turn triggers negative acknowledgements (NAK) to fix these holes in the delivered sequences and retrieve any previously undelivered events. In receiver initiated protocols the assumption at the sender is that the message has been received at the receiver unless indicated otherwise by the NAKs.

It should be noted that in sender-initiated protocols the error detection, initiation of error correction and the retransmission are all performed at the sender side. In receiver-initiated protocols the error detection and initiation of error corrections are performed at the receiver, while the retransmissions are performed by the sender. ACK based schemes can exist by themselves, while NAK based schemes cannot. This is because in a purely NAK based scheme there is no way for the sender to know for sure if a message was received and hence the sender can never clear the buffer allocated for messages that were sent by the sender.

 

1.2         The WSRM & WSR specifications

The specifications – WSR and WSRM – both of which are based on XML, address the issue of ensuring reliable delivery between two service endpoints. In this section we outline the similarities in the underlying principles that guide both these specifications. The similarities that we have identified are along the six related dimensions of acknowledgements, ordering and duplicate eliminations, groups of messages and quality of service, timers, security and fault/diagnostic reporting.

Both the specifications use positive acknowledgements to ensure reliable delivery. This in turn implies that error detections, initiation of error corrections and subsequent retransmissions of “missed” messages can be performed at the sender side. A sender may also proactively initiate corrections based on the non-receipt of acknowledgements within a pre-defined interval.

The specifications also address the related issues of ordering and duplicate detection of messages issued by a source. A combination of these issues can also be used to facilitate exactly once delivery. Both the specifications facilitate guaranteed exactly-once delivery of messages, a very important quality of service that is highly relevant for transaction oriented applications; specifically banking, retailing and e-commerce.

Both the specifications also introduce the concept of a group (also referred to as a sequence) of messages. All messages that are part of a group of messages share a common group identifier. The specifications explicitly incorporate support for this concept by including the group identifier in protocol exchanges that take place between the two entities involved in reliable communications. Furthermore, in both the specifications the qualities of service constraints that can be specified on the delivery of messages are valid only within a group of messages, each with its own group identifier.

The specifications also introduce timer based operations for both messages (application and control) and group of messages. Individual and group of messages are considered invalid upon the expiry of timers associated with them. Finally, the delivery protocols in the specifications also incorporate the use of timers to initiate retransmissions and to time out retransmission attempts.

In terms of security both the specifications aim to leverage the WS-Security specification, which facilitates message level security. Message level security is independent of the security of the underlying transport and facilitates secure interactions over insecure communication links.

The specifications also provide for notification and exchange of errors in processing between the endpoints involved in reliable delivery. The range of errors supported in these specifications can vary from an inability to decipher a message’s content to complex errors pertaining to violations in implied agreements between the interacting entities.

 

2.         Product Description

This software provides an implementation of the implementation of the WS-ReliableMessaging (WSRM) and the WS-Reliability (WSR) specifications.  The table below provides a comparison of the WSRM and WSR specifications.

 

 

Table 1: Comparing some of the features in WS-Reliability and WS-ReliableMessaging

 

WS-Reliability

WS-ReliableMessaging

Defines

Defines elements and attributes in the header block of a SOAP envelope.

An XML based schema for elements that are needed for reliable messaging.

Related Specifications

SOAP, WS-Security

WS_addressing, WS-Policy, WS-Security

Companies Involved

Sun, Oracle, Fujitsu

IBM, Microsoft, BEA

Submission Status

Under consideration by OASIS to be a standard

Not submitted yet.

HTTP Bindings

Defines a separate HTTP binding of the protocol.

NO. Defines no such binding. However, SOAP’s HTTP binding can be leveraged.

Delivery modes supported

Unreliable, at-least-once, ordered-and-exactly-once

At most once, at least once, ordered and exactly-once.

Groups of messages

Identified by GroupId information associated with every message in sequence. Individual messages have numbering that increments sequentially.

Grouped together using Sequence element. Every Sequence element has a unique identifier, and a message number which increments sequentially.

Dedicated exchanges for creation and termination of message groups

NO

YES

Ordering/Duplication dependence

Order is always tied to Guaranteed delivery and cannot be separately specified.

Order is not necessarily tied to guaranteed delivery

Exchange/Specification of protocol constants

Through an abstract concept referred to as Agreement.

WS-Policy.

Message Numbering in a group of messages.

SequenceNumber starts at 0 for the first message in a group.

MessageNumber starts at 1 for the first message in a group.

Defines Message-Exchange patterns

Request/Response, One-way and Polling

Not defined

Negative acknowledgements

NO

YES. This enables receiver-initiated error corrections.

Acknowledging a range of messages

YES

YES

Acknowledgements for multiple Groups

YES

NO

Indication of faults in acknowledgements

YES

NO

Requesting acknowledgements

The AckRequested element is REQUIRED in every message for which reliable delivery needs to be ensured.

AckRequested is used to request the receiving entity to acknowledge the message received.

Time based expiry

Supports timer based expiry of both messages and groups.

Supports timer based expiry of both messages and groups.

Retransmissions

Triggered after receipt of a set of acknowledgements. A specified number of retry attempts are made.

Triggered by either positive or negative acknowledgments. Two other constants Retransmission Interval and exponential backoff . play a role

Security

Relies on WS-Security and assorted specifications

Relies on WS-Security and assorted specifications

Errors

Are notified through SOAP faults.

Are notified through SOAP faults. Fault processing is more sophisticated since one can leverage WS-Addressing’s message information headers.

 

The FIRMS implementation will provide Grid and Web Service applications with ability to interact reliably with each other based on the implementation of the WS-ReliableMessaging (WSRM) and the WS-Reliability (WSR) specification.

 

3.         Use Cases

 

As Web Services have matured the interactions that the services have between themselves have gotten increasingly complex and sophisticated. Web services can be composed easily from other services, and these services can be made to orchestrate with each other in dynamic fashion. Web services specifications have addressed issues such as security, trust, notifications, service descriptions, advertisements, discovery and invocations among others. These specifications can leverage, extend and interoperate with other specifications to facilitate incremental addition of features and capabilities. As web services have become dominant in the Internet and Grid systems landscape, a need to ensure guaranteed delivery of interactions (encapsulated in messages) between services has become increasingly important. This highly important and complex area was previously being addressed in the Web Services community using homegrown, proprietary, application specific solutions. It should be noted that the terms guaranteed delivery and reliable delivery tend to be used interchangeably to signify the same concept.

 

Reliable delivery of messages is now a key component of the Web Services roadmap, with two promising, and competing, specifications in this area viz. WS-Reliability and WS-ReliableMessaging. We include support for both these specifications in this release of the FIRMS software.

 

The WSRM and WSR specifications delegate security related issues to the WS-Security specification, which facilitates message-level security. Nothing in the WSRM or WSR specification or this implementation of these specifications preclude the use of WS-Security. We fully expect this implementation to work with existing WS-Security implementations. The WS-Security specification provides the ability to securely (leveraging encryption, message digest and signing) route SOAP messages between endpoints irrespective of the underlying transport mechanism.

 

This software will report faults (as outlined in the corresponding specifications) if there are malformed requests. We enumerate some of these below:

  1. An acknowledgement received at an endpoint refers to an unknown group or sequence indentifier.
  2. A retransmission request refers to an unknown message number or sequence/group identifier.
  3. If the group/sequence over which communications are being initiated have been terminated or have expired.

 

The WSRM and WSR specifications and the FIRMS software concerns itself only with the reliable delivery of messages from the source to the sink. As far as we know nothing in this software precludes its use by researchers, system administrators or project managers. What has been provided here is the underlying middleware, applications can be easily developed which hide the innards of this specification/implementation from the end-users.

 

4.         Evaluation Metrics

The results pertaining to our implementation of WSRM have appeared in the proceedings of the IEEE E-Science 2005 conference. For the purposes of the documentation of this software we have included the performance section of this paper below.

 

We now include performance measurements from our experiments. These experiments were performed on a 3.5 GHz Pentium IV machine with Sun’s 1.4.2 Java Virtual Machine. For each measurement we performed the experiment 100 times. An outlier removal program was used to remove outliers, if any, in the result set. To detect outliers we first calculate the mean and standard deviation of the entire data set. This is then used to obtain a z-score for each data point, according to following formula: where is the mean and  is the standard deviation of the original sample. If the z-value is greater than 3, the corresponding data point is deemed an outlier.

For each run we also tracked the memory utilization. This was done by simply recording the memory utilization prior to the invocation of a specific operation and after the invocation. In some cases this calculation resulted in a negative utilization because of garbage collection (via the Java garbage collector thread) in the intervening period. We have measured several relevant performance aspects of our implementation. We now proceed to discuss each of this in detail. A synopsis of our results is also available in a separate table (Table 2) for the reader’s perusal. This table lists the operation, the mean, the standard deviation, standard error, minimum and maximum values for the CPU bound latencies (in microseconds) and finally the memory utilization associated with the operation.

In our performance measurements we started off by measuring the time to create a SOAP messages within the Axis Web Services container (SOAPMessage) and using our XMLBeans representation of the SOAP schema (EnvelopeDocument). We found that the costs in terms of {latencies, memory utilization} for these operations were similar. For EnvelopeDocument the cost was {126.86 μSecs, 2192 B} while for SOAPMessage this cost was around {117.34 μSecs, 2192 B}. The standard deviation (and the corresponding standard error) was higher for SOAPMessage creation at 187.30 μSecs. Since every interaction between web service endpoints are encapsulated within SOAP messages, these costs represent the minimum costs that such interactions may incur.

To facilitate deployments within Apache’s Axis and Sun’s JWSDP container, we have developed utilities which facilitate conversions between the SOAP representations ─ SOAPMessage and EnvelopeDocument. The cost to convert an EnvelopeDocument into a SOAPMessage was around {2627.54 μSecs and 60816B} while the cost for converting a SOAPMessage into a EnvelopeDocument was around {827.58 μSecs, 34424B}. One of the reasons for this disparity is that the Axis implementation renames the schema namespace qualifiers contained within the EnvelopeDocument.

Since WSRM heavily leverages the WS-Addressing specification we benchmarked some overheads related to WS-Addressing processing. Here, we first measured the costs associated with the creation of simple EPRs based on a simple URL String and the more elaborate EPR that contains the wsa:ReferenceProperties element. As might be expected the costs for the simple EPR (150.51 μSecs, 2648B) were better than those for the more elaborate EPR (397.34 μSecs, 7184B).

Next, we measured the costs involved in the creation of a SOAP message, targeted to a specific EPR, with the most basic WSA fields ─ wsa:To and wsa:MessageID within the SOAP message. In the second case, we included additional elements such as wsa:From, wsa:RelatesTo and the wsa:Action field. In both these cases the created SOAP message conformed to the rules outlined in the WS-Addressing specification. Here we found that the cost for creating the SOAP message with basic WS-Addressing elements were (397.34, 7184B) while the cost for additional elements was (537.81 μSecs, 13880B).

Upon receipt of a SOAP message, the first task that needs to be performed is the parsing of the SOAP message for the WS-Addressing elements. This is typically the precursor to further more specific parsing later on since the WSA elements indicate not only the semantic intent (wsa:Action) but also the context (wsa:Relates, wsa:MessageID) and also where errors need to be issued to in case there are problems. For example, once we have determined the semantic intent of a message from the wsa:Action to be a Create Sequence request, we may initiate operations to parse the wsrm:CreateSequence element within the Body of the SOAP message. In our benchmarks the cost for parsing the SOAP message for WS-Addressing elements was found to be {1224.752 μSecs, 61024B}. Since this operation is performed for every SOAP message this is a cost that will be incurred during each interaction between the service endpoints.

Next, we measured the costs involved in the creation of a WSRM create sequence request (352.16 μSecs, 16392B) and the response (335.21 μSecs, 18160B) generated upon the receipt of this request.  These costs are in addition to any costs involved due to communication overheads between the service endpoints.

For every message received from the hosting service endpoint at the SourceProcessor, the appropriate wsrm:Sequence is added. This contains the identifier associated with the previously created Sequence and the Message Number assigned to this message. We measured the costs involved in the creation of this wsrm:Sequence element (44.72 μSecs, 2424B) and the costs involved in the addition (12.67 μSecs, 464B) of this element to the SOAP message received at the SourceProcessor.

A WSRM sink is expected to acknowledge messages at regular intervals (based on the acknowledgement interval). We have measured the costs involved in the creation of wsrm:SequenceAcknowledgement document based on a set of Message Numbers. We found this cost to be (516.58 μSecs, 20624B). This cost includes the costs involved in the creation of the one or more wsrm:AcknowledgementRange elements which cover acknowledgements for a group of messages. Thus if one is acknowledging Message Numbers 1,2,3,4,5,7,8,9,11,12,13 there would be 3 acknowledgement ranges corresponding to 1─5, 7─ 9 and 11─13.

We also measured the costs involved in the creation of wsrm:TerminateSequence (24.66 μSecs, 2072B) and the time to create a WSRM Fault(519 μSecs, 18096) based on the rules outlined in the WSRM and WS-Addressing specifications.

 

Figure 1: Total Processing times

Figure 1 depicts the total processing times at a WSRM source and sink. This includes the times for storage of message to stable storage at both source and sink. In our experiments the stable storage was based on MySQL. For MySQL we found the storage cost to be typically between 4-6millseconds for message sizes 100B-10KB. Only after the SOAP message with the added wsrm:Sequence element has been stored onto stable storage will the message be routed to the remote sink endpoint. The graph does not include communication overheads involved in communication between the service endpoints. So these costs are in addition to the networking costs involved. In our experience we have found this cost to vary from a few milliseconds in LAN settings to a few hundred milliseconds in WAN settings.

 

Table 2: Summary of results (All results in Microseconds)

Operation

Mean

Standard

Deviation

Standard

Error

Num of Outliers

Min

Value

Max

Value

Memory

Utilization

(Bytes)

Create an XMLBeans based Envelope Document

126.864

49.395

5.041

4

108

424

2192

Create an Axis based SOAPMessage

117.340

187.302

19.017

3

34

1183

1824

Convert an EnvelopeDocument to a SOAPMessage

2627.548

905.483

93.894

7

1722

5350

60816

Convert SOAPMessage to EnvelopeDocument

827.589

586.872

60.211

5

325

2802

34424

Create a WS-Addressing EPR

(Contains just a URL address)

87.562

58.590

5.979

4

71

465

2072

Create a WS-Addressing EPR

(Contains WSA ReferenceProperties)

150.515

96.764

9.927

5

112

705

2648

Create an Envelope targeted to a specific WSA EPR

397.340

200.396

20.669

6

267

1276

7184

Create an Envelope targeted to a specific WSA EPR with most WSA message information headers

537.814

347.497

35.283

3

344

2123

13880

Parse an EnvelopeDocument to retrieve Wsa Message Info Headers

1224.752

727.870

73.904

3

645

4573

61024

CreateWsrmSequenceRequest

352.163

260.997

26.364

2

229

1568

16392

CreateWsrmSequenceResponse

335.210

226.060

23.193

5

224

1174

18160

CreateWsrmSequenceDocument

44.724

4.733

0.478

2

42

75

2424

Add a WsrmSequenceDocument to an existing envelope. (Contains sequence identifier and message number)

12.670

0.494

0.050

3

12

14

464

Create a WSRM SequenceAcknowledgement based on a set of message numbers

516.583

248.274

25.339

4

335

1514

20624

CreateTerminateSequence

24.666

36.203

3.638

1

19

380

2072

CreateWsrmFault

519.802

294.699

30.077

4

347

1619

18096

 

 

5.         Functional Design Considerations

 

Assumptions that were made during functional design: The WSRM and WSR specifications leverage WS-Addressing and SOAP. These related technologies have a few schemas each corresponding to a different version of the aforementioned specifications. To be consistent with the javax.xml.soap.SOAPMessage format we used the SOAP schema specified at http://schemas.xmlsoap.org/soap/envelope/ . At the time the software was written (Dec  2004) we used the latest WS-Addressing schema that was available at that time -- http://schemas.xmlsoap.org/ws/2004/08/addressing. Here we note that a new version of the WS-Addressing schema released in March 2005 is now available.

 

Prerequisites for the correct working of the product: This software has been written in Java. For the correct working of this software one needs to use JDK 1.4 or higher.

 

Main decisions/reasons regarding functionality: This software is an implementation of the WSRand WSR specifications. The decisions/reasons were driven by the considerations involved in the implementation of this specification. One of the major decisions was the choice of schema – we discussed this in the assumptions section.

 

Scale of deployment: We have tested the software in various configurations on different machines. In some cases we have also tested the source and the sink within the same machine using different OMII Containers.

 

Resource requirements in terms of hardware, data volume, other software or equipment:  All you need is a machine that has a JVM for it. For the correct working of this software one needs to use JDK 1.4 or higher.

 

 

Portability: This software is written in Java. So, this will work on any machine/operating-system that has a Java Virtual Machine for it. As mentioned previously one needs to use JDK 1.4 or higher.

 

 

Reliability/Maintainability/Availability: We have implemented the two most dominant specifications in the area of reliable messaging viz. WS-Reliability and WS-ReliableMessaging.

 

Installation: We wanted the software to be easy to use and install. We have included ANT scripts which facilitate the deployment of the software in a variety of settings.

 

 

Security: As mentioned previously both WSRM and WSR delegate security issues to WS-Security. The WS-Security specification provides the ability to securely route SOAP messages between endpoints irrespective of the underlying transport mechanism. Nothing in the WSRM or WSR (or this implementation of the aforementioned specifications) precludes the use of WS-Security. 

 

 

Configuration and customization: This software is an implementation of a specification. We have provided scripts for deployment of the software in various settings.

 

 

Error handling: This software will report faults if there are problems with any of the exchanges outlined in the WSRM/WSR specifications. We enumerated some of these faults in an earlier section (section 3.0) of this document. The API for this software also facilitates the creation of appropriate requests and responses. These methods also reports if there are problems in any of the parameters involved in the method invocation.

 


 

6.         List Of Functions

 

 

package cgl.narada.wsinfra.wsrm.impl

public class WsrmAckOperationsImpl extends WsrmAckOperations

A utility class to deal with processing acknowledgements.

private void initializeWsrmElementCreation()

Description

This will initialize the WsrmElementCreation

Input arguments

-

Process

This method will initialize the Wsrm Element creation from WsrmProcessingFactory.

Output

-

Exceptions

-

Comments

-

 

public SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[]

  getAcknowledgementRanges(long[] acknowledgements)          

Description

Construct acknowledgement ranges based on the specified acknowledgements.

Input arguments

long[ ] of acknowledgements

Process

This method will create Vectors seperateAcks and AckRanges. It will process acknowledgements. It will get the size of numOfSeperateAcks and if numOfSeperateAcks is greater than zero, it will create and add AcknowledgementRange.

Output

Array of Acknowledgement Range of Sequence Acknowledgement

Exceptions

-

Comments

-

 

 

private void processAcks(long[] acks, Vector seperateAcks, Vector ackRanges)

Description

This method will process acknowledges

Input arguments

Long[] of acks, Vector of separateAcks, Vector of ackRanges

Process

This method will check the acks for null value.  It will deal with the case where there is only one message number to process.  It will first sort the acks, since the algo will work on the sorted array.  If successive elements are seperated by a value of 1 they can be part of a range.  Finally it will create and add AcknowledgementRange using upperRange, lowerRange and ackRanges.

Output

-

Exceptions

-

Comments

-

 

private void  createAndAddAcknowledgementRange(long upperRange, long lowerRange,             Vector ackRangeVector)

Description

Create and add the acknowledgement range based on the parameters and add   to the specified vector

Input arguments

long upperRange, long lowerRange, Vector ackRangeVector

Process

This method will check wsrmElementCreation for null and initializeWsrmElementCreation process.  It will create AcknowledgementRange and adds to the ackRangeVector.

Output

-

Exceptions

-

Comments

-

 

public long[] getAcknowledgements(SequenceAcknowledgementDocument seqAckDocument)

Description

Retrieve the list of positive acknowledgements from the specified      sequenceAcknowledgement document

Input arguments

SequenceAcknowledgementDocument seqAckDocument

Process

This method will get the SequenceAcknowledgement. It will creates seperateAcknowledgements vector and long[] separateAcks.  It will process Acknowledgement Range if number of ranges is more than one.  It will create the seperateAcks and sets the elements from  seperateAcknowledgements vector.

Output

-

Exceptions

-

Comments

-

 

private void processAcknowledgementRange( SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange acknowledgementRange, Vector seperateIntoVector)

Description

Process an acknowledgement range by trying to add the elements in the sepecified range into the seperateIntoVector. Also check to see if the element already exists in the vector, if so do not add

Input arguments

AcknowledgementRange, Vector seperateIntoVector

Process

This method will get the long of lower and upper values from acknowledgement ranges.  It will add it to the seperateIntoVector Vector.

Output

-

Exceptions

-

Comments

-

 

 

public long[]  getMessageNumbersToAcknowledge(String sequenceIdentifier,  boolean ackRequested, WsrmProtocolStorageOperations wsrmProtocolOps) throws WsrmStorageException

Description

Retrive the set of message numbers that need to be acknowledged for a sequence. The set of message mnumbers returned is the union of two sets

(a) The message numbers that have already been acknowledged so far.

(b)The set of unacknowledged message numbers. If the ackRequested variable is false, the message numbers included with this set are those for which the ackInterval has expired.

If the ackRequested variable if it is true, THEN the ackInterval constraint is ignored, and ALL message numbers that have not been acknowledged are included in the set.

Input arguments

String sequenceIdentifier,  Boolean ackrequested, WsrmProtocolStorageOperations wsrmProtocalOps

Process

This method will check sequenceIdentifier and wsrmProtocolOps for null value and return null if any these are null.  It will create long[] of messageNumbersToAck, ackedMessageNumbers and unackedMessageNumbers.  It will combined and return the messageNumbersToAck.

Output

Long[]

Exceptions

-

Comments

-

 

 

private long[]  getCombinedArrayOfLong(long[] first, long[] second)

Description

Combines the two arrays to create a unique array without any duplicate values in the combined array. This will also eliminate any duplicates that might exist in the original arrays

Input arguments

Long array of first, long array of second

Process

This method will check for first and second for null value and return the null value if any of those are null.  Then it will create combined Vector and merger both first and second. It will create long[] and assign elements from combined Vector and return it.

Output

Long array

Exceptions

-

Comments

-

 

private static void addToVector(Vector vector, long value)

Description

Adds a message number to the vector

Input arguments

Vector, Long

Process

This method will check the given value in the vector and adds to it if not present in the vector.

Output

-

Exceptions

-

Comments

-

 

public class WsrmElementAdditionImpl extends WsrmElementAddition

 

This is a class which facilitates the addition of WSRM elements to a SOAP enevelope. Depending on the exchange the elements are added either to the header or body of the SOAP envelope, with the Action Documents appropriately initialized.

 

public boolean addSequence(EnvelopeDocument envelopeDocument, SequenceDocument sequenceDocument)

Description

Adds a sequence document to the specified envelope. This method returns true if the operation succeed.

Input arguments

EnvelopeDocument, SequenceDocument

Process

This method checks for EnvelopeDocument and SequenceDocument for null values and it adds sequence to the envelope SoapHeader as last child element.

Output

Boolean value of true or false.

Exceptions

-

Comments

-

 

 

public boolean addAckRequested(EnvelopeDocument envelopeDocument, AckRequestedDocument ackRequestedDocument)

Description

Adds an AckRequested document to the specified envelope. This method returns true if the operation succeed.

Input arguments

EnvelopeDocument, AckRequestedDocument

Process

This method checks for Envelope document and AckRequesteddocument for null values and adds ackRequested as a last element to the soapHeader.

Output

Boolean value of true or false.

Exceptions

-

Comments

-

 

 

public boolean   addSequenceAcknowledgement(EnvelopeDocument envelopeDocument,     SequenceAcknowledgementDocument seqAckDocument)

Description

Adds a SequenceAcknowledgement element to the specified enevelope. This    method returns true if the operation succeed.

Input arguments

EnvelopeDocument

Process

This method will check for EnvelopeDocument, seqAckDocument for null value and return null if any one is null. It will add seqAckDocument as a last child to SoapHeader of the EnvelopeDocument.

 

Output

Boolean value of true or false

Exceptions

-

Comments

-

 

 

public boolean  addTerminateSequence(EnvelopeDocument envelopeDocument,                                    TerminateSequenceDocument terminateSequenceDocument)

Description

Adds a terminate sequence to the specified envelope. This method returns true if the operation succeed.

Input arguments

EnvelopeDocument, TerminateSequenceDocument

Process

This method checks for envelopeDocument, TerminateSequenceDocument for null values and add terminate sequence to the soapBody of envelopeDocument.

Output

Boolean value of true or false

Exceptions

-

Comments

-

 

public class WsrmElementCreationImpl extends WsrmElementCreation

 

This is a class which facilitates the creation of WSRM elements that are added to exchanges.

 

public static WsrmElementCreation getInstance()

Description

This will returns the WsrmElementCreation class instance.

Input arguments

-

Process

This method will return the instance of this class.

Output

Instance of WsrmElementCreation

Exceptions

-

Comments

-

 

public SequenceDocument newSequence(String identifier, long messageNumber)

Description

Creates a sequence document based on the specified parameter

Input arguments

String identifier, long messageNumber

Process

This method will create sequenceDocument, adds new sequence to it.  It adds new identifier and messageNumber.

Output

SequenceDocument

Exceptions

-

Comments

-

 

 

public SequenceDocument   newSequence(String identifier, long messageNumber,  boolean  lastMessage, Calendar expiresAt)

Description

Creates a sequence document based on the specified parameters

Input arguments

String identifier, long messageNumber, Boolean lastNumber, Calender expiresAt

Process

This method will create the sequenceDocument and sequenceType.  If the last message is true, it will new last message to sequence type.  If expireAt is not null,  it will create ExpiresDocument and copy from source to destination.

Output

SequenceDocument

Exceptions

-

Comments

-

 

public AckRequestedDocument newAckRequested(String identifier)

Description

Creates an AckRequested document based on the specified parameters

Input arguments

String of Identifier

Process

This method will get the AckRequestedDocument instance and adds the given identifier to it.

Output

AckRequestedDocument

Exceptions

 

Comments

-

 

public AckRequestedDocument newAckRequested(String identifier,  long maxMessageNumberUsed)

Description

Creates an AckRequested document based on the specified parameters

Input arguments

String identifier, long maxMessageNumberUser

Process

This method gets the AckRequestedDocument based on given Identifier and sets the maximum message number used by setting input parameter.

Output

AckRequestedDocument

Exceptions

-

Comments

-

 

public SequenceAcknowledgementDocument  newSequenceAcknowledgement(String identifier, long[] acknowledgementsArray, boolean positiveAcks)

Description

Creates a SequenceAcknowledgement element based on the specified parameters. If postiveAcks is true, then the SequenceACK contains positive acknowledgements otherwise it contains negative acknowledgements. The specification forbids inclusion of both positive and negative acknowledgements.

Input arguments

String of Identifier, long array of acknowledgements, Boolean of positive acks.

Process

This method gets the SequenceAcknowledgementDocument instance, adds sequenceAck and sets the Identifier. If postiveAcks exists, it will add to it.

Output

SequenceAcknowledgementDocument

Exceptions

-

Comments

-

 

public TerminateSequenceDocument newTerminateSequence(String identifier)

Description

Terminates a sequence identified the specified identifier

Input arguments

String of Identifier.

Process

This method will get the TerminateSequenceDocument instance and add terminateSequence to it. It will set the new Identifier to it.

Output

TerminateSequenceDocument.

Exceptions

-

Comments

-

 

public SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange

  newAcknowledgementRange(long upperMessageNumber, long lowerMessageNumber)

Description

Create a new acknowledgement range based on the specified parameters

Input arguments

Long of upperMessageNumber, long of lowerMessageNumber

Process

This method gets the SequenceAcknowledgementDocument instance and sets the lower and upper message numbers to it.

Output

SequenceAcknowledgementDocument.

Exceptions

-

Comments

-

 

private BigInteger convertLongToBigInteger(long longValue)

Description

Converts a long into a BigInteger. This is the method which all such conversions should call. This way, if there is a more optimized way to do our conversions we just need to change it here and it impact every place. I am not very happy with this conversion, it is perhaps a little inelegant

Input arguments

Long of longValue

Process

This method will convert longValue into String and creates BigInteger object based on it.

Output

BigInteger

Exceptions

-

Comments

-

 

private BigInteger[] convertLongtoBigIntegerArray(long[] longValues)

Description

Converts an array of long into a Big Integer array

Input arguments

Long array of longValues

Process

This will converts long array into BigInteger array.

Output

BigInteger array

Exceptions

-

Comments

-

 

public class WsrmElementCreationImpl extends WsrmElementCreation

 

This is a utility class which constructs a WsrmExchangeInfo based on    the supplied Envelope Document.

 

public static WsrmExchangeInfoCreator getInstance()

Description

This class will returns the instance of the WsrmExchangeInfoCreator class

Input arguments

-

Process

-

Output

WsrmExchangeInfoCreator

Exceptions

-

Comments

-

 

public WsrmExchangeInfo createWsrmExchangeInfo(EnvelopeDocument envelopeDocument)

    throws ProcessingException

Description

Creates a WsrmExchangeInfo based on the supplied envelope

Input arguments

EnvelopeDocument

Process

This method will get the addressing headers from envelopeDocument and creates WsrmExchangeInfoImpl from it. It also checks for wsrmActionElements and wsrmElements in it.

Output

WsrmExchangeInfo

Exceptions

ProcessingException

Comments

-

 

private void checkWsrmActionElements(WsrmExchangeInfoImpl wsrmExchangeInfo,   AddressingHeaders addressingHeaders)

Description

Inspects the Action element contained within the Envelope to determine if it contains any of Wsrm action headers

Input arguments

WsrmExchangeInfoImpl, addressingHeaders

Process

-

Output

This method checks actionDocument and actions for null values. This also checks for createSequence, createSequenceResponse and termonateSequence.

Exceptions

-

Comments

-

 

private void checkForWsrmElements(WsrmExchangeInfoImpl wsrmExchangeInfo,        EnvelopeDocument envelopeDocument)

Description

Inspects the WsrmElements contained with in the Envelope.

Input arguments

WsrmExchangeInfoImpl, Envelopedocument

Process

This method checks for WsrmElements in the Envelope.

Output

-

Exceptions

-

Comments

-

 

public class WsrmExchangeInfoImpl implements WsrmExchangeInfo

 

This is a utility class which constructs a WsrmExchangeInfo based on    the supplied Envelope Document.

 

public boolean isValidExchange()

Description

Checks to see if this is a valid exchange

Input arguments

-

Process

This method will check for hasSequence, has AckRequired, hasSeqAcknowledgement

Output

Boolean value of true or false

Exceptions

-

Comments

-

 

 

public class WsrmFaultsImpl implements WsrmFaults

 

This class provides a one-stop for creating all the faults that occur during WSRM processing. This eliminates the need to hard-code this in several places. Furthermore, if the spec changes the impact of this  change will be felt at far fewer places.

 

public SequenceFaultDocument getSequenceTerminated(String identifier)

Description

This fault is sent by either the RM Source or the RM Destination to indicate that the endpoint that generates the fault has either encountered an unrecoverable condition, or has detected a violation of the protocol and as a consequence, has chosen to terminate the sequence.

Input arguments

String of Identifier

Process

This will get the SequenceFaultDocument instance, it adds new sequence fault and Identifier to sequence fault.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public String getSequenceTerminatedReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

It will return reason for the sequence termination

Output

String value of fault

Exceptions

-

Comments

-

 

public SequenceFaultDocument getUnknownSequence(String identifier)

Description

This fault is sent by either the RM Source or the RM Destination in response to a message containing an unknown sequence identifier.

Input arguments

String value of Identifier

Process

This will creates new instance of SequenceFaultDocument and add Identifer to SequenceFault  

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public SequenceFaultDocument getInvalidAcknowledgement(SequenceAcknowledgementDocument seqAckDocument)

Description

This fault is sent by the RM Source in response to a <SequenceAcknowledgement> that violates the cumulative acknowledgement invariant. An example of such a violation would be a SequenceAcknowledgement covering messages that have not been sent.

Input arguments

SequenceAcknowledgementDocument

Process

It will create SequenceFaultDocument instance and set fault code as invalidacknowledgement.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public String getInvalidAcknowledgementReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

It will return the String of Acknowledgement.

Output

String of fault

Exceptions

-

Comments

-

 

public SequenceFaultDocument getMessageNumberRollover(String identifier)

Description

This fault is sent by the RM Source to indicate that it has run out of message numbers for a sequence. It is an unrecoverable error and terminates the Sequence.

Input arguments

String of Identifier

Process

It will create SequenceFaultDocument instance, sets Fault code and add Identifier to sequence fault.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public String getMessageNumberRolloverReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

It will return message number rollover reason.

Output

String of fault

Exceptions

-

Comments

-

 

public SequenceFaultDocument getLastMessageNumberExceeded(String identifier)

Description

This fault is sent by the RM Source to indicate that it has run out of message numbers for a sequence. It is an unrecoverable error and terminates the Sequence.

Input arguments

String of Identifier

Process

This gets the SequenceFaultDocument instance,  adds new sequence fault and adds Identifer to the sequence fault.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public String getLastMessageNumberExceededReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

This will return the fault message associated with last message number exceed reason.

Output

String of fault

Exceptions

-

Comments

-

 

public SequenceFaultDocument getSequenceRefused(String identifier)

Description

This fault is sent by an RM Destination to indicate that it cannot begin a requested Sequence.

Input arguments

String of Identifier

Process

This will create SequenceFaultDocument,  add new sequence fault to it and adds Identifier to it.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

 

public String getSequenceRefusedReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

This will return fault associated with sequence refused reason.

Output

String of fault

Exceptions

-

Comments

-

 

public SequenceFaultDocument getCreateSequenceRefused()

Description

This fault is sent by an RM Destination to indicate that it cannot begin a requested Sequence.

Input arguments

-

Process

This will create new instance of SequenceFaultDocument, adds new sequence fault to it and sets fault code.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public SequenceFaultDocument getInvalidMessage()

Description

This is a fault send by an RM node when it encounters an invalid message.

Input arguments

-

Process

This will create SequenceFaultDocument instance, add new sequence fault and sets fault code to it.

Output

SequenceFaultDocument

Exceptions

-

Comments

-

 

public String  getCreateSequenceRefusedReason()

Description

Retrieve the reason associated with the fault

Input arguments

-

Process

This will return the reason for create sequence refused.

Output

String of Fault

Exceptions

-

Comments

-

 

public QName getSoapSenderQName()

Description

Retrieves the Fault:Code for the sender

Input arguments

-

Process

This will return getSoapSender Qname

Output

QName

Exceptions

-

Comments

-

 

public QName getSoapReceiverQName()

Description

Retrieves the Fault:Code for the receiver

Input arguments

-

Process

This will return getSoapReceiver QName.

Output

QName

Exceptions

-

Comments

-

 

private void addIdentifierToSequenceFault(String identifier,                                  SequenceFaultDocument sequenceFaultDocument)

Description

This will add Identifier to Sequence Fault.   

Input arguments

String of Identifier, SequenceFaultDocument.

Process

This will IdentifierDocument instance, add s new Identifier to it and set sequenceFault.

Output

-

Exceptions

-

Comments

-

 

 

public class WsrmNodeFactoryImpl

 

This is a factory class which ensures that there is only instance of the WsrmSourceNode for a given configuration file. This class is primarily useful for deployment purposes.

 

public static WsrmNodeFactoryImpl getInstance()

Description

This will return the instance of the WsrmNodeFactoryImpl

Input arguments

-

Process

This method will return the instance of this class.

Output

WsrmNodeFactoryImpl

Exceptions

-

Comments

-

 

public WsrmSourceNode getWsrmSourceNode(String configInfo) throws WsrmStorageException, DeploymentException

Description

Gets a sequence monitor for the specified configuration file. For a given configuration file (based on the absolute path name) only one instance of the WsrmNode will be running within a given JVM instance.

Input arguments

String of config file information.

Process

This method will check for the configInfo for possible null values,  existence and for absolute path.  If a monitor does not exist, proceed to create one and add it to the monitors list.

Output

-

Exceptions

WsrmStorageException, DeploymentException

Comments

-

 

public class WsrmNodeUtilImpl extends WsrmNodeUtils

This is a utility class which faciliates the retrieval of elements pertaining to WSRM that reside in the SOAP enevelope.

public static WsrmNodeUtils getInstance()

Description

This class will returns the instance

Input arguments

-

Process

This will return the instance of the class

Output

WsrmNodeUtils

Exceptions

-

Comments

-

 

public CreateSequenceDocument getCreateSequenceDocument(EnvelopeDocument envelopeDocument)

    throws WsFaultException

Description

Retrieves element from the body of the SOAP message

Input arguments

EnvelopeDocument

Process

This method gets the bodyType from the EnvelopeDocument, it creates Sequence Document and returns it.

Output

CreateSequencDocument

Exceptions

WsFaultException

Comments

-

 

public CreateSequenceResponseDocument getCreateSequenceResponseDocument(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Retrieves element from the body of the SOAP message.

Input arguments

EnvelopeDocument

Process

This method gets the curser from BodyType, creates sequence response document based on curser text. It checks for null values and creates HandShake from it. It checks HandShake for null values and faults.

Output

CreateSequenceResponseDocument

Exceptions

WsFaultException

Comments

-

 

public TerminateSequenceDocument  getTerminateSequenceDocument(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Retrieves element from the body of the SOAP message.

Input arguments

EnvelopeDocument

Process

This method gets the Curser from Body type, from EnvelopeDocument.  It creates TerminateSequenceDocument from body curser and checks for null values.

Output

TerminateSequencDocument

Exceptions

WsFaultException

Comments

-

 

public IdentifierDocument getIdentifierDocument(XmlCursor xmlCursor) throws WsFaultException

Description

Retrieves the IdentifierDocument from within the speicified XmlCursor

Input arguments

XmlCursor

Process

This method gets the Identifier from WsrmQNames,  creates IdentifierDocument from the xmlcursur text and returns the Identifier Document

Output

IdentifierDocument

Exceptions

WsFaultException

Comments

-

 

public SequenceAcknowledgementDocument getSequenceAcknowledgement(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Retrieves the Sequence Acknowledgement document from within the specified XmlCursor

Input arguments

EnvelopeDocument

Process

This method gets the headerType from EnvelopeDocument. It will retrieve XmlCursor from HeaderType.  It will create SequenceAcknowledgementDocument from XmlCursor text.

Output

SequenceAcknowledgeMentDocument

Exceptions

WsFaultException

Comments

-

 

public AckRequestedDocument getAckRequested(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Retrieves the AckRequested document from within the specified XmlCursor

Input arguments

EnvelopeDocument

Process

This method gets the headerType from EnvelopeDocument. It will retrieve XmlCursor from HeaderType.  It will then create AckRequestedDocument from XmlCursor text.

Output

AckRequestedDocument

Exceptions

WsFaultException

Comments

-

 

public SequenceDocument getSequenceDocument(EnvelopeDocument envelopeDocument)

    throws WsFaultException

Description

Retrieves the SequenceDocument from within the specified XmlCursor

Input arguments

EnvelopeDocument

Process

This method gets the headerType from EnvelopeDocument. It will retrieve XmlCursor from HeaderType.  It will then create SequenceDocument from XmlCursor text.

Output

SequenceDocument

Exceptions

WsFaultException

Comments

-

 

private void checkForElement(XmlCursor xmlCursor, QName qName) throws WsFaultException

Description

Check to see if the element exists and position the cursor at the right location if it does

Input arguments

XmlCursor, QName

Process

This will try to locate the QName given xmlCursor and qName.  If it didn’t find the qName, it will through the exception.

Output

-

Exceptions

WsFaultException

Comments

-

 

private BodyType getEnvelopeBody(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Checks for problems with the envelope and returns the envelope body

Input arguments

EnvelopeDocument

Process

This method will check the EnvelopeDocument for null values. It will get the BodyType from given EnvelopeDocument. It will chack BodyType for null values and returns the BodyType.

Output

BodyType

Exceptions

WsFaultException

Comments

-

 

private HeaderType getEnvelopeHeader(EnvelopeDocument envelopeDocument) throws WsFaultException

Description

Checks for problems with the envelope and returns the envelope body

Input arguments

EnvelopeDocument

Process

This method will check the EnvelopeDocument for null values. It will get the HeaderType from given EnvelopeDocument. It will also check the HeaderType for null values and returns HeaderType.

Output

HeaderType

Exceptions

WsFaultException

Comments

-

 

private void throwInvalidMessageFault(String reason) throws WsFaultException

Description

Throw a WsFaultException, initialized with the invalid message QName and the specified reason

Input arguments

String of reason

Process

This method will create WsFaultException from given reason and QName from wsrmFaults. It will add this fault to SoapHeader.

Output

-

Exceptions

WsFaultException

Comments

-

 

 

public class WsrmRequestCreatorImpl implements WsrmRequestCreator

 

A class which is responsible for creating WSRM requests

 

public static WsrmRequestCreator getInstance()

Description

This will return the instance of this class

Input arguments

-

Process

This method will return the instance of this class

Output

-

Exceptions

-

Comments

-

 

public EnvelopeDocument getCreateSequenceRequest(ToDocument to,                                                   EndpointReferenceType wsrmSourceEpr)

Description

Create a CreateSequenceRequest based on the specified headers. The To, From and ReplyTo, FaultTo are appropriately constructed.

Input arguments

ToDocument to, EndpointReferenceType wsrmSourceEpr

Process

This method will check the to and wsrmSourceEpr for null values.  It will create FromDocument, ActionDocument,  ReplyToDocument, ReplyAfterDocument and FaultToDocument. Then It will create EnvelopeDocument from above documents. 

 

Then it will create SequenceDocument and adds to the body of the EnvelopeDocument  

Output

EnvelopeDocument

Exceptions

-

Comments

-

 

public class WsrmResponseCreatorImpl implements WsrmResponseCreator

 

A class which is responsible for creating WSRM requests

 

public static WsrmResponseCreator getInstance()

Description

This will return the instance of this class

Input arguments

-

Process

This method will return the instance of this class

Output

-

Exceptions

-

Comments

-

 

 

public EnvelopeDocument getCreateSequenceResponse(AddressingHeaders createSequenceRequestHeaders, EndpointReferenceType wsrmSinkEpr, String sequenceIdentifier)

Description

This will create sequence response envelope Document

Input arguments

AddressingHeaders createSequenceRequestHeaders, EndpointReferenceType wsrmSinkEpr, String sequenceIdentifier

Process

This method will creates EndpointReferenceType,  FromDocument, ActionDocument, FaultToDocument and RelatesToDocument from the given parameters.  Then It will create EnvelopeDocument from those documents. It will create SequenceResponseDocument and it creates HandShakeType and adds sequenceIdentifier to it.  Finally it will add SequenceResponseDocument to SoapBody of EnvelopeDocument.

Output

EnvelopeDocument

Exceptions

-

Comments

-

 

public void addCreateSequenceResponse(EnvelopeDocument envelopeDocument, String sequenceIdentifier)

Description

Create a CreateSequenceResponse element and add to a previously created envelope document.

Input arguments

EnvelopeDocument, String sequenceIdentifier

Process

This method will create CreateSequenceResponseDocument, it will get the HandshakeType from it. It will set the sequenceIdentifier to the handshaketype to it.  Then it adds to soapbody of EnvelopeDocument.

Output

-

Exceptions

-

Comments

-

 

public class WsrmSequenceMonitorFactoryImpl implements WsrmSequenceMonitorFactory

 

This is a factory class which ensures that there is only instance of the SequenceMonitorThread running for a given database. If there are multiple databases with multiple sources/sinks this factory class will still work    fine.

 

public static WsrmSequencMonitorFactory getInstance()

Description

This will return the instance of this class

Input arguments

-

Process

This method will return the instance of this class

Output

-

Exceptions

-

Comments

-

 

public WsrmSequenceMonitor getWsrmSequenceMonitor(String configInfo, WsMessageFlow wsMessageFlow)  throws WsrmStorageException, DeploymentException

Description

Gets a sequence monitor for the specified configuration file. For a given configuration file (based on the absolute path name) only one instance of the wsrmSequenceMonitor will be running within a given JVM instance.

Input arguments

String configInfo, WsMessageFlow

Process

This method will check configInfo and wsMessageFlow for null values and throws exception if they are null.  It checks for configFile location and throws exception if the location doesn’t exists.  It gets the absolute path of configFile.  Then It creates WsrmSoapMonitor. If a monitor does not exist, proceed to create one and add it to the monitors list.

Output

WsrmSequenceMonotor

Exceptions

WsrmStorageException, DeploymentException

Comments

-

 

public class WsrmSequenceMonitorImpl extends Thread implements WsrmSequenceMonitor

 

This processor processes Sequences and determines if (a) Acknowledgements/Retransmissions need to be issued.  (b) See if the Inactivity timeout on a sequence has expired, if so proceed to terminate the sequence

 

public void startServices()

Description

Begin services related to sequence monitoring viz. issue acknowledgements and initiate retransmissions for sequences.

Input arguments

-

Process

This will start the services.

Output

-

Exceptions

-

Comments

-

 

public void stopServices()

Description

Stop services related to sequence monitoring.

Input arguments

-

Process

This will stop the services.

Output

-

Exceptions

-

Comments

-

 

public void run()

Description

This will run the services.

Input arguments

-

Process

This will set the Sleep Interval, cycle through the sequences. It will print the termination Information.

Output

-

Exceptions

-

Comments

-

 

private void cycleThroughSequences() throws MessageFlowException, WsrmStorageException

Description

This will cycle through the sequences.

Input arguments

-

Process

This method will get the list of Sequences from WsrmSequenceInfoOps and checks for sentSequences for null values.  If sentSequences not null, it will create SequenceInfo from sequenceIdentifier.  It will check for inactive timeout and issue retransmission.

 

It will get the received Sequencesfrom list activeSequences and check for null values.  If received sequence is not null, it will create WsrmSequenceInfo from sequenceId. It will issue acknowledgements.

Output

-

Exceptions

MessageFlowException, WsrmStorageException

Comments

-

 

public boolean checkInactivityTimeout(WsrmSequenceInfo wsrmSequenceInfo) throws WsrmStorageException

Description

Checks to see if the inactivity interval has expired on the sequence in question.

Input arguments

WsrmSequenceInfo

Process

This method will get the sequenceId, WsrmSequneceInfoPolicies from wsrmSequenceInfo. It will get the inactivity timeout from wsrmSequencePolicies and timeOfLastActivity from WsrmSequenceInfo.  If the inactive time is greater than current time minus timeOfLastActivity,  it will terminate and timout is TRUE else FALSE.

Output

Boolean true or false

Exceptions

WsrmStorageException

Comments

-

 

public boolean checkIfMessagesAvailable(WsrmSequenceInfo wsrmSequenceInfo) throws WsrmStorageException

Description

Checks to see if any messages have been stored for this sequence in question.

Input arguments

WsrmSequenceInfo

Process

This method will get the Identifier from WsrmSequenceInfo,  checkes for availability in stored elements of WsrmProtocolOps.

Output

Boolean true or false

Exceptions

WsrmStorageException

Comments

-

 

public void checkToIssueAcknowledgements(WsrmSequenceInfo wsrmSequenceInfo) throws MessageFlowException, WsrmStorageException

Description

This method checks to see if acknowledgements should be issued on a specific sequence. If there is a need to do so, it proceeds to issue acknowledgements on the sequence.

Input arguments

WsrmSequenceInfo

Process

This method gets the Sequence Identifier from the WsrmSequenceInfo. It will get the acknowledged message numbers, unacknowledged message numbers from wsrmProtocolOps by passing identifier. It combines both message numbers.  It prints the acknowledgements info. It will create SequenceAcknowledgementDocument.  It will process the acknowledgements.

Output

-

Exceptions

MessageFlowException, WsrmStorageException

Comments

-

 

private void printAcknowledgementsInfo(String sequenceId, long[] unackedMessageNumbers,                         long[] acknowledgements)

Description

Print diagnostic information regarding the unackedMessagedNumbers and the set of messages that will be acknowledged

Input arguments

String of sequenceId, long [] of unackedMessageNumbers, long [] of acknowledgements.

Process

This method will print unacknowledged Message Numbers if they are not null.

Output

-

Exceptions

-

Comments

-

 

private void issueAcknowledgement(WsrmSequenceInfo wsrmSequenceInfo,                                          SequenceAcknowledgementDocument sequenceAckDocument) throws MessageFlowException

Description

This method creates an envelope based on the specified wsrmSequenceInfo and the SequenceAcknowledgement Document.

Input arguments

WsrmSequenceInfo, SequenceAcknowledgementDocument

Process

This method will get the Source, Sink endpoint references from WsrmSequenceInfo and it will create FromDocument and RelatesToDocument. It will create EnvelopeDocument based on those parameters. It will add sequenceAcknowledgements to it. It will enroute to network above EnvelopeDocument.

Output

-

Exceptions

MessageFlowException

Comments

-

 

public void checkToIssueRetransmissions(WsrmSequenceInfo wsrmSequenceInfo) throws WsrmStorageException, MessageFlowException

Description

This method checks to see if retransmissions need to be issued on the specified sequence. If a need arises retransmissions are issued and the retransmission interval is reset. There should also be a way to ensure exponential backoff.

Input arguments

WsrmSequenceInfo

Process

This method will get the SequenceId from the WsrmSequenceInfo, messagenumbers not Acknowledgements from WsrmProtocolOps. It will get WsrmStorageWidgets from WsrmProtocolOps and noOfWidgets To Retransmit.  It will add AckRequested element to the envelope document and it will start retransmission.

Output

-

Exceptions

WsrmStorageException, MessageFlowException

Comments

-

 

private void retransmitMessage(WsrmStorageWidget wsrmStorageWidget,                                        AckRequestedDocument ackRequestedDocument) throws MessageFlowException

Description

This will retransmit the message.

Input arguments

WsrmStorageWidget wsrmStorageWidget, AckRequestedDocument ackRequestedDocument

Process

This will get the EnvelopeDocument from the storagewidget. It will check for acknowledge Requested option, and then it will retransmit using EnrouteToNetwork method.

Output

-

Exceptions

MessageFlowException

Comments

-

 

private void enrouteToNetwork(EnvelopeDocument envelopeDocument) throws MessageFlowException

Description

This will send EnvelopeDocument over the network.

Input arguments

EnvelopeDocument

Process

This will get the SoapEnvelopeConversion instance and creates SoapMessage using it. It will send the SoapMessage using WsMessageFlow enrouteNetwork method.

Output

-

Exceptions

MessageFlowException

Comments

-

 

private long computeNewRetransmissionInterval(WsrmSequenceInfo wsrmSequenceInfo)

Description

Computes a new retransmission interval based on a sequence's policies.

Input arguments

WsrmSequenceInfo

Process

This method will create retransmission interval based wsrmsequencePolices and returns it.

Output

Long

Exceptions

-

Comments

-

 

 

private long[] getCombinedArrayOfLong(long[] first, long[] second)

Description

Combines the two arrays to create a unique array without any duplicate values in the combined array. This will also eliminate any duplicates that might exist in the original arrays

Input arguments

Long[] First, Long[] second

Process

This method will check for first and second long [] for null values and adds to Vector.  It will convert again into long[] and returns it

Output

Long[]

Exceptions

-

Comments

-

 

private boolean hasAckRequestedElement(EnvelopeDocument envelopeDocument)

Description

Checks to see if the AckRequested element is present in the envelope.

Input arguments

EnvelopeDocument

Process

This method will get the HeaderType, XmlCursor from EnvelopeDocument.  It will local the Qname using WsrmQnames and return true if exists else false.

Output

Boolean true or false

Exceptions

-

Comments

-

 

public class WsrmSequencePoliciesImpl implements WsrmSequencePolicies

 

This interface encapsulates the WsrmPolicies associated with a sequence. Among the elements that can be set in the Policy associated with a Sequence are

    (a) Sequence creation, expiration and Termination

    (b) This also provides information on the retransmission interval and the inactivity timeout.

 

public boolean hasSequenceExpiration()

Description

Check to see if sequence expiration has been specified

Input arguments

-

Process

It will check for null values.

Output

Boolean true or false.

Exceptions

-

Comments

-

 

public Calendar getSequenceExpiration()

Description

Retrieve the specified sequence expiration

Input arguments

-

Process

It will return sequenceExpiration Calender

Output

Calender

Exceptions

-

Comments

-

 

protected void resetSequenceExpiration(Calendar sequenceExpiration)

Description

It will reset the SequenceExpiration.

Input arguments

Calender sequenceExpiration

Process

This method will reset the SequenceExpiration with input argument.

Output

-

Exceptions

-

Comments

-

 

public boolean hasInactivityTimeout()

Description

Check to see if an inactivity timeout has been specified

Input arguments

-

Process

This method will check inactiveTimeout for null values.

Output

Boolean true or false.

Exceptions

-

Comments

-

 

public InactivityTimeoutDocument getInactivityTimeout()

Description

Retrieve specified inactivity timeout info

Input arguments

-

Process

This will return the inactive timeout

Output

InactivityTimeoutDocument

Exceptions

-

Comments

-

 

protected void setInactivityTimeout(InactivityTimeoutDocument inactivityTimeout)

Description

This will set the inactive Timeout

Input arguments

InactiveTimeOutDocument

Process

This method will set the inactive timeout with given input parameter.

Output

-

Exceptions

-

Comments

-

 

public boolean hasRetransmissionInterval()

Description

Check if retransmission related policies have been specified

Input arguments

-

Process

This method will checks retransmission interval for null values.

Output

Boolean true or false.

Exceptions

-

Comments

-

 

public BaseRetransmissionIntervalDocument getRetransmissionInterval()

Description

Retrieve the retransmission interval related policies

Input arguments

-

Process

This will return the BAseReTransmissonInterval Document.

Output

BaseRetrnasmissonIntervalDocument

Exceptions

-

Comments

-

 

protected void setRetransmissionInterval(BaseRetransmissionIntervalDocument            retransmissionInterval)

Description

This will set the retransmission interval Document

Input arguments

BaseRetrnasmissonIntervalDocument

Process

This method will set the BaseRetrnasmissonIntervalDocument with given parameter.

Output

-

Exceptions

-

Comments

-

 

public boolean hasExponentialBackoff()

Description

Check if the exponential back off has been specified

Input arguments

-

Process

This method will check for Exponential BackOff for null values

Output

Boolean true or false.

Exceptions

-

Comments

-

 

public ExponentialBackoffDocument getExponentialBackoff()

Description

Retrieve the specified exponential back off

Input arguments

-

Process

This method will return the ExponentialBackOffDocument.

Output

ExponentialBackOffDocument

Exceptions

-

Comments

-

 

protected void setExponentialBackoff(ExponentialBackoffDocument exponentialBackoff)

Description

This will set the ExponentialBackoffDocument

Input arguments

ExponentialBackoffDocument

Process

This method will set the ExponentialBackOffDocument.

Output

-

Exceptions

-

Comments

-

 

public boolean hasAcknowledgementInterval()

Description

Check if an acknowledgement interval has been specified

Input arguments

-

Process

This method will check for Acknowledgement Interval for null values.

Output

Boolean true or false

Exceptions

-

Comments

-

 

public AcknowledgementIntervalDocument getAcknowledgementInterval()

Description

Retrieve the specified acknowldgement interval

Input arguments

-

Process

This method will return the AcknowledgementIntervalDocument.

Output

AcknowledgementIntervalDocument

Exceptions

-

Comments

-

 

protected void setAcknowledgementInterval(AcknowledgementIntervalDocument acknowledgementInterval)

Description

This will set the Acknowledgement Interval Document

Input arguments

AcknowledgementIntervalDocument

Process

This method will return the AcknowledgementIntervalDocument.

Output

-

Exceptions

-

Comments

-

 

public byte[] getBytes()

Description

Get the byte stream representation

Input arguments

-

Process

This method will create ByteArrayOutputStream, DataOutputStream instances. It will marshal into bytes stream and return it back.

Output

Byte[]

Exceptions

-

Comments

-

 

 

 

public class WsrmSequencePoliciesImpl implements WsrmSequencePolicies

 

This is a utility class which facilitates the creation of WsrmSequence Policies, and also the addition of policy elements besides the serialization/de-serialization of the policies.

 

public static WsrmSequencePolicyFactory getInstance()

Description

This will return the instance

Input arguments

-

Process

This method will return the instance of this class

Output

WsrmSequencePolicyImpl

Exceptions

-

Comments

-

 

public WsrmSequencePolicies createWsrmSequencePolicies(XmlObject xmlObject)

Description

Construct a sequence policies instance using the XmlCursor instance that has been provided.

Input arguments

XmlObject

Process

This method will create XmlCursor, WsrmSequencePoliciesImpl, AcknowledgementIntervalDocument, BaseRetransmissionIntervalDocument, InactivityTimeoutDocument, ExponentialBackoffDocument and Calendar of sequence expiration.  Then it creates WsrmSequencePolicies using above one.

Output

WsrmSequencePolicies

Exceptions

-

Comments

-

 

public WsrmSequencePolicies getDefaultWsrmSequencePolicies()

Description

Get a default wsrm sequence policies element

Input arguments

-

Process

This method will create String of defaultTimingProfile using getDefaultTimingProfile() and creates  PolicyDocument using defaultTimingProfile.  It will create WsrmSequencePolicies using PolicyDocument.

Output

WsrmSequencePolicies

Exceptions

-

Comments

-

 

public void updateExpiry(WsrmSequencePolicies wsrmSequencePolicies, Calendar expiresAt)

Description

Update the expiry associated with a sequence. This can happen due to a new expiry value being specified within a Sequence element.

Input arguments

WsrmSequencePolicies, Calendar of expiresAt

Process

This method will check WsrmSequencePolicies and expiresAt for null values.  It will create WsrmSequencePoliciesImpl using policies and update with Calendar for expire time

Output

-

Exceptions

-

Comments

-

 

public AcknowledgementIntervalDocument getAcknowledgementInterval(XmlCursor xmlCursor) throws ParsingException

Description

 Retrieves the acknowledgement interval from within the specified XmlCursor

Input arguments

XmlCursor

Process

This method will create String element “[AcknowledgementInterval] element” and QName from it. It will check for this QName.  It will create AcknowledgementIntervalDocument using XmlCursor text and send it back.

Output

AcknowledgementIntervalDocument

Exceptions

ParsingException

Comments

-

 

public BaseRetransmissionIntervalDocument getRetransmissionInterval(XmlCursor xmlCursor) throws ParsingException

Description

Retrieves the retransmission interval from within the specified XmlCursor

Input arguments

XmlCursor

Process

This method creates String of Element "[BaseRetransmissionInterval] element." And QName. It will check QName and throws Exception if not present. It will create BaseRetransmissionIntervalDocument based on XmlCursor.

Output

BaseRetransmissionIntervalDocument

Exceptions

ParsingException

Comments

-

 

public InactivityTimeoutDocument getInactivityTimeout(XmlCursor xmlCursor) throws ParsingException

Description

Retrieves the Inactivity timeout from within the specified XmlCursor

Input arguments

XmlCursor

Process

This method will create String element "[InactivityTimeout] element." and QName. It will check QName and throws Exception if not present.  It will create InactivityTimeoutDocument from XmlCursor. 

Output

InactivityTimeoutDocument

Exceptions

ParsingException