de.fzj.unicore.uas.client
Class EnumerationClient<T>

java.lang.Object
  extended by de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
      extended by de.fzj.unicore.uas.client.BaseUASClient
          extended by de.fzj.unicore.uas.client.EnumerationClient<T>
All Implemented Interfaces:
java.lang.Iterable<T>

public class EnumerationClient<T>
extends BaseUASClient
implements java.lang.Iterable<T>

a client to access an enumeration service

Author:
schuller

Field Summary
 
Fields inherited from class de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
epr, proxyMaker, retryDecider, securityProperties, url
 
Constructor Summary
EnumerationClient(org.w3.x2005.x08.addressing.EndpointReferenceType address, IUASSecurityProperties sec, javax.xml.namespace.QName resultQName)
          create a new enumeration client
EnumerationClient(org.w3.x2005.x08.addressing.EndpointReferenceType address, javax.xml.namespace.QName resultQName)
          create a new enumeration client
EnumerationClient(java.lang.String url, org.w3.x2005.x08.addressing.EndpointReferenceType epr, IUASSecurityProperties sec, javax.xml.namespace.QName resultQName)
          create a new enumeration client
 
Method Summary
protected  Enumeration getEnumeration()
           
 long getNumberOfResults()
          get the total number of results that are available
 org.w3.x2005.x08.addressing.EndpointReferenceType getParentServiceEPR()
          get the address of the parent service instance
 eu.unicore.unicore6.enumeration.EnumerationPropertiesDocument getResourcePropertiesDocument()
           
 java.util.List<T> getResults(long offset, long length)
          get a batch of results of the given length, starting at the given offset
 java.util.Iterator<T> iterator()
          returns an iterator over the availble results.
 void setBatchSize(int batchSize)
          set the batch size that is used by the iterator() method
 
Methods inherited from class de.fzj.unicore.uas.client.BaseUASClient
extractReceiver, getSecurityProperties, getServerVersion, setRetryDefaults
 
Methods inherited from class de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
checkConnection, checkConnection, destroy, getConnectionStatus, getCurrentTime, getEPR, getLT, getMultipleResourceProperties, getResourceProperty, getResourcePropertyDocument, GetResourcePropertyDocument, getRP, getTerminationTime, getUpdateInterval, getUrl, makeProxy, queryResourceProperties, setConnectionTimeout, setConnectionTimeout, setRetryHandler, setTerminationTime, setUpdateInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumerationClient

public EnumerationClient(java.lang.String url,
                         org.w3.x2005.x08.addressing.EndpointReferenceType epr,
                         IUASSecurityProperties sec,
                         javax.xml.namespace.QName resultQName)
                  throws java.lang.Exception
create a new enumeration client

Parameters:
url - - the URL to connect to
epr - - the EPR of the target service
sec - - the security settings to use
resultQName - - the type of XML documents that are enumerated
Throws:
java.lang.Exception

EnumerationClient

public EnumerationClient(org.w3.x2005.x08.addressing.EndpointReferenceType address,
                         IUASSecurityProperties sec,
                         javax.xml.namespace.QName resultQName)
                  throws java.lang.Exception
create a new enumeration client

Parameters:
epr - - the EPR of the target service
sec - - the security settings to use
resultQName - - the type of XML documents that are enumerated
Throws:
java.lang.Exception

EnumerationClient

public EnumerationClient(org.w3.x2005.x08.addressing.EndpointReferenceType address,
                         javax.xml.namespace.QName resultQName)
                  throws java.lang.Exception
create a new enumeration client

Parameters:
epr - - the EPR of the target service
resultQName - - the type of XML documents that are enumerated
Throws:
java.lang.Exception
Method Detail

getResults

public java.util.List<T> getResults(long offset,
                                    long length)
                             throws java.lang.Exception
get a batch of results of the given length, starting at the given offset

Parameters:
offset - - the offset into the result set
length - - the number of results
Throws:
java.lang.Exception

iterator

public java.util.Iterator<T> iterator()
returns an iterator over the availble results. This will lazily fetch more results as they are needed. NOTE: the methods will throw a RuntimeException in case any of the remote methods throw an exception

Specified by:
iterator in interface java.lang.Iterable<T>

getResourcePropertiesDocument

public eu.unicore.unicore6.enumeration.EnumerationPropertiesDocument getResourcePropertiesDocument()
                                                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getNumberOfResults

public long getNumberOfResults()
                        throws java.lang.Exception
get the total number of results that are available

Returns:
Throws:
java.lang.Exception

getParentServiceEPR

public org.w3.x2005.x08.addressing.EndpointReferenceType getParentServiceEPR()
                                                                      throws java.lang.Exception
get the address of the parent service instance

Returns:
Throws:
java.lang.Exception

getEnumeration

protected Enumeration getEnumeration()
                              throws java.lang.Exception
Throws:
java.lang.Exception

setBatchSize

public void setBatchSize(int batchSize)
set the batch size that is used by the iterator() method

Parameters:
batchSize - - the batch size, which is expected to be larger than 1


Copyright © 2006-2010 Research Center Juelich. All Rights Reserved.