Class CloudPoolServer
- java.lang.Object
-
- com.elastisys.scale.cloudpool.api.server.CloudPoolServer
-
public class CloudPoolServer extends java.lang.ObjectFactory methods for creating a HTTPS server that publishes a REST API for aCloudPoolinstance. The REST API is fully covered in the elastisys:scale cloud pool REST API documentation.
-
-
Constructor Summary
Constructors Constructor Description CloudPoolServer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.jetty.server.ServercreateServer(CloudPool cloudPool, CloudPoolOptions options)Creates a HTTPS server that serves REST API requests for a givenCloudPool.static voidmain(CloudPool cloudPool, java.lang.String[] args)Parse command-line arguments and start an HTTPS server that serves REST API requests for a givenCloudPool.static CloudPoolOptionsparseArgs(java.lang.String[] args)Parses command-line arguments intoCloudPoolOptions.
-
-
-
Method Detail
-
parseArgs
public static CloudPoolOptions parseArgs(java.lang.String[] args)
Parses command-line arguments intoCloudPoolOptions. 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--helpwill 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 givenCloudPool. 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 givenCloudPool. The created server is returned with theCloudPoolREST 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 ofCloudPoolOptions.- Parameters:
cloudPool- The cloud pool that theServerwill 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 theCloudPoolor create the server.
-
-