Class ActionBasedEventSource
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.dpws.soap.wseventing.ActionBasedEventSource
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Interceptor,EventSource,EventSourceDialectHandler
public class ActionBasedEventSource extends com.google.common.util.concurrent.AbstractIdleService implements EventSource, EventSourceDialectHandler
Interceptor that handles an action-based event source's incoming subscription requests and facilitates sending notifications.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,SubscriptionManager>getActiveSubscriptions()Returns all active subscription ids with their SubscriptionManager.StringgetDialect()This function shall return the handled filter dialect.voidinit(Subscriptions subscriptions)Called once for a filter dialect handler when the EventSourceInterceptorDispatcher service starts.voidsendNotification(String action, Object payload)Sends a notification to all event sinks.voidsetStale(SourceSubscriptionManager subscriptionManager)Called when a subscription has expired.protected voidshutDown()protected voidstartUp()voidsubscribe(SourceSubscriptionManager subscriptionManager)Called on an incoming subscribe request.voidsubscriptionEndToAll(WsEventingStatus status)Sends a subscription end to all event sinks.voidunsubscribe(SourceSubscriptionManager subscriptionManager)Called on an incoming unsubscribe request.
-
-
-
Method Detail
-
sendNotification
public void sendNotification(String action, Object payload)
Description copied from interface:EventSourceSends a notification to all event sinks.- Specified by:
sendNotificationin interfaceEventSource- 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:EventSourceSends a subscription end to all event sinks.- Specified by:
subscriptionEndToAllin interfaceEventSource- Parameters:
status- the subscription end reason.
-
getActiveSubscriptions
public Map<String,SubscriptionManager> getActiveSubscriptions()
Description copied from interface:EventSourceReturns all active subscription ids with their SubscriptionManager.- Specified by:
getActiveSubscriptionsin interfaceEventSource- Returns:
- Map of subscription ids and SubscriptionManagers.
-
init
public void init(Subscriptions subscriptions)
Description copied from interface:EventSourceDialectHandlerCalled 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:
initin interfaceEventSourceDialectHandler- Parameters:
subscriptions- the subscription registry that handles all subscriptions for the filter dialect
-
subscribe
public void subscribe(SourceSubscriptionManager subscriptionManager)
Description copied from interface:EventSourceDialectHandlerCalled on an incoming subscribe request.- Specified by:
subscribein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
unsubscribe
public void unsubscribe(SourceSubscriptionManager subscriptionManager)
Description copied from interface:EventSourceDialectHandlerCalled on an incoming unsubscribe request.- Specified by:
unsubscribein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
setStale
public void setStale(SourceSubscriptionManager subscriptionManager)
Description copied from interface:EventSourceDialectHandlerCalled when a subscription has expired.- Specified by:
setStalein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
getDialect
public String getDialect()
Description copied from interface:EventSourceDialectHandlerThis function shall return the handled filter dialect.It is used by the dispatcher helping to assign subscription activity.
- Specified by:
getDialectin interfaceEventSourceDialectHandler- Returns:
- the filter dialect handled by this instance.
-
startUp
protected void startUp()
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService
-
shutDown
protected void shutDown()
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-
-