org.globus.wsrf.impl.notification
Class SimpleSubscription

java.lang.Object
  extended by org.globus.wsrf.impl.notification.SimpleSubscription
All Implemented Interfaces:
java.io.Serializable, LocalInvocationEnabledSubscription, PausableSubscription, RemoveCallback, Resource, ResourceIdentifier, ResourceLifetime, ResourceProperties, SecureResource, Subscription
Direct Known Subclasses:
PersistentSubscription

public class SimpleSubscription
extends java.lang.Object
implements LocalInvocationEnabledSubscription, ResourceProperties, ResourceIdentifier, ResourceLifetime, RemoveCallback, SecureResource, java.io.Serializable

Simple in-memory implementation of a subscription resource

See Also:
Serialized Form

Field Summary
protected  NotifyCallback callback
           
protected  org.globus.axis.message.addressing.EndpointReferenceType consumerReference
           
protected  java.util.Calendar creationTime
           
protected  FilterType filter
           
protected  java.lang.String id
           
protected  boolean isPaused
           
(package private) static org.apache.commons.logging.Log logger
           
protected  SubscribeSubscriptionPolicy policy
           
protected  java.lang.String producerHomeLocation
           
protected  ResourceKey producerKey
           
protected  org.globus.axis.message.addressing.EndpointReferenceType producerReference
           
private  ResourcePropertySet propertySet
           
protected  ResourceSecurityDescriptor resourceSecurityDescriptor
           
static javax.xml.namespace.QName RP_SET
           
protected  ClientSecurityDescriptor securityDescriptor
           
protected  java.util.Calendar terminationTime
           
protected  TopicExpressionType topicExpression
           
protected  boolean useNotify
           
 
Constructor Summary
SimpleSubscription()
           
SimpleSubscription(org.globus.axis.message.addressing.EndpointReferenceType consumerReference, org.globus.axis.message.addressing.EndpointReferenceType producerReference, java.util.Calendar initialTerminationTime, SubscribeSubscriptionPolicy policy, FilterType filter, TopicExpressionType topicExpression, ResourceKey producerKey, java.lang.String producerHomeLocation, ClientSecurityDescriptor notificationSecurityDescriptor, ResourceSecurityDescriptor resourceSecurityDescriptor, java.lang.String id, boolean isPaused)
          Construct a new subscription resource.
SimpleSubscription(org.globus.axis.message.addressing.EndpointReferenceType consumerReference, org.globus.axis.message.addressing.EndpointReferenceType producerReference, java.util.Calendar initialTerminationTime, SubscribeSubscriptionPolicy policy, FilterType filter, TopicExpressionType topicExpression, ResourceKey producerKey, java.lang.String producerHomeLocation, ClientSecurityDescriptor notificationSecurityDescriptor, ResourceSecurityDescriptor resourceSecurityDescriptor, java.lang.String id, boolean isPaused, NotifyCallback callback)
          Construct a new subscription resource (for use in local invocations).
 
Method Summary
 NotifyCallback getCallback()
          Get the object that implements NotifyCallback If any.
 org.globus.axis.message.addressing.EndpointReferenceType getConsumerReference()
          Get the consumer endpoint reference associated with this subscription
 java.util.Calendar getCreationTime()
          Get the time at which the resource was created.
 java.util.Calendar getCurrentTime()
          Get the current time
 FilterType getFilterType()
           
 java.lang.Object getID()
          Returns the unique id of the resource.
 org.globus.axis.message.addressing.EndpointReferenceType getProducerReference()
          Get the producer endpoint reference associated with this subscription
 java.lang.Object getResource()
          Get the producing resource
 ResourcePropertySet getResourcePropertySet()
          Returns ResourcePropertySet.
 ResourceSecurityDescriptor getSecurityDescriptor()
          Method to retrieve the security descriptor for this resource.
 ClientSecurityDescriptor getSecurityProperties()
          Get security properties that determine security for the notification call.
 SubscribeSubscriptionPolicy getSubscriptionPolicy()
           
 java.util.Calendar getTerminationTime()
          Get the termination time
 TopicExpressionType getTopicExpression()
          Get the topic expression associated with this subscription
 boolean getUseNotify()
          Wrap notification messages in the notify element?
 boolean isPaused()
          Is the subscription paused?
 void pause()
          Pause the subscription
 void remove()
          Notifies that the resource was removed.
