AEC2Instance
- java.lang.Object
-
- com.dashoptimization.AEC2Instance
-
public class AEC2Instance extends java.lang.Object
-
-
Field Summary
Modifier and Type Field and Description java.lang.StringdnsPublic DNS name of the instance.java.lang.StringimageImage name.java.lang.StringipaddrPublic IP address of the instance.java.lang.StringkeyName of the SSH key used to connect to this instance.java.util.DatelaunchtimeInstance launch time.static intPENDINGState: instance starting.static intRUNNINGState: instance running.static intSHUTTING_DOWNState: instance shutting down.intstateInstance state.static intSTOPPEDState: instance stopped.static intSTOPPINGState: instance stopping.static intTERMINATEDState: instance terminated.java.lang.StringtypeInstance type.
-
Method Summary
Modifier and Type Method and Description java.lang.StringgetConnString()Generate a valid connection string for this instance (default mode)java.lang.StringgetConnStringSSH()Generate a valid connection string for this instance (for SSH)java.lang.StringgetConnStringXSRV()Generate a valid connection string for this instance (for xprmsrv)java.lang.StringgetId()Return Id of this instancejava.lang.Stringstatetext()Return the text corresponding to the state of this instancestatic java.lang.Stringstatetext(int s)Return the text corresponding to an instance statevoidterminate()Terminate this instancevoidupdate()Update instance informationbooleanwaitIsReady(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- iftruea dot is displayed avey 5sec - Returns:
-
trueif 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.IOExceptionTerminate this instance- Throws:
-
java.io.IOException
-
-
