| Constructor and Description |
|---|
DefaultEventSink(EventListener eventListener,
DataStructure bindings)
Constructor.
|
DefaultEventSink(EventListener eventListener,
int configurationId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBinding(CommunicationAutoBinding autoBinding)
Adds the given autoBinding to this
Bindable. |
void |
addBinding(CommunicationBinding binding)
Adds the given binding to this
Bindable. |
void |
addSubscription(java.lang.String clientSubId,
ClientSubscription subscription)
Internal method used within the subscription process.
Subscribing to an event is done by Service.subscribe(EventSink, String,
org.ws4d.java.types.URISet, long, CredentialInfo) . |
URI |
chooseNotifyToAddress(ConnectionInfo connectionInfo,
Delivery delivery,
boolean useReferenceParameterMode) |
void |
clearBindings()
Removes all bindings from this
Bindable instance. |
void |
close()
Closes event receiving for this event endpoint.
|
Iterator |
getCommunicationAutoBindings()
Returns an iterator over all
autoBindings assigned to this Bindable instance. |
Iterator |
getCommunicationBindings()
Returns an iterator over all
bindings assigned to this Bindable
instance. |
CommunicationStructureListener |
getCommunicationStructureListener() |
EventListener |
getEventListener()
Get associated event listener of this event sink.
|
ClientSubscription |
getSubscription(java.lang.String clientSubId) |
boolean |
hasCommunicationAutoBindings()
Returns
true only if this instance has at least one binding assigned. |
boolean |
hasCommunicationBindings()
|
boolean |
isOpen()
Returns if event sink is open to receive notifications/ solicit responses.
|
void |
open(CredentialInfo credentialInfo)
Opens event receiving for this event endpoint.
|
ParameterValue |
receiveLocalEvent(java.lang.String clientSubscriptionId,
URI actionUri,
ParameterValue outputParameter,
CredentialInfo credentialInfo)
Callback method for receiving local notifications/ solicit responses.
|
boolean |
removeBinding(CommunicationAutoBinding autoBinding) |
boolean |
removeBinding(CommunicationBinding binding)
Removes the specified binding from this
Bindable instance. |
ClientSubscription |
removeSubscription(java.lang.String clientSubId) |
boolean |
supportsBindingChanges() |
public DefaultEventSink(EventListener eventListener, DataStructure bindings)
eventListener - Client with which this event sink should be associated. Received events will be transmitted to the
eventListener.bindings - a data structure of CommunicationBinding instances over which to expose this event sinkpublic DefaultEventSink(EventListener eventListener, int configurationId)
eventListener - Client with which this event sink should be associated. Received events will be transmitted to the
eventListener.configurationId - id for propertiespublic boolean hasCommunicationBindings()
Bindabletrue only if this Bindable instance has at least one binding assigned. Returns false, if it doesn't have any
bindings.hasCommunicationBindings in interface Bindablepublic boolean hasCommunicationAutoBindings()
Bindabletrue only if this instance has at least one binding assigned. Returns false, if it doesn't have any
autoBindings.hasCommunicationAutoBindings in interface Bindablepublic Iterator getCommunicationBindings()
Bindablebindings assigned to this Bindable
instance. This iterator will have no next elements (rather than being ), if the
Bindable doesn't have any bindings.getCommunicationBindings in interface Bindablebindingspublic Iterator getCommunicationAutoBindings()
BindableautoBindings assigned to this Bindable instance. This
iterator will have no next elements (rather than being
), if the Bindable doesn't have any
bindings.getCommunicationAutoBindings in interface Bindablebindingspublic boolean supportsBindingChanges()
public URI chooseNotifyToAddress(ConnectionInfo connectionInfo, Delivery delivery, boolean useReferenceParameterMode)
chooseNotifyToAddress in interface EventSinkpublic void addBinding(CommunicationAutoBinding autoBinding) throws java.io.IOException
BindableBindable. Does nothing if the Bindable
already contains the binding.addBinding in interface Bindablejava.io.IOExceptionpublic void addBinding(CommunicationBinding binding) throws java.io.IOException
BindableBindable. Does nothing if the Bindable
already contains the binding.addBinding in interface Bindablebinding - the binding to addjava.io.IOExceptionpublic boolean removeBinding(CommunicationBinding binding) throws java.io.IOException
BindableBindable instance. Does nothing, if the
Bindable doesn't contain the given binding. Returns true if the
binding was removed and false if it didn't exist.removeBinding in interface Bindablebinding - the binding to removetrue if this Bindable instance had the given binding assigned and it was
removed successfully, false otherwisejava.io.IOExceptionpublic boolean removeBinding(CommunicationAutoBinding autoBinding) throws java.io.IOException
removeBinding in interface Bindablejava.io.IOExceptionpublic void clearBindings()
throws WS4DIllegalStateException
BindableBindable instance. Does nothing if there are no
bindings assigned.clearBindings in interface BindableWS4DIllegalStateException - in case this Bindable doesn't support modifications at the current time (see #supportsBindingChanges())public void open(CredentialInfo credentialInfo) throws java.io.IOException
EventSinkpublic void close()
EventSinkpublic EventListener getEventListener()
EventSinkgetEventListener in interface EventSinkpublic boolean isOpen()
EventSinkpublic CommunicationStructureListener getCommunicationStructureListener()
getCommunicationStructureListener in interface EventSinkpublic ClientSubscription getSubscription(java.lang.String clientSubId)
getSubscription in interface EventSinkpublic ClientSubscription removeSubscription(java.lang.String clientSubId)
removeSubscription in interface EventSinkclientSubId - public void addSubscription(java.lang.String clientSubId,
ClientSubscription subscription)
EventSinkService.subscribe(EventSink, String,
org.ws4d.java.types.URISet, long, CredentialInfo) .addSubscription in interface EventSinkclientSubId - client subscription idsubscription - client subscriptionpublic ParameterValue receiveLocalEvent(java.lang.String clientSubscriptionId, URI actionUri, ParameterValue outputParameter, CredentialInfo credentialInfo) throws AuthorizationException
EventSinkreceiveLocalEvent in interface EventSinkclientSubscriptionId - Subscription id the client sent to the service for subscription.actionUri - Action of event fired.outputParameter - The parameter value the service transmitted with the event message.nullAuthorizationException