Class AclTracker

    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • INITIAL_MAX_ACL_CHANGE_SET_ID

        protected static final long INITIAL_MAX_ACL_CHANGE_SET_ID
        See Also:
        Constant Field Values
    • Constructor Detail

      • AclTracker

        public AclTracker​(java.util.Properties p,
                          org.alfresco.solr.client.SOLRAPIClient client,
                          java.lang.String coreName,
                          InformationServer informationServer)
    • Method Detail

      • getWriteLock

        public java.util.concurrent.Semaphore getWriteLock()
        Description copied from class: AbstractTracker
        Trackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running Thread
        Specified by:
        getWriteLock in interface Tracker
        Specified by:
        getWriteLock in class AbstractTracker
      • getRunLock

        public java.util.concurrent.Semaphore getRunLock()
        Description copied from class: AbstractTracker
        Trackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Thread
        Specified by:
        getRunLock in class AbstractTracker
      • doTrack

        protected void doTrack​(java.lang.String iterationId)
                        throws java.lang.Throwable
        Description copied from class: AbstractTracker
        Subclasses must implement behaviour that completes the following steps, in order:
        1. Purge
        2. Reindex
        3. Index
        4. Track repository
        Specified by:
        doTrack in class AbstractTracker
        Parameters:
        iterationId - an identifier which is uniquely associated with a given iteration.
        Throws:
        java.lang.Throwable
      • maintenance

        public void maintenance()
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • hasMaintenance

        public boolean hasMaintenance()
      • indexAclChangeSets

        protected void indexAclChangeSets()
                                   throws org.alfresco.httpclient.AuthenticationException,
                                          java.io.IOException,
                                          org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • indexAcls

        protected void indexAcls()
                          throws org.alfresco.httpclient.AuthenticationException,
                                 java.io.IOException,
                                 org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • reindexAclChangeSets

        protected void reindexAclChangeSets()
                                     throws org.alfresco.httpclient.AuthenticationException,
                                            java.io.IOException,
                                            org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • reindexAcls

        protected void reindexAcls()
                            throws org.alfresco.httpclient.AuthenticationException,
                                   java.io.IOException,
                                   org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • purgeAclChangeSets

        protected void purgeAclChangeSets()
                                   throws java.io.IOException,
                                          org.json.JSONException
        Throws:
        java.io.IOException
        org.json.JSONException
      • purgeAcls

        protected void purgeAcls()
                          throws java.io.IOException,
                                 org.json.JSONException
        Throws:
        java.io.IOException
        org.json.JSONException
      • addAclChangeSetToReindex

        public void addAclChangeSetToReindex​(java.lang.Long aclChangeSetToReindex)
      • addAclChangeSetToIndex

        public void addAclChangeSetToIndex​(java.lang.Long aclChangeSetToIndex)
      • addAclChangeSetToPurge

        public void addAclChangeSetToPurge​(java.lang.Long aclChangeSetToPurge)
      • addAclToReindex

        public void addAclToReindex​(java.lang.Long aclToReindex)
      • addAclToIndex

        public void addAclToIndex​(java.lang.Long aclToIndex)
      • addAclToPurge

        public void addAclToPurge​(java.lang.Long aclToPurge)
      • trackRepository

        protected void trackRepository()
                                throws java.io.IOException,
                                       org.alfresco.httpclient.AuthenticationException,
                                       org.json.JSONException
        Throws:
        java.io.IOException
        org.alfresco.httpclient.AuthenticationException
        org.json.JSONException
      • checkRepoAndIndexConsistency

        protected void checkRepoAndIndexConsistency​(org.alfresco.solr.TrackerState state)
                                             throws org.alfresco.httpclient.AuthenticationException,
                                                    java.io.IOException,
                                                    org.json.JSONException
        Checks the first and last TX time
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • getChangeSetFromCommitTime

        protected java.lang.Long getChangeSetFromCommitTime​(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound,
                                                            long lastGoodChangeSetCommitTimeInIndex)
        Parameters:
        changeSetsFound - BoundedDeque
        lastGoodChangeSetCommitTimeInIndex - long
        Returns:
        Long
      • getSomeAclChangeSets

        protected org.alfresco.solr.client.AclChangeSets getSomeAclChangeSets​(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound,
                                                                              java.lang.Long fromCommitTime,
                                                                              long timeStep,
                                                                              int maxResults,
                                                                              long endTime)
                                                                       throws org.alfresco.httpclient.AuthenticationException,
                                                                              java.io.IOException,
                                                                              org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • indexAcl

        protected void indexAcl​(java.util.List<org.alfresco.solr.client.AclReaders> aclReaderList,
                                boolean overwrite)
                         throws java.io.IOException
        Parameters:
        aclReaderList - List
        overwrite - boolean
        Throws:
        java.io.IOException
      • checkIndex

        public org.alfresco.solr.tracker.IndexHealthReport checkIndex​(java.lang.Long toAclTx,
                                                                      java.lang.Long fromTime,
                                                                      java.lang.Long toTime)
                                                               throws org.alfresco.httpclient.AuthenticationException,
                                                                      java.io.IOException,
                                                                      org.json.JSONException
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException
      • getAclsForDbAclTransaction

        public java.util.List<java.lang.Long> getAclsForDbAclTransaction​(java.lang.Long acltxid)
      • checkAcl

        public org.alfresco.solr.AclReport checkAcl​(java.lang.Long aclid)
      • trackAclChangeSets

        protected void trackAclChangeSets()
                                   throws org.alfresco.httpclient.AuthenticationException,
                                          java.io.IOException,
                                          org.json.JSONException
        Every ACL Change Set contains a list of ACLs to be indexed. This method gets ACL Change Sets from Alfresco Repository to be indexed. The indexing is performed in batches of ACL Change Sets and the Tracker Status is updated in batched of ACLs. Tracker Status contains the Commit Time from the latest ACL Change Set indexed, so new operations can be retrieved from Repository starting with that time.
        Throws:
        org.alfresco.httpclient.AuthenticationException
        java.io.IOException
        org.json.JSONException