Package de.valtech.aecu.core.installhook
Class HookExecutionHistory
- java.lang.Object
-
- de.valtech.aecu.core.installhook.HookExecutionHistory
-
public class HookExecutionHistory extends Object
Execution history for groovy scripts executed duringAecuInstallHookinvocation.
-
-
Constructor Summary
Constructors Constructor Description HookExecutionHistory(javax.jcr.Session session, String groovyScriptPath)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasBeenExecutedBefore()Returns if the script has been executed before.static voidselfCheck(org.apache.sling.api.resource.ResourceResolver resolver)Self test of history.voidsetExecuted()Sets "executed" on the history node to the current date.
-
-
-
Constructor Detail
-
HookExecutionHistory
public HookExecutionHistory(javax.jcr.Session session, String groovyScriptPath) throws de.valtech.aecu.api.service.AecuExceptionConstructor.- Parameters:
session- a session with write permissons on "/var/aecu-installhook".groovyScriptPath- the groovy script to instantiate the execution history for.- Throws:
de.valtech.aecu.api.service.AecuException- in case the call to JcrUtils.getOrCreateByPath fails.
-
-
Method Detail
-
hasBeenExecutedBefore
public boolean hasBeenExecutedBefore()
Returns if the script has been executed before. This is determined by checking existence of the property "executed" on the history node.- Returns:
- true if it has been executed previously, false otherwise.
-
setExecuted
public void setExecuted() throws de.valtech.aecu.api.service.AecuExceptionSets "executed" on the history node to the current date.- Throws:
de.valtech.aecu.api.service.AecuException- in case the property could not be saved.
-
selfCheck
public static void selfCheck(org.apache.sling.api.resource.ResourceResolver resolver) throws de.valtech.aecu.api.service.AecuExceptionSelf test of history. Checks if the history node exists.- Parameters:
resolver- resource resolver- Throws:
de.valtech.aecu.api.service.AecuException- check failed
-
-