changeset 260:8453ba17aa0f

Add VM compiler plugin to gateway. Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/025016.html
author Chris Lessard <clessard@redhat.com>
date Mon, 18 Sep 2017 16:03:05 -0400
parents 5704bdfab65e
children d4290a3f1e03
files distribution/pom.xml distribution/src/etc/services.properties services/jvm-compiler/pom.xml services/jvm-compiler/src/main/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerHttpHandler.java services/jvm-compiler/src/main/java/com/redhat/thermostat/gateway/service/jvm/compiler/SwaggerSpecResourceHandler.java services/jvm-compiler/src/main/resources/jvm-compiler-swagger.yaml services/jvm-compiler/src/main/webapp/WEB-INF/web.xml services/jvm-gc/src/main/resources/jvm-gc-swagger.yaml services/pom.xml tests/integration-tests/src/test/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerServiceIntegrationTest.java tests/keycloak-integration-tests/src/test/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerServiceKeycloakIntegrationTest.java
diffstat 11 files changed, 766 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/pom.xml	Thu Sep 14 10:23:32 2017 -0400
+++ b/distribution/pom.xml	Mon Sep 18 16:03:05 2017 -0400
@@ -230,6 +230,13 @@
                         </artifactItem>
                         <artifactItem>
                             <groupId>com.redhat.thermostat</groupId>
+                            <artifactId>thermostat-web-gateway-service-jvm-compiler</artifactId>
+                            <version>${project.version}</version>
+                            <type>war</type>
+                            <overWrite>false</overWrite>
+                        </artifactItem>
+                        <artifactItem>
+                            <groupId>com.redhat.thermostat</groupId>
                             <artifactId>thermostat-web-gateway-service-jvm-gc</artifactId>
                             <version>${project.version}</version>
                             <type>war</type>
@@ -347,6 +354,13 @@
         </dependency>
         <dependency>
             <groupId>com.redhat.thermostat</groupId>
+            <artifactId>thermostat-web-gateway-service-jvm-compiler</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.redhat.thermostat</groupId>
             <artifactId>thermostat-web-gateway-service-system-memory</artifactId>
             <version>${project.version}</version>
             <type>war</type>
--- a/distribution/src/etc/services.properties	Thu Sep 14 10:23:32 2017 -0400
+++ b/distribution/src/etc/services.properties	Mon Sep 18 16:03:05 2017 -0400
@@ -1,5 +1,6 @@
 /commands = thermostat-web-gateway-service-commands-@project.version@.war
 /jvm-cpu = thermostat-web-gateway-service-jvm-cpu-@project.version@.war
