com.wles.blm
Class BLMRoleManager

java.lang.Object
  extended bycom.wles.blm.BLMComponentManager
      extended bycom.wles.blm.BLMRoleManager

public class BLMRoleManager
extends BLMComponentManager

Manages operations on roles. Roles are used to represent a set of capabilities a subject may hold on a resource. Role membership is scoped to a particular resource, i.e. Bob has the Admin role on application foo. Role memberships are specified by role rules using the BLMRuleManager. Role names are specified in the qualified form //role/roleName. You may make use of the com.wles.util.SubjectBuilder to construct and parse role names from Java objects rather then directly dealing the above format. Use a BLMContextManager to obtain an instance of a BLMRoleManager.

See Also:
BLMContextManager, SubjectBuilder

Method Summary
 void create(java.lang.String name)
          Creates a new role.
 java.lang.String filter(java.lang.String findPattern)
          Finds roles matching a filter pattern.
 boolean find(java.lang.String cID, java.lang.String name)
          Checks for a role within a role collection.
 int getCount(java.lang.String cID)
          Returns the size of a role collection.
 java.lang.String[] getReport(java.lang.String cID)
          Returns a report for on a role collection.
 java.lang.String[] getReport(java.lang.String cID, int iStart, int iCount)
          Returns a report on a subset of a role collection.
 void release(java.lang.String cID)
          Releases a role collection.
 void remove(java.lang.String name)
          Removes a role from the system.
 void rename(java.lang.String oldName, java.lang.String newName)
          Renames a role in the system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public void create(java.lang.String name)
            throws com.wles.blm.BLMException
Creates a new role.

Specified by:
create in class BLMComponentManager
Parameters:
name - name of the role to be created
Throws:
BLMException

filter

public java.lang.String filter(java.lang.String findPattern)
                        throws com.wles.blm.BLMException
Finds roles matching a filter pattern. Returns a role collection ID.

Specified by:
filter in class BLMComponentManager
Parameters:
findPattern - filter pattern
Returns:
collection ID as String
Throws:
BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

find

public boolean find(java.lang.String cID,
                    java.lang.String name)
             throws com.wles.blm.BLMException
Checks for a role within a role collection.

Specified by:
find in class BLMComponentManager
Parameters:
cID - collection ID
name - name of the role
Returns:
found (true/false)
Throws:
BLMException

getCount

public int getCount(java.lang.String cID)
             throws com.wles.blm.BLMException
Returns the size of a role collection.

Specified by:
getCount in class BLMComponentManager
Parameters:
cID - collection ID
Returns:
number of roles in the collection
Throws:
BLMException

getReport

public java.lang.String[] getReport(java.lang.String cID)
                             throws com.wles.blm.BLMException
Returns a report for on a role collection.

Parameters:
cID - collection ID
Returns:
A String array of role names from the collection.
Throws:
BLMException

getReport

public java.lang.String[] getReport(java.lang.String cID,
                                    int iStart,
                                    int iCount)
                             throws com.wles.blm.BLMException
Returns a report on a subset of a role collection.

Parameters:
cID - collection ID
iStart - start index of the subset
iCount - size of the subset
Returns:
A String array of role names from the collection.
Throws:
BLMException

release

public void release(java.lang.String cID)
             throws com.wles.blm.BLMException
Releases a role collection. Supplying a null collection id will cause all held collections to be released.

Specified by:
release in class BLMComponentManager
Parameters:
cID - collection ID
Returns:
void
Throws:
BLMException

remove

public void remove(java.lang.String name)
            throws com.wles.blm.BLMException
Removes a role from the system. The role must not be in use within rules or the method will fail.

Specified by:
remove in class BLMComponentManager
Parameters:
name - name of the role
Throws:
BLMException

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws com.wles.blm.BLMException
Renames a role in the system. All rules referencing this role will automatically be updated.

Specified by:
rename in class BLMComponentManager
Parameters:
oldName - old name of the role
newName - new name of the role
Throws:
BLMException


Copyright © 2005 BEA Systems Inc. All Rights Reserved.