Class AbstractLiveSolrObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.indexing.observation.AbstractLiveSolrObserver
- All Implemented Interfaces:
 IndexingObserver,Observer,LogEnabled,Prioritizable,Supporter<Event>,Contextualizable,Serviceable
- Direct Known Subclasses:
 AbstractTagObserver,SolrContentUnpublishedPart1Observer,SolrContentUnpublishedPart2Observer,SolrLiveContentValidatedOrTaggedObserver,SolrPageMovePart1Observer,SolrPageMovePart2Observer,SolrPageRenameObserver
public abstract class AbstractLiveSolrObserver
extends AbstractLogEnabled
implements IndexingObserver, Contextualizable, Serviceable
Abstract 
Observer for synchronizing the live solr index.- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe Avalon context.protected AmetysObjectResolverThe ametys object resolver.protected SolrIndexerThe Solr indexer.protected SolrPageIndexerThe Solr page indexer.Fields inherited from interface org.ametys.cms.indexing.IndexingObserver
INDEXING_OBSERVERFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected void_deletePageDocumentsForContent(String contentId) Deletes Solr page documents associated with a content.protected Page_getPageInLive(String pageId) Returns the page in the live workspace corresponding to a given id.protected abstract void_updateIndex(Event event, Map<String, Object> transientVars) Update the index from the event observed.protected void_updatePageDocument(String pageId) Updates a Solr document referencing a page.protected void_updatePageDocument(String pageId, boolean indexRecursively) Updates a Solr document referencing a page.protected void_updatePageDocumentsForContent(String contentId) Updates Solr page documents associated with a content.voidcontextualize(Context context) intGet the priority for the component.voidObserves an event.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.indexing.IndexingObserver
getTraits 
- 
Field Details
- 
_context
The Avalon context. - 
_resolver
The ametys object resolver. - 
_solrIndexer
The Solr indexer. - 
_solrPageIndexer
The Solr page indexer. 
 - 
 - 
Constructor Details
- 
AbstractLiveSolrObserver
public AbstractLiveSolrObserver() 
 - 
 - 
Method Details
- 
contextualize
- Specified by:
 contextualizein interfaceContextualizable- Throws:
 ContextException
 - 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
getPriority
Description copied from interface:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
 getPriorityin interfacePrioritizable- Returns:
 - the priority
 
 - 
observe
Description copied from interface:ObserverObserves an event.- Specified by:
 observein interfaceObserver- Parameters:
 event- the event.transientVars- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
 Exception- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
 - 
_updateIndex
protected abstract void _updateIndex(Event event, Map<String, Object> transientVars) throws ExceptionUpdate the index from the event observed.- Parameters:
 event- the event.transientVars- the transient vars passed from one Observer to another when processing a single Event.- Throws:
 Exception- if an error occurs.
 - 
_updatePageDocumentsForContent
Updates Solr page documents associated with a content.- Parameters:
 contentId- the content id.- Throws:
 Exception- if an error occurs.
 - 
_deletePageDocumentsForContent
Deletes Solr page documents associated with a content.- Parameters:
 contentId- the content id.- Throws:
 Exception- if an error occurs.
 - 
_updatePageDocument
Updates a Solr document referencing a page.- Parameters:
 pageId- the page id.- Throws:
 Exception- if an error occurs.
 - 
_updatePageDocument
Updates a Solr document referencing a page.- Parameters:
 pageId- the page id.indexRecursively- to also process children pages.- Throws:
 Exception- if an error occurs.
 - 
_getPageInLive
Returns the page in the live workspace corresponding to a given id.- Parameters:
 pageId- the page id.- Returns:
 - the page in the live workspace or null if not present.
 
 
 -