Initializing help system before first use

AEC2

  • java.lang.Object
    • com.dashoptimization.AEC2


  • public class AEC2
    extends java.lang.Object
    • Field Summary

      Modifier and Type Field and Description
      java.lang.String connectionMode
      Default connection mode (xprmsrv or ssh).
      java.lang.String image
      The AMI Id used when starting a new instance.
      java.lang.String instanceType
      The instance type used when starting a new instance.
      java.lang.String securityGroup
      The name of the security group used when starting a new instance.
      int xsrvPort
      Port used by xprmsrv.
    • Constructor Summary

      Constructor and Description
      AEC2() 
    • Method Summary

      Modifier and Type Method and Description
      java.util.List<AEC2Instance> getAllInstances()
      Retrieve from AWS the list of running (or recently terminated) instances.
      void loadConfig(java.lang.String fname)
      Load a config file written by Mosel
      AEC2Instance runInstance()
      Run a new instance using the current settings
      void setCredentials(java.lang.String uid, java.lang.String passwd)
      Set AWS Credentials
      void setEndPoint(java.lang.String ep)
      Set EndPoint
      void setSSHKey(java.lang.String k, java.lang.String kdata)
      Set SSH keys
      static boolean tcpPing(java.lang.String hostname, int port)
      Test whether a remote host accepts connections on a given port
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • image

        public java.lang.String image
        The AMI Id used when starting a new instance. This parameter is initialised by loadConfig(java.lang.String)
      • instanceType

        public java.lang.String instanceType
        The instance type used when starting a new instance. This parameter is initialised by loadConfig(java.lang.String). Possible values: m1.small, m1.large, m1.xlarge, c1.medium, c1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, cc1.4xlarge, cg1.4xlarge, t1.micro
      • securityGroup

        public java.lang.String securityGroup
        The name of the security group used when starting a new instance. This parameter is initialised by loadConfig(java.lang.String)
      • connectionMode

        public java.lang.String connectionMode
        Default connection mode (xprmsrv or ssh). This parameter is initialised by loadConfig(java.lang.String)
    • Constructor Detail

      • AEC2

        public AEC2()
    • Method Detail

      • loadConfig

        public void loadConfig(java.lang.String fname)
                        throws java.io.IOException
        Load a config file written by Mosel
        Parameters:
        fname - file to process
        Throws:
        java.io.IOException - If load fails or the data it contains is not valid
      • setEndPoint

        public void setEndPoint(java.lang.String ep)
                         throws java.io.IOException
        Set EndPoint
        Parameters:
        ep - Endpoint to use
        Throws:
        java.io.IOException - If request to AWS fails
      • setCredentials

        public void setCredentials(java.lang.String uid,
                                   java.lang.String passwd)
                            throws java.io.IOException
        Set AWS Credentials
        Parameters:
        uid - User Id
        passwd - password
        Throws:
        java.io.IOException - If the password or use ID is not valid
      • setSSHKey

        public void setSSHKey(java.lang.String k,
                              java.lang.String kdata)
                       throws java.io.IOException
        Set SSH keys
        Parameters:
        k - the key name
        kdata - its secret part
        Throws:
        java.io.IOException - If the file generation fails (the key is saved into a file).
      • runInstance

        public AEC2Instance runInstance()
                                 throws java.io.IOException
        Run a new instance using the current settings
        Throws:
        java.io.IOException
      • getAllInstances

        public java.util.List<AEC2Instance> getAllInstances()
                                                     throws java.io.IOException
        Retrieve from AWS the list of running (or recently terminated) instances.
        Throws:
        java.io.IOException
      • tcpPing

        public static boolean tcpPing(java.lang.String hostname,
                                      int port)
        Test whether a remote host accepts connections on a given port
        Parameters:
        hostname - host to test
        port - TCP port to test
        Returns:
        true if connection is possible