diff options
author | Isaac Manuel Raj <isaac.manuelraj@huawei.com> | 2019-04-12 15:59:24 +0530 |
---|---|---|
committer | Isaac Manuel Raj <isaac.manuelraj@huawei.com> | 2019-04-12 15:59:24 +0530 |
commit | 8105ceaa286edf76aa4f35804c565ad00c35d874 (patch) | |
tree | 2153ba8649f4c778adc975b4d81006e9524cbf8f /nova-client/src/main/java/com | |
parent | 7c3e544981e3965552679a5f08597d547b19026c (diff) |
Code Enhancement (Sonar Fixes)
Sonar Issues Fixes
Issue-ID: SO-1490
Change-Id: Ie14a83ebab7350cc43f11e6ebaebbd21d1b0203e
Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
Diffstat (limited to 'nova-client/src/main/java/com')
2 files changed, 62 insertions, 63 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java index b73ec97..820934a 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java @@ -27,13 +27,13 @@ import com.woorea.openstack.nova.model.HostAggregate; import com.woorea.openstack.nova.model.HostAggregates; public class AggregatesExtension { - + private final OpenStackClient CLIENT; - + public AggregatesExtension(OpenStackClient client) { CLIENT = client; } - + public List list() { return new List(); } @@ -43,7 +43,7 @@ public class AggregatesExtension { } public UpdateAggregateMetadata updateAggregateMetadata(String id, - String name, String availabilityZone) { + String name, String availabilityZone) { return new UpdateAggregateMetadata(id, name, availabilityZone); } @@ -70,11 +70,11 @@ public class AggregatesExtension { } public class List extends OpenStackRequest<HostAggregates> { - + public List() { super(CLIENT, HttpMethod.GET, "/os-aggregates", - null, - HostAggregates.class); + null, + HostAggregates.class); } } @@ -83,9 +83,9 @@ public class AggregatesExtension { public ShowAggregate(String id) { super(CLIENT, HttpMethod.GET, - new StringBuffer("/os-aggregates/").append(id), - null, - HostAggregate.class); + new StringBuffer("/os-aggregates/").append(id), + null, + HostAggregate.class); } } @@ -94,16 +94,16 @@ public class AggregatesExtension { public UpdateAggregateMetadata(String id, String name, String availabilityZone) { super(CLIENT, HttpMethod.PUT, - new StringBuffer("/os-aggregates/").append(id), - availabilityZone == null ? - Entity.json("{\"aggregate\": {\"name\": \"" + name + "\" }}") - : - Entity.json("{\"aggregate\": {\"name\": \"" + - name + - "\", \"availability_zone\": \"" + - availabilityZone + - "\" }}"), - HostAggregate.class); + new StringBuffer("/os-aggregates/").append(id), + availabilityZone == null ? + Entity.json("{\"aggregate\": {\"name\": \"" + name + "\" }}") + : + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": \"" + + availabilityZone + + "\" }}"), + HostAggregate.class); } } @@ -112,18 +112,18 @@ public class AggregatesExtension { public CreateAggregate(String name, String availabilityZone) { super(CLIENT, HttpMethod.POST, - new StringBuffer("/os-aggregates"), - availabilityZone == null ? - Entity.json("{\"aggregate\": {\"name\": \"" + - name + - "\", \"availability_zone\": null }}") - : - Entity.json("{\"aggregate\": {\"name\": \"" + - name + - "\", \"availability_zone\": \"" + - availabilityZone + - "\" }}"), - HostAggregate.class); + new StringBuffer("/os-aggregates"), + availabilityZone == null ? + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": null }}") + : + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": \"" + + availabilityZone + + "\" }}"), + HostAggregate.class); } } @@ -132,9 +132,9 @@ public class AggregatesExtension { public DeleteAggregate(String id) { super(CLIENT, HttpMethod.DELETE, - new StringBuffer("/os-aggregates/").append(id), - null, - null); + new StringBuffer("/os-aggregates/").append(id), + null, + null); } } @@ -142,11 +142,11 @@ public class AggregatesExtension { public AddHost(String aggregateId, String hostId) { super(CLIENT, HttpMethod.POST, - new StringBuffer("/os-aggregates/") - .append(aggregateId).append("/action"), - Entity.json("{\"add_host\": {\"host\": \"" + - hostId + "\" }}"), - HostAggregate.class); + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"add_host\": {\"host\": \"" + + hostId + "\" }}"), + HostAggregate.class); } } @@ -155,11 +155,11 @@ public class AggregatesExtension { public RemoveHost(String hostId, String aggregateId) { super(CLIENT, HttpMethod.POST, - new StringBuffer("/os-aggregates/") - .append(aggregateId).append("/action"), - Entity.json("{\"remove_host\": {\"host\": \"" + - hostId + "\" }}"), - HostAggregate.class); + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"remove_host\": {\"host\": \"" + + hostId + "\" }}"), + HostAggregate.class); } } @@ -168,12 +168,11 @@ public class AggregatesExtension { public SetMetadata(String aggregateId, String key, String value) { super(CLIENT, HttpMethod.POST, - new StringBuffer("/os-aggregates/") - .append(aggregateId).append("/action"), - Entity.json("{\"set_metadata\": {\"metadata\": { \"" + - key + "\": \"" + value + "\" }}}"), - HostAggregate.class); + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"set_metadata\": {\"metadata\": { \"" + + key + "\": \"" + value + "\" }}}"), + HostAggregate.class); } } } - diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java index d957382..d176bb1 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java @@ -25,24 +25,24 @@ import com.woorea.openstack.nova.model.Cloudpipe; import com.woorea.openstack.nova.model.Cloudpipes; public class CloudpipesExtension { - + private final OpenStackClient CLIENT; - + public CloudpipesExtension(OpenStackClient client) { CLIENT = client; } - + public List list() { return new List(); } - + public Create create(Cloudpipe cloudpipe) { return new Create(cloudpipe); } - + public class List extends OpenStackRequest<Cloudpipes> { - + public List() { super(CLIENT, HttpMethod.GET, "/os-cloudpipes", null, Cloudpipes.class); } @@ -51,15 +51,15 @@ public class CloudpipesExtension { public class Create extends OpenStackRequest<Cloudpipe> { - private Cloudpipe cloudpipe; - + + public Create(Cloudpipe cloudpipe) { super(CLIENT, HttpMethod.POST, "/os-cloudpipes", Entity.json(cloudpipe), Cloudpipe.class); - this.cloudpipe = cloudpipe; + } } - - -} + + +}
\ No newline at end of file |