org.globus.ogsa.impl.ogsi
Class NotificationSourceProvider

java.lang.Object
  extended byorg.globus.ogsa.impl.ogsi.NotificationSourceProvider
All Implemented Interfaces:
GridServiceCallback, NotificationProvider, OperationProvider, ServiceDataListener, ServiceDataValueCallback
Direct Known Subclasses:
SecureNotificationSourceProvider

public class NotificationSourceProvider
extends java.lang.Object
implements NotificationProvider, ServiceDataListener, OperationProvider, ServiceDataValueCallback, GridServiceCallback

Notification source implementation used to subscribe and notify a collection of external sinks


Field Summary
protected  GridServiceBase base
           
protected  FactoryProvider factoryProvider
           
 
Constructor Summary
NotificationSourceProvider()
           
 
Method Summary
 void activate(GridContext context)
          Called when a service becomes active after having been deactivated.
 java.lang.String addSubscription(ExtensibilityType subscriptionExpression, HandleType handle)
           
 java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames, HandleType handle)
           
 java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames, HandleType handle, java.lang.String subscriptionID)
           
 java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames, HandleType handle, java.lang.String subscriptionID, org.apache.axis.types.Duration minInterval)
           
 java.lang.String addSubscription(javax.xml.namespace.QName subscriptionName, HandleType handle, java.lang.String subscriptionID)
           
 void addTopic(javax.xml.namespace.QName topic, javax.xml.namespace.QName messageType)
           
 void addTopic(java.lang.String topic, javax.xml.namespace.QName messageType)
           
 void deactivate(GridContext context)
          Called just before a service gets deactivated.
protected  java.lang.String getNotificationFactoryProperty(org.apache.axis.MessageContext ctx)
           
 javax.xml.namespace.QName[] getOperations()
          Called during initialization when the Grid service needs to find out what operations are supported by this provider.
protected  java.lang.Object getSDEValue(java.util.Map cache, javax.xml.namespace.QName sdeName)
           
 java.util.Collection getServiceDataValues(javax.xml.namespace.QName qname)
          Gets service data values requested for a service data element qname.
protected  java.lang.String getSubscriptionID()
           
 void initialize(GridServiceBase base)
          Called when the operation provider is added to a grid service.
 void notify(javax.xml.namespace.QName topic, java.lang.Object messageData)
           
 void notify(javax.xml.namespace.QName topic, java.lang.Object messageData, java.util.Map properties)
           
 void notify(javax.xml.namespace.QName topic, java.lang.Object messageData, java.util.Map properties, boolean ack)
           
 void notify(java.lang.String topic, java.lang.Object messageData)
           
 void notify(java.lang.String topic, java.lang.Object messageData, java.util.Map properties)
           
