1 package org.kuali.maven.ec2;
2
3 import org.apache.maven.plugin.MojoExecutionException;
4
5
6
7
8
9
10 public class TerminateInstanceMojo extends AbstractEC2Mojo {
11
12
13
14
15
16
17
18 private String instanceId;
19
20
21
22
23
24
25 private boolean wait;
26
27
28
29
30
31
32 private int waitTimeout;
33
34
35
36
37
38
39 private String state;
40
41 @Override
42 protected boolean isSkip() {
43 if (Constants.NONE.equals(instanceId)) {
44 getLog().info("instanceId=" + instanceId);
45 return true;
46 } else {
47 return false;
48 }
49 }
50
51 @Override
52 public void execute(EC2Utils ec2Utils) throws MojoExecutionException {
53 WaitControl wc = new WaitControl(wait, waitTimeout, state);
54 ec2Utils.terminate(instanceId, wc);
55 }
56
57 public String getInstanceId() {
58 return instanceId;
59 }
60
61 public void setInstanceId(String id) {
62 this.instanceId = id;
63 }
64
65 public boolean isWait() {
66 return wait;
67 }
68
69 public void setWait(boolean wait) {
70 this.wait = wait;
71 }
72
73 public int getWaitTimeout() {
74 return waitTimeout;
75 }
76
77 public void setWaitTimeout(int waitTimeout) {
78 this.waitTimeout = waitTimeout;
79 }
80
81 public String getState() {
82 return state;
83 }
84
85 public void setState(String state) {
86 this.state = state;
87 }
88 }