Class GenericEventSource
-
- All Implemented Interfaces:
-
org.somda.sdc.dpws.soap.interception.Interceptor,org.somda.sdc.dpws.soap.wseventing.EventSource,org.somda.sdc.dpws.soap.wseventing.EventSourceDialectHandler
public class GenericEventSource implements EventSource, EventSourceDialectHandler
Interceptor that handles an event source's incoming subscription requests and facilitates sending notifications.
-
-
Method Summary
Modifier and Type Method Description voidsendNotification(String action, Object payload)Sends a notification to all event sinks. voidsubscriptionEndToAll(WsEventingStatus status)Sends a subscription end to all event sinks. voidsendNotificationFor(String subscriptionId, String action, Object payload)Additional method to send out a notification to a single subscription. voidendSubscriptionFor(String subscriptionId)Additional method to send out a subscription end to a single subscription. Map<String, SubscriptionManager>getActiveSubscriptions()Returns all active subscription ids with their SubscriptionManager. voidinit(Subscriptions subscriptions)Called once for a filter dialect handler when the EventSourceInterceptorDispatcher service starts. voidsubscribe(SourceSubscriptionManager subscriptionManager)Called on an incoming subscribe request. voidunsubscribe(SourceSubscriptionManager subscriptionManager)Called on an incoming unsubscribe request. voidsetStale(SourceSubscriptionManager subscriptionManager)Called when a subscription has expired. StringgetDialect()This function shall return the handled filter dialect. -
-
Method Detail
-
sendNotification
void sendNotification(String action, Object payload)
Sends a notification to all event sinks.
- Parameters:
action- the action URI used for dispatching to event sinks.payload- a JAXB element or JAXB generated class object to transport.
-
subscriptionEndToAll
void subscriptionEndToAll(WsEventingStatus status)
Sends a subscription end to all event sinks.
- Parameters:
status- the subscription end reason.
-
sendNotificationFor
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
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
Map<String, SubscriptionManager> getActiveSubscriptions()
Returns all active subscription ids with their SubscriptionManager.
- Returns:
Map of subscription ids and SubscriptionManagers.
-
init
void init(Subscriptions subscriptions)
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!
- Parameters:
subscriptions- the subscription registry that handles all subscriptions for the filter dialect
-
subscribe
void subscribe(SourceSubscriptionManager subscriptionManager)
Called on an incoming subscribe request.
- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
unsubscribe
void unsubscribe(SourceSubscriptionManager subscriptionManager)
Called on an incoming unsubscribe request.
- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
setStale
void setStale(SourceSubscriptionManager subscriptionManager)
Called when a subscription has expired.
- Parameters:
subscriptionManager- the subscription manager for this subscription.
-
getDialect
String getDialect()
This function shall return the handled filter dialect.
It is used by the dispatcher helping to assign subscription activity.
- Returns:
the filter dialect handled by this instance.
-
-
-
-