@@ -0,0 +1,1885 @@
+package com.collective.celos;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aimport org.apache.log4j.Logger;%0A%0Aimport com.fasterxml.jackson.databind.node.ArrayNode;%0Aimport com.fasterxml.jackson.databind.node.ObjectNode;%0A%0A/*%0ATrigger that combines multiple triggers and signals data availability only if all of them do.%0A%0AExample that combines two HDFSCheckTriggers to wait for /foo and /bar paths in HDFS:%0A%0A%7B%0A    %22type%22: %22com.collective.celos.AndTrigger%22,%0A    %22properties%22: %7B%0A       %22celos.andTrigger.triggers%22: %5B%0A           %7B%0A               %22type%22: %22com.collective.celos.HDFSCheckTrigger%22,%0A               %22properties%22: %7B%0A                   %22celos.hdfs.path%22: %22/foo%22%0A               %7D%0A           %7D,%0A           %7B%0A               %22type%22: %22com.collective.celos.HDFSCheckTrigger%22,%0A               %22properties%22: %7B%0A                   %22celos.hdfs.path%22: %22/bar%22%0A               %7D%0A           %7D%0A       %5D%0A    %7D%0A%7D%0A */%0Apublic class AndTrigger implements Trigger %7B%0A%0A    public static final String TRIGGERS_PROP = %22celos.andTrigger.triggers%22;%0A%0A    private static final Logger LOGGER = Logger.getLogger(WorkflowConfigurationParser.class);%0A    %0A    private final Set%3CTrigger%3E triggers = new HashSet%3C%3E();%0A    private final JSONInstanceCreator creator = new JSONInstanceCreator();%0A    %0A    public AndTrigger(ObjectNode properties) throws Exception %7B%0A        ArrayNode triggersArray = Util.getArrayProperty(properties, TRIGGERS_PROP);%0A        for (int i = 0; i %3C triggersArray.size(); i++) %7B%0A            LOGGER.info(%22Creating sub-trigger: %22 + i);%0A            triggers.add((Trigger) creator.createInstance(triggersArray.get(i)));%0A        %7D%0A    %7D%0A    %0A    @Override%0A    public boolean isDataAvailable(ScheduledTime t) throws Exception %7B%0A        for (Trigger trigger : triggers) %7B%0A            if (!trigger.isDataAvailable(t)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%0A%7D%0A

Add AndTrigger.