Class GenericEventSource

java.lang.Object
org.somda.sdc.dpws.soap.wseventing.GenericEventSource
All Implemented Interfaces:
Interceptor, EventSource, EventSourceDialectHandler

public class GenericEventSource extends Object implements EventSource, EventSourceDialectHandler
Interceptor that handles an event source's incoming subscription requests and facilitates sending notifications.
  • Method Details

    • sendNotification

      public void sendNotification(String action, Object payload)
      Description copied from interface: EventSource
      Sends a notification to all event sinks.
      Specified by:
      sendNotification in interface EventSource
      Parameters:
      action - the action URI used for dispatching to event sinks.
      payload - a JAXB element or JAXB generated class object to transport.
    • subscriptionEndToAll

      public void subscriptionEndToAll(WsEventingStatus status)
      Description copied from interface: EventSource
      Sends a subscription end to all event sinks.
      Specified by:
      subscriptionEndToAll in interface EventSource
      Parameters:
      status - the subscription end reason.
    • sendNotificationFor

      public void sendNotificationFor(String subscriptionId, String action, Object payload)
      Additional method to send out a notification to a single subscription.
      Parameters:
      subscriptionId - the subscription id for which a notification will be sent.
      action - the WS-Addressing action header URI.
      payload - the notification payload as JAXBElement or an object that can be marshalled.
    • endSubscriptionFor

      public void endSubscriptionFor(String subscriptionId)
      Additional method to send out a subscription end to a single subscription.
      Parameters:
      subscriptionId - the subscription id for which the end will be announced.
    • getActiveSubscriptions

      public Map<String,SubscriptionManager> getActiveSubscriptions()
      Description copied from interface: EventSource
      Returns all active subscription ids with their SubscriptionManager.
      Specified by:
      getActiveSubscriptions in interface EventSource
      Returns:
      Map of subscription ids and SubscriptionManagers.
    • init

      public void init(Subscriptions subscriptions)
      Description copied from interface: EventSourceDialectHandler
      Called once for a filter dialect handler when the EventSourceInterceptorDispatcher service starts.

      This function is guaranteed to be called before any other callback of this interface is called.

      The subscriptions are managed by the EventSourceInterceptorDispatcher!

      Specified by:
      init in interface EventSourceDialectHandler
      Parameters:
      subscriptions - the subscription registry that handles all subscriptions for the filter dialect
    • subscribe

      public void subscribe(SourceSubscriptionManager subscriptionManager)
      Description copied from interface: EventSourceDialectHandler
      Called on an incoming subscribe request.
      Specified by:
      subscribe in interface EventSourceDialectHandler
      Parameters:
      subscriptionManager - the subscription manager for this subscription.
    • unsubscribe

      public void unsubscribe(SourceSubscriptionManager subscriptionManager)
      Description copied from interface: EventSourceDialectHandler
      Called on an incoming unsubscribe request.
      Specified by:
      unsubscribe in interface EventSourceDialectHandler
      Parameters:
      subscriptionManager - the subscription manager for this subscription.
    • setStale

      public void setStale(SourceSubscriptionManager subscriptionManager)
      Description copied from interface: EventSourceDialectHandler
      Called when a subscription has expired.
      Specified by:
      setStale in interface EventSourceDialectHandler
      Parameters:
      subscriptionManager - the subscription manager for this subscription.
    • getDialect

      public String getDialect()
      Description copied from interface: EventSourceDialectHandler
      This function shall return the handled filter dialect.

      It is used by the dispatcher helping to assign subscription activity.

      Specified by:
      getDialect in interface EventSourceDialectHandler
      Returns:
      the filter dialect handled by this instance.