package fr.treeptik.cloudunit.hooks;

/**
 * Created by nicolas on 19/04/2016.
 */
public enum HookAction {

    APPLICATION_POST_START("Application post start", "/cloudunit/appconf/hooks/application-post-start.sh"),
    APPLICATION_POST_STOP("Application post stop", "/cloudunit/appconf/hooks/application-post-stop.sh"),
    APPLICATION_PRE_START("Application pre start", "/cloudunit/appconf/hooks/application-pre-start.sh"),
    APPLICATION_PRE_STOP("Application pre stop", "/cloudunit/appconf/hooks/application-pre-stop.sh");

    private final String label;
    private final String command;

    HookAction(String label, String command) {
        this.label = label;
        this.command = command;
    }

    public String getLabel() {
        return label;
    }

    public String[] getCommand() {
        String[] commandBash = new String[2];
        commandBash[0] = "bash";
        commandBash[1] = command;
        return commandBash;
    }
}

@@ -520,16 +520,418 @@
 top.sh%22)
+,%0A    SNAPSHOT_PRE_ACTION(%22Before Snapshot%22, %22/cloudunit/appconf/hooks/snapshot-pre-action.sh%22),%0A    SNAPSHOT_POST_ACTION(%22After Snapshot%22, %22/cloudunit/appconf/hooks/snapshot-post-action.sh%22),%0A    CLONE_PRE_ACTION(%22Before restoring an application%22, %22/cloudunit/appconf/hooks/clone-pre-action.sh%22),%0A    CLONE_POST_ACTION(%22After restoring an application%22, %22/cloudunit/appconf/hooks/clone-post-action.sh%22)
 ;%0A%0A    p

Add new Hooks. Not yet called into code