protected  void notifySDE(javax.xml.namespace.QName sdeName, java.util.Map properties, boolean ack)
          Sends out notifications.
 void notifyWithAck(javax.xml.namespace.QName topic, java.lang.Object messageData)
           
 void notifyWithAck(javax.xml.namespace.QName topic, java.lang.Object messageData, java.util.Map properties)
           
 void notifyWithAck(java.lang.String topic, java.lang.Object messageData)
           
 void notifyWithAck(java.lang.String topic, java.lang.Object messageData, java.util.Map properties)
           
 void postCreate(GridContext context)
          Called when a service has been created and all of its configuration has been set up.
 void preCreate(GridServiceBase base)
          Called when a service object is created.
 void preDestroy(GridContext context)
          Called just before a service gets destroyed.
 void removeSubscription(java.lang.String id)
           
 void serviceDataChanged(ServiceData data, boolean ack)
          notifies the listener that a service data element has changed
 void subscribe(ExtensibilityType subscriptionExpression, LocatorType sink, ExtendedDateTimeType expirationTime, LocatorTypeHolder subscriptionInstanceLocator, TerminationTimeTypeHolder currentTerminationTime)
           
 java.util.Iterator subscriptionServiceIterator(GridContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected GridServiceBase base

factoryProvider

protected FactoryProvider factoryProvider
Constructor Detail

NotificationSourceProvider

public NotificationSourceProvider()
Method Detail

preCreate

public void preCreate(GridServiceBase base)
               throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service object is created.

Specified by:
preCreate in interface GridServiceCallback
Parameters:
base - the Grid service that is in the process of creating this service object, or if this is a persistent Grid service it points to the service to be created.
Throws:
GridServiceException - if the service should not be created

postCreate

public void postCreate(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service has been created and all of its configuration has been set up.

Specified by:
postCreate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service that was created.
Throws:
GridServiceException - if the service creation should be aborted

activate

public void activate(GridContext context)
              throws GridServiceException
Description copied from interface: GridServiceCallback
Called when a service becomes active after having been deactivated. A service is always activated before any methods can be called on it.

Specified by:
activate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the service activation should be aborted

deactivate

public void deactivate(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called just before a service gets deactivated. When a service is deactivated it is subject to garbage collection, so if state is to be survive deactivation it has to be checkpointed into persistent storage. A deactivated service is however still discoverable by clients.

Specified by:
deactivate in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the service deactivation failed

preDestroy

public void preDestroy(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
Called just before a service gets destroyed. After this call is made the framework removes all knowledge about the service, so it is a good place to clean up service resources. Note that this call can be triggered both by a client initiated destroy call, as well as a framework initiated softstate timeout.

Specified by:
preDestroy in interface GridServiceCallback
Parameters:
context - state information currently associated with the service
Throws:
GridServiceException - if the destruction failed (will be reported to clients in the case of explicit destroy calls)

getOperations

public javax.xml.namespace.QName[] getOperations()
Description copied from interface: OperationProvider
Called during initialization when the Grid service needs to find out what operations are supported by this provider.

Specified by:
getOperations in interface OperationProvider
Returns:
an array of operation qnames as defined in WSDL. An OperationProvider can use the empty string "" to denote that all operations with a certain local name are implemented. Similarly the wildcard "*" can be used in the local part of the qname to denote that all operations within a certain namespace are implemented. Combining these two approaches and returning: new QName[] {new QName("","*")}, will result in all incoming operations being redirected to this provider (apart from the OGSI defined GridService interface operations provided by the GridServiceBase implementation. Note that individual operations in the OGSI namespace could still be overridded with this approach, but not using the 'all namespaces and all operation' wildcard.

initialize

public void initialize(GridServiceBase base)
                throws GridServiceException
Description copied from interface: OperationProvider
Called when the operation provider is added to a grid service.

Specified by:
initialize in interface OperationProvider
Parameters:
base - the service this provider is being associated with
Throws:
GridServiceException - if the initialization (and service creation is to be aborted)

getServiceDataValues

public java.util.Collection getServiceDataValues(javax.xml.namespace.QName qname)
Description copied from interface: ServiceDataValueCallback
Gets service data values requested for a service data element qname.

Specified by:
getServiceDataValues in interface ServiceDataValueCallback
Parameters:
qname - name of service data element (all values will be wrapped inside of element tags with this qname)
Returns:
a collection of service data values, if the collection is empty or null, the evaluator will ignore this service data element.

getSubscriptionID

protected java.lang.String getSubscriptionID()

addSubscription

public java.lang.String addSubscription(ExtensibilityType subscriptionExpression,
                                        HandleType handle)
                                 throws GridServiceException,
                                        TargetInvalidFaultType,
                                        ExtensibilityNotSupportedFaultType
Specified by:
addSubscription in interface NotificationProvider
Throws:
GridServiceException
TargetInvalidFaultType
ExtensibilityNotSupportedFaultType

addSubscription

public java.lang.String addSubscription(javax.xml.namespace.QName subscriptionName,
                                        HandleType handle,
                                        java.lang.String subscriptionID)
                                 throws TargetInvalidFaultType
Specified by:
addSubscription in interface NotificationProvider
Throws:
TargetInvalidFaultType

addSubscription

public java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames,
                                        HandleType handle)
                                 throws TargetInvalidFaultType
Specified by:
addSubscription in interface NotificationProvider
Throws:
TargetInvalidFaultType

addSubscription

public java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames,
                                        HandleType handle,
                                        java.lang.String subscriptionID)
                                 throws TargetInvalidFaultType
Specified by:
addSubscription in interface NotificationProvider
Throws:
TargetInvalidFaultType

addSubscription

public java.lang.String addSubscription(javax.xml.namespace.QName[] sdeNames,
                                        HandleType handle,
                                        java.lang.String subscriptionID,
                                        org.apache.axis.types.Duration minInterval)
                                 throws TargetInvalidFaultType
Throws:
TargetInvalidFaultType

removeSubscription

public void removeSubscription(java.lang.String id)
                        throws TargetInvalidFaultType
Specified by:
removeSubscription in interface NotificationProvider
Throws:
TargetInvalidFaultType

serviceDataChanged

public void serviceDataChanged(ServiceData data,
                               boolean ack)
Description copied from interface: ServiceDataListener
notifies the listener that a service data element has changed

Specified by:
serviceDataChanged in interface ServiceDataListener
Parameters:
data - service data element that has changed
ack - a hint whether the notifier expects notifications sent off as a result of this notificaiton to be acknowledged

getSDEValue

protected java.lang.Object getSDEValue(java.util.Map cache,
                                       javax.xml.namespace.QName sdeName)
                                throws GridServiceException
Throws:
GridServiceException

notifySDE

protected void notifySDE(javax.xml.namespace.QName sdeName,
                         java.util.Map properties,
                         boolean ack)
Sends out notifications. If a subscription was created for a number of SDEs, the values of the difference SDEs will be aggregated and sent as one big message.


getNotificationFactoryProperty

protected java.lang.String getNotificationFactoryProperty(org.apache.axis.MessageContext ctx)

subscribe

public void subscribe(ExtensibilityType subscriptionExpression,
                      LocatorType sink,
                      ExtendedDateTimeType expirationTime,
                      LocatorTypeHolder subscriptionInstanceLocator,
                      TerminationTimeTypeHolder currentTerminationTime)
               throws java.rmi.RemoteException,
                      FaultType,
                      TargetInvalidFaultType,
                      ExtensibilityNotSupportedFaultType,
                      ExtensibilityTypeFaultType
Throws:
java.rmi.RemoteException
FaultType
TargetInvalidFaultType
ExtensibilityNotSupportedFaultType
ExtensibilityTypeFaultType

addTopic

public void addTopic(java.lang.String topic,
                     javax.xml.namespace.QName messageType)
              throws TopicAlreadyExistsException,
                     GridServiceException
Specified by:
addTopic in interface NotificationProvider
Throws:
TopicAlreadyExistsException
GridServiceException

addTopic

public void addTopic(javax.xml.namespace.QName topic,
                     javax.xml.namespace.QName messageType)
              throws TopicAlreadyExistsException,
                     GridServiceException
Specified by:
addTopic in interface NotificationProvider
Throws:
TopicAlreadyExistsException
GridServiceException

notify

public void notify(java.lang.String topic,
                   java.lang.Object messageData)
Specified by:
notify in interface NotificationProvider

notify

public void notify(javax.xml.namespace.QName topic,
                   java.lang.Object messageData)
Specified by:
notify in interface NotificationProvider

notifyWithAck

public void notifyWithAck(java.lang.String topic,
                          java.lang.Object messageData)

notifyWithAck

public void notifyWithAck(javax.xml.namespace.QName topic,
                          java.lang.Object messageData)

notify

public void notify(java.lang.String topic,
                   java.lang.Object messageData,
                   java.util.Map properties)
Specified by:
notify in interface NotificationProvider

notify

public void notify(javax.xml.namespace.QName topic,
                   java.lang.Object messageData,
                   java.util.Map properties)
Specified by:
notify in interface NotificationProvider

notifyWithAck

public void notifyWithAck(javax.xml.namespace.QName topic,
                          java.lang.Object messageData,
                          java.util.Map properties)

notifyWithAck

public void notifyWithAck(java.lang.String topic,
                          java.lang.Object messageData,
                          java.util.Map properties)

notify

public void notify(javax.xml.namespace.QName topic,
                   java.lang.Object messageData,
                   java.util.Map properties,
                   boolean ack)

subscriptionServiceIterator

public java.util.Iterator subscriptionServiceIterator(GridContext ctx)
                                               throws GridServiceException
Throws:
GridServiceException


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