From c2088b86b363cda57bca06eb9bb1e824379f83a2 Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Mon, 22 Apr 2019 11:07:28 +0530 Subject: Declare constant for String literal Declare constant for String literal cloudify v3 client classes Issue-ID: SO-1490 Change-Id: I8843bfb7aae5b25c6d9ad201c90a5bf9d3b0d577 Signed-off-by: Sindhuri.A --- .../java/org/onap/so/cloudify/v3/client/DeploymentsResource.java | 9 +++++---- .../java/org/onap/so/cloudify/v3/client/ExecutionsResource.java | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'cloudify-client') diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/DeploymentsResource.java b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/DeploymentsResource.java index 262045a367..335f6b1697 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/DeploymentsResource.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/DeploymentsResource.java @@ -32,6 +32,7 @@ import org.onap.so.cloudify.base.client.CloudifyRequest; public class DeploymentsResource { private final CloudifyClient client; + private static final String DEPLOYMENT_PATH = "/api/v3/deployments/"; public DeploymentsResource(CloudifyClient client) { this.client = client; @@ -59,25 +60,25 @@ public class DeploymentsResource { public class CreateDeployment extends CloudifyRequest { public CreateDeployment(String deploymentId, CreateDeploymentParams body) { - super(client, HttpMethod.PUT, "/api/v3/deployments/" + deploymentId, Entity.json(body), Deployment.class); + super(client, HttpMethod.PUT, DEPLOYMENT_PATH + deploymentId, Entity.json(body), Deployment.class); } } public class DeleteDeployment extends CloudifyRequest { public DeleteDeployment(String deploymentId) { - super(client, HttpMethod.DELETE, "/api/v3/deployments/" + deploymentId, null, Deployment.class); + super(client, HttpMethod.DELETE, DEPLOYMENT_PATH + deploymentId, null, Deployment.class); } } public class GetDeployment extends CloudifyRequest { public GetDeployment(String id) { - super(client, HttpMethod.GET, "/api/v3/deployments/" + id, null, Deployment.class); + super(client, HttpMethod.GET, DEPLOYMENT_PATH + id, null, Deployment.class); } } public class GetDeploymentOutputs extends CloudifyRequest { public GetDeploymentOutputs(String id) { - super(client, HttpMethod.GET, "/api/v3/deployments/" + id + "/outputs", null, DeploymentOutputs.class); + super(client, HttpMethod.GET, DEPLOYMENT_PATH + id + "/outputs", null, DeploymentOutputs.class); } } diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/ExecutionsResource.java b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/ExecutionsResource.java index 51aaea94bb..34251bfe52 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/ExecutionsResource.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/ExecutionsResource.java @@ -33,6 +33,7 @@ import org.onap.so.cloudify.base.client.CloudifyRequest; public class ExecutionsResource { private final CloudifyClient client; + private static final String EXECUTIONS_PATH = "/api/v3/executions/"; public ExecutionsResource(CloudifyClient client) { this.client = client; @@ -76,7 +77,7 @@ public class ExecutionsResource { public class GetExecution extends CloudifyRequest { public GetExecution(String id) { - super(client, HttpMethod.GET, "/api/v3/executions/" + id, null, Execution.class); + super(client, HttpMethod.GET, EXECUTIONS_PATH + id, null, Execution.class); } } @@ -95,13 +96,13 @@ public class ExecutionsResource { public class UpdateExecution extends CloudifyRequest { public UpdateExecution(String executionId, UpdateExecutionParams body) { - super(client, HttpMethod.PATCH, "/api/v3/executions/" + executionId, Entity.json(body), Execution.class); + super(client, HttpMethod.PATCH, EXECUTIONS_PATH + executionId, Entity.json(body), Execution.class); } } public class CancelExecution extends CloudifyRequest { public CancelExecution(String executionId, CancelExecutionParams body) { - super(client, HttpMethod.POST, "/api/v3/executions/" + executionId, Entity.json(body), Execution.class); + super(client, HttpMethod.POST, EXECUTIONS_PATH + executionId, Entity.json(body), Execution.class); } } -- cgit 1.2.3-korg