com.tivoli.pd.rgy
Interface RgyIterator


public interface RgyIterator

Returned by methods in RgyRegistry for iterating over lists of user or group names (either SAM or Native) found during a search of the registry.

Multiple threads should not access the same instance of this interface at the same time.

Unlike all other Rgy class methods, this class will not fail-over if the registry server fails in the middle of it's operation. It will simply throw a ServerDownRgyException. The exploiter of this class must deal with the issue and retry their operation. If a new instance of RgyIterator is created, it will choose a registry server that is working to begin it's search on, if one is available.


Method Summary
 void close()
          This methods primary purpose is to allow the iteration to be aborted early, before hasNext() has returned false or RgyIterator method has thrown an RgyException.
 boolean hasNext()
          Used to determine if the iteration has more elements to return.
 java.lang.String next()
          Returns the next element in the iteration.
 

Method Detail

hasNext

boolean hasNext()
                throws RgyException
Used to determine if the iteration has more elements to return. In the case when an RgyException is throws by this method, it can be assumed the close method has been invoked and need not be used.

Returns:
true if the iterator has more elements.
Throws:
SizeLimitExceededRgyException - if more results are available than the maxResults specified when this RgyIterator was obtained. This only occurs after maxResults iterations have been completed.
RgyException

next

java.lang.String next()
                      throws RgyException
Returns the next element in the iteration.

Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.
RgyException

close

void close()
This methods primary purpose is to allow the iteration to be aborted early, before hasNext() has returned false or RgyIterator method has thrown an RgyException. Close should be called in the abort case so that the underlying registry connection is promptly released back into the pool of available connections.

Normally close is called automatically. Close() can be called multiple times without issue.