provisionr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject [09/21] PROVISIONR-20. Change groupId from com.axemblr.provisionr to org.apache.provisionr
Date Mon, 01 Apr 2013 08:52:32 GMT
http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/ProcessVariables.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/ProcessVariables.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/ProcessVariables.java
deleted file mode 100644
index 1fc6459..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/ProcessVariables.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon;
-
-public class ProcessVariables {
-
-    private ProcessVariables() {
-        /* singleton */
-    }
-
-    /**
-     * ID of a base image from which to create the others in the pool
-     */
-    public static final String IMAGE_ID = "imageId";
-
-    /**
-     * The reservation ID for a pool as String
-     *
-     * @see com.axemblr.provisionr.amazon.activities.RunOnDemandInstances
-     */
-    public static final String RESERVATION_ID = "reservationId";
-
-    /**
-     * The amount the user is willing to pay for spot instances in the
-     * Amazon pool he's trying to start. If set, the request is for spot
-     * instances, if null the request is for on demand instances.
-     * 
-     * @see com.axemblr.provisionr.amazon.activities.RunSpotInstances
-     */
-    public static final String SPOT_BID = "spotBid";
-
-    /**
-     * Flag that gets set when the process attempts to send spot requests
-     * for the first time. Because the describe call is not consistent
-     * until a reasonable delay passes, this will be used to timeout the
-     * Activiti retries so that the requests are not resent if they were
-     * successful. 
-     * 
-     * @see com.axemblr.provisionr.amazon.activities.RunSpotInstances
-     */
-    public static final String SPOT_REQUESTS_SENT = "spotRequestsSent";
-
-    /**
-     * List of request IDs as returned by Amazon for spot instances. These need to 
-     * be followed up to get the actual instance IDs.
-     * 
-     * @see com.axemblr.provisionr.amazon.activities.RunSpotInstances
-     */
-    public static final String SPOT_INSTANCE_REQUEST_IDS = "spotInstanceRequestIds";
-
-    /**
-     * Have all spot instance requests been handled by Amazon? (none are pending)
-     * 
-     *  @see com.axemblr.provisionr.amazon.activities.CheckNoRequestsAreOpen
-     */
-    public static final String NO_SPOT_INSTANCE_REQUESTS_OPEN = "noSpotInstanceRequestsOpen";
-
-    /**
-     * Are all spot instance requests in an active state? (none cancelled, none terminated)
-     * 
-     * @see com.axemblr.provisionr.amazon.activities.CheckAllRequestsAreActive
-     */
-    public static final String ALL_SPOT_INSTANCE_REQUESTS_ACTIVE = "allSpotInstanceRequestsActive";
-
-    /**
-     * List of instance IDs as returned by Amazon
-     *
-     * @see com.axemblr.provisionr.amazon.activities.RunOnDemandInstances
-     */
-    public static final String INSTANCE_IDS = "instanceIds";
-
-    /**
-     * List of requested EBS volume IDs
-     * 
-     * @see com.axemblr.provisionr.amazon.activities.CreateEBSVolumes
-     */
-    public static final String VOLUME_IDS = "volumeIds"; 
-
-    /**
-     * Are all started instances running?
-     *
-     * @see com.axemblr.provisionr.amazon.activities.CheckAllInstancesAreRunning
-     */
-    public static final String ALL_INSTANCES_RUNNING = "allInstancesRunning";
-
-    /**
-     * Are all instances marked as terminated?
-     *
-     * @see com.axemblr.provisionr.amazon.activities.CheckAllInstancesAreTerminated
-     */
-    public static final String ALL_INSTANCES_TERMINATED = "allInstancesTerminated";
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllInstancesMatchPredicate.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllInstancesMatchPredicate.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllInstancesMatchPredicate.java
deleted file mode 100644
index d7c4b04..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllInstancesMatchPredicate.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DescribeInstancesRequest;
-import com.amazonaws.services.ec2.model.DescribeInstancesResult;
-import com.amazonaws.services.ec2.model.Instance;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Iterables;
-
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AllInstancesMatchPredicate extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(AllInstancesMatchPredicate.class);
-
-    private final String resultVariable;
-    private final Predicate<Instance> predicate;
-
-    protected AllInstancesMatchPredicate(ProviderClientCache cache,
-                                         String resultVariable, Predicate<Instance> predicate) {
-        super(cache);
-        this.resultVariable = checkNotNull(resultVariable, "resultVariable is null");
-        this.predicate = checkNotNull(predicate, "predicate is null");
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        @SuppressWarnings("unchecked")
-        Optional<List<String>> instanceIds = 
-            Optional.fromNullable((List<String>) execution.getVariable(ProcessVariables.INSTANCE_IDS));
-
-        if (!instanceIds.isPresent()) {
-            LOG.warn("<< Process variable '{}' not found", ProcessVariables.INSTANCE_IDS);
-            return;
-        } else if (instanceIds.get().size() == 0) {
-            LOG.info(">> No instances are currently registered in the process.");
-            return;
-        }
-
-        try {
-            DescribeInstancesResult result = client.describeInstances(new DescribeInstancesRequest()
-                .withInstanceIds(instanceIds.get()));
-
-            List<Instance> instances = collectInstancesFromReservations(result.getReservations());
-
-            if (Iterables.all(instances, predicate)) {
-                LOG.info(">> All {} instances match predicate {} ", instanceIds, predicate);
-                execution.setVariable(resultVariable, true);
-
-            } else {
-                LOG.info("<< Not all instances {} match predicate {}", instanceIds, predicate);
-                execution.setVariable(resultVariable, false);
-            }
-        } catch (AmazonServiceException exception) {
-            if (exception.getErrorCode().equalsIgnoreCase("InvalidInstanceID.NotFound")) {
-                LOG.warn("<< Got error InvalidInstanceID.NotFound. Assuming predicate {} is false", predicate);
-                execution.setVariable(resultVariable, false);
-            } else {
-                throw Throwables.propagate(exception);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
deleted file mode 100644
index 1de5c7a..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsRequest;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsResult;
-import com.amazonaws.services.ec2.model.SpotInstanceRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Predicate;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Iterables;
-
-public class AllSpotRequestsMatchPredicate extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(AllSpotRequestsMatchPredicate.class);
-
-    protected final String resultVariable;
-    private final Predicate<SpotInstanceRequest> predicate;
-
-    protected AllSpotRequestsMatchPredicate(ProviderClientCache cache, String resultVariable, 
-            Predicate<SpotInstanceRequest> predicate) {
-        super(cache);
-        this.resultVariable = checkNotNull(resultVariable, "resultVariable is null");
-        this.predicate = checkNotNull(predicate, "predicate is null");
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-
-        LOG.info(">> Checking if all spot requests match predicate {}", predicate);
-
-        @SuppressWarnings("unchecked")
-        List<String> requestIds = (List<String>) execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS);
-        checkNotNull(requestIds, "process variable '{}' not found", ProcessVariables.SPOT_INSTANCE_REQUEST_IDS);
-
-        DescribeSpotInstanceRequestsRequest describeRequest = new DescribeSpotInstanceRequestsRequest();
-        describeRequest.setSpotInstanceRequestIds(requestIds);
-
-        // Retrieve all of the requests we want to monitor.
-        DescribeSpotInstanceRequestsResult describeResult = client.describeSpotInstanceRequests(describeRequest);
-        List<SpotInstanceRequest> requests = describeResult.getSpotInstanceRequests();
-
-        if (Iterables.all(requests, predicate)) {
-            LOG.info(">> All {} requests match predicate {} ", requests, predicate);
-            execution.setVariable(resultVariable, true);
-        } else {
-            LOG.info("<< Not all requests {} match predicate {}", requests, predicate);
-            execution.setVariable(resultVariable, false);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AmazonActivity.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AmazonActivity.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AmazonActivity.java
deleted file mode 100644
index 6d8d27a..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/AmazonActivity.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import java.util.List;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.Reservation;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.core.CoreProcessVariables;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.activiti.engine.delegate.JavaDelegate;
-
-public abstract class AmazonActivity implements JavaDelegate {
-
-    private final ProviderClientCache providerClientCache;
-
-    protected AmazonActivity(ProviderClientCache providerClientCache) {
-        this.providerClientCache = checkNotNull(providerClientCache, "providerClientCache is null");
-    }
-
-    /**
-     * Amazon specific activity implementation
-     *
-     * @param client    Amazon client created using the pool provider
-     * @param pool      Virtual machines pool description
-     * @param execution Activiti execution context
-     */
-    public abstract void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception;
-
-    /**
-     * Wrap the abstract {@code execute} method with the logic that knows how to create the Amazon client
-     */
-    @Override
-    public void execute(DelegateExecution execution) throws Exception {
-        Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL);
-        checkNotNull(pool, "Please add the pool description as a process " +
-            "variable with the name '%s'.", CoreProcessVariables.POOL);
-
-        execute(providerClientCache.getUnchecked(pool.getProvider()), pool, execution);
-    }
-
-    protected List<Instance> collectInstancesFromReservations(List<Reservation> reservation) {
-        /* Make a copy as an ArrayList to force lazy collection evaluation */
-        List<List<Instance>> allInstances = Lists.transform(reservation, new Function<Reservation, List<Instance>>() {
-            @Override
-            public List<Instance> apply(Reservation reservation) {
-                return reservation.getInstances();
-            }
-        });
-
-        return Lists.newArrayList(Iterables.concat(allInstances));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CancelSpotRequests.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CancelSpotRequests.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CancelSpotRequests.java
deleted file mode 100644
index e24ace5..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CancelSpotRequests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.CancelSpotInstanceRequestsRequest;
-import com.axemblr.provisionr.amazon.AmazonProvisionr;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-
-public class CancelSpotRequests extends AmazonActivity {
-
-    public static final Logger LOG = LoggerFactory.getLogger(AmazonProvisionr.class);
-
-    public CancelSpotRequests(ProviderClientCache providerClientCache) {
-        super(providerClientCache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        @SuppressWarnings("unchecked")
-        List<String> requests = (List<String>) execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS);
-        checkNotNull(requests, "process variable '{}' not found", ProcessVariables.SPOT_INSTANCE_REQUEST_IDS);
-        if (requests.size() > 0) {
-            client.cancelSpotInstanceRequests(new CancelSpotInstanceRequestsRequest()
-                    .withSpotInstanceRequestIds(requests));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreRunning.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreRunning.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreRunning.java
deleted file mode 100644
index b15272f..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreRunning.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.model.Instance;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.google.common.base.Predicate;
-
-public class CheckAllInstancesAreRunning extends AllInstancesMatchPredicate {
-
-    public static class InstanceIsRunning implements Predicate<Instance> {
-        @Override
-        public boolean apply(Instance instance) {
-            return instance.getState().getName().equalsIgnoreCase("running");
-        }
-
-        @Override
-        public String toString() {
-            return "InstanceIsRunning{}";
-        }
-    }
-
-    public CheckAllInstancesAreRunning(ProviderClientCache cache) {
-        super(cache, ProcessVariables.ALL_INSTANCES_RUNNING, new InstanceIsRunning());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreTerminated.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreTerminated.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreTerminated.java
deleted file mode 100644
index 7105083..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllInstancesAreTerminated.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.model.Instance;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.google.common.base.Predicate;
-
-public class CheckAllInstancesAreTerminated extends AllInstancesMatchPredicate {
-
-    public static class InstanceIsTerminated implements Predicate<Instance> {
-        @Override
-        public boolean apply(Instance instance) {
-            return instance.getState().getName().equalsIgnoreCase("terminated");
-        }
-
-        @Override
-        public String toString() {
-            return "InstanceIsTerminated{}";
-        }
-    }
-
-    public CheckAllInstancesAreTerminated(ProviderClientCache cache) {
-        super(cache, ProcessVariables.ALL_INSTANCES_TERMINATED, new InstanceIsTerminated());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllRequestsAreActive.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllRequestsAreActive.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllRequestsAreActive.java
deleted file mode 100644
index 22fe199..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckAllRequestsAreActive.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.axemblr.provisionr.amazon.activities;
-
-import org.activiti.engine.delegate.DelegateExecution;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.SpotInstanceRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Predicate;
-
-public class CheckAllRequestsAreActive extends AllSpotRequestsMatchPredicate {
-
-    public static class RequestIsActive implements Predicate<SpotInstanceRequest> {
-
-        @Override
-        public boolean apply(SpotInstanceRequest request) {
-            return "active".equalsIgnoreCase(request.getState());
-        }
-
-        @Override
-        public String toString() {
-            return "RequestIsActive{}";
-        }
-    }
-
-    public CheckAllRequestsAreActive(ProviderClientCache cache) {
-        super(cache, ProcessVariables.ALL_SPOT_INSTANCE_REQUESTS_ACTIVE, new RequestIsActive());
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        super.execute(client, pool, execution);        
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckNoRequestsAreOpen.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckNoRequestsAreOpen.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckNoRequestsAreOpen.java
deleted file mode 100644
index 4641e1f..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/CheckNoRequestsAreOpen.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.model.SpotInstanceRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.google.common.base.Predicate;
-
-public class CheckNoRequestsAreOpen extends AllSpotRequestsMatchPredicate {
-
-    public static class RequestIsNotOpen implements Predicate<SpotInstanceRequest> {
-
-        @Override
-        public boolean apply(SpotInstanceRequest request) {
-            return !"open".equalsIgnoreCase(request.getState());
-        }
-
-        @Override
-        public String toString() {
-            return "RequestIsNotOpen{}";
-        }
-    }
-
-    public CheckNoRequestsAreOpen(ProviderClientCache cache) {
-        super(cache, ProcessVariables.NO_SPOT_INSTANCE_REQUESTS_OPEN, new RequestIsNotOpen());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteKeyPair.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteKeyPair.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteKeyPair.java
deleted file mode 100644
index 1415866..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteKeyPair.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DeleteKeyPairRequest;
-import com.axemblr.provisionr.amazon.core.KeyPairs;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DeleteKeyPair extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(DeleteKeyPair.class);
-
-    public DeleteKeyPair(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
-        String keyName = KeyPairs.formatNameFromBusinessKey(execution.getProcessBusinessKey());
-
-        LOG.info(">> Deleting key pair {}", keyName);
-        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteSecurityGroup.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteSecurityGroup.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteSecurityGroup.java
deleted file mode 100644
index 20e56b9..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DeleteSecurityGroup.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DeleteSecurityGroupRequest;
-import com.axemblr.provisionr.amazon.core.ErrorCodes;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.amazon.core.SecurityGroups;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.api.provider.Provider;
-import com.google.common.base.Throwables;
-import com.google.common.cache.LoadingCache;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DeleteSecurityGroup extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(DeleteSecurityGroup.class);
-
-    public DeleteSecurityGroup(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
-        final String groupName = SecurityGroups.formatNameFromBusinessKey(execution.getProcessBusinessKey());
-        try {
-            LOG.info(">> Deleting Security Group {}", groupName);
-
-            client.deleteSecurityGroup(new DeleteSecurityGroupRequest().withGroupName(groupName));
-
-        } catch (AmazonServiceException e) {
-            if (e.getErrorCode().equals(ErrorCodes.SECURITY_GROUP_NOT_FOUND)) {
-                LOG.info("<< Security Group {} not found. Ignoring this error.", groupName);
-            } else {
-                throw Throwables.propagate(e);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DumpConsoleOutput.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DumpConsoleOutput.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DumpConsoleOutput.java
deleted file mode 100644
index 9a792d8..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/DumpConsoleOutput.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.GetConsoleOutputRequest;
-import com.amazonaws.services.ec2.model.GetConsoleOutputResult;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Machine;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Charsets;
-import static com.google.common.base.Preconditions.checkNotNull;
-import net.schmizz.sshj.common.Base64;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DumpConsoleOutput extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(DumpConsoleOutput.class);
-
-    public DumpConsoleOutput(ProviderClientCache providerClientCache) {
-        super(providerClientCache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        Machine machine = (Machine) execution.getVariable("machine");
-        checkNotNull(machine, "expecting 'machine' as a process variable");
-
-        LOG.info(">> Requesting console output for instance {}", machine.getExternalId());
-        GetConsoleOutputResult result = client.getConsoleOutput(
-            new GetConsoleOutputRequest().withInstanceId(machine.getExternalId()));
-        if (result.getOutput() != null) {
-            String content = new String(Base64.decode(result.getOutput()), Charsets.UTF_8);
-            LOG.info("<< Console output for instance {}: {}", machine.getExternalId(), content);
-        } else {
-            LOG.warn("<< Console output was null for instance {}", machine.getExternalId());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureKeyPairExists.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureKeyPairExists.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureKeyPairExists.java
deleted file mode 100644
index 545c439..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureKeyPairExists.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DeleteKeyPairRequest;
-import com.amazonaws.services.ec2.model.ImportKeyPairRequest;
-import com.amazonaws.services.ec2.model.ImportKeyPairResult;
-import com.axemblr.provisionr.amazon.core.ErrorCodes;
-import com.axemblr.provisionr.amazon.core.KeyPairs;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.api.provider.Provider;
-import com.google.common.cache.LoadingCache;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class EnsureKeyPairExists extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(EnsureKeyPairExists.class);
-
-    public EnsureKeyPairExists(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
-        String keyName = KeyPairs.formatNameFromBusinessKey(execution.getProcessBusinessKey());
-        LOG.info(">> Importing admin access key pair as {}", keyName);
-
-        final String publicKey = pool.getAdminAccess().getPublicKey();
-        try {
-            importPoolPublicKeyPair(client, keyName, publicKey);
-
-        } catch (AmazonServiceException e) {
-            if (e.getErrorCode().equals(ErrorCodes.DUPLICATE_KEYPAIR)) {
-                LOG.info("<< Duplicate key pair found. Re-importing from pool description");
-
-                client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
-                importPoolPublicKeyPair(client, keyName, publicKey);
-            }
-        }
-    }
-
-    private void importPoolPublicKeyPair(AmazonEC2 client, String keyName, String publicKey) {
-        ImportKeyPairResult result = client.importKeyPair(new ImportKeyPairRequest()
-            .withKeyName(keyName).withPublicKeyMaterial(publicKey));
-        LOG.info("<< Created remote key with fingerprint {}", result.getKeyFingerprint());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureSecurityGroupExists.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureSecurityGroupExists.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureSecurityGroupExists.java
deleted file mode 100644
index 34cfeb4..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/EnsureSecurityGroupExists.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.AuthorizeSecurityGroupIngressRequest;
-import com.amazonaws.services.ec2.model.CreateSecurityGroupRequest;
-import com.amazonaws.services.ec2.model.CreateSecurityGroupResult;
-import com.amazonaws.services.ec2.model.DescribeSecurityGroupsRequest;
-import com.amazonaws.services.ec2.model.DescribeSecurityGroupsResult;
-import com.amazonaws.services.ec2.model.IpPermission;
-import com.amazonaws.services.ec2.model.RevokeSecurityGroupIngressRequest;
-import com.axemblr.provisionr.amazon.core.ErrorCodes;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.amazon.core.SecurityGroups;
-import com.axemblr.provisionr.amazon.functions.ConvertRuleToIpPermission;
-import com.axemblr.provisionr.api.network.Network;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.api.provider.Provider;
-import com.google.common.base.Throwables;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import static com.google.common.collect.Iterables.getOnlyElement;
-import static com.google.common.collect.Sets.difference;
-import java.util.Set;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class EnsureSecurityGroupExists extends AmazonActivity {
-
-    public static final Logger LOG = LoggerFactory.getLogger(EnsureSecurityGroupExists.class);
-
-    public EnsureSecurityGroupExists(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
-        final String businessKey = execution.getProcessBusinessKey();
-        final String groupName = SecurityGroups.formatNameFromBusinessKey(businessKey);
-
-        try {
-            LOG.info(">> Creating Security Group with name {}", groupName);
-            CreateSecurityGroupRequest request = new CreateSecurityGroupRequest()
-                .withGroupName(groupName).withDescription("Security Group for " + businessKey);
-
-            CreateSecurityGroupResult result = client.createSecurityGroup(request);
-            LOG.info("<< Created Security Group with ID {}", result.getGroupId());
-
-        } catch (AmazonServiceException e) {
-            if (e.getErrorCode().equals(ErrorCodes.DUPLICATE_SECURITY_GROUP)) {
-                LOG.warn(String.format("<< Security Group %s already exists. " +
-                    "Synchronizing ingress rules.", groupName), e);
-            } else {
-                throw Throwables.propagate(e);
-            }
-        }
-
-        synchronizeIngressRules(client, groupName, pool.getNetwork());
-    }
-
-    private void synchronizeIngressRules(AmazonEC2 client, String groupName, Network network) {
-        DescribeSecurityGroupsResult result = client.describeSecurityGroups(
-            new DescribeSecurityGroupsRequest().withGroupNames(groupName));
-
-        Set<IpPermission> existingPermissions = ImmutableSet.copyOf(getOnlyElement(
-            result.getSecurityGroups()).getIpPermissions());
-
-        Set<IpPermission> expectedPermissions = ImmutableSet.copyOf(
-            Iterables.transform(network.getIngress(), ConvertRuleToIpPermission.FUNCTION));
-
-        authorizeIngressRules(client, groupName, difference(expectedPermissions, existingPermissions));
-        revokeIngressRules(client, groupName, difference(existingPermissions, expectedPermissions));
-    }
-
-    private void authorizeIngressRules(AmazonEC2 client, String groupName, Set<IpPermission> ipPermissions) {
-        if (!ipPermissions.isEmpty()) {
-            LOG.info(">> Authorizing Security Group Ingress Rules {} for {}", ipPermissions, groupName);
-
-            AuthorizeSecurityGroupIngressRequest request = new AuthorizeSecurityGroupIngressRequest()
-                .withGroupName(groupName).withIpPermissions(ipPermissions);
-            client.authorizeSecurityGroupIngress(request);
-        }
-    }
-
-    private void revokeIngressRules(AmazonEC2 client, String groupName, Set<IpPermission> ipPermissions) {
-        if (!ipPermissions.isEmpty()) {
-            LOG.info(">> Revoking Security Group Ingress Rules: {} for {}", ipPermissions, groupName);
-
-            RevokeSecurityGroupIngressRequest request = new RevokeSecurityGroupIngressRequest()
-                .withGroupName(groupName).withIpPermissions(ipPermissions);
-            client.revokeSecurityGroupIngress(request);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/GetInstanceIdsFromSpotRequests.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/GetInstanceIdsFromSpotRequests.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/GetInstanceIdsFromSpotRequests.java
deleted file mode 100644
index 64b613b..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/GetInstanceIdsFromSpotRequests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.axemblr.provisionr.amazon.activities;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsRequest;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsResult;
-import com.amazonaws.services.ec2.model.SpotInstanceRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-
-public class GetInstanceIdsFromSpotRequests extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(GetInstanceIdsFromSpotRequests.class);
-    
-    public GetInstanceIdsFromSpotRequests(ProviderClientCache providerClientCache) {
-        super(providerClientCache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        LOG.info(">> retrieving instance Ids from spot request Ids");
-
-        @SuppressWarnings("unchecked")
-        List<String> requestIds = 
-                (List<String>) execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS);
-        DescribeSpotInstanceRequestsResult result = client.describeSpotInstanceRequests(
-                new DescribeSpotInstanceRequestsRequest().withSpotInstanceRequestIds(requestIds));
-        List<String> instanceIds = new ArrayList<String>();
-        for (SpotInstanceRequest spotRequest : result.getSpotInstanceRequests()) {
-            if (spotRequest.getInstanceId() != null) {
-                instanceIds.add(spotRequest.getInstanceId());
-            }
-        }
-        execution.setVariable(ProcessVariables.INSTANCE_IDS, instanceIds);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/PublishListOfMachines.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/PublishListOfMachines.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/PublishListOfMachines.java
deleted file mode 100644
index 30adafd..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/PublishListOfMachines.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DescribeInstancesRequest;
-import com.amazonaws.services.ec2.model.DescribeInstancesResult;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.Reservation;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Machine;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.core.CoreProcessVariables;
-import com.google.common.base.Function;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.common.collect.Lists;
-import java.util.Arrays;
-import java.util.List;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Use the IDs to retrieve details about the running machines and
- * store them as a process variable (machines)
- *
- * @see Machine
- */
-public class PublishListOfMachines extends AmazonActivity {
-
-    public static final Logger LOG = LoggerFactory.getLogger(PublishListOfMachines.class);
-
-    public PublishListOfMachines(ProviderClientCache providerClientCache) {
-        super(providerClientCache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        @SuppressWarnings("unchecked")
-        List<String> instanceIds = (List<String>) execution.getVariable(ProcessVariables.INSTANCE_IDS);
-        checkNotNull(instanceIds, "%s not found as a process variable", ProcessVariables.INSTANCE_IDS);
-
-        LOG.info(">> Describing instances {}", instanceIds);
-        DescribeInstancesResult result = client.describeInstances(new DescribeInstancesRequest()
-            .withInstanceIds(instanceIds));
-
-        LOG.info("<< Got the following reservations: {}", result.getReservations());
-
-        List<Instance> instances = collectInstancesFromReservations(result.getReservations());
-        List<Machine> machines = Lists.transform(instances,
-            new Function<Instance, Machine>() {
-                @Override
-                public Machine apply(Instance instance) {
-                    return Machine.builder()
-                        .externalId(instance.getInstanceId())
-                        .publicDnsName(instance.getPublicDnsName())
-                        .publicIp(instance.getPublicIpAddress())
-                        .privateDnsName(instance.getPrivateDnsName())
-                        .privateIp(instance.getPrivateIpAddress())
-                        .createMachine();
-                }
-            });
-
-        /* Create a new ArrayList to force evaluation for lazy collections */
-        execution.setVariable(CoreProcessVariables.MACHINES, Lists.newArrayList(machines));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunInstances.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunInstances.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunInstances.java
deleted file mode 100644
index bd3d191..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunInstances.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.amazonaws.AmazonWebServiceRequest;
-import com.amazonaws.services.ec2.model.BlockDeviceMapping;
-import com.amazonaws.services.ec2.model.EbsBlockDevice;
-import com.amazonaws.services.ec2.model.LaunchSpecification;
-import com.amazonaws.services.ec2.model.RequestSpotInstancesRequest;
-import com.amazonaws.services.ec2.model.RunInstancesRequest;
-import com.amazonaws.services.ec2.model.SpotInstanceType;
-import com.axemblr.provisionr.amazon.core.ImageTable;
-import com.axemblr.provisionr.amazon.core.ImageTableQuery;
-import com.axemblr.provisionr.amazon.core.KeyPairs;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.amazon.core.SecurityGroups;
-import com.axemblr.provisionr.amazon.options.ProviderOptions;
-import com.axemblr.provisionr.amazon.options.SoftwareOptions;
-import com.axemblr.provisionr.api.hardware.BlockDevice;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.api.provider.Provider;
-import com.google.common.base.Charsets;
-import com.google.common.base.Strings;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
-import com.google.common.io.Resources;
-
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.List;
-
-import net.schmizz.sshj.common.Base64;
-
-import org.activiti.engine.delegate.DelegateExecution;
-
-public abstract class RunInstances extends AmazonActivity {
-
-    public static final String DEFAULT_ARCH = "amd64";
-    public static final String DEFAULT_TYPE = "instance-store";
-    public static final String DEFAULT_AMI_ID = "ami-0cdf4965"; // Ubuntu 12.10 x64
-
-    protected RunInstances(ProviderClientCache providerClientCache) {
-        super(providerClientCache);
-    }
-
-    protected RunInstancesRequest createOnDemandInstancesRequest(Pool pool, DelegateExecution execution) 
-            throws IOException {
-        return (RunInstancesRequest) createRequest(pool, execution, false);
-    }
-
-    protected RequestSpotInstancesRequest createSpotInstancesRequest(Pool pool, DelegateExecution execution) 
-            throws IOException {
-        return (RequestSpotInstancesRequest) createRequest(pool, execution, true);
-    }
-
-    private AmazonWebServiceRequest createRequest(Pool pool, DelegateExecution execution, boolean spot) 
-            throws IOException {
-        final String businessKey = execution.getProcessBusinessKey();
-
-        final String securityGroupName = SecurityGroups.formatNameFromBusinessKey(businessKey);
-        final String keyPairName = KeyPairs.formatNameFromBusinessKey(businessKey);
-
-        final String instanceType = pool.getHardware().getType();
-        final String imageId = getImageIdFromPoolConfigurationOrQueryImageTable(
-            pool, pool.getProvider(), instanceType);
-
-        final String userData = Resources.toString(Resources.getResource(RunInstances.class,
-            "/com/axemblr/provisionr/amazon/userdata.sh"), Charsets.UTF_8);
-
-        List<BlockDevice> blockDevices = pool.getHardware().getBlockDevices();
-        List<BlockDeviceMapping> blockDeviceMappings = Lists.newArrayList();
-        if (blockDevices != null && blockDevices.size() > 0) {
-            for (BlockDevice device : blockDevices) {
-                blockDeviceMappings.add(new BlockDeviceMapping()
-                        .withDeviceName(device.getName())
-                        .withEbs(new EbsBlockDevice()
-                            .withVolumeSize(device.getSize())
-                            .withDeleteOnTermination(true)
-                         ));
-            }
-        }
-
-        if (spot) {
-            Calendar validUntil = Calendar.getInstance();
-            validUntil.add(Calendar.MINUTE, 10);
-            final String spotPrice = checkNotNull(pool.getProvider().getOption(ProviderOptions.SPOT_BID),
-                    "The bid for spot instances was not specified");
-            LaunchSpecification ls = new LaunchSpecification()
-                .withInstanceType(instanceType)
-                .withKeyName(keyPairName)
-                .withImageId(imageId)
-                .withBlockDeviceMappings(blockDeviceMappings)
-                .withSecurityGroups(Lists.newArrayList(securityGroupName))
-                .withUserData(Base64.encodeBytes(userData.getBytes(Charsets.UTF_8)));
-            return new RequestSpotInstancesRequest()
-                .withSpotPrice(spotPrice)
-                .withLaunchSpecification(ls)
-                .withLaunchGroup(businessKey)
-                .withInstanceCount(pool.getExpectedSize())
-                .withType(SpotInstanceType.OneTime)
-                .withValidUntil(validUntil.getTime());
-        } else {
-            return new RunInstancesRequest()
-                .withClientToken(businessKey)
-                .withSecurityGroups(securityGroupName)
-                .withKeyName(keyPairName)
-                .withInstanceType(instanceType)
-                .withImageId(imageId)
-                .withBlockDeviceMappings(blockDeviceMappings)
-                .withMinCount(pool.getMinSize())
-                .withMaxCount(pool.getExpectedSize())
-                .withUserData(Base64.encodeBytes(userData.getBytes(Charsets.UTF_8)));
-        }
-    }
-
-    private String getImageIdFromPoolConfigurationOrQueryImageTable(
-            Pool pool, Provider provider, String instanceType
-        ) {
-            final String imageId = pool.getSoftware().getImageId();
-            if (!Strings.isNullOrEmpty(imageId)) {
-                return "default".equals(imageId) ? DEFAULT_AMI_ID : imageId;
-            }
-
-            ImageTable imageTable;
-            try {
-                imageTable = ImageTable.fromCsvResource("/com/axemblr/provisionr/amazon/ubuntu.csv");
-            } catch (IOException e) {
-                throw Throwables.propagate(e);
-            }
-
-            final String region = provider.getOptionOr(ProviderOptions.REGION, ProviderOptions.DEFAULT_REGION);
-            final String version = provider.getOptionOr(SoftwareOptions.BASE_OPERATING_SYSTEM_VERSION,
-                SoftwareOptions.DEFAULT_BASE_OPERATING_SYSTEM_VERSION);
-
-            ImageTableQuery query = imageTable.query()
-                .filterBy("region", region)
-                .filterBy("version", version)
-                .filterBy("arch", DEFAULT_ARCH);
-
-            if (instanceType.equals("t1.micro")) {
-                query.filterBy("type", "ebs");
-            } else {
-                query.filterBy("type", DEFAULT_TYPE);
-            }
-
-            return query.singleResult();
-        }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunOnDemandInstances.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunOnDemandInstances.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunOnDemandInstances.java
deleted file mode 100644
index 6407b81..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunOnDemandInstances.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-* Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*    http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package com.axemblr.provisionr.amazon.activities;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.RunInstancesRequest;
-import com.amazonaws.services.ec2.model.RunInstancesResult;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-
-public class RunOnDemandInstances extends RunInstances {
-
-    private static final Logger LOG = LoggerFactory.getLogger(RunOnDemandInstances.class);
-
-    public static final String DEFAULT_ARCH = "amd64";
-    public static final String DEFAULT_TYPE = "instance-store";
-
-    public RunOnDemandInstances(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws IOException {
-
-        final RunInstancesRequest request = createOnDemandInstancesRequest(pool, execution);
-        // TODO allow for more options (e.g. monitoring & termination protection etc.)
-
-        LOG.info(">> Sending RunInstances request: {}", request);
-        RunInstancesResult result = client.runInstances(request);
-        LOG.info("<< Got RunInstances result: {}", result);
-
-        // TODO tag instances: managed-by: Axemblr Provisionr, business-key: ID etc.
-
-        execution.setVariable(ProcessVariables.RESERVATION_ID,
-            result.getReservation().getReservationId());
-        execution.setVariable(ProcessVariables.INSTANCE_IDS,
-            collectInstanceIdsAsList(result.getReservation().getInstances()));
-    }
-
-
-    private List<String> collectInstanceIdsAsList(List<Instance> instances) {
-        /* Make a copy as an ArrayList to force lazy collection evaluation */
-        return Lists.newArrayList(Lists.transform(instances,
-            new Function<Instance, String>() {
-                @Override
-                public String apply(Instance instance) {
-                    return instance.getInstanceId();
-                }
-            }));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunSpotInstances.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunSpotInstances.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunSpotInstances.java
deleted file mode 100644
index 16766f4..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/RunSpotInstances.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*    http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsRequest;
-import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsResult;
-import com.amazonaws.services.ec2.model.Filter;
-import com.amazonaws.services.ec2.model.RequestSpotInstancesRequest;
-import com.amazonaws.services.ec2.model.RequestSpotInstancesResult;
-import com.amazonaws.services.ec2.model.SpotInstanceRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Stopwatch;
-import com.google.common.collect.Lists;
-import com.google.common.util.concurrent.Uninterruptibles;
-
-
-public class RunSpotInstances extends RunInstances {
-
-    private static final Logger LOG = LoggerFactory.getLogger(RunSpotInstances.class);
-    
-    public RunSpotInstances(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
-        /* before sending a new request, we check to see if we already registered
-           a launch group with the process ID, if yes, we don't re-send the request */
-        final String businessKey = execution.getProcessBusinessKey();
-
-        /* we timeout if requests have already been sent - the activity is being retried. */
-        Optional<Object> alreadySent = Optional.fromNullable(
-                execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS));
-
-        if (alreadySent.isPresent()) {
-            DescribeSpotInstanceRequestsRequest describeRequest = new DescribeSpotInstanceRequestsRequest()
-                    .withFilters(new Filter()
-                        .withName("launch-group").withValues(businessKey)
-                        .withName("state").withValues("open", "active"));
-            Stopwatch stopwatch = new Stopwatch().start();
-            while (stopwatch.elapsedTime(TimeUnit.MINUTES) < 2) {
-                DescribeSpotInstanceRequestsResult result = client.describeSpotInstanceRequests(describeRequest);
-                List<SpotInstanceRequest> pending = result.getSpotInstanceRequests();
-                if (pending.size() > 0) {
-                    LOG.info("Not resending spot instance requests {} for businessKey: {}.", pending, businessKey);
-                    execution.setVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS, 
-                            collectSpotInstanceRequestIds(pending));
-                    return;
-                }
-                LOG.info("The describe call has not returned anything yet, waiting 20s and retrying.");
-                Uninterruptibles.sleepUninterruptibly(20, TimeUnit.SECONDS);
-            }
-        }
-
-        final RequestSpotInstancesRequest request = createSpotInstancesRequest(pool, execution);
-        execution.setVariable(ProcessVariables.SPOT_REQUESTS_SENT, true);
-        RequestSpotInstancesResult requestResult = client.requestSpotInstances(request);
-        List<String> spotInstanceRequestIds = collectSpotInstanceRequestIds(requestResult.getSpotInstanceRequests());
-
-        execution.setVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS, spotInstanceRequestIds);
-    }
-    
-    private List<String> collectSpotInstanceRequestIds(List<SpotInstanceRequest> requestResponses) {
-        /* Make a copy as an ArrayList to force lazy collection evaluation */
-        return Lists.newArrayList(Lists.transform(requestResponses,
-            new Function<SpotInstanceRequest, String>() {
-                @Override
-                public String apply(SpotInstanceRequest instanceRequest) {
-                    return instanceRequest.getSpotInstanceRequestId();
-                }
-            }));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/SetupAdminAccess.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/SetupAdminAccess.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/SetupAdminAccess.java
deleted file mode 100644
index 68ed926..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/SetupAdminAccess.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import com.axemblr.provisionr.api.access.AdminAccess;
-import com.axemblr.provisionr.api.pool.Machine;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.axemblr.provisionr.core.Mustache;
-import com.axemblr.provisionr.core.activities.PuppetActivity;
-import com.google.common.base.Charsets;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.io.Resources;
-import java.io.IOException;
-import java.util.Map;
-
-public class SetupAdminAccess extends PuppetActivity {
-
-    public static final String DEFAULT_UBUNTU_AMI_USER = "ubuntu";
-
-    public static final String ADMIN_ACCESS_TEMPLATE = "/com/axemblr/provisionr/amazon/puppet/adminaccess.pp.mustache";
-    public static final String SSHD_CONFIG_TEMPLATE = "/com/axemblr/provisionr/amazon/puppet/sshd_config.mustache";
-    public static final String SUDOERS_TEMPLATE = "/com/axemblr/provisionr/amazon/puppet/sudoers";
-
-    public SetupAdminAccess() {
-        super("adminaccess");
-    }
-
-    @Override
-    public AdminAccess overrideAdminAccess(Pool pool) {
-        return pool.getAdminAccess().toBuilder().username(DEFAULT_UBUNTU_AMI_USER).createAdminAccess();
-    }
-
-    @Override
-    public String createPuppetScript(Pool pool, Machine machine) throws Exception {
-        return Mustache.toString(getClass(), ADMIN_ACCESS_TEMPLATE,
-            ImmutableMap.of(
-                "user", pool.getAdminAccess().getUsername(),
-                "publicKey", getRawSshKey(pool))
-        );
-    }
-
-    private String getRawSshKey(Pool pool) {
-        return pool.getAdminAccess().getPublicKey().split(" ")[1];
-    }
-
-    @Override
-    public Map<String, String> createAdditionalFiles(Pool pool, Machine machine) throws IOException {
-        return ImmutableMap.of(
-            "/tmp/sshd_config",
-            Mustache.toString(getClass(), SSHD_CONFIG_TEMPLATE,
-                ImmutableMap.of("user", pool.getAdminAccess().getUsername())),
-            "/tmp/sudoers",
-            Resources.toString(Resources.getResource(getClass(), SUDOERS_TEMPLATE), Charsets.UTF_8)
-        );
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/TerminateInstances.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/TerminateInstances.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/TerminateInstances.java
deleted file mode 100644
index 25bc47b..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/activities/TerminateInstances.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.activities;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.model.TerminateInstancesRequest;
-import com.axemblr.provisionr.amazon.ProcessVariables;
-import com.axemblr.provisionr.amazon.core.ProviderClientCache;
-import com.axemblr.provisionr.api.pool.Pool;
-import com.google.common.base.Optional;
-
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Terminate instances previously started by {@see RunOnDemandInstances}
- */
-public class TerminateInstances extends AmazonActivity {
-
-    private static final Logger LOG = LoggerFactory.getLogger(TerminateInstances.class);
-
-    public TerminateInstances(ProviderClientCache cache) {
-        super(cache);
-    }
-
-    @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
-        @SuppressWarnings("unchecked")
-        Optional<List<String>> instanceIds = 
-                Optional.fromNullable((List<String>) execution.getVariable(ProcessVariables.INSTANCE_IDS));
-
-        LOG.info(">> Terminating instances: {}", instanceIds);
-        if (instanceIds.isPresent() && instanceIds.get().size() > 0) {
-            client.terminateInstances(new TerminateInstancesRequest().withInstanceIds(instanceIds.get()));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/config/DefaultProviderConfig.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/config/DefaultProviderConfig.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/config/DefaultProviderConfig.java
deleted file mode 100644
index 09e5b2f..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/config/DefaultProviderConfig.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.config;
-
-import com.axemblr.provisionr.amazon.AmazonProvisionr;
-import com.axemblr.provisionr.api.provider.Provider;
-import com.axemblr.provisionr.api.provider.ProviderBuilder;
-import com.google.common.base.Optional;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public class DefaultProviderConfig {
-
-    private final String accessKey;
-    private final String secretKey;
-    private final String region;
-    private final String endpoint;
-
-    public DefaultProviderConfig(String accessKey, String secretKey, String region, String endpoint) {
-        this.accessKey = checkNotNull(accessKey, "accessKey is null");
-        this.secretKey = checkNotNull(secretKey, "secretKey is null");
-        this.region = checkNotNull(region, "region is null");
-        this.endpoint = checkNotNull(endpoint, "endpoint is null");
-    }
-
-    public Optional<Provider> createProvider() {
-        if (accessKey.isEmpty() || secretKey.isEmpty()) {
-            return Optional.absent();
-        }
-        final ProviderBuilder builder = Provider.builder()
-            .id(AmazonProvisionr.ID)
-            .accessKey(accessKey)
-            .secretKey(secretKey);
-
-        if (!region.isEmpty()) {
-            builder.option("region", region);
-        }
-
-        if (endpoint.isEmpty()) {
-            builder.endpoint(Optional.<String>absent());
-        } else {
-            builder.endpoint(endpoint);
-        }
-
-        return Optional.of(builder.createProvider());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ErrorCodes.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ErrorCodes.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ErrorCodes.java
deleted file mode 100644
index 78a159f..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ErrorCodes.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.core;
-
-public class ErrorCodes {
-
-    private ErrorCodes() {
-        /* singleton */
-    }
-
-    public static final String SECURITY_GROUP_NOT_FOUND = "InvalidGroup.NotFound";
-
-    public static final String DUPLICATE_SECURITY_GROUP = "InvalidGroup.Duplicate";
-
-    public static final String DUPLICATE_KEYPAIR = "InvalidKeyPair.Duplicate";
-
-    public static final String KEYPAIR_NOT_FOUND = "InvalidKeyPair.NotFound";
-
-}                         

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTable.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTable.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTable.java
deleted file mode 100644
index 3a9587d..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTable.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.core;
-
-import com.google.common.base.Charsets;
-import com.google.common.base.Function;
-import com.google.common.base.Objects;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableTable;
-import com.google.common.collect.Iterables;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Table;
-import com.google.common.collect.Tables;
-import com.google.common.io.Resources;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-public class ImageTable {
-
-    private static final Splitter COMMA = Splitter.on(",").trimResults();
-
-    /**
-     * Load the list of AMIs from a resource file (csv format)
-     * <p/>
-     * Note: the parser is doing only split by comma. There is no
-     * support for escaping line components
-     *
-     * @param resource path to resource
-     * @return an instance of {@see ImageTable}
-     * @throws IOException
-     */
-    public static ImageTable fromCsvResource(String resource) throws IOException {
-        checkNotNull(resource, "resource is null");
-
-        List<String> lines = Resources.readLines(Resources.getResource(ImageTable.class, resource), Charsets.UTF_8);
-        checkArgument(!lines.isEmpty(), "the resource is an empty file");
-
-        final ImmutableTable.Builder<String, String, String> table = ImmutableTable.builder();
-        final Iterable<String> headers = extractHeaders(lines);
-
-        int index = 0;
-        for (String line : Iterables.skip(lines, 1)) {
-            final Iterable<Table.Cell<String, String, String>> cells =
-                combineHeadersWithLinePartsAsTableCells(index, headers, COMMA.split(line));
-            for (Table.Cell<String, String, String> cell : cells) {
-                table.put(cell);
-            }
-            index++;
-        }
-
-        return new ImageTable(table.build());
-    }
-
-    static Iterable<Table.Cell<String, String, String>> combineHeadersWithLinePartsAsTableCells(
-        int index, Iterable<String> headers, Iterable<String> lineParts
-    ) {
-        final String rowKey = "" + index;
-        return transform(zip(headers, lineParts),
-            new Function<Map.Entry<String, String>, Table.Cell<String, String, String>>() {
-                @Override
-                public Table.Cell<String, String, String> apply(Map.Entry<String, String> entry) {
-                    return Tables.immutableCell(rowKey, entry.getKey(), entry.getValue());
-                }
-            });
-    }
-
-    static <K, V> Iterable<Map.Entry<K, V>> zip(Iterable<K> first, Iterable<V> second) {
-        checkArgument(Iterables.size(first) == Iterables.size(second), "iterables don't have the same size");
-
-        final Iterator<K> iterator = first.iterator();
-        return newArrayList(transform(second, new Function<V, Map.Entry<K, V>>() {
-            @Override
-            public Map.Entry<K, V> apply(V input) {
-                return Maps.immutableEntry(iterator.next(), input);
-            }
-        }));
-    }
-
-    static Iterable<String> extractHeaders(List<String> lines) {
-        String headerLine = Iterables.getFirst(lines, "");
-        checkArgument(!headerLine.isEmpty(), "Found an empty header line");
-
-        return COMMA.split(headerLine);
-    }
-
-    private final Table<String, String, String> table;
-
-    public ImageTable(Table<String, String, String> table) {
-        this.table = checkNotNull(table, "table is null");
-    }
-
-    Table<String, String, String> getTable() {
-        return table;
-    }
-
-    public ImageTableQuery query() {
-        return new ImageTableQuery(this);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(table);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ImageTable other = (ImageTable) obj;
-        return Objects.equal(this.table, other.table);
-    }
-
-    @Override
-    public String toString() {
-        return "ImageTable{" +
-            "table=" + table +
-            '}';
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTableQuery.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTableQuery.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTableQuery.java
deleted file mode 100644
index 78c18c9..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/ImageTableQuery.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.core;
-
-import com.google.common.base.Objects;
-import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import java.util.Map;
-
-public class ImageTableQuery {
-
-    private final ImageTable table;
-    private final ImmutableMap.Builder<String, String> filtersBuilder = ImmutableMap.builder();
-
-    public ImageTableQuery(ImageTable table) {
-        this.table = checkNotNull(table, "table is null");
-    }
-
-    public ImageTableQuery filterBy(String column, String value) {
-        filtersBuilder.put(column, value);
-        return this;
-    }
-
-    public String singleResult() {
-        final Map<String, String> filters = filtersBuilder.build();
-        final ImmutableSet.Builder<String> builder = ImmutableSet.builder();
-
-        for (String row : table.getTable().rowKeySet()) {
-            if (matchesFilters(table.getTable().row(row), filters)) {
-                builder.add(table.getTable().get(row, "ami-id"));
-            }
-        }
-        return Iterables.getOnlyElement(builder.build());
-    }
-
-    boolean matchesFilters(final Map<String, String> row, Map<String, String> filters) {
-        return Iterables.all(filters.entrySet(),
-            new Predicate<Map.Entry<String, String>>() {
-                @Override
-                public boolean apply(Map.Entry<String, String> entry) {
-                    return Objects.equal(row.get(entry.getKey()), entry.getValue());
-                }
-            });
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(table, filtersBuilder);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ImageTableQuery other = (ImageTableQuery) obj;
-        return Objects.equal(this.table, other.table) && Objects.equal(this.filtersBuilder, other.filtersBuilder);
-    }
-
-    @Override
-    public String toString() {
-        return "ImageTableQuery{" +
-            "table=" + table +
-            ", filters=" + filtersBuilder +
-            '}';
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/6ba40c4b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/KeyPairs.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/KeyPairs.java b/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/KeyPairs.java
deleted file mode 100644
index fb7acf7..0000000
--- a/providers/amazon/src/main/java/com/axemblr/provisionr/amazon/core/KeyPairs.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2012 S.C. Axemblr Software Solutions S.R.L
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.axemblr.provisionr.amazon.core;
-
-public class KeyPairs {
-
-    private KeyPairs() {
-        /* singleton */
-    }
-
-    public static String formatNameFromBusinessKey(String businessKey) {
-        return String.format("key-%s", businessKey);
-    }
-}


Mime
View raw message