diff options
author | Bharat saraswal <bharat.saraswal@huawei.com> | 2017-09-22 19:22:11 +0530 |
---|---|---|
committer | Bharat saraswal <bharat.saraswal@huawei.com> | 2017-10-05 11:46:08 +0530 |
commit | 601c7f2800a7da2c182ad02b0d76eda03758c47d (patch) | |
tree | 58ca74aff5c6eec0698b3b24f07cad064ac29afe /heat-client | |
parent | 030c1418fa5c900298b3f543e0ac38c77fd58b7f (diff) |
Resolved below sonar issues.
removed redundant code.
rename variable to follow camelCase.
removed tab char and changed them with spaces.
Issue-ID:SO-98
Change-Id: I1b56af476ea587640adb2c6d601ac589d2726e11
Signed-off-by: Bharat saraswal <bharat.saraswal@huawei.com>
Diffstat (limited to 'heat-client')
-rw-r--r-- | heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java b/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java index 716df9d..3af56dd 100644 --- a/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java +++ b/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java @@ -25,12 +25,14 @@ import com.woorea.openstack.base.client.HttpMethod; import com.woorea.openstack.base.client.OpenStackClient; import com.woorea.openstack.base.client.OpenStackRequest; import com.woorea.openstack.heat.model.CreateStackParam; -import com.woorea.openstack.heat.model.UpdateStackParam; import com.woorea.openstack.heat.model.Stack; import com.woorea.openstack.heat.model.Stacks; +import com.woorea.openstack.heat.model.UpdateStackParam; public class StackResource { + private static final String STACKS = "/stacks/"; + private static final String STACK = "/stacks"; private final OpenStackClient client; public StackResource(OpenStackClient client) { @@ -58,35 +60,38 @@ public class StackResource { } public class CreateStack extends OpenStackRequest<Stack> { + public CreateStack(CreateStackParam params) { - super(client, HttpMethod.POST, "/stacks", Entity.json(params), Stack.class); + super(client, HttpMethod.POST, STACK, Entity.json(params), Stack.class); } } public class UpdateStack extends OpenStackRequest<Void> { + public UpdateStack(String name, UpdateStackParam params) { - super(client, HttpMethod.PUT, "/stacks/" + name, Entity.json(params), Void.class); + super(client, HttpMethod.PUT, STACKS + name, Entity.json(params), Void.class); } } public class DeleteStack extends OpenStackRequest<Void> { + public DeleteStack(String name) { - super(client, HttpMethod.DELETE, "/stacks/" + name, null, Void.class); + super(client, HttpMethod.DELETE, STACKS + name, null, Void.class); } } public class GetStack extends OpenStackRequest<Stack> { + public GetStack(String name) { - super(client, HttpMethod.GET, "/stacks/" + name, null, Stack.class); + super(client, HttpMethod.GET, STACKS + name, null, Stack.class); } } public class List extends OpenStackRequest<Stacks> { + public List() { - super(client, HttpMethod.GET, "/stacks", null, Stacks.class); + super(client, HttpMethod.GET, STACK, null, Stacks.class); } } - - } |