org.globus.ws.enumeration
Class EnumResource

java.lang.Object
  extended by org.globus.ws.enumeration.EnumResource
All Implemented Interfaces:
PersistenceCallback, RemoveCallback, Resource, ResourceIdentifier, ResourceLifetime
Direct Known Subclasses:
TransientEnumResource

public class EnumResource
extends java.lang.Object
implements Resource, ResourceLifetime, ResourceIdentifier, PersistenceCallback, RemoveCallback

Represents a persistent enumeration context. The enumeration resource has lifetime information and a reference to the EnumIterator object that provides access to the enumeration data. The enumeration resource also contains VisibilityProperties that control access to the enumeration resource and data.


Field Summary
private static org.globus.util.I18n i18n
           
protected  boolean isDuration
           
protected  EnumIterator iter
           
protected  java.lang.Object key
           
private static FilePersistenceHelper persistenceHelper
           
protected  java.util.Calendar terminationTime
           
private static org.apache.axis.components.uuid.UUIDGen uuidGen
           
protected  VisibilityProperties visibility
           
 
Constructor Summary
EnumResource()
           
EnumResource(EnumIterator iter, VisibilityProperties visibility)
          Creates EnumResource with given iterator and visibility properties.
 
Method Summary
 java.util.Calendar getCurrentTime()
          Get the current time
 java.lang.Object getID()
          Returns the unique id of the resource.
 EnumIterator getIterator()
          Gets the data iterator.
private  java.io.File getKeyAsFile(java.lang.Object key)
           
private static FilePersistenceHelper getPersistenceHelper()
           
 java.util.Calendar getTerminationTime()
          Get the termination time
 VisibilityProperties getVisibility()
          Gets the visibility properties.
 boolean isDuration()
          Gets whether this resource lifetime is expressed as a duration or a specific time/date.
 void load(ResourceKey key)
          Loads the resource state.
 void remove()
          Notifies that the resource was removed.
 void setDuration(boolean duration)
          Sets whether this resource lifetime is expressed as a duration or a specific time/date.
 void setTerminationTime(java.util.Calendar time)
          Set the termination time
 void store()
          Saves the resource state.
 
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

uuidGen

private static final org.apache.axis.components.uuid.UUIDGen uuidGen

persistenceHelper

private static FilePersistenceHelper persistenceHelper

key

protected java.lang.Object key

isDuration

protected boolean isDuration

terminationTime

protected java.util.Calendar terminationTime

iter

protected EnumIterator iter

visibility

protected VisibilityProperties visibility
Constructor Detail

EnumResource

public EnumResource()

EnumResource

public EnumResource(EnumIterator iter,
                    VisibilityProperties visibility)
Creates EnumResource with given iterator and visibility properties.

Parameters:
iter - the data iterator. Cannot be null.
visibility - the visibility properties. Cannot be null.
Method Detail

getIterator

public EnumIterator getIterator()
Gets the data iterator.

Returns:
the data iterator.

getVisibility

public VisibilityProperties getVisibility()
Gets the visibility properties.

Returns:
the visibility properties.

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.

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

setDuration

public void setDuration(boolean duration)
Sets whether this resource lifetime is expressed as a duration or a specific time/date.

Parameters:
duration - if true, the lifetime of this resource will be returned as a duration. If false, the lifetime of this resource will be returned as a specific time/date.

isDuration

public boolean isDuration()
Gets whether this resource lifetime is expressed as a duration or a specific time/date.

Returns:
if true, the lifetime of this resource will be returned as a duration. If false, the lifetime of this resource will be returned as a specific time/date.

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

load

public void load(ResourceKey key)
          throws ResourceException
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.

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.

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.

getKeyAsFile

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

getPersistenceHelper

private static FilePersistenceHelper getPersistenceHelper()