tyrex.security.container.helper

Class RolesRealm

public class RolesRealm extends Object

Cached copy of a realm and all the roles in that realm. Implementations of realms can extend this class and use it to add roles, list members in roles, lookup roles and members in roles, and construct RoleCredentials.

Version: $Revision: 1.5 $ $Date: 2001/03/19 17:39:02 $

Author: Assaf Arkin

Nested Class Summary
static classRolesRealm.Role
Definition of a role is a name and members list.
Constructor Summary
protected RolesRealm(String realmName, String[] defaultRoles)
Construct a new realm.
Method Summary
protected voidaddRole(String roleName, String[] members)
Add a role or members to an existing role.
StringgetRealmName()
Returns the name of this realm.
RoleCredentialsgetRoleCredentials(String member)
Returns a role credentials for the given member.
String[]listMembers(String roleName)
Lists all the members in the role.
String[]listRoles()
Lists all the roles in this realm.

Constructor Detail

RolesRealm

protected RolesRealm(String realmName, String[] defaultRoles)
Construct a new realm.

Parameters: realmName The realm name defaultRoles List of default roles that all members are listed in, or null if no default roles

Method Detail

addRole

protected void addRole(String roleName, String[] members)
Add a role or members to an existing role. If the role did not exist before, the role and all its members are added to the role list. If the role existed before, the members are added to the existing list of members.

Parameters: roleName The role name members The members list

getRealmName

public String getRealmName()
Returns the name of this realm.

Returns: Name of realm

getRoleCredentials

public RoleCredentials getRoleCredentials(String member)
Returns a role credentials for the given member. The credentials is constructed by accumulating all the roles in which the member is listed as a member.

Parameters: member The member

Returns: Role credentials

listMembers

public String[] listMembers(String roleName)
Lists all the members in the role.

Parameters: roleName The role name

Returns: Array of zero or more members

listRoles

public String[] listRoles()
Lists all the roles in this realm.

Returns: Array of zero or more roles

Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.