org.gcube.contentmanagement.contentmanager.stubs.calls.iterators
Class AsyncRSIterator<T>

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.BaseRSIterator<T>
      extended by org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.AsyncRSIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>, RemoteIterator<T>

public class AsyncRSIterator<T>
extends BaseRSIterator<T>
implements java.util.Iterator<T>

A RemoteIterator over a ResultSet with an embedded ResultParser and the ability to deliver parsing failures asynchronously.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
AsyncRSIterator(java.net.URI l, ResultParser<T> p, int timeout)
          Creates an instance with a result set locator, a result parser, and a reading timeout.
AsyncRSIterator(java.net.URI l, ResultParser<T> p, int timeout, FaultListener fl)
          Creates an instance with a result set locator, a result parser, a reading timeout, and a fault listener.
 
Method Summary
 boolean hasNext()
          Indicates whether there are more elements to iterate over.
 T next()
          Returns the next element.
 void remove()
          
 
Methods inherited from class org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.BaseRSIterator
close, getRSIterator, locator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncRSIterator

public AsyncRSIterator(java.net.URI l,
                       ResultParser<T> p,
                       int timeout)
                throws java.lang.Exception
Creates an instance with a result set locator, a result parser, and a reading timeout.

Parameters:
l - the locator.
p - the parser.
timeout - the timeout, in seconds.
Throws:
java.lang.Exception - if the result set could not be accessed from the locator.

AsyncRSIterator

public AsyncRSIterator(java.net.URI l,
                       ResultParser<T> p,
                       int timeout,
                       FaultListener fl)
                throws java.lang.Exception
Creates an instance with a result set locator, a result parser, a reading timeout, and a fault listener.

Parameters:
l - the locator.
p - the parser.
timeout - the timeout, in seconds.
fl - the fault listener.
Throws:
java.lang.Exception - if the result set could not be accessed from the locator.
Method Detail

hasNext

public boolean hasNext()
Indicates whether there are more elements to iterate over.

Specified by:
hasNext in interface java.util.Iterator<T>
Specified by:
hasNext in interface RemoteIterator<T>
Returns:
true if there are more elements, false otherwise.

next

public T next()
Returns the next element.

Specified by:
next in interface java.util.Iterator<T>
Specified by:
next in interface RemoteIterator<T>
Returns:
the element.

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<T>