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

java.lang.Object
  extended by gov.nih.nci.cagrid.wsenum.utils.BaseSDKObjectIterator
All Implemented Interfaces:
org.globus.ws.enumeration.EnumIterator
Direct Known Subclasses:
ConcurrenPersistantObjectEnumIterator, PersistantSDKObjectIterator, SimplePersistantSDKObjectIterator

public abstract class BaseSDKObjectIterator
extends java.lang.Object
implements org.globus.ws.enumeration.EnumIterator

BaseSDKObjectIterator Base class to consolidate some functionality of SDK object enum iterators

Version:
$Id: BaseSDKObjectIterator.java,v 1.1 2007/05/16 15:00:57 dervin Exp $
Author:
David Ervin

Constructor Summary
protected BaseSDKObjectIterator(java.io.File file, javax.xml.namespace.QName objectQName)
           
 
Method Summary
protected  boolean enumerationIsReleased()
           
protected  java.lang.String getNextXmlChunk()
          Reads the next chunk of XML from the file
protected  javax.xml.namespace.QName getObjectQName()
           
 void release()
          Releases the enumeration and cleans up resources.
protected  org.globus.ws.enumeration.IterationResult wrapUpElements(java.util.List<javax.xml.soap.SOAPElement> soapElements, boolean end)
          Encapsulates converting the list of SOAPElements to an array, then an Iteration Result
protected static void writeSdkObjects(java.util.Iterator objIter, javax.xml.namespace.QName name, java.lang.String filename, java.lang.StringBuffer wsddContents)
          Writes the SDK serializable objects to disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.ws.enumeration.EnumIterator
next
 

Constructor Detail

BaseSDKObjectIterator

protected BaseSDKObjectIterator(java.io.File file,
                                javax.xml.namespace.QName objectQName)
                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

writeSdkObjects

protected static void writeSdkObjects(java.util.Iterator objIter,
                                      javax.xml.namespace.QName name,
                                      java.lang.String filename,
                                      java.lang.StringBuffer wsddContents)
                               throws java.lang.Exception
Writes the SDK serializable objects to disk

Parameters:
objects - The list of objects to write out
name - The QName of the objects
filename - The filename to store the objects into
wsddContents - The contents of the WSDD configuration file
Throws:
java.lang.Exception

getNextXmlChunk

protected java.lang.String getNextXmlChunk()
                                    throws java.io.IOException
Reads the next chunk of XML from the file

Returns:
Null if no more XML is found
Throws:
java.io.IOException

wrapUpElements

protected org.globus.ws.enumeration.IterationResult wrapUpElements(java.util.List<javax.xml.soap.SOAPElement> soapElements,
                                                                   boolean end)
Encapsulates converting the list of SOAPElements to an array, then an Iteration Result

Parameters:
soapElements -
end -
Returns:
An iteration result wrapping the result list

release

public void release()
Releases the enumeration and cleans up resources. Deletes the temporary persistance file

Specified by:
release in interface org.globus.ws.enumeration.EnumIterator

enumerationIsReleased

protected boolean enumerationIsReleased()

getObjectQName

protected javax.xml.namespace.QName getObjectQName()