Skip to content

Commit

Permalink
[HWKMETRICS-623] Add GZIP annotation to all REST endpoints to enable …
Browse files Browse the repository at this point in the history
…content encoding when the client supports it. The annotation enables content encoding by default.
  • Loading branch information
Stefan Negrea committed Mar 14, 2017
1 parent 03b416b commit a11473c
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 Red Hat, Inc. and/or its affiliates
* Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -33,6 +33,7 @@
import org.hawkular.metrics.api.jaxrs.MetricsServiceLifecycle;
import org.hawkular.metrics.api.jaxrs.util.ManifestInformation;
import org.hawkular.metrics.model.Status;
import org.jboss.resteasy.annotations.GZIP;

import io.swagger.annotations.ApiOperation;

Expand All @@ -42,6 +43,7 @@
@Path("/admin")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@ApplicationScoped
public class AdminHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.hawkular.metrics.model.param.TagNames;
import org.hawkular.metrics.model.param.Tags;
import org.hawkular.metrics.model.param.TimeRange;
import org.jboss.resteasy.annotations.GZIP;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

Expand All @@ -87,6 +88,7 @@
@Path("/availability")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "Availability")
@ApplicationScoped
@Logged
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 Red Hat, Inc. and/or its affiliates
* Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -35,6 +35,7 @@
import javax.ws.rs.core.Response;

import org.hawkular.metrics.api.jaxrs.util.ManifestInformation;
import org.jboss.resteasy.annotations.GZIP;
import org.jboss.resteasy.spi.ResteasyProviderFactory;

import io.swagger.annotations.ApiOperation;
Expand All @@ -43,6 +44,7 @@
* @author Matt Wringe
*/
@Path(BaseHandler.PATH)
@GZIP
@ApplicationScoped
public class BaseHandler {
public static final String PATH = "/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import org.hawkular.metrics.model.param.TagNames;
import org.hawkular.metrics.model.param.Tags;
import org.hawkular.metrics.model.param.TimeRange;
import org.jboss.resteasy.annotations.GZIP;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
Expand All @@ -89,6 +90,7 @@
@Path("/counters")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "Counter")
@ApplicationScoped
@Logged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import org.hawkular.metrics.model.param.Tags;
import org.hawkular.metrics.model.param.TimeRange;
import org.jboss.logging.Logger;
import org.jboss.resteasy.annotations.GZIP;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
Expand All @@ -92,6 +93,7 @@
@Path("/gauges")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "Gauge")
@ApplicationScoped
@Logged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import org.hawkular.metrics.model.param.Duration;
import org.hawkular.metrics.model.param.Tags;
import org.hawkular.metrics.model.param.TimeRange;
import org.jboss.resteasy.annotations.GZIP;

import com.google.common.base.Strings;

Expand All @@ -97,6 +98,7 @@
@Path("/metrics")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "Metric")
@ApplicationScoped
@Logged
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 Red Hat, Inc. and/or its affiliates
* Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -29,6 +29,7 @@
import javax.ws.rs.core.Response;

import org.hawkular.metrics.api.jaxrs.util.StringValue;
import org.jboss.resteasy.annotations.GZIP;

import io.swagger.annotations.ApiOperation;

Expand All @@ -38,6 +39,7 @@
@Path("/ping")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@ApplicationScoped
public class PingHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 Red Hat, Inc. and/or its affiliates
* Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -34,6 +34,7 @@
import org.hawkular.metrics.api.jaxrs.MetricsServiceLifecycle.State;
import org.hawkular.metrics.api.jaxrs.util.ManifestInformation;
import org.hawkular.metrics.model.CassandraStatus;
import org.jboss.resteasy.annotations.GZIP;

import io.swagger.annotations.ApiOperation;

Expand All @@ -43,6 +44,7 @@
@Path(StatusHandler.PATH)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@ApplicationScoped
public class StatusHandler {
public static final String PATH = "/status";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.hawkular.metrics.model.MetricId;
import org.hawkular.metrics.model.param.TagNames;
import org.hawkular.metrics.model.param.Tags;
import org.jboss.resteasy.annotations.GZIP;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

Expand All @@ -78,6 +79,7 @@
@Path("/strings")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "String", description = "This resource is experimental and changes may be made to it in subsequent " +
"releases that are not backwards compatible.")
@ApplicationScoped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.hawkular.metrics.model.ApiError;
import org.hawkular.metrics.model.TenantDefinition;
import org.jboss.logging.Logger;
import org.jboss.resteasy.annotations.GZIP;

import com.google.common.collect.ImmutableMap;

Expand All @@ -63,6 +64,7 @@
@Path("/tenants")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@GZIP
@Api(tags = "Tenant")
@ApplicationScoped
@Logged
Expand Down

0 comments on commit a11473c

Please sign in to comment.