Package org.ametys.plugins.blog.observer
Class AbstractBlogObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.blog.observer.AbstractBlogObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
- Direct Known Subclasses:
SolrBlogContentDeletedOrUnpublishedObserver
,SolrBlogContentValidatedObserver
public abstract class AbstractBlogObserver
extends AbstractLogEnabled
implements Observer, Contextualizable, Serviceable
Abstract
Observer
for observing event on blog-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BlogPageHandler
The blog cache managerprotected Context
The context.protected AmetysObjectResolver
The ametys object resolver.protected SolrPageIndexer
The solr page indexer.Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
_internalObserve
(Event event, Page postPage, WebContent postContent) Do the actual work.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.void
Observes an event.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_context
The context. -
_blogRootPageHandler
The blog cache manager -
_resolver
The ametys object resolver. -
_solrPageIndexer
The solr page indexer.
-
-
Constructor Details
-
AbstractBlogObserver
public AbstractBlogObserver()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPriority
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in interfaceObserver
- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
observe
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in 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.
-
_internalObserve
Do the actual work.- Parameters:
event
- the observation event.postPage
- the Page holding the virtual factory.postContent
- the post content
-