cgl.narada.wsinfra.wse.impl
Class WseSubscriptionManagerProcessor

java.lang.Object
  extended by cgl.narada.wsinfra.WsProcessor
      extended by cgl.narada.wsinfra.wse.impl.WseSubscriptionManagerProcessor
All Implemented Interfaces:
SubscriptionExpiryListener, WseSubscriptionManager

public class WseSubscriptionManagerProcessor
extends WsProcessor
implements WseSubscriptionManager, SubscriptionExpiryListener

This class encapsulates the behavior of a WS-Eventing subscription manager node.


Method Summary
static WseSubscriptionManagerProcessor getInstance()
           
 WsMessageFlow getMessageFlow()
          Gets the message flow which the processor should use.
 void onSubscriptionExpiry(SubscriptionEntry expiredEntry)
          Method that is called when one of the managed subscriptions expires
 boolean processExchange(EnvelopeDocument envelopeDocument, int direction)
          Process the exchange.
 GetStatusResponseDocument processGetStatusOfSubscription(GetStatusDocument getStatusDocument)
          Process the a GetStatus request issued by a sink.
 RenewResponseDocument processRenewSubscription(RenewDocument renewDocument)
          Process a renew request issued by a sink.
 void processSubscriptionAddition(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
          This method is used to notify a subscription manager of the a successuful subscription request-response combination.
 void processSubscriptionRenewal(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
           
 void processSubscriptionStatus(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
          Process a request to get the status of a subscription.
 void processSubscriptionUnsubscribe(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
           
 EnvelopeDocument processUnsubscribe(UnsubscribeDocument unsubscribeDocument)
          Process an unsubscribe request issued by a sink.
 void setMessageFlow(WsMessageFlow wsMessageFlow)
          Sets the message flow which the processor should use
 void setSubscriptionManagerEPR(EndpointReferenceType subscriptionManagerEpr)
           
 
Methods inherited from class cgl.narada.wsinfra.WsProcessor
enrouteToApplication, enrouteToNetwork, enrouteToNetwork, isFault, manageFaultException, processExchange, processExchange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WseSubscriptionManagerProcessor getInstance()

setMessageFlow

public void setMessageFlow(WsMessageFlow wsMessageFlow)
                    throws DeploymentException
Sets the message flow which the processor should use

Specified by:
setMessageFlow in class WsProcessor
Throws:
DeploymentException

getMessageFlow

public WsMessageFlow getMessageFlow()
Gets the message flow which the processor should use.

Specified by:
getMessageFlow in class WsProcessor

setSubscriptionManagerEPR

public void setSubscriptionManagerEPR(EndpointReferenceType subscriptionManagerEpr)

processExchange

public boolean processExchange(EnvelopeDocument envelopeDocument,
                               int direction)
                        throws UnknownExchangeException,
                               IncorrectExchangeException,
                               ProcessingException,
                               MessageFlowException
Process the exchange. The argument also indicates the direction in which the exchange has actually traversed.

Specified by:
processExchange in class WsProcessor
Throws:
UnknownExchangeException
IncorrectExchangeException
ProcessingException
MessageFlowException

processSubscriptionRenewal

public void processSubscriptionRenewal(EnvelopeDocument envelopeDocument,
                                       AddressingHeaders addressingHeaders)
                                throws ProcessingException,
                                       WsFaultException,
                                       MessageFlowException
Throws:
ProcessingException
WsFaultException
MessageFlowException

processSubscriptionStatus

public void processSubscriptionStatus(EnvelopeDocument envelopeDocument,
                                      AddressingHeaders addressingHeaders)
                               throws ProcessingException,
                                      WsFaultException,
                                      MessageFlowException
Process a request to get the status of a subscription. This method will throw exceptions (or generate faults) if the identifier contained in the subscription GetStatus is an unknown one.

Throws:
ProcessingException
WsFaultException
MessageFlowException

processSubscriptionUnsubscribe

public void processSubscriptionUnsubscribe(EnvelopeDocument envelopeDocument,
                                           AddressingHeaders addressingHeaders)
                                    throws ProcessingException,
                                           WsFaultException,
                                           MessageFlowException
Throws:
ProcessingException
WsFaultException
MessageFlowException

processSubscriptionAddition

public void processSubscriptionAddition(EnvelopeDocument envelopeDocument,
                                        AddressingHeaders addressingHeaders)
                                 throws WsFaultException,
                                        MessageFlowException
This method is used to notify a subscription manager of the a successuful subscription request-response combination. The request (issued by the sink) allows a subscription manager to know about the subscription, while the response (issued by the source) allows it know the wse:Identifer for this subscription and also the expiry associated with the subscription. Also note that the wse:Identifier is what is used by the sinks in all their interactions with the subscription manager

Specified by:
processSubscriptionAddition in interface WseSubscriptionManager
Throws:
WsFaultException
MessageFlowException

processGetStatusOfSubscription

public GetStatusResponseDocument processGetStatusOfSubscription(GetStatusDocument getStatusDocument)
                                                         throws WsFaultException
Process the a GetStatus request issued by a sink. A fault may be thrown if there are problems processing this request. wse:Identifer is needed.

Specified by:
processGetStatusOfSubscription in interface WseSubscriptionManager
Throws:
WsFaultException

processRenewSubscription

public RenewResponseDocument processRenewSubscription(RenewDocument renewDocument)
                                               throws WsFaultException
Process a renew request issued by a sink. A fault may be thrown if there are problems processing this request. wse:Identifier is needed

Specified by:
processRenewSubscription in interface WseSubscriptionManager
Throws:
WsFaultException

processUnsubscribe

public EnvelopeDocument processUnsubscribe(UnsubscribeDocument unsubscribeDocument)
                                    throws WsFaultException
Process an unsubscribe request issued by a sink. A fault may be thrown if there are problems processing this request. wse:Identifier is needed

Specified by:
processUnsubscribe in interface WseSubscriptionManager
Throws:
WsFaultException

onSubscriptionExpiry

public void onSubscriptionExpiry(SubscriptionEntry expiredEntry)
Method that is called when one of the managed subscriptions expires

Specified by:
onSubscriptionExpiry in interface SubscriptionExpiryListener


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