Class AclTracker

All Implemented Interfaces:
Tracker

public class AclTracker extends ActivatableTracker
Multithreaded ACL Tracker implementation.
Author:
Matt Ward
  • Field Details

    • 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:
  • Constructor Details

  • Method Details

    • getWriteLock

      public 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 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(String iterationId) throws 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:
      Throwable
    • maintenance

      public void maintenance() throws Exception
      Throws:
      Exception
    • hasMaintenance

      public boolean hasMaintenance()
    • indexAclChangeSets

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

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

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

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

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

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

      public void addAclChangeSetToReindex(Long aclChangeSetToReindex)
    • addAclChangeSetToIndex

      public void addAclChangeSetToIndex(Long aclChangeSetToIndex)
    • addAclChangeSetToPurge

      public void addAclChangeSetToPurge(Long aclChangeSetToPurge)
    • addAclToReindex

      public void addAclToReindex(Long aclToReindex)
    • addAclToIndex

      public void addAclToIndex(Long aclToIndex)
    • addAclToPurge

      public void addAclToPurge(Long aclToPurge)
    • clearScheduledMaintenanceWork

      protected void clearScheduledMaintenanceWork()
      Description copied from class: ActivatableTracker
      Cleans up the scheduled maintenance work collected by this tracker.
      Overrides:
      clearScheduledMaintenanceWork in class ActivatableTracker
    • trackRepository

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

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

      protected 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, Long fromCommitTime, long timeStep, int maxResults, long endTime) throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException
      Throws:
      org.alfresco.httpclient.AuthenticationException
      IOException
      org.json.JSONException
    • indexAcl

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

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

      public List<Long> getAclsForDbAclTransaction(Long acltxid)
    • checkAcl

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

      protected void trackAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, 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
      IOException
      org.json.JSONException
    • invalidateState

      public void invalidateState()
      Specified by:
      invalidateState in interface Tracker
      Overrides:
      invalidateState in class AbstractTracker