From efdf50410fd3d341c0bbb6550ac758549d2bf3f4 Mon Sep 17 00:00:00 2001 From: seshukm Date: Wed, 25 Jul 2018 18:15:51 +0800 Subject: basic code issue cleanup Issue-ID: SO-729 Change-Id: I9f6ba919cfc959836b2a69aa9ca9719d5b95a6d1 Signed-off-by: seshukm --- .../keystone/v3/api/ProjectsResource.java | 30 ++++++------ .../openstack/keystone/v3/api/RolesResource.java | 14 +++--- .../keystone/v3/api/ServicesResource.java | 6 +-- .../openstack/keystone/v3/api/TokensResource.java | 56 +++++++++++----------- .../openstack/keystone/v3/api/UsersResource.java | 30 ++++++------ 5 files changed, 68 insertions(+), 68 deletions(-) (limited to 'keystone-client') diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java index b58f990..900ce20 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java @@ -24,20 +24,20 @@ import com.woorea.openstack.keystone.v3.model.Projects; public class ProjectsResource extends GenericResource { - public ProjectsResource(OpenStackClient client) { - super(client, "/projects", Project.class, Projects.class); - } - - public OpenStackRequest users(String projectId) { - return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), Users.class); - } - - public ProjectUserRolesResource userRoles(String projectId, String userId) { - return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString()); - } - - public ProjectUserRolesResource groupRoles(String projectId, String groupId) { - return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString()); - } + public ProjectsResource(OpenStackClient client) { + super(client, "/projects", Project.class, Projects.class); + } + + public OpenStackRequest users(String projectId) { + return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), Users.class); + } + + public ProjectUserRolesResource userRoles(String projectId, String userId) { + return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString()); + } + + public ProjectUserRolesResource groupRoles(String projectId, String groupId) { + return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString()); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java index addd004..ae8fc60 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java @@ -24,12 +24,12 @@ import com.woorea.openstack.keystone.v3.model.Users; public class RolesResource extends GenericResource { - public RolesResource(OpenStackClient client) { - super(client, "/roles", Role.class, Roles.class); - } - - public OpenStackRequest users(String domainId, String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString(), Users.class); - } + public RolesResource(OpenStackClient client) { + super(client, "/roles", Role.class, Roles.class); + } + + public OpenStackRequest users(String domainId, String userId) { + return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString(), Users.class); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java index 28603fa..c0e25e6 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java @@ -22,8 +22,8 @@ import com.woorea.openstack.keystone.model.Services; public class ServicesResource extends GenericResource { - public ServicesResource(OpenStackClient client) { - super(client, "/services", Service.class, Services.class); - } + public ServicesResource(OpenStackClient client) { + super(client, "/services", Service.class, Services.class); + } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java index b564d7d..9d176d7 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java @@ -24,35 +24,35 @@ import com.woorea.openstack.keystone.v3.model.Authentication; import com.woorea.openstack.keystone.v3.model.Token; public class TokensResource { - - private final OpenStackClient CLIENT; - - public TokensResource(OpenStackClient client) { - CLIENT = client; - } - - public Authenticate authenticate(Authentication authentication) { - return new Authenticate(authentication); - } - - public OpenStackRequest show() { - return CLIENT.get("/auth/tokens", Token.class); - } + + private final OpenStackClient CLIENT; + + public TokensResource(OpenStackClient client) { + CLIENT = client; + } + + public Authenticate authenticate(Authentication authentication) { + return new Authenticate(authentication); + } + + public OpenStackRequest show() { + return CLIENT.get("/auth/tokens", Token.class); + } - public class Authenticate extends OpenStackRequest { - - private Authentication authentication; - - public Authenticate() { - - } - - public Authenticate(Authentication authentication) { - super(CLIENT, HttpMethod.POST, "/auth/tokens", Entity.json(authentication), Token.class); - this.authentication = authentication; - } + public class Authenticate extends OpenStackRequest { + + private Authentication authentication; + + public Authenticate() { + + } + + public Authenticate(Authentication authentication) { + super(CLIENT, HttpMethod.POST, "/auth/tokens", Entity.json(authentication), Token.class); + this.authentication = authentication; + } - } - + } + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java index 73cdb46..0e1e609 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java @@ -24,20 +24,20 @@ import com.woorea.openstack.keystone.v3.model.Users; public class UsersResource extends GenericResource { - public UsersResource(OpenStackClient client) { - super(client, "/users", User.class, Users.class); - } - - public OpenStackRequest groups(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class); - } - - public OpenStackRequest projects(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class); - } - - public OpenStackRequest roles(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class); - } + public UsersResource(OpenStackClient client) { + super(client, "/users", User.class, Users.class); + } + + public OpenStackRequest groups(String userId) { + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class); + } + + public OpenStackRequest projects(String userId) { + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class); + } + + public OpenStackRequest roles(String userId) { + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class); + } } -- cgit 1.2.3-korg