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 indexingProject
resources. 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
_solrProjectResourceIndexer
The 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 boolean
isHandledResource(AmetysObject object)
Returns true if it is aResource
orResourceCollection
handled by this observerprotected void
onCollectionRenamedOrMoved(ResourceCollection resourceCollection, String workspaceName)
Method called when a resource collection handled by this observer is renamed or moved.protected void
onResourceCreated(Resource resource, String workspaceName)
Method called when a resource handled by this observer is created.protected void
onResourceUpdated(Resource resource, String workspaceName)
Method called when a resource handled by this observer is updated, moved or renamed.void
service(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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSolrIndexResourceObserver
- Throws:
ServiceException
-
getWorkspacesToIndex
protected String[] getWorkspacesToIndex()
Description copied from class:AbstractSolrIndexResourceObserver
Get the list of workspace to index- Specified by:
getWorkspacesToIndex
in classAbstractSolrIndexResourceObserver
- Returns:
- An array of workspace names
-
isHandledResource
protected boolean isHandledResource(AmetysObject object)
Description copied from class:AbstractSolrIndexResourceObserver
Returns true if it is aResource
orResourceCollection
handled by this observer- Specified by:
isHandledResource
in 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:AbstractSolrIndexResourceObserver
Method called when a resource handled by this observer is created. Typically for indexing the created resource.- Specified by:
onResourceCreated
in 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:AbstractSolrIndexResourceObserver
Method called when a resource handled by this observer is updated, moved or renamed. Typically for indexing the updated resource.- Specified by:
onResourceUpdated
in 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:AbstractSolrIndexResourceObserver
Method called when a resource collection handled by this observer is renamed or moved. Typically for indexing the children of the resource collection.- Specified by:
onCollectionRenamedOrMoved
in classAbstractSolrIndexResourceObserver
- Parameters:
resourceCollection
- The resource collectionworkspaceName
- The workspace name- Throws:
Exception
- if an error occurs
-
-