Class CloudPoolServer

    • Constructor Summary

      Constructors 
      Constructor Description
      CloudPoolServer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.jetty.server.Server createServer​(CloudPool cloudPool, CloudPoolOptions options)
      Creates a HTTPS server that serves REST API requests for a given CloudPool.
      static void main​(CloudPool cloudPool, java.lang.String[] args)
      Parse command-line arguments and start an HTTPS server that serves REST API requests for a given CloudPool.
      static CloudPoolOptions parseArgs​(java.lang.String[] args)
      Parses command-line arguments into CloudPoolOptions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloudPoolServer

        public CloudPoolServer()
    • Method Detail

      • parseArgs

        public static CloudPoolOptions parseArgs​(java.lang.String[] args)
        Parses command-line arguments into CloudPoolOptions. On failure to process the command-line arguments, an error will be written together with a usage string and then the program will exit with a failure code.

        The --help will cause the usage text to be written before exiting the program (with a zero exit code).

        Parameters:
        args -
        Returns:
      • main

        public static void main​(CloudPool cloudPool,
                                java.lang.String[] args)
                         throws java.lang.Exception
        Parse command-line arguments and start an HTTPS server that serves REST API requests for a given CloudPool.

        A failure to parse the command-line arguments will cause the program to print a usage message and exit with an error code. The function blocks until the started server is stopped.

        Parameters:
        cloudPool - The cloud pool that the started server will publish.
        args - The command-line arguments.
        Throws:
        java.lang.Exception
      • createServer

        public static org.eclipse.jetty.server.Server createServer​(CloudPool cloudPool,
                                                                   CloudPoolOptions options)
                                                            throws java.lang.Exception
        Creates a HTTPS server that serves REST API requests for a given CloudPool.

        The created server is returned with the CloudPool REST API deployed, but in an unstarted state, so the client is responsible for starting the server.

        The behavior of the HTTPS server is controlled via a set of CloudPoolOptions.

        Parameters:
        cloudPool - The cloud pool that the Server will publish.
        options - A set of options that control the behavior of the HTTPS server.
        Returns:
        The created Server.
        Throws:
        java.lang.Exception - Thrown on a failure to initialize the CloudPool or create the server.