org.globus.wsrf.impl.notification
Class PersistentSubscription

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

public class PersistentSubscription
extends SimpleSubscription
implements PersistenceCallback

See Also:
Serialized Form

Field Summary
private static java.lang.String FILE_SUFFIX
           
private static org.globus.util.I18n i18n
           
private  FilePersistenceHelper persistenceHelper
           
private  boolean removed
           
 
Fields inherited from class org.globus.wsrf.impl.notification.SimpleSubscription
callback, consumerReference, creationTime, filter, id, isPaused, logger, policy, producerHomeLocation, producerKey, producerReference, resourceSecurityDescriptor, RP_SET, securityDescriptor, terminationTime, topicExpression, useNotify
 
Constructor Summary
PersistentSubscription()
           
PersistentSubscription(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)
           
PersistentSubscription(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)
           
 
Method Summary
private  java.io.File getKeyAsFile(java.lang.Object key)
           
protected  FilePersistenceHelper getPersistenceHelper()
           
 void load(java.io.File file)
           
 void load(ResourceKey key)
          Loads the resource state.
 void pause()
          Pause the subscription
 void remove()
          Notifies that the resource was removed.
 void resume()
          Resume the subscription
 void setTerminationTime(java.util.Calendar time)
          Set the termination time
 void store()
          Saves the resource state.
 
Methods inherited from class org.globus.wsrf.impl.notification.SimpleSubscription
getCallback, getConsumerReference, getCreationTime, getCurrentTime, getFilterType, getID, getProducerReference, getResource, getResourcePropertySet, getSecurityDescriptor, getSecurityProperties, getSubscriptionPolicy, getTerminationTime, getTopicExpression, getUseNotify, isPaused
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i18n

private static org.globus.util.I18n i18n

persistenceHelper

private transient FilePersistenceHelper persistenceHelper

FILE_SUFFIX

private static final java.lang.String FILE_SUFFIX
See Also:
Constant Field Values

removed

private boolean removed
Constructor Detail

PersistentSubscription

public PersistentSubscription()

PersistentSubscription

public PersistentSubscription(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)

PersistentSubscription

public PersistentSubscription(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)
Method Detail

load

public void load(ResourceKey key)
          throws ResourceException,
                 NoSuchResourceException,
                 InvalidResourceKeyException
Description copied from interface: PersistenceCallback
Loads the resource state.

Specified by:
load in interface PersistenceCallback
Throws:
NoSuchResourceException - if no resource state exists for the specified key.
InvalidResourceKeyException - if the resource key is invalid.
ResourceException - if the load operation fails for any other reason.

load

public void load(java.io.File file)
          throws ResourceException,
                 NoSuchResourceException,
                 InvalidResourceKeyException
Throws:
ResourceException
NoSuchResourceException
InvalidResourceKeyException

store

public void store()
           throws ResourceException
Description copied from interface: PersistenceCallback
Saves the resource state.

Specified by:
store in interface PersistenceCallback
Throws:
ResourceException - if the store operation fails.

getKeyAsFile

private java.io.File getKeyAsFile(java.lang.Object key)
                           throws InvalidResourceKeyException
Throws:
InvalidResourceKeyException

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
Overrides:
remove in class SimpleSubscription
Throws:
ResourceException - if the remove operation fails.

getPersistenceHelper

protected FilePersistenceHelper getPersistenceHelper()

setTerminationTime

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

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

pause

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

Specified by:
pause in interface PausableSubscription
Overrides:
pause in class SimpleSubscription
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
Overrides:
resume in class SimpleSubscription
Throws:
java.lang.Exception