From 083f0f9bc39e96b1b8ab0c515e1202b51c3fa04d Mon Sep 17 00:00:00 2001 From: seshukm Date: Wed, 25 Jul 2018 17:59:44 +0800 Subject: Basic checkstyle fixes Issue-ID: SO-729 Change-Id: I9ee8e0b8519ac9110a56b48aa17acaa524d70a30 Signed-off-by: seshukm --- .../woorea/openstack/ceilometer/Ceilometer.java | 48 ++++----- .../ceilometer/QueriableCeilometerCommand.java | 94 +++++++++--------- .../ceilometer/v2/api/MetersResource.java | 110 ++++++++++----------- .../ceilometer/v2/api/ResourcesResource.java | 66 ++++++------- 4 files changed, 159 insertions(+), 159 deletions(-) (limited to 'ceilometer-client/src/main/java/com') diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java index a0b37e0..aa089df 100644 --- a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java +++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java @@ -23,28 +23,28 @@ import com.woorea.openstack.ceilometer.v2.api.MetersResource; import com.woorea.openstack.ceilometer.v2.api.ResourcesResource; public class Ceilometer extends OpenStackClient { - - private final MetersResource METERS; - - private final ResourcesResource RESOURCES; - - public Ceilometer(String endpoint, OpenStackClientConnector connector) { - super(endpoint, connector); - METERS = new MetersResource(this); - RESOURCES = new ResourcesResource(this); - } - - public Ceilometer(String endpoint) { - this(endpoint, null); - - } - - public ResourcesResource resources() { - return RESOURCES; - } - - public MetersResource meters() { - return METERS; - } - + + private final MetersResource METERS; + + private final ResourcesResource RESOURCES; + + public Ceilometer(String endpoint, OpenStackClientConnector connector) { + super(endpoint, connector); + METERS = new MetersResource(this); + RESOURCES = new ResourcesResource(this); + } + + public Ceilometer(String endpoint) { + this(endpoint, null); + + } + + public ResourcesResource resources() { + return RESOURCES; + } + + public MetersResource meters() { + return METERS; + } + } diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java index 7d3bcf3..83eecd4 100644 --- a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java +++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java @@ -23,52 +23,52 @@ import java.util.List; import com.woorea.openstack.base.client.OpenStackRequest; public abstract class QueriableCeilometerCommand extends OpenStackRequest { - - protected List fields = new ArrayList<>(); - - protected List ops = new ArrayList<>(); - - protected List values = new ArrayList<>(); - - private T filter(String field, String op, Serializable value) { - fields.add(field); - ops.add(op); - values.add(value); - return (T) this; - } - - public T lt(String field, Serializable value) { - return filter(field, "lt", value); - } - - public T le(String field, Serializable value) { - return filter(field, "le", value); - } - - public T eq(String field, Serializable value) { - return filter(field, "eq", value); - } - - public T ne(String field, Serializable value) { - return filter(field, "ne", value); - } - - public T ge(String field, Serializable value) { - return filter(field, "ge", value); - } - - public T gt(String field, Serializable value) { - return filter(field, "gt", value); - } + + protected List fields = new ArrayList<>(); + + protected List ops = new ArrayList<>(); + + protected List values = new ArrayList<>(); + + private T filter(String field, String op, Serializable value) { + fields.add(field); + ops.add(op); + values.add(value); + return (T) this; + } + + public T lt(String field, Serializable value) { + return filter(field, "lt", value); + } + + public T le(String field, Serializable value) { + return filter(field, "le", value); + } + + public T eq(String field, Serializable value) { + return filter(field, "eq", value); + } + + public T ne(String field, Serializable value) { + return filter(field, "ne", value); + } + + public T ge(String field, Serializable value) { + return filter(field, "ge", value); + } + + public T gt(String field, Serializable value) { + return filter(field, "gt", value); + } - /* - public WebTarget query(WebTarget target) { - if(fields.size() > 0) { - target = target.queryParam("q.field", fields.toArray()); - target = target.queryParam("q.op", ops.toArray()); - target = target.queryParam("q.value", values.toArray()); - } - return target; - } - */ + /* + public WebTarget query(WebTarget target) { + if(fields.size() > 0) { + target = target.queryParam("q.field", fields.toArray()); + target = target.queryParam("q.op", ops.toArray()); + target = target.queryParam("q.value", values.toArray()); + } + return target; + } + */ } diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java index 23979c7..8f35170 100644 --- a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java +++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java @@ -23,65 +23,65 @@ import com.woorea.openstack.ceilometer.QueriableCeilometerCommand; import com.woorea.openstack.ceilometer.v2.model.Sample; public class MetersResource { - - private final OpenStackClient CLIENT; - - public MetersResource(OpenStackClient client) { - CLIENT = client; - } - - public List list() { - return new List(); - } - - public Show show() { - return new Show(); - } - - public Statistics statistics() { - return new Statistics(); - } - - public class List extends QueriableCeilometerCommand> { - public List() { - //return query(target.path("meters")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - } - } - - public class Show extends QueriableCeilometerCommand> { + + private final OpenStackClient CLIENT; + + public MetersResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Show show() { + return new Show(); + } + + public Statistics statistics() { + return new Statistics(); + } + + public class List extends QueriableCeilometerCommand> { + public List() { + //return query(target.path("meters")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); + } + } + + public class Show extends QueriableCeilometerCommand> { - private String name; - - public Show name(String name) { - this.name = name; - return this; - } - - public Show() { -// if(name == null) { -// throw new UnsupportedOperationException("meter id is mandatory"); -// } -// return query(target.path("meters").path(name)).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - } + private String name; + + public Show name(String name) { + this.name = name; + return this; + } + + public Show() { +// if(name == null) { +// throw new UnsupportedOperationException("meter id is mandatory"); +// } +// return query(target.path("meters").path(name)).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); + } - } + } - public class Statistics extends QueriableCeilometerCommand> { + public class Statistics extends QueriableCeilometerCommand> { - private String name; - - public Statistics name(String name) { - this.name = name; - return this; - } - - public Statistics() { -// if(name == null) { -// throw new UnsupportedOperationException("meter id is mandatory"); -// } -// return query(target.path("meters").path(name).path("statistics")).request(MediaType.APPLICATION_JSON).get(new GenericType>(){}); - } + private String name; + + public Statistics name(String name) { + this.name = name; + return this; + } + + public Statistics() { +// if(name == null) { +// throw new UnsupportedOperationException("meter id is mandatory"); +// } +// return query(target.path("meters").path(name).path("statistics")).request(MediaType.APPLICATION_JSON).get(new GenericType>(){}); + } - } + } } diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java index 01c777d..4639ef4 100644 --- a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java +++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java @@ -24,38 +24,38 @@ import com.woorea.openstack.ceilometer.QueriableCeilometerCommand; import com.woorea.openstack.ceilometer.v2.model.Resource; public class ResourcesResource { - - private final OpenStackClient CLIENT; - - public ResourcesResource(OpenStackClient client) { - CLIENT = client; - } - - public class ResourceList extends QueriableCeilometerCommand> { - - public ResourceList() { - OpenStackRequest request = new OpenStackRequest(); - //return query(target.path("resources")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - } - - } - - public class ResourceShow extends OpenStackRequest { - - private String id; - - public ResourceShow id(String id) { - this.id = id; - return this; - } - - public ResourceShow(OpenStackClient client) { -// if(id == null) { -// throw new UnsupportedOperationException("resource id is mandatory"); -// } -// return target.path("resources").path(id).request(MediaType.APPLICATION_JSON).get(Resource.class); - } - - } + + private final OpenStackClient CLIENT; + + public ResourcesResource(OpenStackClient client) { + CLIENT = client; + } + + public class ResourceList extends QueriableCeilometerCommand> { + + public ResourceList() { + OpenStackRequest request = new OpenStackRequest(); + //return query(target.path("resources")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); + } + + } + + public class ResourceShow extends OpenStackRequest { + + private String id; + + public ResourceShow id(String id) { + this.id = id; + return this; + } + + public ResourceShow(OpenStackClient client) { +// if(id == null) { +// throw new UnsupportedOperationException("resource id is mandatory"); +// } +// return target.path("resources").path(id).request(MediaType.APPLICATION_JSON).get(Resource.class); + } + + } } -- cgit 1.2.3-korg