public class HistoryUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ATTR_END |
static String |
ATTR_PATH |
protected static String |
ATTR_RESULT |
protected static String |
ATTR_RUN_OUTPUT |
protected static String |
ATTR_RUN_RESULT |
protected static String |
ATTR_RUN_STATE |
protected static String |
ATTR_RUN_TIME |
protected static String |
ATTR_START |
protected static String |
ATTR_STATE |
static String |
HISTORY_BASE
Base node for history entries
|
static String |
NODE_FALLBACK |
| Constructor and Description |
|---|
HistoryUtil() |
| Modifier and Type | Method and Description |
|---|---|
de.valtech.aecu.api.service.HistoryEntry |
createHistoryEntry(org.apache.sling.api.resource.ResourceResolver resolver)
Starts 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.
|
void |
finishHistoryEntry(de.valtech.aecu.api.service.HistoryEntry history,
org.apache.sling.api.resource.ResourceResolver resolver)
Finishes the history entry.
|
List<de.valtech.aecu.api.service.HistoryEntry> |
getHistory(int startIndex,
int count,
org.apache.sling.api.resource.ResourceResolver resolver)
Returns the last history entries.
|
org.apache.sling.api.resource.Resource |
getHistoryEntryResource(org.apache.sling.api.resource.Resource child)
Returns the base resource for a (fallback) script resource.
|
void |
purgeHistory(org.apache.sling.api.resource.ResourceResolver resolver,
int daysToKeep)
Purges the history by keeping only entries within the set number of days.
|
de.valtech.aecu.api.service.HistoryEntry |
readHistoryEntry(org.apache.sling.api.resource.Resource resource)
Reads a history entry from JCR.
|
de.valtech.aecu.api.service.ExecutionResult |
readHistorySingleResult(org.apache.sling.api.resource.Resource resource)
Reads a single script run from history.
|
void |
selfCheck(org.apache.sling.api.resource.ResourceResolver resolver)
Self test of history.
|
void |
storeExecutionInHistory(de.valtech.aecu.api.service.HistoryEntry history,
de.valtech.aecu.api.service.ExecutionResult result,
org.apache.sling.api.resource.ResourceResolver resolver)
Stores an execution run in existing history.
|
public static final String HISTORY_BASE
public static final String NODE_FALLBACK
public static final String ATTR_PATH
protected static final String ATTR_RUN_OUTPUT
protected static final String ATTR_RUN_STATE
protected static final String ATTR_RUN_RESULT
protected static final String ATTR_RUN_TIME
protected static final String ATTR_RESULT
protected static final String ATTR_STATE
protected static final String ATTR_START
protected static final String ATTR_END
public de.valtech.aecu.api.service.HistoryEntry createHistoryEntry(org.apache.sling.api.resource.ResourceResolver resolver)
throws de.valtech.aecu.api.service.AecuException
resolver - resource resolverde.valtech.aecu.api.service.AecuException - error setting up entrypublic void storeExecutionInHistory(de.valtech.aecu.api.service.HistoryEntry history,
de.valtech.aecu.api.service.ExecutionResult result,
org.apache.sling.api.resource.ResourceResolver resolver)
throws de.valtech.aecu.api.service.AecuException
history - history entryresult - script execution resultresolver - resource resolverde.valtech.aecu.api.service.AecuException - error inserting history entrypublic void finishHistoryEntry(de.valtech.aecu.api.service.HistoryEntry history,
org.apache.sling.api.resource.ResourceResolver resolver)
history - open history entryresolver - resource resolverpublic List<de.valtech.aecu.api.service.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 resolverpublic org.apache.sling.api.resource.Resource getHistoryEntryResource(org.apache.sling.api.resource.Resource child)
child - child of base resourcepublic de.valtech.aecu.api.service.HistoryEntry readHistoryEntry(org.apache.sling.api.resource.Resource resource)
resource - history resourcepublic de.valtech.aecu.api.service.ExecutionResult readHistorySingleResult(org.apache.sling.api.resource.Resource resource)
resource - resourceprotected void createPath(String path, org.apache.sling.api.resource.ResourceResolver resolver, String primaryType) throws de.valtech.aecu.api.service.AecuException
path - pathresolver - resource resolverprimaryType - primary typede.valtech.aecu.api.service.AecuException - 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.aecu.api.service.AecuException
resolver - resource resolverde.valtech.aecu.api.service.AecuException - check failedCopyright © 2019. All rights reserved.