public abstract class AbstractSolrIndexResourceObserver extends AbstractLogEnabled implements AsyncObserver, Contextualizable, Serviceable
| Modifier and Type | Field and Description | 
|---|---|
| protected Context | _contextThe component context. | 
| protected AmetysObjectResolver | _resolverThe AmetysObject resolver. | 
| protected SolrIndexer | _solrIndexerThe Solr indexer. | 
| static String | DISABLE_INDEXING_KEYRequest attribute disabling content indexation when set to  true. | 
MAX_PRIORITY, MIN_PRIORITY| Constructor and Description | 
|---|
| AbstractSolrIndexResourceObserver() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | _index(Event event,
      String workspaceName)Perform the indexation process | 
| void | contextualize(Context context) | 
| int | getPriority(Event event)Retrieves the priority to observe this event. This can be used to process a supported event before others observers. | 
| protected abstract String[] | getWorkspacesToIndex()Get the list of workspace to index | 
| protected abstract boolean | isHandledResource(AmetysObject object)Returns true if it is a  ResourceorResourceCollectionhandled by this observer | 
| void | observe(Event event,
       Map<String,Object> transientVars)Observes an event. | 
| protected abstract void | onCollectionRenamedOrMoved(ResourceCollection resourceCollection,
                          String workspaceName)Method called when a resource collection handled by this observer is renamed or moved. | 
| protected abstract void | onResourceCreated(Resource resource,
                 String workspaceName)Method called when a resource handled by this observer is created. | 
| protected abstract void | onResourceUpdated(Resource resource,
                 String workspaceName)Method called when a resource handled by this observer is updated, moved or renamed. | 
| void | service(ServiceManager serviceManager) | 
| boolean | supports(Event event)Checks if the event is supported. | 
getLogger, setLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparallelizablepublic static final String DISABLE_INDEXING_KEY
true.protected SolrIndexer _solrIndexer
protected AmetysObjectResolver _resolver
public AbstractSolrIndexResourceObserver()
public void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void service(ServiceManager serviceManager) throws ServiceException
service in interface ServiceableServiceExceptionpublic boolean supports(Event event)
Observerpublic int getPriority(Event event)
ObservergetPriority in interface Observerevent - the event.public void observe(Event event, Map<String,Object> transientVars) throws Exception
Observerobserve in interface Observerevent - the event.transientVars - transientVars passed from one Observer to another when processing a single Event. 
 This may allow optimizations between observers.Exception - if an error occurs. 
 All exceptions will be logged but not propagated, as the observation mechanism should never fail.protected abstract String[] getWorkspacesToIndex()
protected void _index(Event event, String workspaceName) throws IndexingException
event - The current eventworkspaceName - The workspace name for the indexationIndexingException - if an error occurs during indexation.protected abstract boolean isHandledResource(AmetysObject object)
Resource or ResourceCollection handled by this observerobject - The resource or collectionprotected abstract void onResourceCreated(Resource resource, String workspaceName) throws Exception
resource - The created resourceworkspaceName - The workspace nameException - if an error occursprotected abstract void onResourceUpdated(Resource resource, String workspaceName) throws Exception
resource - The updated resourceworkspaceName - The workspace nameException - if an error occursprotected abstract void onCollectionRenamedOrMoved(ResourceCollection resourceCollection, String workspaceName) throws Exception
resourceCollection - The resource collectionworkspaceName - The workspace nameException - if an error occurs