Class HookExecutionHistory


  • public class HookExecutionHistory
    extends Object
    Execution history for groovy scripts executed during AecuInstallHook invocation.
    • Constructor Detail

      • HookExecutionHistory

        public HookExecutionHistory​(javax.jcr.Session session,
                                    String groovyScriptPath)
                             throws de.valtech.aecu.api.service.AecuException
        Constructor.
        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.AecuException
        Sets "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.AecuException
        Self test of history. Checks if the history node exists.
        Parameters:
        resolver - resource resolver
        Throws:
        de.valtech.aecu.api.service.AecuException - check failed