org.exoplatform.clouddrive.cmis
Class CMISAPI.ChangesIterator

java.lang.Object
  extended by org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
      extended by org.exoplatform.clouddrive.cmis.CMISAPI.ChangesIterator
Enclosing class:
CMISAPI

protected class CMISAPI.ChangesIterator
extends org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>

Iterator over set of drive change events from CMIS Change Log. The iterator will fetch all available events since a given start token.This iterator hides next-chunk logic on request to the service.
Iterator methods can throw CMISException in case of remote or communication errors.


Field Summary
protected  List<org.apache.chemistry.opencmis.client.api.ChangeEvent> changes
           
protected  CMISAPI.ChangeToken changeToken
           
protected  boolean cleanNext
           
protected  boolean firstRun
           
protected  boolean hasMoreItems
           
protected  CMISAPI.ChangeToken lastFetchedToken
           
protected  CMISAPI.ChangeToken latestChunkToken
           
 
Fields inherited from class org.exoplatform.clouddrive.utils.ChunkIterator
available, fetched, iter, next
 
Constructor Summary
protected CMISAPI.ChangesIterator(CMISAPI.ChangeToken startChangeToken)
           
 
Method Summary
protected  CMISAPI.ChangeToken getLastChangeToken()
          Last consumed event change token.
 boolean hasNext()
          
protected  boolean hasNextChunk()
          
 org.apache.chemistry.opencmis.client.api.ChangeEvent next()
          
protected  Iterator<org.apache.chemistry.opencmis.client.api.ChangeEvent> nextChunk()
           
 
Methods inherited from class org.exoplatform.clouddrive.utils.ChunkIterator
available, getAvailable, getFetched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changeToken

protected CMISAPI.ChangeToken changeToken

lastFetchedToken

protected CMISAPI.ChangeToken lastFetchedToken

latestChunkToken

protected CMISAPI.ChangeToken latestChunkToken

changes

protected List<org.apache.chemistry.opencmis.client.api.ChangeEvent> changes

firstRun

protected boolean firstRun

hasMoreItems

protected boolean hasMoreItems

cleanNext

protected boolean cleanNext
Constructor Detail

CMISAPI.ChangesIterator

protected CMISAPI.ChangesIterator(CMISAPI.ChangeToken startChangeToken)
                           throws CMISException,
                                  org.exoplatform.clouddrive.CloudDriveAccessException
Throws:
CMISException
org.exoplatform.clouddrive.CloudDriveAccessException
Method Detail

nextChunk

protected Iterator<org.apache.chemistry.opencmis.client.api.ChangeEvent> nextChunk()
                                                                            throws CMISException,
                                                                                   org.exoplatform.clouddrive.CloudDriveAccessException
Specified by:
nextChunk in class org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
Throws:
CMISException
org.exoplatform.clouddrive.CloudDriveAccessException

hasNextChunk

protected boolean hasNextChunk()

Specified by:
hasNextChunk in class org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>

hasNext

public boolean hasNext()
                throws org.exoplatform.clouddrive.CloudDriveException

Overrides:
hasNext in class org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
Throws:
org.exoplatform.clouddrive.CloudDriveException

next

public org.apache.chemistry.opencmis.client.api.ChangeEvent next()
                                                          throws NoSuchElementException,
                                                                 org.exoplatform.clouddrive.CloudDriveException

Overrides:
next in class org.exoplatform.clouddrive.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
Throws:
NoSuchElementException
org.exoplatform.clouddrive.CloudDriveException

getLastChangeToken

protected CMISAPI.ChangeToken getLastChangeToken()
Last consumed event change token. Can be the same as start token. Can be null if no data received by fetching and if CMIS service doesn't return the chunk latest token.

Returns:
CMISAPI.ChangeToken last fetched change token, token of last fetched events portion or null


Copyright © 2003–2015 eXo Platform SAS. All rights reserved.