org.globus.ws.enumeration
Class ClientEnumeration

java.lang.Object
  extended by org.globus.ws.enumeration.ClientEnumeration

public class ClientEnumeration
extends java.lang.Object

Provides basic client-side API for managing enumeration lifetime and retrieving enumeration data.


Field Summary
protected  EnumerationContextType context
           
private static org.globus.util.I18n i18n
           
protected  DataSource port
           
 
Constructor Summary
ClientEnumeration(DataSource port, EnumerationContextType context)
          Creates ClientEnumeration with a given data source port and an enumeration context.
ClientEnumeration(javax.xml.rpc.Stub stub, EnumerationContextType context)
          Creates ClientEnumeration with a given stub and an enumeration context.
 
Method Summary
private  void checkContext()
           
static DataSource getAsDataSource(javax.xml.rpc.Stub stub)
          Exposes the given stub as a data source interface.
 EnumerationContextType getContext()
          Gets the current enumeration context.
 EnumExpiration getStatus()
          Gets the expiration time/duration of the enumeration.
 IterationResult pull()
          Retrieves the next set of elements of the enumeration.
 IterationResult pull(IterationConstraints constraints)
          Retrieves the next set of elements of the enumeration.
 void release()
          Releases the enumeration.
 EnumExpiration renew(EnumExpiration expiration)
          Sets a new expiration time/duration of the enumeration.
 
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

port

protected DataSource port

context

protected EnumerationContextType context
Constructor Detail

ClientEnumeration

public ClientEnumeration(DataSource port,
                         EnumerationContextType context)
Creates ClientEnumeration with a given data source port and an enumeration context.

Parameters:
port - the data source port.
context - the enumeration context.
Throws:
java.lang.IllegalArgumentException - if the port or context parameters are null.

ClientEnumeration

public ClientEnumeration(javax.xml.rpc.Stub stub,
                         EnumerationContextType context)
Creates ClientEnumeration with a given stub and an enumeration context. The stub instance must define all of the operations exposed by the DataSource interface.

Parameters:
stub - the data source stub.
context - the enumeration context.
Throws:
java.lang.IllegalArgumentException - if stub or context parameters are null or if the stub does not define all of the operations of the DataSource interface.
See Also:
getAsDataSource(Stub)
Method Detail

getAsDataSource

public static DataSource getAsDataSource(javax.xml.rpc.Stub stub)
Exposes the given stub as a data source interface.

Parameters:
stub - the stub to expose as a data source.
Returns:
the data source interface dynamic proxy for the stub.
Throws:
java.lang.IllegalArgumentException - if the stub cannot be exposed as a data source interface (the stub does not define any or all of the data source methods).

getContext

public EnumerationContextType getContext()
Gets the current enumeration context. The enumeration context can change after renew or pull operations are called or it can become null after the release operation is called.

Returns:
the current enumeration context.

pull

public IterationResult pull()
                     throws java.rmi.RemoteException
Retrieves the next set of elements of the enumeration.

Returns:
the iteration result (always non-null). It contains the next set of elements of the enumeration that meet the default constraints (see IterationConstraints).
Throws:
java.rmi.RemoteException

pull

public IterationResult pull(IterationConstraints constraints)
                     throws java.rmi.RemoteException
Retrieves the next set of elements of the enumeration.

Parameters:
constraints - the enumeration constraints. Can be null. If null the default constraints are assumed (see (IterationConstraints).
Returns:
the iteration result (always non-null). It contains the next set of elements of the enumeration that meet the specified constraints.
Throws:
java.rmi.RemoteException

release

public void release()
             throws java.rmi.RemoteException
Releases the enumeration.

Throws:
java.rmi.RemoteException

renew

public EnumExpiration renew(EnumExpiration expiration)
                     throws java.rmi.RemoteException
Sets a new expiration time/duration of the enumeration.

Parameters:
expiration - the suggested expiration time/duration of the enumeration. Can be null to configure the enumeration without an expiration time/duration (the enumeration will not expire).
Returns:
the actual expiration time accepted by the service. Can be null if the enumeration does not have the expiration time/duration.
Throws:
java.rmi.RemoteException

getStatus

public EnumExpiration getStatus()
                         throws java.rmi.RemoteException
Gets the expiration time/duration of the enumeration.

Returns:
the expiration status of the enumeration. Can be null if the enumeration does not have expiration time/duration.
Throws:
java.rmi.RemoteException

checkContext

private void checkContext()
                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException