Class SolrIndexProjectResourceObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
-
- org.ametys.plugins.workspaces.indexing.project.SolrIndexProjectResourceObserver
-
- All Implemented Interfaces:
AsyncObserver,Observer,LogEnabled,Contextualizable,Serviceable
public class SolrIndexProjectResourceObserver extends AbstractSolrIndexResourceObserver
Component for indexingProjectresources. Project are indexed in default and live systematically since there is currently no workflow on project resources.
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrProjectResourceIndexer_solrProjectResourceIndexerThe Solr indexer for project resources-
Fields inherited from class org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
_context, _resolver, _solrIndexer, DISABLE_INDEXING_KEY
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description SolrIndexProjectResourceObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]getWorkspacesToIndex()Get the list of workspace to indexprotected booleanisHandledResource(AmetysObject object)Returns true if it is aResourceorResourceCollectionhandled by this observerprotected voidonCollectionRenamedOrMoved(ResourceCollection resourceCollection, String workspaceName)Method called when a resource collection handled by this observer is renamed or moved.protected voidonResourceCreated(Resource resource, String workspaceName)Method called when a resource handled by this observer is created.protected voidonResourceUpdated(Resource resource, String workspaceName)Method called when a resource handled by this observer is updated, moved or renamed.voidservice(ServiceManager serviceManager)-
Methods inherited from class org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
_index, contextualize, getPriority, observe, supports
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.core.observation.AsyncObserver
parallelizable
-
-
-
-
Field Detail
-
_solrProjectResourceIndexer
protected SolrProjectResourceIndexer _solrProjectResourceIndexer
The Solr indexer for project resources
-
-
Constructor Detail
-
SolrIndexProjectResourceObserver
public SolrIndexProjectResourceObserver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSolrIndexResourceObserver- Throws:
ServiceException
-
getWorkspacesToIndex
protected String[] getWorkspacesToIndex()
Description copied from class:AbstractSolrIndexResourceObserverGet the list of workspace to index- Specified by:
getWorkspacesToIndexin classAbstractSolrIndexResourceObserver- Returns:
- An array of workspace names
-
isHandledResource
protected boolean isHandledResource(AmetysObject object)
Description copied from class:AbstractSolrIndexResourceObserverReturns true if it is aResourceorResourceCollectionhandled by this observer- Specified by:
isHandledResourcein classAbstractSolrIndexResourceObserver- Parameters:
object- The resource or collection- Returns:
- true if it is handled by this observer
-
onResourceCreated
protected void onResourceCreated(Resource resource, String workspaceName) throws Exception
Description copied from class:AbstractSolrIndexResourceObserverMethod called when a resource handled by this observer is created. Typically for indexing the created resource.- Specified by:
onResourceCreatedin classAbstractSolrIndexResourceObserver- Parameters:
resource- The created resourceworkspaceName- The workspace name- Throws:
Exception- if an error occurs
-
onResourceUpdated
protected void onResourceUpdated(Resource resource, String workspaceName) throws Exception
Description copied from class:AbstractSolrIndexResourceObserverMethod called when a resource handled by this observer is updated, moved or renamed. Typically for indexing the updated resource.- Specified by:
onResourceUpdatedin classAbstractSolrIndexResourceObserver- Parameters:
resource- The updated resourceworkspaceName- The workspace name- Throws:
Exception- if an error occurs
-
onCollectionRenamedOrMoved
protected void onCollectionRenamedOrMoved(ResourceCollection resourceCollection, String workspaceName) throws Exception
Description copied from class:AbstractSolrIndexResourceObserverMethod called when a resource collection handled by this observer is renamed or moved. Typically for indexing the children of the resource collection.- Specified by:
onCollectionRenamedOrMovedin classAbstractSolrIndexResourceObserver- Parameters:
resourceCollection- The resource collectionworkspaceName- The workspace name- Throws:
Exception- if an error occurs
-
-