diff options
author | seshukm <seshu.kumar.m@huawei.com> | 2018-07-25 18:13:18 +0800 |
---|---|---|
committer | seshukm <seshu.kumar.m@huawei.com> | 2018-07-25 18:13:18 +0800 |
commit | 4f27ba159b9786fd440c7b07f19da26b5a65786c (patch) | |
tree | db811b3f98618a37ffac9494b528291835e8e7a8 /keystone-client/src | |
parent | a9bc456b0de6ad5158665f960e4860269544ce46 (diff) |
fix keystone code issues
Issue-ID: SO-729
Change-Id: Ia3f30f048499b5f8b3654cb851f140aa1707bd63
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'keystone-client/src')
6 files changed, 68 insertions, 68 deletions
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java index af0f7e1..44ffb2d 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java @@ -25,16 +25,16 @@ import com.woorea.openstack.keystone.model.Roles; public class DomainUserRolesResource extends GenericResource<Role, Roles> { - public DomainUserRolesResource(OpenStackClient client, String path) { - super(client, path, Role.class, Roles.class); - } + public DomainUserRolesResource(OpenStackClient client, String path) { + super(client, path, Role.class, Roles.class); + } - public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); - } - - public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); - } + public OpenStackRequest<Void> add(String roleId) { + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); + } + + public OpenStackRequest<Void> remove(String roleId) { + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java index 9aa01f3..c04aba0 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java @@ -22,16 +22,16 @@ import com.woorea.openstack.keystone.v3.model.Domains; public class DomainsResource extends GenericResource<Domain, Domains> { - public DomainsResource(OpenStackClient client) { - super(client, "/domains", Domain.class, Domains.class); - } - - public DomainUserRolesResource userRoles(String domainId, String userId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); - } - - public DomainUserRolesResource groupRoles(String domainId, String groupId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/groups/").append(groupId).append("/roles").toString()); - } + public DomainsResource(OpenStackClient client) { + super(client, "/domains", Domain.class, Domains.class); + } + + public DomainUserRolesResource userRoles(String domainId, String userId) { + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); + } + + public DomainUserRolesResource groupRoles(String domainId, String groupId) { + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/groups/").append(groupId).append("/roles").toString()); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java index 7a7b1bf..4d4d147 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java @@ -22,8 +22,8 @@ import com.woorea.openstack.keystone.v3.model.Endpoints; public class EndpointsResource extends GenericResource<Endpoint, Endpoints> { - public EndpointsResource(OpenStackClient client) { - super(client, "/endpoints", Endpoint.class, Endpoints.class); - } + public EndpointsResource(OpenStackClient client) { + super(client, "/endpoints", Endpoint.class, Endpoints.class); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java index 30c915c..c27ab8b 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java @@ -23,38 +23,38 @@ import com.woorea.openstack.base.client.OpenStackRequest; public class GenericResource<One, Many> { - protected final OpenStackClient CLIENT; - - protected CharSequence path; - - protected Class<One> oneClass; - protected Class<Many> manyClass; - - public GenericResource(OpenStackClient client, CharSequence path, Class<One> oneClass, Class<Many> manyClass) { - CLIENT = client; - this.path = path; - this.oneClass = oneClass; - this.manyClass = manyClass; - } - - public OpenStackRequest<Many> list() { - return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); - } - - public OpenStackRequest<One> create(One one) { - return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); - } - - public OpenStackRequest<One> show(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); - } - - public OpenStackRequest<One> update(String id, One one) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); - } - - public OpenStackRequest<One> delete(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); - } - + protected final OpenStackClient CLIENT; + + protected CharSequence path; + + protected Class<One> oneClass; + protected Class<Many> manyClass; + + public GenericResource(OpenStackClient client, CharSequence path, Class<One> oneClass, Class<Many> manyClass) { + CLIENT = client; + this.path = path; + this.oneClass = oneClass; + this.manyClass = manyClass; + } + + public OpenStackRequest<Many> list() { + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); + } + + public OpenStackRequest<One> create(One one) { + return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); + } + + public OpenStackRequest<One> show(String id) { + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + } + + public OpenStackRequest<One> update(String id, One one) { + return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); + } + + public OpenStackRequest<One> delete(String id) { + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + } + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java index 45da3a6..efcf7d0 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java @@ -23,8 +23,8 @@ import com.woorea.openstack.keystone.v3.model.Users; public class GroupUsersResource extends GenericResource<User, Users> { - public GroupUsersResource(OpenStackClient client, String path) { - super(client, path, User.class, Users.class); - } + public GroupUsersResource(OpenStackClient client, String path) { + super(client, path, User.class, Users.class); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java index 7c35825..c3b760f 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java @@ -22,12 +22,12 @@ import com.woorea.openstack.keystone.v3.model.Groups; public class GroupsResource extends GenericResource<Group, Groups> { - public GroupsResource(OpenStackClient client) { - super(client, "/groups", Group.class, Groups.class); - } - - public DomainUserRolesResource userRoles(String domainId, String userId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); - } + public GroupsResource(OpenStackClient client) { + super(client, "/groups", Group.class, Groups.class); + } + + public DomainUserRolesResource userRoles(String domainId, String userId) { + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); + } } |