Class RoleServiceImpl
- java.lang.Object
-
- org.openstack4j.openstack.internal.BaseOpenStackService
-
- org.openstack4j.openstack.identity.v2.internal.RoleServiceImpl
-
- All Implemented Interfaces:
RoleService,RestService
public class RoleServiceImpl extends BaseOpenStackService implements RoleService
Identity Role based Operations Implementation- Author:
- Jeremy Unruh
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
BaseOpenStackService.Invocation<R>
-
-
Constructor Summary
Constructors Constructor Description RoleServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionResponseaddUserRole(String userId, String roleId)Adds a global role to a userActionResponseaddUserRole(String tenantId, String userId, String roleId)Adds a tenant based role to a userRolecreate(String name)Creates a new RoleActionResponsedelete(String roleId)Delete a role by it's IDRoleget(String roleId)Gets a role by IDRolegetByName(String name)Gets a Role by NameList<? extends Role>list()Lists the global rolesList<? extends Role>listRolesForUser(String userId)List roles for user.List<? extends Role>listRolesForUser(String userId, String tenantId)List roles for user.ActionResponseremoveUserRole(String userId, String roleId)Removes a global role from a userActionResponseremoveUserRole(String tenantId, String userId, String roleId)Removes the user role from a user and the associated tenant-
Methods inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
delete, deleteWithResponse, get, getProvider, getServiceVersion, getWithResponse, getXOpenstackRequestId, head, patch, patchWithResponse, post, postWithResponse, put, putWithResponse, request, toList, uri
-
-
-
-
Method Detail
-
addUserRole
public ActionResponse addUserRole(String userId, String roleId)
Adds a global role to a user- Specified by:
addUserRolein interfaceRoleService- Parameters:
userId- the user idroleId- the role id to add- Returns:
- the action response
-
addUserRole
public ActionResponse addUserRole(String tenantId, String userId, String roleId)
Adds a tenant based role to a user- Specified by:
addUserRolein interfaceRoleService- Parameters:
tenantId- the tenant iduserId- the user idroleId- the role id- Returns:
- the action response
-
removeUserRole
public ActionResponse removeUserRole(String userId, String roleId)
Removes a global role from a user- Specified by:
removeUserRolein interfaceRoleService- Parameters:
userId- the user idroleId- the role id- Returns:
- the action response
-
removeUserRole
public ActionResponse removeUserRole(String tenantId, String userId, String roleId)
Removes the user role from a user and the associated tenant- Specified by:
removeUserRolein interfaceRoleService- Parameters:
tenantId- the tenant iduserId- the user idroleId- the role id- Returns:
- the action response
-
list
public List<? extends Role> list()
Lists the global roles- Specified by:
listin interfaceRoleService- Returns:
- the list extends role>
-
listRolesForUser
public List<? extends Role> listRolesForUser(String userId)
List roles for user.- Specified by:
listRolesForUserin interfaceRoleService- Parameters:
userId- the user id- Returns:
- the list extends role>
-
listRolesForUser
public List<? extends Role> listRolesForUser(String userId, String tenantId)
List roles for user.- Specified by:
listRolesForUserin interfaceRoleService- Parameters:
userId- the user idtenantId- the tenant id- Returns:
- the list extends role>
-
delete
public ActionResponse delete(String roleId)
Delete a role by it's ID- Specified by:
deletein interfaceRoleService- Parameters:
roleId- the role id
-
get
public Role get(String roleId)
Gets a role by ID- Specified by:
getin interfaceRoleService- Parameters:
roleId- the role id- Returns:
- the role
-
create
public Role create(String name)
Creates a new Role- Specified by:
createin interfaceRoleService- Parameters:
name- the name of the role- Returns:
- the role
-
getByName
public Role getByName(String name)
Gets a Role by Name- Specified by:
getByNamein interfaceRoleService- Parameters:
name- the name of the Role- Returns:
- the Role or null if not found
-
-