Class ResourceBackedPojoChangeMonitor

java.lang.Object
org.apache.sling.scripting.sightly.impl.engine.ResourceBackedPojoChangeMonitor
All Implemented Interfaces:
ExternalResourceChangeListener, ResourceChangeListener

public class ResourceBackedPojoChangeMonitor extends Object implements ResourceChangeListener, ExternalResourceChangeListener
  • Constructor Details

    • ResourceBackedPojoChangeMonitor

      public ResourceBackedPojoChangeMonitor()
  • Method Details

    • recordLastModifiedTimestamp

      public void recordLastModifiedTimestamp(String path, long timestamp)
      Records the usage of the Use-object available at the provided path.
      Parameters:
      path - the path of the Use-object
      timestamp - the timestamp when the object identified by the resource from path was last modified
    • getLastModifiedDateForJavaUseObject

      public long getLastModifiedDateForJavaUseObject(String path)
      Returns the last modified date for a Java Use-API object stored in the repository.
      Parameters:
      path - the Resource path of the Use-object
      Returns:
      the Java Use-API file's last modified date or 0 if there's no information about this file
    • onChange

      public void onChange(@NotNull @NotNull List<ResourceChange> changes)
      Description copied from interface: ResourceChangeListener
      Report resource changes based on the filter properties of this listener.

      Note that resource changes for paths which are ancestors of the paths this listener was registered to may be reported through this method. This is due to limitations of certain resource providers to provide events on a more granular level (e.g. for deletion or movement of resources containing (potentially nested) child resources).

      Starting with version 1.2 of this API, an instance of ResoureChangeList is passed as the parameter to allow passing additional information.

      Specified by:
      onChange in interface ResourceChangeListener
      Parameters:
      changes - The changes list. This list is immutable.