org.ws4d.java.eventing
Interface SubscriptionManager


public interface SubscriptionManager


Method Summary
 long getStatus(ClientSubscription subscription)
          This method should be called each time a service receives a request to obtain the status of a subscription from a client.
 GetStatusResponseMessage getStatus(GetStatusMessage msg, ProtocolData protocolData)
          This method should be called each time a local service receives a request to obtain the status of a subscription from a client.
 boolean isRemote()
           
 long renew(ClientSubscription subscription, long duration)
          Renews an existing subscription with new duration.
 RenewResponseMessage renew(RenewMessage msg, ProtocolData protocolData)
          This method should be called each time a local service receives a request to renew a subscription from a client.
 void sendSubscriptionEnd()
          Notifies each subscribed event sink / event listener that the service has terminated the subscription.
 ClientSubscription subscribe(EventSink sink, java.lang.String clientSubscriptionId, URISet eventActionURIs, long duration)
          Subscribe to subscription for local client.
 SubscribeResponseMessage subscribe(SubscribeMessage msg, ProtocolData protocolData)
          This method should be called each time a local service receives a subscription request from a remote client.
 void unsubscribe(ClientSubscription subscription)
          This method should be called each time a service receives a request to cancel a subscription from a local client.
 UnsubscribeResponseMessage unsubscribe(UnsubscribeMessage msg, ProtocolData protocolData)
          This method should be called each time a local service receives a request to cancel a subscription from a remote client.
 

Method Detail

subscribe

SubscribeResponseMessage subscribe(SubscribeMessage msg,
                                   ProtocolData protocolData)
                                   throws SOAPException
This method should be called each time a local service receives a subscription request from a remote client.

Parameters:
msg - the subscribe message describing the request
Returns:
a corresponding subscribe response message suitable to confirm the subscription
Throws:
SOAPException - in case the subscription failed for any reason, a fault message with further details can be obtained from this SOAPException (see SOAPException.getFault())

subscribe

ClientSubscription subscribe(EventSink sink,
                             java.lang.String clientSubscriptionId,
                             URISet eventActionURIs,
                             long duration)
                             throws EventingException
Subscribe to subscription for local client.

Parameters:
sink -
clientSubscriptionId -
eventActionURIs -
duration -
Returns:
a client subscription instance describing the status and allowing management of the subscription
Throws:
EventingException

unsubscribe

UnsubscribeResponseMessage unsubscribe(UnsubscribeMessage msg,
                                       ProtocolData protocolData)
                                       throws SOAPException
This method should be called each time a local service receives a request to cancel a subscription from a remote client.

Parameters:
msg - the unsubscribe message describing the request
Returns:
a corresponding unsubscribe response message suitable to confirm the subscription cancellation
Throws:
SOAPException - in case the cancellation failed for any reason, a fault message with further details can be obtained from this SOAPException (see SOAPException.getFault())

unsubscribe

void unsubscribe(ClientSubscription subscription)
                 throws EventingException,
                        TimeoutException
This method should be called each time a service receives a request to cancel a subscription from a local client.

Parameters:
subscription - Client subscription.
Throws:
EventingException
TimeoutException

renew

RenewResponseMessage renew(RenewMessage msg,
                           ProtocolData protocolData)
                           throws SOAPException
This method should be called each time a local service receives a request to renew a subscription from a client.

Parameters:
msg - the renew message describing the request
Returns:
a corresponding renew response message suitable to confirm the subscription renewal
Throws:
SOAPException - in case the renewal failed for any reason, a fault message with further details can be obtained from this SOAPException (see SOAPException.getFault())

renew

long renew(ClientSubscription subscription,
           long duration)
           throws EventingException,
                  TimeoutException
Renews an existing subscription with new duration. If duration is "0", subscription never terminates. This method should be called each time a service receives a request to renew a subscription from a client.

Parameters:
subscription -
duration -
Throws:
EventingException
TimeoutException

getStatus

GetStatusResponseMessage getStatus(GetStatusMessage msg,
                                   ProtocolData protocolData)
                                   throws SOAPException
This method should be called each time a local service receives a request to obtain the status of a subscription from a client.

Parameters:
msg - the get status message describing the request
Returns:
a corresponding get status response message suitable to confirm the subscription status query
Throws:
SOAPException - in case the status query failed for any reason, a fault message with further details can be obtained from this SOAPException (see SOAPException.getFault())

getStatus

long getStatus(ClientSubscription subscription)
               throws EventingException,
                      TimeoutException
This method should be called each time a service receives a request to obtain the status of a subscription from a client.

Parameters:
subscription -
Returns:
the current status of the subscription in terms of milliseconds until its expiration
Throws:
EventingException
TimeoutException

sendSubscriptionEnd

void sendSubscriptionEnd()
Notifies each subscribed event sink / event listener that the service has terminated the subscription.


isRemote

boolean isRemote()