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.ec2.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.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet; |
31 | import org.jclouds.ec2.compute.strategy.EC2DestroyNodeStrategy; |
32 | import org.jclouds.ec2.compute.strategy.EC2GetNodeMetadataStrategy; |
33 | import org.jclouds.ec2.compute.strategy.EC2ListNodesStrategy; |
34 | import org.jclouds.ec2.compute.strategy.EC2RebootNodeStrategy; |
35 | import org.jclouds.ec2.compute.strategy.EC2ResumeNodeStrategy; |
36 | import org.jclouds.ec2.compute.strategy.EC2SuspendNodeStrategy; |
37 | |
38 | /** |
39 | * @author Adrian Cole |
40 | */ |
41 | public class EC2BindComputeStrategiesByClass extends BindComputeStrategiesByClass { |
42 | @Override |
43 | protected Class<? extends CreateNodesInGroupThenAddToSet> defineRunNodesAndAddToSetStrategy() { |
44 | return EC2CreateNodesInGroupThenAddToSet.class; |
45 | } |
46 | |
47 | /** |
48 | * not needed, as {@link EC2CreateNodesInGroupThenAddToSet} is used and is already set-based. |
49 | */ |
50 | @Override |
51 | protected Class<? extends CreateNodeWithGroupEncodedIntoName> defineAddNodeWithTagStrategy() { |
52 | return null; |
53 | } |
54 | |
55 | /** |
56 | * not needed, as {@link EC2CreateNodesInGroupThenAddToSet} is used and is already set-based. |
57 | */ |
58 | @Override |
59 | protected void bindAddNodeWithTagStrategy(Class<? extends CreateNodeWithGroupEncodedIntoName> clazz) { |
60 | } |
61 | |
62 | @Override |
63 | protected Class<? extends DestroyNodeStrategy> defineDestroyNodeStrategy() { |
64 | return EC2DestroyNodeStrategy.class; |
65 | } |
66 | |
67 | @Override |
68 | protected Class<? extends GetNodeMetadataStrategy> defineGetNodeMetadataStrategy() { |
69 | return EC2GetNodeMetadataStrategy.class; |
70 | } |
71 | |
72 | @Override |
73 | protected Class<? extends ListNodesStrategy> defineListNodesStrategy() { |
74 | return EC2ListNodesStrategy.class; |
75 | } |
76 | |
77 | @Override |
78 | protected Class<? extends RebootNodeStrategy> defineRebootNodeStrategy() { |
79 | return EC2RebootNodeStrategy.class; |
80 | } |
81 | |
82 | @Override |
83 | protected Class<? extends ResumeNodeStrategy> defineStartNodeStrategy() { |
84 | return EC2ResumeNodeStrategy.class; |
85 | } |
86 | |
87 | @Override |
88 | protected Class<? extends SuspendNodeStrategy> defineStopNodeStrategy() { |
89 | return EC2SuspendNodeStrategy.class; |
90 | } |
91 | |
92 | } |