Class AbstractSiteCacheObserver

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.cache.AbstractSiteCacheObserver
All Implemented Interfaces:
Observer, LogEnabled, Prioritizable, Supporter<Event>, Serviceable
Direct Known Subclasses:
AbstractSurveyCacheObserver, InvalidateCacheOnContentCommentedObserver, InvalidateCacheOnContentDeletionObserver, InvalidateCacheOnContentPageModificationObserver, InvalidateCacheOnContentPageModificationObserver, InvalidateCacheOnContentReactionObserver, InvalidateCacheOnContentUnpublishObserver, InvalidateCacheOnContentValidationOrTaggingObserver, InvalidateCacheOnFormModifiedObserver, InvalidateCacheOnPageDeletionObserver, InvalidateCacheOnPageMinorChangeObserver, InvalidateCacheOnPageModificationObserver, InvalidateCacheOnPageMoveObserver, InvalidateCacheOnRobotsChangeObserver, InvalidateCacheOnZoneItemAdditionObserver, InvalidateCacheOnZoneItemDeletionObserver

public abstract class AbstractSiteCacheObserver extends AbstractLogEnabled implements Observer, Serviceable
Abstract Observer for invalidate site data.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getPriority

      public int getPriority()
      Description copied from interface: Prioritizable
      Get the priority for the component. On components using Prioritizable interface, each implementation define the order. In most cases, less is the number, more prior is the component.
      Specified by:
      getPriority in interface Prioritizable
      Returns:
      the priority
    • observe

      public void observe(Event event, Map<String,Object> transientVars) throws Exception
      Description copied from interface: Observer
      Observes an event.
      Specified by:
      observe in interface Observer
      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.
    • _getSite

      protected abstract Site _getSite(Event event)
      Retrieves the site needed for accessing the front-office.
      Parameters:
      event - the event.
      Returns:
      the site or null if not found.
    • _internalObserve

      protected abstract void _internalObserve(Event event, Site site, javax.jcr.Session liveSession) throws Exception
      Observes the event with access to the target site and live workspace.
      Parameters:
      event - the event.
      site - the site.
      liveSession - the session to the workspace live.
      Throws:
      Exception - if an error occurs.