Package org.alfresco.solr.tracker
Class AclTracker
- java.lang.Object
-
- org.alfresco.solr.tracker.AbstractTracker
-
- org.alfresco.solr.tracker.ActivatableTracker
-
- org.alfresco.solr.tracker.AclTracker
-
- All Implemented Interfaces:
Tracker
public class AclTracker extends ActivatableTracker
Multithreaded ACLTrackerimplementation.- Author:
- Matt Ward
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.solr.tracker.Tracker
Tracker.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGGER-
Fields inherited from class org.alfresco.solr.tracker.ActivatableTracker
isEnabled
-
Fields inherited from class org.alfresco.solr.tracker.AbstractTracker
client, coreName, props, rollback, rollbackCausedBy, shardCount, shardInstance, shardKey, shardProperty, state, trackerId, transformContent, type
-
-
Constructor Summary
Constructors Constructor Description AclTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAclChangeSetToIndex(Long aclChangeSetToIndex)voidaddAclChangeSetToPurge(Long aclChangeSetToPurge)voidaddAclChangeSetToReindex(Long aclChangeSetToReindex)voidaddAclToIndex(Long aclToIndex)voidaddAclToPurge(Long aclToPurge)voidaddAclToReindex(Long aclToReindex)org.alfresco.solr.AclReportcheckAcl(Long aclid)org.alfresco.solr.tracker.IndexHealthReportcheckIndex(Long toAclTx, Long fromTime, Long toTime)protected voidclearScheduledMaintenanceWork()Cleans up the scheduled maintenance work collected by this tracker.protected voiddoTrack(String iterationId)Subclasses must implement behaviour that completes the following steps, in order: Purge Reindex Index Track repositoryList<Long>getAclsForDbAclTransaction(Long acltxid)protected LonggetChangeSetFromCommitTime(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, long lastGoodChangeSetCommitTimeInIndex)SemaphoregetRunLock()Trackers implementing this method should decide if the Run Lock is applied globally for every Tracker Thread (static) or locally for each running Threadprotected org.alfresco.solr.client.AclChangeSetsgetSomeAclChangeSets(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, Long fromCommitTime, long timeStep, int maxResults, long endTime)SemaphoregetWriteLock()Trackers implementing this method should decide if the Write Lock is applied globally for every Tracker Thread (static) or locally for each running ThreadbooleanhasMaintenance()protected voidindexAcl(List<org.alfresco.solr.client.AclReaders> aclReaderList, boolean overwrite)protected voidindexAclChangeSets()protected voidindexAcls()voidinvalidateState()voidmaintenance()protected voidpurgeAclChangeSets()protected voidpurgeAcls()protected voidreindexAclChangeSets()protected voidreindexAcls()protected voidtrackAclChangeSets()Every ACL Change Set contains a list of ACLs to be indexed.protected voidtrackRepository()-
Methods inherited from class org.alfresco.solr.tracker.ActivatableTracker
disable, enable, isDisabled, isEnabled, logAndClear, track
-
Methods inherited from class org.alfresco.solr.tracker.AbstractTracker
checkNode, getDocRouter, getProps, getRollback, getRollbackCausedBy, getTrackerState, getType, isAlreadyInShutDownMode, setRollback, setShutdown, shutdown
-
-
-
-
Constructor Detail
-
AclTracker
public AclTracker(Properties p, org.alfresco.solr.client.SOLRAPIClient client, String coreName, InformationServer informationServer)
-
-
Method Detail
-
getWriteLock
public Semaphore getWriteLock()
Description copied from class:AbstractTrackerTrackers 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:
getWriteLockin interfaceTracker- Specified by:
getWriteLockin classAbstractTracker
-
getRunLock
public Semaphore getRunLock()
Description copied from class:AbstractTrackerTrackers 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:
getRunLockin classAbstractTracker
-
doTrack
protected void doTrack(String iterationId) throws Throwable
Description copied from class:AbstractTrackerSubclasses must implement behaviour that completes the following steps, in order:- Purge
- Reindex
- Index
- Track repository
- Specified by:
doTrackin classAbstractTracker- Parameters:
iterationId- an identifier which is uniquely associated with a given iteration.- Throws:
Throwable
-
hasMaintenance
public boolean hasMaintenance()
-
indexAclChangeSets
protected void indexAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
indexAcls
protected void indexAcls() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
reindexAclChangeSets
protected void reindexAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
reindexAcls
protected void reindexAcls() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONException- Throws:
org.alfresco.httpclient.AuthenticationExceptionIOExceptionorg.json.JSONException
-
purgeAclChangeSets
protected void purgeAclChangeSets() throws IOException, org.json.JSONException- Throws:
IOExceptionorg.json.JSONException
-
purgeAcls
protected void purgeAcls() throws IOException, org.json.JSONException- Throws:
IOExceptionorg.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:ActivatableTrackerCleans up the scheduled maintenance work collected by this tracker.- Overrides:
clearScheduledMaintenanceWorkin classActivatableTracker
-
trackRepository
protected void trackRepository() throws IOException, org.alfresco.httpclient.AuthenticationException, org.json.JSONException- Throws:
IOExceptionorg.alfresco.httpclient.AuthenticationExceptionorg.json.JSONException
-
getChangeSetFromCommitTime
protected Long getChangeSetFromCommitTime(org.alfresco.solr.BoundedDeque<org.alfresco.solr.client.AclChangeSet> changeSetsFound, long lastGoodChangeSetCommitTimeInIndex)
- Parameters:
changeSetsFound- BoundedDequelastGoodChangeSetCommitTimeInIndex- 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.AuthenticationExceptionIOExceptionorg.json.JSONException
-
indexAcl
protected void indexAcl(List<org.alfresco.solr.client.AclReaders> aclReaderList, boolean overwrite) throws IOException
- Parameters:
aclReaderList- Listoverwrite- 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.AuthenticationExceptionIOExceptionorg.json.JSONException
-
checkAcl
public org.alfresco.solr.AclReport checkAcl(Long aclid)
-
trackAclChangeSets
protected void trackAclChangeSets() throws org.alfresco.httpclient.AuthenticationException, IOException, org.json.JSONExceptionEvery 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.AuthenticationExceptionIOExceptionorg.json.JSONException
-
invalidateState
public void invalidateState()
- Specified by:
invalidateStatein interfaceTracker- Overrides:
invalidateStatein classAbstractTracker
-
-