Class ClientIterator
- java.lang.Object
-
- org.apache.jackrabbit.rmi.client.ClientObject
-
- org.apache.jackrabbit.rmi.client.iterator.ClientIterator
-
- All Implemented Interfaces:
Iterator,RangeIterator
- Direct Known Subclasses:
ClientAccessControlPolicyIterator,ClientNodeIterator,ClientNodeTypeIterator,ClientPrincipalIterator,ClientPropertyIterator,ClientRowIterator,ClientVersionIterator
@Deprecated public abstract class ClientIterator extends ClientObject implements RangeIterator
Deprecated.RMI support is deprecated and will be removed in a future version of Jackrabbit; see Jira ticket JCR-4972 for more information.A buffering local adapter for the JCR-RMI
RemoteIteratorinterface. This class makes the remote iterator locally available using the JCRRangeIteratorinterface. The element arrays returned by the remote iterator are buffered locally.See the subclasses for type-specific versions of this abstract class.
-
-
Constructor Summary
Constructors Constructor Description ClientIterator(RemoteIterator remote, LocalAdapterFactory factory)Deprecated.Creates a local adapter for the given remote iterator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract ObjectgetObject(Object remote)Deprecated.Returns a local adapter for the given remote object.longgetPosition()Deprecated.Returns the current position within the iterator.longgetSize()Deprecated.Returns the size (the total number of elements) of this iteration.booleanhasNext()Deprecated.Checks if there are more elements in this iteration.Objectnext()Deprecated.Returns the next element in this iteration.voidremove()Deprecated.Not supported.voidskip(long skipNum)Deprecated.Skips the given number of elements in this iteration.-
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientObject
getFactory, getItem, getNode, getNodeTypeArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
ClientIterator
public ClientIterator(RemoteIterator remote, LocalAdapterFactory factory)
Deprecated.Creates a local adapter for the given remote iterator. The element buffer is initially empty.- Parameters:
remote- remote iteratorfactory- local adapter factory
-
-
Method Detail
-
getPosition
public long getPosition()
Deprecated.Returns the current position within the iterator.- Specified by:
getPositionin interfaceRangeIterator- Returns:
- current position
- See Also:
RangeIterator.getPosition()
-
getSize
public long getSize() throws RemoteRuntimeExceptionDeprecated.Returns the size (the total number of elements) of this iteration. Returns-1if the size is unknown.To minimize the number of remote method calls, the size is retrieved when this method is first called and cached for subsequent invocations.
- Specified by:
getSizein interfaceRangeIterator- Returns:
- number of elements in the iteration, or
-1 - Throws:
RemoteRuntimeException- on RMI errors- See Also:
RangeIterator.getSize()
-
skip
public void skip(long skipNum) throws NoSuchElementException, RemoteRuntimeExceptionDeprecated.Skips the given number of elements in this iteration.The elements in the local element buffer are skipped first, and a remote skip method call is made only if more elements are being skipped than remain in the local buffer.
- Specified by:
skipin interfaceRangeIterator- Parameters:
skipNum- the number of elements to skip- Throws:
NoSuchElementException- if skipped past the last elementRemoteRuntimeException- on RMI errors- See Also:
RangeIterator.skip(long)
-
hasNext
public boolean hasNext() throws RemoteRuntimeExceptionDeprecated.Checks if there are more elements in this iteration.- Specified by:
hasNextin interfaceIterator- Returns:
trueif there are more elements,falseotherwise- Throws:
RemoteRuntimeException- on RMI errors
-
getObject
protected abstract Object getObject(Object remote)
Deprecated.Returns a local adapter for the given remote object. This abstract method is used bynext()to convert the remote references returned by the remote iterator to local adapters.Subclasses should implement this method to use the local adapter factory to create local adapters of the specific element type.
- Parameters:
remote- remote object- Returns:
- local adapter
-
next
public Object next() throws NoSuchElementException, RemoteRuntimeException
Deprecated.Returns the next element in this iteration.- Specified by:
nextin interfaceIterator- Returns:
- next element
- Throws:
NoSuchElementException- if there are no more elementsRemoteRuntimeException- on RMI errors
-
remove
public void remove() throws UnsupportedOperationExceptionDeprecated.Not supported.- Specified by:
removein interfaceIterator- Throws:
UnsupportedOperationException- always thrown
-
-