Package org.apache.sling.scripting.sightly.impl.engine

# Class ResourceBackedPojoChangeMonitor

java.lang.Object
org.apache.sling.scripting.sightly.impl.engine.ResourceBackedPojoChangeMonitor

All Implemented Interfaces:
  `org.apache.sling.api.resource.observation.ExternalResourceChangeListener`, `org.apache.sling.api.resource.observation.ResourceChangeListener`

public class ResourceBackedPojoChangeMonitor extends Object implements org.apache.sling.api.resource.observation.ResourceChangeListener, org.apache.sling.api.resource.observation.ExternalResourceChangeListener

## Field Summary

### Fields inherited from interface org.apache.sling.api.resource.observation.ResourceChangeListener

`CHANGE_ADDED, CHANGE_CHANGED, CHANGE_PROVIDER_ADDED, CHANGE_PROVIDER_REMOVED, CHANGE_REMOVED, CHANGES, PATHS, PROPERTY_NAMES_HINT`

## Constructor Summary

Constructors
Constructor
Description
`ResourceBackedPojoChangeMonitor()`

## Method Summary

Modifier and Type
Method
Description
`long`
`getLastModifiedDateForJavaUseObject(String path)`
Returns the last modified date for a Java Use-API object stored in the repository.
`void`
`onChange(@NotNull List<org.apache.sling.api.resource.observation.ResourceChange> changes)`
`void`
`recordLastModifiedTimestamp(String path, long timestamp)`
Records the usage of the Use-object available at the provided `path`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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<org.apache.sling.api.resource.observation.ResourceChange> changes)

Specified by:
  `onChange` in interface `org.apache.sling.api.resource.observation.ResourceChangeListener`