cgl.narada.wsinfra.wse.impl
Class WseResponseCreatorImpl

java.lang.Object
  extended by cgl.narada.wsinfra.wse.impl.WseResponseCreatorImpl
All Implemented Interfaces:
WseResponseCreator

public class WseResponseCreatorImpl
extends Object
implements WseResponseCreator

This is a utility class which create various responses based on the specified parameters. This is typically used by the source and the subscriptionManager.


Method Summary
 EnvelopeDocument createGetStatusResponse(EndpointReferenceType sinkEpr, EndpointReferenceType subscriptionManagerEpr, RelatesToDocument relatesTo, GetStatusResponseDocument getStatusResponseDocument)
          Create the SOAP envelope with the specified getStatus response.
 EnvelopeDocument createRenewResponse(EndpointReferenceType sinkEpr, EndpointReferenceType subscriptionManagerEpr, RelatesToDocument relatesTo, RenewResponseDocument renewResponseDocument)
          Create the SOAP envelope with the specified renew response.
 EnvelopeDocument createRenewResponseToSource(EndpointReferenceType sourceEpr, EndpointReferenceType subscriptionManagerEpr, String subscriptionIdentifier, RenewResponseDocument renewResponseDocument)
          Create the SOAP envelope with the specified renew response.
 EnvelopeDocument createSubscribeResponse(EndpointReferenceType sinkEpr, EndpointReferenceType sourceEpr, RelatesToDocument relatesTo, SubscribeResponseDocument subscribeResponseDocument)
          Create the SOAP envelope with the specified subscribe response.
 EnvelopeDocument createSubscribeResponseToSM(EndpointReferenceType subscriptionManagerEpr, EndpointReferenceType sourceEpr, SubscribeDocument subscribeDocument, SubscribeResponseDocument subResponseDocument)
          Create the SOAP envelope with the specified subscribe response AND the subscribe original request.
 EnvelopeDocument createSubscriptionEnd(EndpointReferenceType destinationEpr, EndpointReferenceType sourceEpr, SubscriptionEndDocument subscriptionEndDocument)
          Creates a SOAP envelope with the subscription end document
 EnvelopeDocument createUnsubscribeResponse(EndpointReferenceType sinkEpr, EndpointReferenceType subscriptionManagerEpr, RelatesToDocument relatesTo)
          Create the SOAP envelope with the specified getStatus response.
 EnvelopeDocument createUnsubscribeResponseToSource(EndpointReferenceType sourceEpr, EndpointReferenceType subscriptionMgrEpr, String subscriptionIdentifier)
          Create the SOAP envelope with the specified getStatus response.
static WseResponseCreator getInstance()
           
 RelatesToDocument getResponseRelatesTo(AddressingHeaders requestHeaders)
          Initializes the relates to element appropriately, based on whether there is a messageID in the requestHeaders.
 EndpointReferenceType getSendResponseTo(AddressingHeaders requestHeaders, EndpointReferenceType alternateEPR, String requestType)
          Try and the initialize the EPR to send a response message to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WseResponseCreator getInstance()

createSubscribeResponse

public EnvelopeDocument createSubscribeResponse(EndpointReferenceType sinkEpr,
                                                EndpointReferenceType sourceEpr,
                                                RelatesToDocument relatesTo,
                                                SubscribeResponseDocument subscribeResponseDocument)
                                         throws ProcessingException
Create the SOAP envelope with the specified subscribe response. This envelope's destination is the Sink which generated the original request message.

Specified by:
createSubscribeResponse in interface WseResponseCreator
Throws:
ProcessingException

createSubscribeResponseToSM

public EnvelopeDocument createSubscribeResponseToSM(EndpointReferenceType subscriptionManagerEpr,
                                                    EndpointReferenceType sourceEpr,
                                                    SubscribeDocument subscribeDocument,
                                                    SubscribeResponseDocument subResponseDocument)
                                             throws ProcessingException
Create the SOAP envelope with the specified subscribe response AND the subscribe original request. This envelope's destination is the SubscriptionManager for the source in question.

