diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-17 04:44:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-17 04:44:30 +0000 |
commit | d7218db1247c9129c06fde271cd09661acbd2c42 (patch) | |
tree | 5245b2bff3ee16f3d49f1ec316b26599193781b7 /nova-client/src | |
parent | 39bead8d87c54140fe346e1f7459d4b315a1a4df (diff) | |
parent | 1fa2733cde5ac4bfe3d122f01ec854369123a6ca (diff) |
Merge "Code Enhancement (Sonar Fixes)"
Diffstat (limited to 'nova-client/src')
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); } - + } - -} +} |