Class CMISAPI.ChangesIterator

  • Enclosing class:
    CMISAPI

    protected class CMISAPI.ChangesIterator
    extends org.exoplatform.services.cms.clouddrives.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 Detail

      • changes

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

        protected boolean firstRun
        The first run.
      • hasMoreItems

        protected boolean hasMoreItems
        The has more items.
      • cleanNext

        protected boolean cleanNext
        The clean next.
    • Constructor Detail

      • ChangesIterator

        protected ChangesIterator​(CMISAPI.ChangeToken startChangeToken)
                           throws CMISException,
                                  org.exoplatform.services.cms.clouddrives.CloudDriveAccessException
        Instantiates a new changes iterator.
        Parameters:
        startChangeToken - the start change token
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
    • Method Detail

      • nextChunk

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

        protected boolean hasNextChunk()
        Specified by:
        hasNextChunk in class org.exoplatform.services.cms.clouddrives.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
      • hasNext

        public boolean hasNext()
                        throws org.exoplatform.services.cms.clouddrives.CloudDriveException
        Overrides:
        hasNext in class org.exoplatform.services.cms.clouddrives.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveException
      • next

        public org.apache.chemistry.opencmis.client.api.ChangeEvent next()
                                                                  throws NoSuchElementException,
                                                                         org.exoplatform.services.cms.clouddrives.CloudDriveException
        Overrides:
        next in class org.exoplatform.services.cms.clouddrives.utils.ChunkIterator<org.apache.chemistry.opencmis.client.api.ChangeEvent>
        Throws:
        NoSuchElementException
        org.exoplatform.services.cms.clouddrives.CloudDriveException
      • getLastChangeToken

        protected CMISAPI.ChangeToken getLastChangeToken()
        Last consumed event change token. Can be the same as start token. Can be empty 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