Specified by:
createSubscribeResponseToSM in interface WseResponseCreator
Throws:
ProcessingException

createRenewResponse

public EnvelopeDocument createRenewResponse(EndpointReferenceType sinkEpr,
                                            EndpointReferenceType subscriptionManagerEpr,
                                            RelatesToDocument relatesTo,
                                            RenewResponseDocument renewResponseDocument)
                                     throws ProcessingException
Create the SOAP envelope with the specified renew response. This envelope's destination is the sink which originated the message.

Specified by:
createRenewResponse in interface WseResponseCreator
Throws:
ProcessingException

createRenewResponseToSource

public EnvelopeDocument createRenewResponseToSource(EndpointReferenceType sourceEpr,
                                                    EndpointReferenceType subscriptionManagerEpr,
                                                    String subscriptionIdentifier,
                                                    RenewResponseDocument renewResponseDocument)
                                             throws ProcessingException
Create the SOAP envelope with the specified renew response. This envelope's destination is the source which notify's the relevant sink.

Specified by:
createRenewResponseToSource in interface WseResponseCreator
Throws:
ProcessingException

createGetStatusResponse

public EnvelopeDocument createGetStatusResponse(EndpointReferenceType sinkEpr,
                                                EndpointReferenceType subscriptionManagerEpr,
                                                RelatesToDocument relatesTo,
                                                GetStatusResponseDocument getStatusResponseDocument)
                                         throws ProcessingException
Create the SOAP envelope with the specified getStatus response. This envelope's destination is the sink which originated the message.

Specified by:
createGetStatusResponse in interface WseResponseCreator
Throws:
ProcessingException

createUnsubscribeResponse

public EnvelopeDocument createUnsubscribeResponse(EndpointReferenceType sinkEpr,
                                                  EndpointReferenceType subscriptionManagerEpr,
                                                  RelatesToDocument relatesTo)
                                           throws ProcessingException
Create the SOAP envelope with the specified getStatus response. This envelope's destination is the sink which originated the message.

Specified by:
createUnsubscribeResponse in interface WseResponseCreator
Throws:
ProcessingException

createUnsubscribeResponseToSource

public EnvelopeDocument createUnsubscribeResponseToSource(EndpointReferenceType sourceEpr,
                                                          EndpointReferenceType subscriptionMgrEpr,
                                                          String subscriptionIdentifier)
                                                   throws ProcessingException
Create the SOAP envelope with the specified getStatus response. This envelope's destination is the source for the sink in question.

Specified by:
createUnsubscribeResponseToSource in interface WseResponseCreator
Throws:
ProcessingException

createSubscriptionEnd

public EnvelopeDocument createSubscriptionEnd(EndpointReferenceType destinationEpr,
                                              EndpointReferenceType sourceEpr,
                                              SubscriptionEndDocument subscriptionEndDocument)
                                       throws ProcessingException
Creates a SOAP envelope with the subscription end document

Specified by:
createSubscriptionEnd in interface WseResponseCreator
Throws:
ProcessingException

getSendResponseTo

public EndpointReferenceType getSendResponseTo(AddressingHeaders requestHeaders,
                                               EndpointReferenceType alternateEPR,
                                               String requestType)
                                        throws ProcessingException
Try and the initialize the EPR to send a response message to. This is typically used to initialize the [wsa:To] element. The addressing headers that are passed here are the headers that were constructed based on the original request that came in previously. So this method will look for the [wsa:ReplyTo] or [wsa:From] elements to construct the responses.

Specified by:
getSendResponseTo in interface WseResponseCreator
Throws:
ProcessingException

getResponseRelatesTo

public RelatesToDocument getResponseRelatesTo(AddressingHeaders requestHeaders)
Initializes the relates to element appropriately, based on whether there is a messageID in the requestHeaders. This will return a NULL if there is no MessageID within the AddressingHeaders.

Specified by:
getResponseRelatesTo in interface WseResponseCreator


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