public class HistoryService extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ATTR_CLEAN |
protected static String |
ATTR_OUTPUT |
protected static String |
ATTR_PATH |
protected static String |
ATTR_TIME |
protected static String |
ATTR_USER_ID |
static String |
HISTORY_BASE
Base node for history entries
|
| Constructor and Description |
|---|
HistoryService() |
| Modifier and Type | Method and Description |
|---|---|
void |
createHistoryEntry(org.apache.sling.api.resource.ResourceResolver resolver,
de.valtech.avs.api.service.scanner.ScanResult result)
Creates a new history entry.
|
protected void |
createPath(String path,
org.apache.sling.api.resource.ResourceResolver resolver,
String primaryType)
Creates the folder at the given path if not yet existing.
|
List<de.valtech.avs.api.history.HistoryEntry> |
getHistory(int startIndex,
int count,
org.apache.sling.api.resource.ResourceResolver resolver)
Returns the last history entries.
|
void |
purgeHistory(org.apache.sling.api.resource.ResourceResolver resolver,
int daysToKeep)
Purges the history by keeping only entries within the set number of days.
|
void |
selfCheck(org.apache.sling.api.resource.ResourceResolver resolver)
Self test of history.
|
public static final String HISTORY_BASE
protected static final String ATTR_TIME
protected static final String ATTR_CLEAN
protected static final String ATTR_OUTPUT
protected static final String ATTR_PATH
protected static final String ATTR_USER_ID
public void createHistoryEntry(org.apache.sling.api.resource.ResourceResolver resolver,
de.valtech.avs.api.service.scanner.ScanResult result)
throws de.valtech.avs.api.service.AvsException
resolver - resource resolverresult - scan resultde.valtech.avs.api.service.AvsException - error setting up entrypublic List<de.valtech.avs.api.history.HistoryEntry> getHistory(int startIndex, int count, org.apache.sling.api.resource.ResourceResolver resolver)
startIndex - start reading at this index (first is 0)count - number of entries to readresolver - resource resolverprotected void createPath(String path, org.apache.sling.api.resource.ResourceResolver resolver, String primaryType) throws de.valtech.avs.api.service.AvsException
path - pathresolver - resource resolverprimaryType - primary typede.valtech.avs.api.service.AvsException - error creating folderpublic void purgeHistory(org.apache.sling.api.resource.ResourceResolver resolver,
int daysToKeep)
throws org.apache.sling.api.resource.PersistenceException
resolver - resource resolverdaysToKeep - number of days to keeporg.apache.sling.api.resource.PersistenceException - error deleting nodepublic void selfCheck(org.apache.sling.api.resource.ResourceResolver resolver)
throws de.valtech.avs.api.service.AvsException
resolver - resource resolverde.valtech.avs.api.service.AvsException - check failedCopyright © 2020. All rights reserved.