cgl.narada.wsinfra.wse.impl
Class WseSourceProcessor

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

public class WseSourceProcessor
extends WsProcessor
implements WseSource, SubscriptionExpiryListener

This class which implements the interface that encapsulates the behavior of a WS-Eventing source node.


Method Summary
 String cancelSubscription(String subscriptionId, String additionalReason)
          A source can also facilitate cancellation of subscriptions that aren't yet slated to expire.
static WseSourceProcessor getInstance()
           
 WsMessageFlow getMessageFlow()
          Gets the message flow which the processor should use.
 SubscriptionManagement getSubscriptionManagement()
          Retrieves the subscription management
 void issueSubscriptionEnd(String subscriptionId, String status, String reason)
           
 void onSubscriptionExpiry(SubscriptionEntry expiredEntry)
          Method that is called when one of the managed subscriptions expires
 boolean processExchange(EnvelopeDocument envelopeDocument, int direction)
          Process the exchange.
 void processNotification(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
          This method is used to ensure the dissemination of a notification to registered subscriptions.
 SubscribeResponseDocument processSubscribeRequest(SubscribeDocument subscribeDocument)
          The method to process a SubscriptionRequest issued by a Sink.
 void processSubscriptionRenewal(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
          This method is used to update the subscription tables maintained at the source.
 void processUnsubscribe(EnvelopeDocument envelopeDocument, AddressingHeaders addressingHeaders)
          This method is used to update the subscription tables maintained at the source.
 void setMessageFlow(WsMessageFlow wsMessageFlow)
          Sets the message flow which the processor should use
 void setSourceEPR(EndpointReferenceType sourceEpr)
           
 void setSubscriptionManagerEPR(EndpointReferenceType subscriptionManagerEpr)
           
 void terminateServices()
          This is called by the source when it is doing a planned shutdown of the event source.
 
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 WseSourceProcessor getInstance()

getSubscriptionManagement

public SubscriptionManagement getSubscriptionManagement()
Retrieves the subscription management

Returns:
SubscriptionManagement

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

setSourceEPR

public void setSourceEPR(EndpointReferenceType sourceEpr)

setSubscriptionManagerEPR

public void setSubscriptionManagerEPR(EndpointReferenceType subscriptionManagerEpr)

processExchange

public boolean processExchange(EnvelopeDocument envelopeDocument,
                               int direction)
                        throws UnknownExchangeException,
                               IncorrectExchangeException,
                               MessageFlowException,
                               ProcessingException
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
MessageFlowException
ProcessingException

processSubscribeRequest

public SubscribeResponseDocument processSubscribeRequest(SubscribeDocument subscribeDocument)
                                                  throws WsFaultException,
                                                         ProcessingException
The method to process a SubscriptionRequest issued by a Sink. If this request is successfully processed a SubscribeResponseDocument is issued. If the request is NOT successful a WsFaultException is thrown.

Specified by:
processSubscribeRequest in interface WseSource
Throws:
WsFaultException
ProcessingException

processSubscriptionRenewal

public void processSubscriptionRenewal(EnvelopeDocument envelopeDocument,
                                       AddressingHeaders addressingHeaders)
                                throws WsFaultException
This method is used to update the subscription tables maintained at the source. ONLY requests successfully renewed by the SubscriptionManager are forwarded onto the source for updates at the source. This method will throw an error if the request was issued by anyone BUT the registered SubscriptionManager. wse:Identifier of the subscription. wse:From should match Subscription Manager for the subscription. wse:RenewResponse which would indicate the new expiry time for the subscription.

Specified by:
processSubscriptionRenewal in interface WseSource
Throws:
WsFaultException

processUnsubscribe

public void processUnsubscribe(EnvelopeDocument envelopeDocument,
                               AddressingHeaders addressingHeaders)
                        throws WsFaultException
This method is used to update the subscription tables maintained at the source. Unsubscribe requests processed by the SubscriptionManager are forwarded onto the source for updates at the source. This method will throw an error if the request was issued by anyone BUT the registered SubscriptionManager for the subscription in question. wse:Identifier of the subscription wse:From shoould match SubscriptionManager for the subscription.

Specified by:
processUnsubscribe in interface WseSource
Throws:
WsFaultException

processNotification

public void processNotification(EnvelopeDocument envelopeDocument,
                                AddressingHeaders addressingHeaders)
                         throws ProcessingException,
                                MessageFlowException
This method is used to ensure the dissemination of a notification to registered subscriptions.

Specified by:
processNotification in interface WseSource
Throws:
ProcessingException
MessageFlowException

onSubscriptionExpiry

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

Specified by:
onSubscriptionExpiry in interface SubscriptionExpiryListener

cancelSubscription

public String cancelSubscription(String subscriptionId,
                                 String additionalReason)
A source can also facilitate cancellation of subscriptions that aren't yet slated to expire.


terminateServices

public void terminateServices()
This is called by the source when it is doing a planned shutdown of the event source. All the subscriptions will be terminated and an appropriate SubscriptionEnd message will be sent to all the registered entities.


issueSubscriptionEnd

public void issueSubscriptionEnd(String subscriptionId,
                                 String status,
                                 String reason)
                          throws ProcessingException,
                                 MessageFlowException
Throws:
ProcessingException
MessageFlowException


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