summaryrefslogtreecommitdiffstats
path: root/nova-client
diff options
context:
space:
mode:
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-12 16:10:55 +0530
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-16 13:34:08 +0000
commit1fa2733cde5ac4bfe3d122f01ec854369123a6ca (patch)
treec9e8039e77b7953fa16e0a69ed9d3c0002e81a11 /nova-client
parent226c37657808fa22336940e9be49147809f41710 (diff)
Code Enhancement (Sonar Fixes)
Sonar Issues Fixes Issue-ID: SO-1490 Change-Id: I54fc0c234f63037cce1ce03707fdb863eeec4754 Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
Diffstat (limited to 'nova-client')
-rw-r--r--nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java26
-rw-r--r--nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java39
2 files changed, 32 insertions, 33 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java
index bcfc96c..fb9bdc4 100644
--- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java
+++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java
@@ -27,9 +27,9 @@ import com.woorea.openstack.nova.model.SecurityGroupRuleForCreate;
import com.woorea.openstack.nova.model.SecurityGroups;
public class SecurityGroupsExtension {
-
+
private final OpenStackClient CLIENT;
-
+
public SecurityGroupsExtension(OpenStackClient client) {
CLIENT = client;
}
@@ -72,7 +72,7 @@ public class SecurityGroupsExtension {
public class Delete extends OpenStackRequest<Void> {
/**
- *
+ *
* @param id
* @deprecated
*/
@@ -99,7 +99,7 @@ public class SecurityGroupsExtension {
public class DeleteRule extends OpenStackRequest<Void> {
/**
- *
+ *
* @param id
* @deprecated
*/
@@ -107,7 +107,7 @@ public class SecurityGroupsExtension {
public DeleteRule(Integer id) {
super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-group-rules/").append(String.valueOf(id)).toString(), null, Void.class);
}
-
+
public DeleteRule(String id) {
super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-group-rules/").append(String.valueOf(id)).toString(), null, Void.class);
}
@@ -118,7 +118,7 @@ public class SecurityGroupsExtension {
}
public Create createSecurityGroup(String name,
- String description) {
+ String description) {
return new Create(new SecurityGroupForCreate(name, description));
}
@@ -129,20 +129,20 @@ public class SecurityGroupsExtension {
public Show showSecurityGroup(Integer id) {
return new Show(String.valueOf(id));
}
-
+
public Show showSecurityGroup(String id) {
return new Show(id);
}
public Delete deleteSecurityGroup(Integer id) {
return new Delete(String.valueOf(id));
}
-
+
public Delete deleteSecurityGroup(String id) {
return new Delete(id);
}
/**
- *
+ *
* @param parentSecurityGroupId
* @param ipProtocol
* @param fromPort
@@ -160,7 +160,7 @@ public class SecurityGroupsExtension {
return new CreateRule(securityGroupRuleForCreate);
}
/**
- *
+ *
* @param parentSecurityGroupId
* @param ipProtocol
* @param fromPort
@@ -178,7 +178,7 @@ public class SecurityGroupsExtension {
sourceGroupId);
return new CreateRule(securityGroupRuleForCreate);
}
-
+
public CreateRule createSecurityGroupRule(
String parentSecurityGroupId, String ipProtocol, Integer fromPort,
Integer toPort, String cidr) {
@@ -192,7 +192,7 @@ public class SecurityGroupsExtension {
Integer toPort) {
SecurityGroupRuleForCreate securityGroupRuleForCreate = new SecurityGroupRuleForCreate(
parentSecurityGroupId, sourceGroupId,ipProtocol, fromPort, toPort
- );
+ );
return new CreateRule(securityGroupRuleForCreate);
}
public DeleteRule deleteSecurityGroupRule(String id) {
@@ -202,4 +202,4 @@ public class SecurityGroupsExtension {
return new DeleteRule(String.valueOf(id));
}
-}
+} \ No newline at end of file
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java
index 1afba7e..252e55b 100644
--- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java
+++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java
@@ -27,76 +27,75 @@ import com.woorea.openstack.nova.model.SnapshotForCreate;
import com.woorea.openstack.nova.model.Snapshots;
public class SnapshotsExtension {
-
+
private final OpenStackClient CLIENT;
-
+
public SnapshotsExtension(OpenStackClient client) {
CLIENT = client;
}
-
+
public List list(boolean detail) {
return new List(detail);
}
-
+
public Create create(SnapshotForCreate snapshotForCreate) {
return new Create(snapshotForCreate);
}
-
+
public Show show(String id) {
return new Show(id);
}
-
+
public ShowMetadata showMetadata(String id) {
return new ShowMetadata(id);
}
-
+
public Delete delete(String id) {
return new Delete(id);
}
public class List extends OpenStackRequest<Snapshots> {
-
+
public List(boolean detail) {
super(CLIENT, HttpMethod.GET, detail ? "/os-snapshots/detail" : "/os-snapshots", null, Snapshots.class);
}
}
-
+
public class Create extends OpenStackRequest<SnapshotForCreate> {
private SnapshotForCreate snapshotForCreate;
-
+
public Create(SnapshotForCreate snapshotForCreate) {
super(CLIENT, HttpMethod.POST, "/os-snapshots", Entity.json(snapshotForCreate), SnapshotForCreate.class);
this.snapshotForCreate = snapshotForCreate;
}
-
+
}
-
+
public class Show extends OpenStackRequest<Snapshot> {
-
+
public Show(String id) {
super(CLIENT, HttpMethod.GET, new StringBuilder("/os-snapshots/").append(id).toString(), null, Snapshot.class);
}
}
-
+
public class ShowMetadata extends OpenStackRequest<Metadata> {
-
+
public ShowMetadata(String id) {
super(CLIENT, HttpMethod.GET, new StringBuilder("/os-snapshots/").append(id).append("/metadata").toString(), null, Metadata.class);
}
}
-
+
public class Delete extends OpenStackRequest<Void> {
-
+
public Delete(String id) {
super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-snapshots/").append(id).toString(), null, Void.class);
}
-
+
}
-
-}
+}