private  boolean removeListener(java.util.Collection topics)
           
 void resume()
          Resume the subscription
 void setTerminationTime(java.util.Calendar time)
          Set the termination time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.commons.logging.Log logger

RP_SET

public static final javax.xml.namespace.QName RP_SET

consumerReference

protected org.globus.axis.message.addressing.EndpointReferenceType consumerReference

producerReference

protected org.globus.axis.message.addressing.EndpointReferenceType producerReference

policy

protected SubscribeSubscriptionPolicy policy

producerKey

protected ResourceKey producerKey

producerHomeLocation

protected java.lang.String producerHomeLocation

topicExpression

protected TopicExpressionType topicExpression

terminationTime

protected java.util.Calendar terminationTime

creationTime

protected java.util.Calendar creationTime

filter

protected FilterType filter

securityDescriptor

protected ClientSecurityDescriptor securityDescriptor

id

protected java.lang.String id

resourceSecurityDescriptor

protected ResourceSecurityDescriptor resourceSecurityDescriptor

callback

protected NotifyCallback callback

useNotify

protected boolean useNotify

isPaused

protected boolean isPaused

propertySet

private transient ResourcePropertySet propertySet
Constructor Detail

SimpleSubscription

public SimpleSubscription()

SimpleSubscription

public SimpleSubscription(org.globus.axis.message.addressing.EndpointReferenceType consumerReference,
                          org.globus.axis.message.addressing.EndpointReferenceType producerReference,
                          java.util.Calendar initialTerminationTime,
                          SubscribeSubscriptionPolicy policy,
                          FilterType filter,
                          TopicExpressionType topicExpression,
                          ResourceKey producerKey,
                          java.lang.String producerHomeLocation,
                          ClientSecurityDescriptor notificationSecurityDescriptor,
                          ResourceSecurityDescriptor resourceSecurityDescriptor,
                          java.lang.String id,
                          boolean isPaused)
Construct a new subscription resource.

Parameters:
consumerReference - The WS-Addressing endpoint reference of the consumer
producerReference - The WS-Addressing endpoint reference of the producer
initialTerminationTime - The initial termination time of this resource
policy - The subscription policy
producerKey - The key of the producer resource
producerHomeLocation - The JNDI location of the home of the producer resource
topicExpression - The topic expression for this subscription
notificationSecurityDescriptor - Security settings for notify
resourceSecurityDescriptor - Security settings for this subscription resource
id - The resource identifier

SimpleSubscription

public SimpleSubscription(org.globus.axis.message.addressing.EndpointReferenceType consumerReference,
                          org.globus.axis.message.addressing.EndpointReferenceType producerReference,
                          java.util.Calendar initialTerminationTime,
                          SubscribeSubscriptionPolicy policy,
                          FilterType filter,
                          TopicExpressionType topicExpression,
                          ResourceKey producerKey,
                          java.lang.String producerHomeLocation,
                          ClientSecurityDescriptor notificationSecurityDescriptor,
                          ResourceSecurityDescriptor resourceSecurityDescriptor,
                          java.lang.String id,
                          boolean isPaused,
                          NotifyCallback callback)
Construct a new subscription resource (for use in local invocations).

Parameters:
consumerReference - The WS-Addressing endpoint reference of the consumer
producerReference - The WS-Addressing endpoint reference of the producer
initialTerminationTime - The initial termination time of this resource
policy - The subscription policy
precondition - The precondition
selector - The selector
producerKey - The key of the producer resource
producerHomeLocation - The JNDI location of the home of the producer resource
topicExpression - The topic expression for this subscription
isPaused - The initial pause/resume state
useNotify - Whether to use raw notifications or not.
notificationSecurityDescriptor - Security settings for notify
resourceSecurityDescriptor - Security settings for this subscription resource
id - The resource identifier
notifyCallback - Called directly if it's a local call
Method Detail

getResourcePropertySet

public ResourcePropertySet getResourcePropertySet()
Description copied from interface: ResourceProperties
Returns ResourcePropertySet.

Specified by:
getResourcePropertySet in interface ResourceProperties
Returns:
ResourcePropertySet.

setTerminationTime

public void setTerminationTime(java.util.Calendar time)
Description copied from interface: ResourceLifetime
Set the termination time

