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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Method Summary
Modifier and TypeMethodDescriptionReturns all active subscription ids with their SubscriptionManager.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.Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Method Details
-
sendNotification
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
Description copied from interface:EventSourceSends a subscription end to all event sinks.- Specified by:
subscriptionEndToAllin interfaceEventSource- Parameters:
status- the subscription end reason.
-
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
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
Description copied from interface:EventSourceDialectHandlerCalled on an incoming subscribe request.- Specified by:
subscribein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
unsubscribe
Description copied from interface:EventSourceDialectHandlerCalled on an incoming unsubscribe request.- Specified by:
unsubscribein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
setStale
Description copied from interface:EventSourceDialectHandlerCalled when a subscription has expired.- Specified by:
setStalein interfaceEventSourceDialectHandler- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
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
-