org.globus.ogsa.client.managers
Class NotificationSinkManager

java.lang.Object
  extended byorg.globus.ogsa.client.managers.NotificationSinkManager
Direct Known Subclasses:
GSINotificationSinkManager, SecureNotificationSinkManager

public class NotificationSinkManager
extends java.lang.Object

Class simplifying client side sink setup and notification subscription


Field Summary
static boolean CHILD_THREAD
           
static boolean MAIN_THREAD
           
protected  java.util.Map properties
           
protected  ServiceContainer serviceContainer
           
 
Constructor Summary
protected NotificationSinkManager()
           
 
Method Summary
 java.lang.String addListener(java.util.Calendar timeout, HandleType sourceHandle, NotificationSinkCallback callback, ExtensibilityType subscriptionExpression)
          Subscribes to a set of service data entries of the specified service to receive notifications of the SDEs state change.
 java.lang.String addListener(javax.xml.namespace.QName[] serviceData, java.util.Calendar timeout, HandleType sourceHandle, NotificationSinkCallback callback)
          Subscribes to a set of service data entries of the specified service to receive notifications of the SDEs state change.
 java.lang.String addListener(javax.xml.namespace.QName[] serviceData, java.util.Calendar timeout, HandleType sourceHandle, NotificationSinkCallback callback, ExtensibilityType subscriptionExpression)
          Deprecated. Use addListener() instead.
 java.lang.String addListener(javax.xml.namespace.QName serviceData, java.util.Calendar timeout, HandleType sourceHandle, NotificationSinkCallback callback)
          Subscribes to a service data entry of the specified service to receive notifications of the SDE state change.
 java.lang.String addListener(java.lang.String serviceData, java.util.Calendar timeout, HandleType sourceHandle, NotificationSinkCallback callback)
          Subscribes to a service data entry of the specified service to receive notifications of the SDE state change.
 java.lang.String addSink(NotificationSinkCallback callback)
           
 java.lang.String addSink(NotificationSinkCallback callback, java.lang.Object id)
           
 java.util.Calendar getDefaultSubscriptionTimeout()
          Returns default subscription timeout.
static NotificationSinkManager getInstance(java.lang.String type)
           
static NotificationSinkManager getManager()
           
static java.lang.String getSinkID(java.net.URL url, NotificationSinkCallback callback, java.lang.Object obj)
           
 NotificationSubscription getSubscriptionService(java.lang.String subscriptionID)
           
protected  java.lang.String getWsdl()
           
 void init(java.util.Map properties)
           
 boolean isListening()
           
 void removeListener(java.lang.String subscriptionID)
          Unsubscribes a notification sink.
 void removeSink(java.lang.String sink)
           
protected  void setCallbackEndpoint(NotificationSinkCallback callback)
           
protected  void setCallbackHandle(NotificationSinkCallback callback)
           
protected  void setProperties(javax.xml.rpc.Stub stub)
           
 void setService(org.apache.axis.client.Service service)
           
 void startListening()
           
 void startListening(boolean isMainThread)
           
 void stopListening()
           
 void unregisterListener(java.lang.String subscriptionID)
          Removes the listener from the subscription map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN_THREAD

public static final boolean MAIN_THREAD
See Also:
Constant Field Values

CHILD_THREAD

public static final boolean CHILD_THREAD
See Also:
Constant Field Values

serviceContainer

protected ServiceContainer serviceContainer

properties

protected java.util.Map properties
Constructor Detail

NotificationSinkManager

protected NotificationSinkManager()
Method Detail

getManager

public static NotificationSinkManager getManager()

getInstance

public static NotificationSinkManager getInstance(java.lang.String type)

init

public void init(java.util.Map properties)

setService

public void setService(org.apache.axis.client.Service service)

getWsdl

protected java.lang.String getWsdl()

setCallbackEndpoint

protected void setCallbackEndpoint(NotificationSinkCallback callback)

setCallbackHandle

protected void setCallbackHandle(NotificationSinkCallback callback)

addSink

public java.lang.String addSink(NotificationSinkCallback callback)
                         throws GridServiceException
Throws:
GridServiceException

addSink

public java.lang.String addSink(NotificationSinkCallback callback,
                                java.lang.Object id)
                         throws GridServiceException
Throws:
GridServiceException

removeSink

public void removeSink(java.lang.String sink)
                throws GridServiceException
Throws:
GridServiceException

setProperties

protected void setProperties(javax.xml.rpc.Stub stub)

getSinkID

public static java.lang.String getSinkID(java.net.URL url,
                                         NotificationSinkCallback callback,
                                         java.lang.Object obj)

