| 1 | /** |
| 2 | * Licensed to jclouds, Inc. (jclouds) under one or more |
| 3 | * contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. jclouds licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.jclouds.vcloud.compute.config; |
| 20 | |
| 21 | import org.jclouds.compute.config.BindComputeStrategiesByClass; |
| 22 | import org.jclouds.compute.strategy.CreateNodeWithGroupEncodedIntoName; |
| 23 | import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet; |
| 24 | import org.jclouds.compute.strategy.DestroyNodeStrategy; |
| 25 | import org.jclouds.compute.strategy.GetNodeMetadataStrategy; |
| 26 | import org.jclouds.compute.strategy.ListNodesStrategy; |
| 27 | import org.jclouds.compute.strategy.RebootNodeStrategy; |
| 28 | import org.jclouds.compute.strategy.ResumeNodeStrategy; |
| 29 | import org.jclouds.compute.strategy.SuspendNodeStrategy; |
| 30 | import org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet; |
| 31 | import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn; |
| 32 | import org.jclouds.vcloud.compute.strategy.VCloudDestroyNodeStrategy; |
| 33 | import org.jclouds.vcloud.compute.strategy.VCloudGetNodeMetadataStrategy; |
| 34 | import org.jclouds.vcloud.compute.strategy.VCloudLifeCycleStrategy; |
| 35 | import org.jclouds.vcloud.compute.strategy.VCloudListNodesStrategy; |
| 36 | /** |
| 37 | * @author Adrian Cole |
| 38 | */ |
| 39 | public class VCloudBindComputeStrategiesByClass extends BindComputeStrategiesByClass { |
| 40 | |
| 41 | @Override |
| 42 | protected Class<? extends CreateNodesInGroupThenAddToSet> defineRunNodesAndAddToSetStrategy() { |
| 43 | return CreateNodesWithGroupEncodedIntoNameThenAddToSet.class; |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | protected Class<? extends CreateNodeWithGroupEncodedIntoName> defineAddNodeWithTagStrategy() { |
| 48 | return InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class; |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | protected Class<? extends DestroyNodeStrategy> defineDestroyNodeStrategy() { |
| 53 | return VCloudDestroyNodeStrategy.class; |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | protected Class<? extends GetNodeMetadataStrategy> defineGetNodeMetadataStrategy() { |
| 58 | return VCloudGetNodeMetadataStrategy.class; |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | protected Class<? extends ListNodesStrategy> defineListNodesStrategy() { |
| 63 | return VCloudListNodesStrategy.class; |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | protected Class<? extends RebootNodeStrategy> defineRebootNodeStrategy() { |
| 68 | return VCloudLifeCycleStrategy.class; |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | protected Class<? extends ResumeNodeStrategy> defineStartNodeStrategy() { |
| 73 | return VCloudLifeCycleStrategy.class; |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | protected Class<? extends SuspendNodeStrategy> defineStopNodeStrategy() { |
| 78 | return VCloudLifeCycleStrategy.class; |
| 79 | } |
| 80 | } |