summaryrefslogtreecommitdiffstats
path: root/nova-client
diff options
context:
space:
mode:
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-12 16:01:51 +0530
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-04-16 13:39:23 +0000
commit189a8f019f3b6b0609960b846f8c5de34365558f (patch)
tree89e9330ac09e0543adaf00dcef7823ca469e859f /nova-client
parent226c37657808fa22336940e9be49147809f41710 (diff)
Code Enhancement (Sonar Fixes)
Sonar Issues Fixes Issue-ID: SO-1490 Change-Id: I9759c8ba1d6098e8f2b4eb6da36a676d0ecd4e19 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/FloatingIpsExtension.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
index 4b39b2e..d1ae7f4 100644
--- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
+++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
@@ -28,13 +28,13 @@ import com.woorea.openstack.nova.model.FloatingIp;
import com.woorea.openstack.nova.model.FloatingIps;
public class FloatingIpsExtension {
-
+
private final OpenStackClient CLIENT;
-
+
public FloatingIpsExtension(OpenStackClient client) {
CLIENT = client;
}
-
+
public class List extends OpenStackRequest<FloatingIps> {
public List() {
@@ -44,40 +44,39 @@ public class FloatingIpsExtension {
}
public class Allocate extends OpenStackRequest<FloatingIp> {
-
+
public Allocate(Entity<?> entity) {
super(CLIENT, HttpMethod.POST, "/os-floating-ips", entity, FloatingIp.class);
}
}
-
+
public class Deallocate extends OpenStackRequest<Void> {
-
+
public Deallocate(String id) {
super(CLIENT, HttpMethod.DELETE, new StringBuffer("/os-floating-ips/").append(id).toString(), null, Void.class);
}
-
+
}
public List list() {
return new List();
}
-
+
public Allocate allocate(String pool) {
Entity<?> entity=null;
if(pool!=null) {
- Map<String, String> body = new HashMap<String, String>();
+ Map<String, String> body = new HashMap<>();
body.put("pool", pool);
entity=Entity.json(body);
}
return new Allocate(entity);
}
-
+
public Deallocate deallocate(String id) {
return new Deallocate(id);
}
-
-
-
-}
+
+
+}