Swagger API: putting the jvm back

As part of the jvm implementation the jvm.json and the reference to it
need to return to the build.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: missing a class in a method decleration

The class name is missing in the method decleration. It would cause a
symobol not found error if tried to use.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Fix a bug in the initilization of the a bufferbuilder

The way the buffer builder was initilized the first character was
ignored.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Remove copy constructor and assignment from json base

In the implementation of the jvm API there is a used of a list of Json
object, that cause sometimes Json objects to be copied construct.

To support Json object copying, the base copy constructor does not needs
to do anything as the copying is done in the inherit class. To enforce
that, the copy constructor and assignment operator are deleted from the
json base class.

The logic for copying an object is added by the code generation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Fix a few error with commas in Json parsing

While testing the jvm implementation a few errors were find with the
position of commas in the parsed json object.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Adding copy constructor to the generated code

Sometimes the generated Json object needs to be copied construct. The
code generation script now adds a copy constructor.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add query parameters to the request structure

The request structure should support query parameters, it has now a
vector to hold it and a search function to look for it.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Fix a comment and format in handler.hh

The comment was wrong and an astyle was applied on the file.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add not found exception to handler

Sometimes it is required that a handler will return a 404, for example
the handler that interact with the jvm will return a 404 if the jvm is
not available.

To support that the handler can throw a not_found exception that will be
caught by the routes that in response will return a 404 to the request.

In addition the set_header method was change so that a handler can use
it to return status different then an OK.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: support query parameters

The jvm api implementation requires query parameters support. To support
that the request handler will parse the url before it is decode, find if
it contains query parameters and add each of the parameters to the
request.

For that the request handler needs to get the request by reference and
not a const reference and the parameter parsing need to be done before
the url decode.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: routes dispatching need to support GET/POST

In the jvm API implementation there are API with the same url but differ
in their http type (GET vs POST) to support that the routes need to
handle matching rule by the the http type.

To do that the rules are now array of vector, to support multiple
commands (currently GET and POST are supported)

When a request is matched against the matching rules the entry in the
array is picked according to the http command.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add the java directory to the include list

The jvm implementation depends on the include file from java
directory the directory is added to the makefile

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add the jvm implementation

This adds the implementation for the jvm.json,  the supported operations
are:
/jvm/version - get the jvm version
/jvm/memory/gc - GET get the garbage collection information
/jvm/memory/gc - POST force a garbage collection
/jvm/jmx/{mbean} - GET mbean information
/jvm/jmx/ - get a list of all the mbean in the system
/jvm/jmx/{mbean}/{attribute} - POST set an attribute in an mbean

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add the jvm init to main

The main needs to call the jvm init.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server: Add stubs for the java_api

The java_api is the java front end and is part of the osv code, for the
standalone application to keep working, it needs to be stub locally.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http server Testing: set empty reply on POST command

When calling post command the reply is empty, there is no need to parse
it

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server Testing: add try to curl request

The curl helper function should catch exceptions if they occure and
return an empty string.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server Testing: Testing the jvm API add validation function

Adds helper validation function

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server Testing: Start with a jvm and validate that it connects

To test the jvm the image needs to start with the jvm, it is now set to
open the CRaSH while testing. In addition, before the tests starts, it
validates that the jvm is ready.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Http Server Testing: Add the jvm testing

Adds tests for each of the url that includes in the jvm.json API

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>