站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

RoleModule - JBOSS Portal 2.4 API 英文版文档


org.jboss.portal.identity
Interface RoleModule

All Known Implementing Classes:
RoleModuleImpl

public interface RoleModule


Method Summary
 Role createRole(java.lang.String name, java.lang.String displayName)
          Create a new role with the specified name.
 Role findRoleById(java.lang.Object id)
          Retrieves a role by its id.
 Role findRoleById(java.lang.String id)
          Retrieves a role by its id.
 Role findRoleByName(java.lang.String name)
          Retrieves a role by its name
 java.util.Set findRoleMembers(java.lang.String roleName, int offset, int limit, java.lang.String userNameFilter)
          Returns role members based on rolename
 java.util.Set findRoles()
          Get all the roles
 java.util.Set findRolesByNames(java.lang.String[] names)
          Retrieve a collection of role from the role names.
 java.util.Set getRoles(User user)
          Return the set of role objects that a given user has.
 int getRolesCount()
          Returns the number of roles.
 void removeRole(java.lang.Object id)
          Remove a role.
 void setRoles(User user, java.util.Set roles)
          Assign a set of role objects to a given user.
 

Method Detail

findRoleByName

public Role findRoleByName(java.lang.String name)
                    throws IdentityException,
                           java.lang.IllegalArgumentException
Retrieves a role by its name

Parameters:
name - the role name
Returns:
the role
Throws:
IdentityException
java.lang.IllegalArgumentException

findRolesByNames

public java.util.Set findRolesByNames(java.lang.String[] names)
                               throws IdentityException,
                                      java.lang.IllegalArgumentException
Retrieve a collection of role from the role names.

Parameters:
names - the role names
Returns:
a collection of roles
Throws:
java.lang.IllegalArgumentException
IdentityException

findRoleById

public Role findRoleById(java.lang.Object id)
                  throws IdentityException,
                         java.lang.IllegalArgumentException
Retrieves a role by its id.

Parameters:
id - the role id
Returns:
the role
Throws:
IdentityException
java.lang.IllegalArgumentException

findRoleById

public Role findRoleById(java.lang.String id)
                  throws IdentityException,
                         java.lang.IllegalArgumentException
Retrieves a role by its id.

Parameters:
id - the role id
Returns:
the role
Throws:
IdentityException
java.lang.IllegalArgumentException

createRole

public Role createRole(java.lang.String name,
                       java.lang.String displayName)
                throws IdentityException,
                       java.lang.IllegalArgumentException
Create a new role with the specified name.

Parameters:
name - the role name
displayName - the role display name
Returns:
the role
Throws:
IdentityException
java.lang.IllegalArgumentException

removeRole

public void removeRole(java.lang.Object id)
                throws IdentityException,
                       java.lang.IllegalArgumentException
Remove a role.

Parameters:
id - the role id
Throws:
IdentityException
java.lang.IllegalArgumentException

getRolesCount

public int getRolesCount()
                  throws IdentityException
Returns the number of roles.

Returns:
the number of roles
Throws:
IdentityException

findRoles

public java.util.Set findRoles()
                        throws IdentityException
Get all the roles

Returns:
the roles
Throws:
IdentityException

findRoleMembers

public java.util.Set findRoleMembers(java.lang.String roleName,
                                     int offset,
                                     int limit,
                                     java.lang.String userNameFilter)
                              throws IdentityException
Returns role members based on rolename

Parameters:
roleName -
offset -
limit -
Throws:
IdentityException

setRoles

public void setRoles(User user,
                     java.util.Set roles)
              throws IdentityException
Assign a set of role objects to a given user.

Parameters:
user - the user
roles - the user roles
Throws:
IdentityException

getRoles

public java.util.Set getRoles(User user)
                       throws IdentityException
Return the set of role objects that a given user has.

Parameters:
user - the user
Returns:
the set of roles of the specified user
Throws:
IdentityException