gov.nih.nci.cagrid.wsenum.utils
Class PersistantSDKObjectIterator

java.lang.Object
  extended by gov.nih.nci.cagrid.wsenum.utils.BaseSDKObjectIterator
      extended by gov.nih.nci.cagrid.wsenum.utils.PersistantSDKObjectIterator
All Implemented Interfaces:
org.globus.ws.enumeration.EnumIterator

public class PersistantSDKObjectIterator
extends BaseSDKObjectIterator

PersistantSDKObjectIterator Enumeration iterator which provides for persisting caCORE SDK objects to disk

Version:
$Id: PersistantSDKObjectIterator.java,v 1.2 2007/06/06 16:59:27 dervin Exp $
Author:
David W. Ervin

Method Summary
static org.globus.ws.enumeration.EnumIterator createIterator(java.util.Iterator objectIter, javax.xml.namespace.QName objectQName, java.io.InputStream wsddInput)
          Serializes a List of caCORE SDK generated objects to a temp file on the local disk, then creates an EnumIterator which can return those objects.
static org.globus.ws.enumeration.EnumIterator createIterator(java.util.Iterator objectIter, javax.xml.namespace.QName objectQName, java.io.InputStream wsddInput, java.lang.String tempFilename)
          Serializes a List of caCORE SDK generated objects to a specified file on the local disk, then creates an EnumIterator which can return those objects.
static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects, javax.xml.namespace.QName objectQName)
           
static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects, javax.xml.namespace.QName objectQName, java.io.InputStream wsddInput)
          Serializes a List of caCORE SDK generated objects to a temp file on the local disk, then creates an EnumIterator which can return those objects.
static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects, javax.xml.namespace.QName objectQName, java.io.InputStream wsddInput, java.lang.String tempFilename)
          Serializes a List of caCORE SDK generated objects to a specified file on the local disk, then creates an EnumIterator which can return those objects.
 org.globus.ws.enumeration.IterationResult next(org.globus.ws.enumeration.IterationConstraints constraints)
          Retrieves the next set of items of the enumeration.
 
Methods inherited from class gov.nih.nci.cagrid.wsenum.utils.BaseSDKObjectIterator
enumerationIsReleased, getNextXmlChunk, getObjectQName, release, wrapUpElements, writeSdkObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createIterator

public static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects,
                                                                    javax.xml.namespace.QName objectQName)
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

createIterator

public static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects,
                                                                    javax.xml.namespace.QName objectQName,
                                                                    java.io.InputStream wsddInput)
                                                             throws java.lang.Exception
Serializes a List of caCORE SDK generated objects to a temp file on the local disk, then creates an EnumIterator which can return those objects. NOTE: The temp file is created in the current user's home directory /.cagrid/SDKEnumIterator directory. For security reasons, access to this location must be controlled in a production data environment.

Parameters:
objects - The list of caCORE SDK objects to be enumerated
objectQName - The QName of the objects
wsddInput - An input stream to the WSDD configuration file
Returns:
An enum iterator instance to iterate the given objects
Throws:
java.lang.Exception

createIterator

public static org.globus.ws.enumeration.EnumIterator createIterator(java.util.Iterator objectIter,
                                                                    javax.xml.namespace.QName objectQName,
                                                                    java.io.InputStream wsddInput)
                                                             throws java.lang.Exception
Serializes a List of caCORE SDK generated objects to a temp file on the local disk, then creates an EnumIterator which can return those objects. NOTE: The temp file is created in the current user's home directory /.cagrid/SDKEnumIterator directory. For security reasons, access to this location must be controlled in a production data environment.

Parameters:
objectIter - An iterator to a collection of caCORE SDK objects to be enumerated
objectQName - The QName of the objects
wsddInput - An input stream to the WSDD configuration file
Returns:
An enum iterator instance to iterate the given objects
Throws:
java.lang.Exception

createIterator

public static org.globus.ws.enumeration.EnumIterator createIterator(java.util.List objects,
                                                                    javax.xml.namespace.QName objectQName,
                                                                    java.io.InputStream wsddInput,
                                                                    java.lang.String tempFilename)
                                                             throws java.lang.Exception
Serializes a List of caCORE SDK generated objects to a specified file on the local disk, then creates an EnumIterator which can return those objects.

Parameters:
objects - The list of caCORE SDK objects to be enumerated
objectQName - The QName of the objects
tempFilename - The name of the file to serialize objects into. NOTE: For security reasons, access to this location must be controlled in a production data environment.
wsddInput - An input stream of the WSDD configuration file
Returns:
An enum iterator instance to iterate the given objects
Throws:
java.lang.Exception

createIterator

public static org.globus.ws.enumeration.EnumIterator createIterator(java.util.Iterator objectIter,
                                                                    javax.xml.namespace.QName objectQName,
                                                                    java.io.InputStream wsddInput,
                                                                    java.lang.String tempFilename)
                                                             throws java.lang.Exception
Serializes a List of caCORE SDK generated objects to a specified file on the local disk, then creates an EnumIterator which can return those objects.

Parameters:
objectIter - An iterator to a collection of caCORE SDK objects to be enumerated
objectQName - The QName of the objects
tempFilename - The name of the file to serialize objects into. NOTE: For security reasons, access to this location must be controlled in a production data environment.
wsddInput - An input stream of the WSDD configuration file
Returns:
An enum iterator instance to iterate the given objects
Throws:
java.lang.Exception

next

public org.globus.ws.enumeration.IterationResult next(org.globus.ws.enumeration.IterationConstraints constraints)
                                               throws org.globus.ws.enumeration.TimeoutException,
                                                      java.util.NoSuchElementException
Retrieves the next set of items of the enumeration. Note: This implementation ignores the maxCharacters iteration constraint

Parameters:
constraints - the constrains for this iteration. Can be null. If null, default constraints must be assumed.
Returns:
the result of this iteration that fulfils the specified constraints. It must always be non-null.
Throws:
org.globus.ws.enumeration.TimeoutException - if maxTime constraint was specified and the enumeration data was not collected within that time. This is never thrown in this implementation
java.util.NoSuchElementException - if iterator has no more elements