AEC2Instance
- java.lang.Object
-
- com.dashoptimization.AEC2Instance
-
public class AEC2Instance extends java.lang.Object
-
-
Field Summary
Modifier and Type Field and Description java.lang.String
dns
Public DNS name of the instance.java.lang.String
image
Image name.java.lang.String
ipaddr
Public IP address of the instance.java.lang.String
key
Name of the SSH key used to connect to this instance.java.util.Date
launchtime
Instance launch time.static int
PENDING
State: instance starting.static int
RUNNING
State: instance running.static int
SHUTTING_DOWN
State: instance shutting down.int
state
Instance state.static int
STOPPED
State: instance stopped.static int
STOPPING
State: instance stopping.static int
TERMINATED
State: instance terminated.java.lang.String
type
Instance type.
-
Method Summary
Modifier and Type Method and Description java.lang.String
getConnString()
Generate a valid connection string for this instance (default mode)java.lang.String
getConnStringSSH()
Generate a valid connection string for this instance (for SSH)java.lang.String
getConnStringXSRV()
Generate a valid connection string for this instance (for xprmsrv)java.lang.String
getId()
Return Id of this instancejava.lang.String
statetext()
Return the text corresponding to the state of this instancestatic java.lang.String
statetext(int s)
Return the text corresponding to an instance statevoid
terminate()
Terminate this instancevoid
update()
Update instance informationboolean
waitIsReady(int delay, boolean verbose)
Wait until the instance to be ready to process connections
-
-
-
Field Detail
-
PENDING
public static final int PENDING
State: instance starting.- See Also:
- Constant Field Values
-
RUNNING
public static final int RUNNING
State: instance running.- See Also:
- Constant Field Values
-
SHUTTING_DOWN
public static final int SHUTTING_DOWN
State: instance shutting down.- See Also:
- Constant Field Values
-
TERMINATED
public static final int TERMINATED
State: instance terminated.- See Also:
- Constant Field Values
-
STOPPING
public static final int STOPPING
State: instance stopping.- See Also:
- Constant Field Values
-
STOPPED
public static final int STOPPED
State: instance stopped.- See Also:
- Constant Field Values
-
image
public java.lang.String image
Image name.
-
state
public int state
Instance state.
-
dns
public java.lang.String dns
Public DNS name of the instance.
-
key
public java.lang.String key
Name of the SSH key used to connect to this instance.
-
type
public java.lang.String type
Instance type.
-
launchtime
public java.util.Date launchtime
Instance launch time.
-
ipaddr
public java.lang.String ipaddr
Public IP address of the instance.
-
-
Method Detail
-
getId
public java.lang.String getId()
Return Id of this instance
-
getConnStringSSH
public java.lang.String getConnStringSSH()
Generate a valid connection string for this instance (for SSH)
-
getConnStringXSRV
public java.lang.String getConnStringXSRV()
Generate a valid connection string for this instance (for xprmsrv)
-
getConnString
public java.lang.String getConnString()
Generate a valid connection string for this instance (default mode)
-
waitIsReady
public boolean waitIsReady(int delay, boolean verbose)
Wait until the instance to be ready to process connections- Parameters:
-
delay
- maximum wait time -
verbose
- iftrue
a dot is displayed avey 5sec - Returns:
-
true
if the instance is ready
-
update
public void update()
Update instance information
-
statetext
public static java.lang.String statetext(int s)
Return the text corresponding to an instance state- Parameters:
-
s
- state as a numeric code - Returns:
- text associated to the state
-
statetext
public java.lang.String statetext()
Return the text corresponding to the state of this instance- Returns:
- text associated to the state
-
terminate
public void terminate() throws java.io.IOException
Terminate this instance- Throws:
-
java.io.IOException
-
-