summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSindhuri.A <arcot.sindhuri@huawei.com>2019-04-22 11:07:28 +0530
committerSindhuri.A <arcot.sindhuri@huawei.com>2019-04-22 11:07:28 +0530
commitc2088b86b363cda57bca06eb9bb1e824379f83a2 (patch)
tree35eb41f53a119a01ba23e2214f238ad2411d61f0
parent0a355f91e1da586f70450329d8620b823d59b9e5 (diff)
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 <arcot.sindhuri@huawei.com>
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/DeploymentsResource.java9
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/ExecutionsResource.java7
2 files changed, 9 insertions, 7 deletions
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<Deployment> {
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<Deployment> {
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<Deployment> {
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<DeploymentOutputs> {
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<Execution> {
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<Execution> {
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<Execution> {
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);
}
}