getSubscriptionService

public NotificationSubscription getSubscriptionService(java.lang.String subscriptionID)
                                                throws FaultType,
                                                       GridServiceException
Throws:
FaultType
GridServiceException

getDefaultSubscriptionTimeout

public java.util.Calendar getDefaultSubscriptionTimeout()
Returns default subscription timeout. By default timeout of one hour is returned.


addListener

public java.lang.String addListener(java.lang.String serviceData,
                                    java.util.Calendar timeout,
                                    HandleType sourceHandle,
                                    NotificationSinkCallback callback)
                             throws java.rmi.RemoteException,
                                    GridServiceException
Subscribes to a service data entry of the specified service to receive notifications of the SDE state change.

Parameters:
serviceData - the service data name to subscribe to. The service data name is a QName with an empty namespace and local name set to the specified service data name.
timeout - the timeout of the subscription. If null, timeout returned by getDefaultSubscriptionTimeout() is used.
sourceHandle - the GSH of the service to subscribe to.
callback - the notification sink.
Returns:
an id of this subscription.
Throws:
java.rmi.RemoteException
GridServiceException

addListener

public java.lang.String addListener(javax.xml.namespace.QName serviceData,
                                    java.util.Calendar timeout,
                                    HandleType sourceHandle,
                                    NotificationSinkCallback callback)
                             throws java.rmi.RemoteException,
                                    GridServiceException
Subscribes to a service data entry of the specified service to receive notifications of the SDE state change.

Parameters:
serviceData - the service data name to subscribe to.
timeout - the timeout of the subscription. If null, timeout returned by getDefaultSubscriptionTimeout() is used.
sourceHandle - the GSH of the service to subscribe to.
callback - the notification sink.
Returns:
an id of this subscription.
Throws:
java.rmi.RemoteException
GridServiceException

addListener

public java.lang.String addListener(javax.xml.namespace.QName[] serviceData,
                                    java.util.Calendar timeout,
                                    HandleType sourceHandle,
                                    NotificationSinkCallback callback)
                             throws java.rmi.RemoteException,
                                    GridServiceException
Subscribes to a set of service data entries of the specified service to receive notifications of the SDEs state change.

Parameters:
serviceData - a set of service data names to subscribe to.
timeout - the timeout of the subscription. If null, timeout returned by getDefaultSubscriptionTimeout() is used.
sourceHandle - the GSH of the service to subscribe to.
callback - the notification sink.
Returns:
an id of this subscription.
Throws:
java.rmi.RemoteException
GridServiceException

addListener

public java.lang.String addListener(javax.xml.namespace.QName[] serviceData,
                                    java.util.Calendar timeout,
                                    HandleType sourceHandle,
                                    NotificationSinkCallback callback,
                                    ExtensibilityType subscriptionExpression)
                             throws java.rmi.RemoteException,
                                    GridServiceException
Deprecated. Use addListener() instead.

Throws:
java.rmi.RemoteException
GridServiceException

addListener

public java.lang.String addListener(java.util.Calendar timeout,
                                    HandleType sourceHandle,
                                    NotificationSinkCallback callback,
                                    ExtensibilityType subscriptionExpression)
                             throws java.rmi.RemoteException,
                                    GridServiceException
Subscribes to a set of service data entries of the specified service to receive notifications of the SDEs state change.

Parameters:
timeout - the timeout of the subscription. If null, timeout returned by getDefaultSubscriptionTimeout() is used.
sourceHandle - the GSH of the service to subscribe to.
callback - the notification sink.
subscriptionExpression - the subscription type to perform.
Returns:
an id of this subscription.
Throws:
java.rmi.RemoteException
GridServiceException

removeListener

public void removeListener(java.lang.String subscriptionID)
                    throws java.rmi.RemoteException,
                           GridServiceException
Unsubscribes a notification sink.

Parameters:
subscriptionID - the id of the subscription to unsubscribe.
Throws:
java.rmi.RemoteException
GridServiceException

unregisterListener

public void unregisterListener(java.lang.String subscriptionID)
Removes the listener from the subscription map. This method is helpful to remove a subscription that is destroyed by methods other than the removeListenerMethods, for e.g: - terminationTime - destroy


startListening

public void startListening(boolean isMainThread)
                    throws GridServiceException
Throws:
GridServiceException

startListening

public void startListening()
                    throws GridServiceException
Throws:
GridServiceException

stopListening

public void stopListening()
                   throws GridServiceException
Throws:
GridServiceException

isListening

public boolean isListening()


Copyright ? 1999 University of Chicago and The University of Southern California. All Rights Reserved.