+/jvm-compiler = thermostat-web-gateway-service-jvm-compiler-@project.version@.war
 /jvm-gc = thermostat-web-gateway-service-jvm-gc-@project.version@.war
 /jvm-io = thermostat-web-gateway-service-jvm-io-@project.version@.war
 /jvm-memory = thermostat-web-gateway-service-jvm-memory-@project.version@.war
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/jvm-compiler/pom.xml	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2012-2017 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses/>.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>thermostat-web-gateway-services</artifactId>
+        <groupId>com.redhat.thermostat</groupId>
+        <version>1.99.12-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>thermostat-web-gateway-service-jvm-compiler</artifactId>
+
+    <packaging>war</packaging>
+
+    <name>Thermostat Web Gateway JVM Compiler Service</name>
+
+    <properties>
+        <com.redhat.thermostat.gateway.SERVICE_NAME>jvm-compiler</com.redhat.thermostat.gateway.SERVICE_NAME>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>${javax.servlet.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>${javax-rs-api.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.redhat.thermostat</groupId>
+            <artifactId>thermostat-web-gateway-common-mongodb</artifactId>
+            <version>1.99.12-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <webResources>
+                        <resource>
+                            <directory>src/main/webapp</directory>
+                            <filtering>true</filtering>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/jvm-compiler/src/main/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerHttpHandler.java	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.gateway.service.jvm.compiler;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import com.redhat.thermostat.gateway.common.core.model.OffsetParameter;
+import com.redhat.thermostat.gateway.common.mongodb.servlet.MongoHttpHandlerHelper;
+import com.redhat.thermostat.gateway.common.mongodb.servlet.RequestParameters;
+
+@Path("/")
+public class JvmCompilerHttpHandler {
+    private static final String collectionName = "jvm-compiler";
+
+    private final MongoHttpHandlerHelper serviceHelper = new MongoHttpHandlerHelper(collectionName);
+
+    @GET
+    @Path("/jvms/{" + RequestParameters.JVM_ID + "}")
+    @Consumes({ "application/json" })
+    @Produces({ "application/json", "text/html; charset=utf-8" })
+    public Response getJvmCompiler(@PathParam(RequestParameters.JVM_ID) String jvmId,
+                              @QueryParam(RequestParameters.LIMIT) @DefaultValue("1") Integer limit,
+                              @QueryParam(RequestParameters.OFFSET) @DefaultValue("0") OffsetParameter offset,
+                              @QueryParam(RequestParameters.SORT) String sort,
+                              @QueryParam(RequestParameters.QUERY) String queries,
+                              @QueryParam(RequestParameters.INCLUDE) String includes,
+                              @QueryParam(RequestParameters.EXCLUDE) String excludes,
+                              @QueryParam(RequestParameters.METADATA) @DefaultValue("false") Boolean metadata,
+                              @Context HttpServletRequest httpServletRequest,
+                              @Context ServletContext context) {
+        return serviceHelper.handleGetWithJvmID(httpServletRequest, context, null, jvmId, limit, offset.getValue(), sort, queries, includes, excludes, metadata);
+    }
+
+    @GET
+    @Path("/systems/{" + RequestParameters.SYSTEM_ID + "}/jvms/{" + RequestParameters.JVM_ID + "}")
+    @Consumes({ "application/json" })
+    @Produces({ "application/json", "text/html; charset=utf-8" })
+    public Response getJvmCompiler(@PathParam(RequestParameters.SYSTEM_ID) String systemId,
+                              @PathParam(RequestParameters.JVM_ID) String jvmId,
+                              @QueryParam(RequestParameters.LIMIT) @DefaultValue("1") Integer limit,
+                              @QueryParam(RequestParameters.OFFSET) @DefaultValue("0") OffsetParameter offset,
+                              @QueryParam(RequestParameters.SORT) String sort,
+                              @QueryParam(RequestParameters.QUERY) String queries,
+                              @QueryParam(RequestParameters.INCLUDE) String includes,
+                              @QueryParam(RequestParameters.EXCLUDE) String excludes,
+                              @QueryParam(RequestParameters.METADATA) @DefaultValue("false") Boolean metadata,
+                              @Context HttpServletRequest httpServletRequest,
+                              @Context ServletContext context) {
+        return serviceHelper.handleGetWithJvmID(httpServletRequest, context, systemId, jvmId, limit, offset.getValue(), sort, queries, includes, excludes, metadata);
+    }
+
+    @POST
+    @Path("/systems/{" + RequestParameters.SYSTEM_ID + "}/jvms/{" + RequestParameters.JVM_ID + "}")
+    @Consumes({ "application/json" })
+    @Produces({ "application/json", "text/html; charset=utf-8" })
+    public Response postJvmCompiler(String body,
+                               @PathParam(RequestParameters.SYSTEM_ID) String systemId,
+                               @PathParam(RequestParameters.JVM_ID) String jvmId,
+                               @QueryParam(RequestParameters.METADATA) @DefaultValue("false") Boolean metadata,
+                               @Context ServletContext context,
+                               @Context HttpServletRequest httpServletRequest) {
+        return serviceHelper.handlePostWithJvmID(httpServletRequest, context, systemId, jvmId, metadata, body);
+    }
+
+    @DELETE
+    @Path("/systems/{" + RequestParameters.SYSTEM_ID + "}/jvms/{" + RequestParameters.JVM_ID + "}")
+    @Consumes({ "application/json" })
+    @Produces({ "application/json", "text/html; charset=utf-8" })
+    public Response deleteJvmCompiler(@PathParam(RequestParameters.SYSTEM_ID) String systemId,
+                                 @PathParam(RequestParameters.JVM_ID) String jvmId,
+                                 @QueryParam(RequestParameters.QUERY) String queries,
+                                 @QueryParam(RequestParameters.METADATA) @DefaultValue("false") Boolean metadata,
+                                 @Context ServletContext context,
+                                 @Context HttpServletRequest httpServletRequest) {
+        return serviceHelper.handleDeleteWithJvmID(httpServletRequest, context, systemId, jvmId, queries, metadata);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/jvm-compiler/src/main/java/com/redhat/thermostat/gateway/service/jvm/compiler/SwaggerSpecResourceHandler.java	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.gateway.service.jvm.compiler;
+
+import java.io.IOException;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import com.redhat.thermostat.gateway.common.core.servlet.BasicResourceHandler;
+
+@Path("doc/{fileName: .+\\.yaml}")
+@Produces(MediaType.TEXT_PLAIN)
+public class SwaggerSpecResourceHandler extends BasicResourceHandler {
+
+    @GET
+    public Response getFileAsPlainText(@PathParam("fileName") String fileName) throws IOException {
+        return getFileAsResponse(SwaggerSpecResourceHandler.class.getClassLoader(), fileName);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/jvm-compiler/src/main/resources/jvm-compiler-swagger.yaml	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,222 @@
+swagger: '2.0'
+info:
+  version: 0.0.1
+  title: Thermostat Web Gateway JVM Compiler Info API
+  license:
+    name: GPL v2 with Classpath Exception
+    url: 'http://www.gnu.org/licenses'
+consumes:
+  - application/json
+produces:
+  - application/json
+  - text/html; charset=utf-8
+basePath: /jvm-compiler/0.0.1
+paths:
+  /jvms/{jvmId}:
+    parameters:
+      - $ref: '#/parameters/jvm-id'
+    get:
+      description: Get JVM Compiler information for JVM {jvmId}.
+      parameters:
+        - $ref: '#/parameters/limit'
+        - $ref: '#/parameters/offset'
+        - $ref: '#/parameters/sort'
+        - $ref: '#/parameters/include'
+        - $ref: '#/parameters/exclude'
+        - $ref: '#/parameters/query'
+        - $ref: '#/parameters/metadata'
+      responses:
+        '200':
+          description: OK
+          schema:
+            $ref: '#/definitions/jvm-compiler-info-get-response'
+  /systems/{systemId}/jvms/{jvmId}:
+    parameters:
+      - $ref: '#/parameters/thermostat-realms'
+      - $ref: '#/parameters/system-id'
+      - $ref: '#/parameters/jvm-id'
+    get:
+      description: Get JVM Compiler information for systme {systemId}.
+      parameters:
+        - $ref: '#/parameters/limit'
+        - $ref: '#/parameters/offset'
+        - $ref: '#/parameters/sort'
+        - $ref: '#/parameters/include'
+        - $ref: '#/parameters/exclude'
+        - $ref: '#/parameters/query'
+        - $ref: '#/parameters/metadata'
+      responses:
+        '200':
+          description: OK
+          schema:
+            $ref: '#/definitions/jvm-compiler-info-get-response'
+    post:
+      description: Add JVM Compiler information for JVM {jvmId}.
+      parameters:
+        - $ref: '#/parameters/jvm-compiler-info-array'
+        - $ref: '#/parameters/metadata'
+      responses:
+        '200':
+          description: OK
+          schema:
+            $ref: '#/definitions/metadata'
+    delete:
+      description: Delete JVM Compiler information for JVM {jvmId}.
+      parameters:
+        - $ref: '#/parameters/query'
+        - $ref: '#/parameters/metadata'
+      responses:
+        '200':
+          description: OK
+          schema:
+            $ref: '#/definitions/metadata'
+definitions:
+  jvm-compiler-info-get-response:
+    type: object
+    properties:
+      response:
+        $ref: '#/definitions/jvm-compiler-info-array'
+  jvm-compiler-info-array:
+    type: array
+    items:
+      $ref: '#/definitions/jvm-compiler-info'
+  jvm-compiler-info:
+    type: object
+    properties:
+      totalCompiles:
+        $ref: '#/definitions/metric'
+      totalBailouts:
+        $ref: '#/definitions/metric'
+      totalInvalidates:
+        $ref: '#/definitions/metric'
+      lastSize:
+        $ref: '#/definitions/metric'
+      lastType:
+        $ref: '#/definitions/metric'
+      lastMethod:
+        type: string
+      lastFailedType:
+        type: string
+      lastFailedMethod:
+        type: string
+      compilationTime:
+        $ref: '#/definitions/metric'
+      timeStamp:
+        $ref: '#/definitions/timeStamp'
+      agentId:
+        type: integer
+        format: int64
+      jvmId:
+        type: integer
+        format: int64
+  metric:
+    type: object
+    properties:
+      $numberLong:
+        type: string
+  metadata:
+    type: object
+    properties:
+      payloadCount:
+        type: integer
+      count:
+        type: integer
+      prev:
+        type: string
+      next:
+        type: string
+      first:
+        type: string
+      last:
+        type: string
+      insertCount:
+        type: integer
+      matchCount:
+        type: integer
+      elapsed:
+        type: integer
+        format: int64
+  timeStamp:
+    description: UNIX timestamp in milliseconds
+    type: object
+    properties:
+      $numberLong:
+        type: string
+parameters:
+  system-id:
+    name: systemId
+    in: path
+    required: true
+    type: string
+  jvm-id:
+    name: jvmId
+    in: path
+    required: true
+    type: string
+  jvm-compiler-info-array:
+    name: jvm-compiler-info-array
+    in: body
+    description: The JVM Compiler information
+    required: true
+    schema:
+      $ref: '#/definitions/jvm-compiler-info-array'
+  limit:
+    name: limit
+    in: query
+    description: Limit of items to return. Example '1'
+    type: integer
+    required: false
+    default: 1
+  offset:
+    name: offset
+    in: query
+    description: Offset of items to return. Example '0'
+    type: integer
+    required: true
+    default: 0
+  sort:
+    name: sort
+    in: query
+    description: Sort string. Comma separated list of fields prefixed with '+' for ascending or '-' for descending. Example '?sort=+a,-b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
+    type: string
+    required: false
+  query:
+    name: query
+    in: query
+    description: Query string. Comma separated list of key, comparator, value pairs. Comparator supports '==', '<=', '>=', '<', '>', '!='. Example '?query=a==b,c!=d'. Keys are fields in documents and use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
+    type: string
+    required: false
+  include:
+    name: include
+    in: query
+    description: >-
+      Inclusion string. Comma separated list of fields to include in the
+      response. Example '?include=a,b' Fields use dot notation for embedded
+      documents. Example 'outer.inner' refers to field inner contained in field
+      outer. Cannot be used in combination with 'exclude' parameter Overriden by
+      'exclude' parameter
+    type: string
+    required: false
+  exclude:
+    name: exclude
+    in: query
+    description: >-
+      Exclusion string. Comma separated list of fields to exclude in the
+      response. Example '?exclude=a,b' Fields use dot notation for embedded
+      documents. Example 'outer.inner' refers to field inner contained in field
+      outer. Cannot be used in combination with 'include' parameter; takes
+      precedence over 'include' parameter
+    type: string
+    required: false
+  metadata:
+    name: metadata
+    type: boolean
+    in: query
+    description:  >-
+      "Metadata flag. If set to 'true', the subsequent request response will return metadata information. If set to 'false', such metadata information will be omitted."
+  thermostat-realms:
+    name: X-Thermostat-Realms
+    type: string
+    in: header
+    description:  >-
+      "Realms Header used to specify a subset of roles to use for Keycloak authorization. Attempts to specify realms that the client does not have, or no valiod realms at all will result in a 400 Bad Request response. Expects a space separated list of realms. Example 'X-Thermostat-Realms: realm-one realm-two'"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/jvm-compiler/src/main/webapp/WEB-INF/web.xml	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,88 @@
+<!--
+
+ Copyright 2012-2017 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses/>.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+         version="3.1">
+    <servlet>
+        <servlet-name>JvmCompilerServlet</servlet-name>
+        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
+        <init-param>
+            <param-name>
+                jersey.config.server.provider.packages
+            </param-name>
+            <param-value>
+                com.redhat.thermostat.gateway.service.jvm.compiler,
+            </param-value>
+        </init-param>
+    </servlet>
+    <filter>
+        <filter-name>ServiceVersionFilter</filter-name>
+        <filter-class>com.redhat.thermostat.gateway.common.core.servlet.ServiceVersionFilter</filter-class>
+        <init-param>
+            <param-name>version</param-name>
+            <param-value>0.0.1</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>ServiceVersionFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <servlet-mapping>
+        <servlet-name>JvmCompilerServlet</servlet-name>
+        <url-pattern>/0.0.1/*</url-pattern>
+    </servlet-mapping>
+    <!-- Service configuration -->
+    <context-param>
+        <param-name>com.redhat.thermostat.gateway.SERVICE_NAME</param-name>
+        <param-value>@com.redhat.thermostat.gateway.SERVICE_NAME@</param-value>
+    </context-param>
+    <!-- Listener for setting up the storage connection -->
+    <listener>
+        <listener-class>com.redhat.thermostat.gateway.common.mongodb.servlet.StorageConnectionSettingListener</listener-class>
+    </listener>
+    <!-- Allow viewing of API spec without authentication -->
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Swagger API Spec File</web-resource-name>
+            <url-pattern>/0.0.1/doc/@com.redhat.thermostat.gateway.SERVICE_NAME@-swagger.yaml</url-pattern>
+        </web-resource-collection>
+        <!-- Explicitly no auth constraint for this file -->
+    </security-constraint>
+</web-app>
--- a/services/jvm-gc/src/main/resources/jvm-gc-swagger.yaml	Thu Sep 14 10:23:32 2017 -0400
+++ b/services/jvm-gc/src/main/resources/jvm-gc-swagger.yaml	Mon Sep 18 16:03:05 2017 -0400
@@ -206,12 +206,6 @@
     required: true
     schema:
       $ref: '#/definitions/jvm-gc-stats'
-  jvm-id:
-    name: jvmId
-    in: path
-    required: true
-    type: string
-    description: The ID of the jvm
   put-body:
     name: putBody
     in: body
--- a/services/pom.xml	Thu Sep 14 10:23:32 2017 -0400
+++ b/services/pom.xml	Mon Sep 18 16:03:05 2017 -0400
@@ -57,6 +57,7 @@
         <module>jvm-memory</module>
         <module>jvm-cpu</module>
         <module>jvm-io</module>
+        <module>jvm-compiler</module>
         <module>systems</module>
         <module>system-cpu</module>
         <module>system-memory</module>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/integration-tests/src/test/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerServiceIntegrationTest.java	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.gateway.service.jvm.compiler;
+
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import com.redhat.thermostat.gateway.tests.integration.MongoIntegrationTest;
+import com.redhat.thermostat.gateway.tests.utils.HttpTestUtil;
+import org.eclipse.jetty.http.HttpMethod;
+import org.junit.Test;
+
+public class JvmCompilerServiceIntegrationTest extends MongoIntegrationTest {
+
+    private static final String SERVICE_NAME = "jvm-compiler";
+    private static final String VERSION_NUMBER = "0.0.1";
+    private static final String SYSTEM_ID = UUID.randomUUID().toString();
+    private static final String JVM_ID = UUID.randomUUID().toString();
+    private static final String simpleUrl = baseUrl + "/" + SERVICE_NAME + "/" + VERSION_NUMBER;
+    private static final String serviceUrl = simpleUrl + "/systems/" + SYSTEM_ID + "/jvms/" + JVM_ID;
+    private static final String jvmsServiceUrl = simpleUrl + "/jvms/" + JVM_ID;
+
+    public JvmCompilerServiceIntegrationTest() {
+        super(SERVICE_NAME + "/" + VERSION_NUMBER + "/systems/" + SYSTEM_ID + "/jvms/" + JVM_ID, SERVICE_NAME);
+    }
+
+    @Test
+    public void testGetForJvms() throws InterruptedException, TimeoutException, ExecutionException {
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.GET, jvmsServiceUrl, 200, HttpTestUtil.EMPTY_RESPONSE);
+    }
+
+    @Test
+    public void testGetForSystemJvms() throws InterruptedException, TimeoutException, ExecutionException {
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.GET, serviceUrl, 200, HttpTestUtil.EMPTY_RESPONSE);
+    }
+
+    @Test
+    public void testPut() throws InterruptedException, TimeoutException, ExecutionException {
+        String putContent = "{\"set\": {\"a\":\"c\"}}";
+        HttpTestUtil.addRecords(client, serviceUrl, "[{\"a\":\"b\"}]");
+        HttpTestUtil.testContentResponse(client, HttpMethod.PUT, serviceUrl, putContent, 405);
+    }
+
+    @Test
+    public void testDelete() throws InterruptedException, TimeoutException, ExecutionException {
+        String expectedBefore = "{\"response\":[{\"a\":\"b\",\"systemId\":\"" + SYSTEM_ID + "\",\"jvmId\":\"" + JVM_ID + "\"}]}";
+        HttpTestUtil.addRecords(client, serviceUrl, "[{\"a\":\"b\"}]");
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.GET, serviceUrl, 200, expectedBefore);
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.DELETE, serviceUrl + "?q=a==b", 200);
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.GET, serviceUrl, 200, HttpTestUtil.EMPTY_RESPONSE);
+    }
+
+    @Test
+    public void testPost() throws InterruptedException, TimeoutException, ExecutionException {
+        String expected = "{\"response\":[{\"a\":\"b\",\"systemId\":\"" + SYSTEM_ID + "\",\"jvmId\":\"" + JVM_ID + "\"}]}";
+        HttpTestUtil.addRecords(client, serviceUrl, "[{\"a\":\"b\"}]");
+        HttpTestUtil.testContentlessResponse(client, HttpMethod.GET, serviceUrl, 200, expected);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/keycloak-integration-tests/src/test/java/com/redhat/thermostat/gateway/service/jvm/compiler/JvmCompilerServiceKeycloakIntegrationTest.java	Mon Sep 18 16:03:05 2017 -0400
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.gateway.service.jvm.compiler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jetty.http.HttpMethod;
+
+import com.redhat.thermostat.gateway.tests.keycloak.BasicKeycloakIntegrationTestSuite;
+import com.redhat.thermostat.gateway.tests.utils.EndpointDefinition;
+
+public class JvmCompilerServiceKeycloakIntegrationTest extends BasicKeycloakIntegrationTestSuite {
+    private static final String serviceName = "jvm-compiler";
+    private static final String versionNumber = "0.0.1";
+
+    private static final String postData = "[{\"item\":1}]";
+
+    public JvmCompilerServiceKeycloakIntegrationTest() {
+        super(serviceName, versionNumber, serviceName);
+    }
+
+    @Override
+    protected List<EndpointDefinition> getEndpointList() {
+        List<EndpointDefinition> endpointDefinitions = new ArrayList<>();
+        endpointDefinitions.add(new EndpointDefinition(HttpMethod.GET, "/jvms/jid1", EndpointDefinition.NO_BODY));
+        endpointDefinitions.add(new EndpointDefinition(HttpMethod.GET, "/systems/sid1/jvms/jid1", EndpointDefinition.NO_BODY));
+        endpointDefinitions.add(new EndpointDefinition(HttpMethod.POST, "/systems/sid1/jvms/jid1", postData));
+        endpointDefinitions.add(new EndpointDefinition(HttpMethod.DELETE, "/systems/sid1/jvms/jid1", EndpointDefinition.NO_BODY));
+        return endpointDefinitions;
+    }
+}