Specified by:
setTerminationTime in interface ResourceLifetime
Parameters:
time - The termination time to set

getTerminationTime

public java.util.Calendar getTerminationTime()
Description copied from interface: ResourceLifetime
Get the termination time

Specified by:
getTerminationTime in interface ResourceLifetime
Returns:
The termination time

getCurrentTime

public java.util.Calendar getCurrentTime()
Description copied from interface: ResourceLifetime
Get the current time

Specified by:
getCurrentTime in interface ResourceLifetime
Returns:
The current time

getCreationTime

public java.util.Calendar getCreationTime()
Description copied from interface: Subscription
Get the time at which the resource was created.

Specified by:
getCreationTime in interface Subscription
Returns:
The creation time

getConsumerReference

public org.globus.axis.message.addressing.EndpointReferenceType getConsumerReference()
Description copied from interface: Subscription
Get the consumer endpoint reference associated with this subscription

Specified by:
getConsumerReference in interface Subscription
Returns:
The consumer endpoint reference

getSubscriptionPolicy

public SubscribeSubscriptionPolicy getSubscriptionPolicy()

getProducerReference

public org.globus.axis.message.addressing.EndpointReferenceType getProducerReference()
Description copied from interface: Subscription
Get the producer endpoint reference associated with this subscription

Specified by:
getProducerReference in interface Subscription
Returns:
The producer endpoint reference

getResource

public java.lang.Object getResource()
                             throws java.lang.Exception
Description copied from interface: Subscription
Get the producing resource

Specified by:
getResource in interface Subscription
Returns:
The producing resource
Throws:
java.lang.Exception

getTopicExpression

public TopicExpressionType getTopicExpression()
Description copied from interface: Subscription
Get the topic expression associated with this subscription

Specified by:
getTopicExpression in interface Subscription
Returns:
The topic expression

getUseNotify

public boolean getUseNotify()
Description copied from interface: Subscription
Wrap notification messages in the notify element?

Specified by:
getUseNotify in interface Subscription
Returns:
True (default) if notify should be used, false if not.

getSecurityProperties

public ClientSecurityDescriptor getSecurityProperties()
Description copied from interface: Subscription
Get security properties that determine security for the notification call. If any. Returns null for insecure subcriptions

Specified by:
getSecurityProperties in interface Subscription
Returns:
map of security properties.

getFilterType

public FilterType getFilterType()
Specified by:
getFilterType in interface Subscription

isPaused

public boolean isPaused()
Description copied from interface: PausableSubscription
Is the subscription paused?

Specified by:
isPaused in interface PausableSubscription
Returns:
True if the subscription is paused, false if not.

pause

public void pause()
           throws java.lang.Exception
Description copied from interface: PausableSubscription
Pause the subscription

Specified by:
pause in interface PausableSubscription
Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception
Description copied from interface: PausableSubscription
Resume the subscription

Specified by:
resume in interface PausableSubscription
Throws:
java.lang.Exception

getCallback

public NotifyCallback getCallback()
Description copied from interface: LocalInvocationEnabledSubscription
Get the object that implements NotifyCallback If any. Returns null for insecure subcriptions

Specified by:
getCallback in interface LocalInvocationEnabledSubscription
Returns:
callback

getID

public java.lang.Object getID()
Description copied from interface: ResourceIdentifier
Returns the unique id of the resource. In most cases this value should match value returned by ResoureKey.getValue().

Specified by:
getID in interface ResourceIdentifier
Returns:
the id of the resource.

remove

public void remove()
            throws ResourceException
Description copied from interface: RemoveCallback
Notifies that the resource was removed. This function must not be called directly on the resource object. Only ResourceHome.remove() is allowed to call that method during the remove operation.

Specified by:
remove in interface RemoveCallback
Throws:
ResourceException - if the remove operation fails.

removeListener

private boolean removeListener(java.util.Collection topics)

getSecurityDescriptor

public ResourceSecurityDescriptor getSecurityDescriptor()
Description copied from interface: SecureResource
Method to retrieve the security descriptor for this resource. If the descriptor does not have Subject and GridMap set, then it is recommended that ResourceSecurityConfig be used initialize the descriptor object. If the initialized is set to true, in the returned descriptor, then no initialization is done.

Specified by:
getSecurityDescriptor in interface SecureResource
Returns:
resource security descriptor for the resource. Can be null.