Interface IUserRoleDao
-
public interface IUserRoleDao
Contract for data access objects that read and write users and roles.- Author:
- mlowery
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IPentahoRole
createRole(ITenant tenant, String roleName, String description, String[] memberUserNames)
Create a role under a specified tenant.IPentahoUser
createUser(ITenant tenant, String username, String password, String description, String[] roles)
Creates user under a specified tenant.void
deleteRole(IPentahoRole role)
Delete the role from the repositoryvoid
deleteUser(IPentahoUser user)
Delete the user from the repositoryIPentahoRole
getRole(ITenant tenant, String name)
Retrieves the role with a given name from the specified tenant.List<IPentahoUser>
getRoleMembers(ITenant tenant, String roleName)
Retrieves the list of users associated to a particular role in a given tenant.List<IPentahoRole>
getRoles()
Retrieve all the role from the default tenantList<IPentahoRole>
getRoles(ITenant tenant)
Retrieve all the role from the specified tenant.List<IPentahoRole>
getRoles(ITenant tenant, boolean includeSubtenants)
Retrieve all the roles from the specified tenant.IPentahoUser
getUser(ITenant tenant, String name)
Retrieve the user from a specified tenant of the repository.List<IPentahoRole>
getUserRoles(ITenant tenant, String userName)
Retrieves the list of roles associated to a particular user in a given tenant.List<IPentahoUser>
getUsers()
Retrieve all the users from the default tenant of a repository.List<IPentahoUser>
getUsers(ITenant tenant)
Retrieve all the users from the specified tenant of a repository.List<IPentahoUser>
getUsers(ITenant tenant, boolean includeSubtenants)
Retrieve all the users from the specified tenant of a repository .void
setPassword(ITenant tenant, String userName, String password)
Update the password of an existing user under a specified tenant.void
setRoleDescription(ITenant tenant, String roleName, String description)
Update the role description of a given role under a specific tenant.void
setRoleMembers(ITenant tenant, String roleName, String[] memberUserNames)
Assign list of user names to a particular role in a specified tenant.void
setUserDescription(ITenant tenant, String userName, String description)
Update the user description of an existing user under a speficied tenant.void
setUserRoles(ITenant tenant, String userName, String[] roles)
Assign a list of roles to a particular user in a specified tenant.
-
-
-
Method Detail
-
createUser
IPentahoUser createUser(ITenant tenant, String username, String password, String description, String[] roles) throws AlreadyExistsException, UncategorizedUserRoleDaoException
Creates user under a specified tenant. If the tenant is null then it will create the user under a default tenant.- Parameters:
tenant
-username
-password
-description
-roles
-- Returns:
- pentaho user
- Throws:
AlreadyExistsException
UncategorizedUserRoleDaoException
-
setPassword
void setPassword(ITenant tenant, String userName, String password) throws NotFoundException, UncategorizedUserRoleDaoException
Update the password of an existing user under a specified tenant. If the tenant is null then it will try to update the password of an existing user under a default tenant- Parameters:
tenant
-userName
-password
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
setUserDescription
void setUserDescription(ITenant tenant, String userName, String description) throws NotFoundException, UncategorizedUserRoleDaoException
Update the user description of an existing user under a speficied tenant. If the tenant is null then it will try to update the user description of an existing user under a default tenant- Parameters:
tenant
-userName
-description
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
deleteUser
void deleteUser(IPentahoUser user) throws NotFoundException, UncategorizedUserRoleDaoException
Delete the user from the repository- Parameters:
user
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
getUser
IPentahoUser getUser(ITenant tenant, String name) throws UncategorizedUserRoleDaoException
Retrieve the user from a specified tenant of the repository. If the tenant is null then it will try to retrieve the user from a default tenant of the repository.- Parameters:
tenant
-name
-- Returns:
- pentaho user
- Throws:
UncategorizedUserRoleDaoException
-
getUsers
List<IPentahoUser> getUsers() throws UncategorizedUserRoleDaoException
Retrieve all the users from the default tenant of a repository.- Returns:
- list of pentaho user
- Throws:
UncategorizedUserRoleDaoException
-
getUsers
List<IPentahoUser> getUsers(ITenant tenant) throws UncategorizedUserRoleDaoException
Retrieve all the users from the specified tenant of a repository. If the tenant is null then it will try to retrieve all the users from the default tenant.- Parameters:
tenant
-- Returns:
- pentaho user list
- Throws:
UncategorizedUserRoleDaoException
-
getUsers
List<IPentahoUser> getUsers(ITenant tenant, boolean includeSubtenants) throws UncategorizedUserRoleDaoException
Retrieve all the users from the specified tenant of a repository . If the tenant is null then it will try to retrieve all the users from the default tenant. If includeSubtenants is true, then it will retrieve all the users from the current specified tenant and its subtenants.- Parameters:
tenant
-includeSubtenants
-- Returns:
- pentaho user list
- Throws:
UncategorizedUserRoleDaoException
-
createRole
IPentahoRole createRole(ITenant tenant, String roleName, String description, String[] memberUserNames) throws AlreadyExistsException, UncategorizedUserRoleDaoException
Create a role under a specified tenant. If the tenant is null then this role will be created under a default tenant- Parameters:
tenant
-roleName
-description
-memberUserNames
-- Returns:
- pentaho role
- Throws:
AlreadyExistsException
UncategorizedUserRoleDaoException
-
setRoleDescription
void setRoleDescription(ITenant tenant, String roleName, String description) throws NotFoundException, UncategorizedUserRoleDaoException
Update the role description of a given role under a specific tenant. If the tenant is null, then it will search for the role in the default tenant and update the description there- Parameters:
tenant
-roleName
-description
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
deleteRole
void deleteRole(IPentahoRole role) throws NotFoundException, UncategorizedUserRoleDaoException
Delete the role from the repository- Parameters:
role
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
getRole
IPentahoRole getRole(ITenant tenant, String name) throws UncategorizedUserRoleDaoException
Retrieves the role with a given name from the specified tenant. If the tenant is null, then it will retrieve the role from the default tenant- Parameters:
tenant
-name
-- Returns:
- pentaho role
- Throws:
UncategorizedUserRoleDaoException
-
getRoles
List<IPentahoRole> getRoles() throws UncategorizedUserRoleDaoException
Retrieve all the role from the default tenant- Returns:
- pentaho role list
- Throws:
UncategorizedUserRoleDaoException
-
getRoles
List<IPentahoRole> getRoles(ITenant tenant) throws UncategorizedUserRoleDaoException
Retrieve all the role from the specified tenant. If the tenant is null, then it will retrieve all the roles from the default tenant- Parameters:
tenant
-- Returns:
- pentaho role list
- Throws:
UncategorizedUserRoleDaoException
-
getRoles
List<IPentahoRole> getRoles(ITenant tenant, boolean includeSubtenants) throws UncategorizedUserRoleDaoException
Retrieve all the roles from the specified tenant. If the includeSubtenants is "true" then it will get all the role from the subtenants as well- Parameters:
tenant
-includeSubtenants
-- Returns:
- pentaho role list
- Throws:
UncategorizedUserRoleDaoException
-
setRoleMembers
void setRoleMembers(ITenant tenant, String roleName, String[] memberUserNames) throws NotFoundException, UncategorizedUserRoleDaoException
Assign list of user names to a particular role in a specified tenant. If the tenant is null, then it will search for this role in a default tenant- Parameters:
tenant
-roleName
-memberUserNames
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
setUserRoles
void setUserRoles(ITenant tenant, String userName, String[] roles) throws NotFoundException, UncategorizedUserRoleDaoException
Assign a list of roles to a particular user in a specified tenant. If the tenant is null, then it will search for this user in a default tenant- Parameters:
tenant
-userName
-roles
-- Throws:
NotFoundException
UncategorizedUserRoleDaoException
-
getRoleMembers
List<IPentahoUser> getRoleMembers(ITenant tenant, String roleName) throws UncategorizedUserRoleDaoException
Retrieves the list of users associated to a particular role in a given tenant. If the tenant is null, then it will get role members in a default tenant- Parameters:
tenant
-roleName
-- Returns:
- pentaho user list
- Throws:
UncategorizedUserRoleDaoException
-
getUserRoles
List<IPentahoRole> getUserRoles(ITenant tenant, String userName) throws UncategorizedUserRoleDaoException
Retrieves the list of roles associated to a particular user in a given tenant. If the tenant is null, then it will get user roles in a default tenant- Parameters:
tenant
-userName
-- Returns:
- pentaho role list
- Throws:
UncategorizedUserRoleDaoException
-
-