com.wles.blm
Class BLMLocalSubjectGroupManager

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

public class BLMLocalSubjectGroupManager
extends BLMComponentManager

Manages all operations on subject groups, including creation, deletion and profile operations. Group names are specified in a qualified format which includes the identity directory which they belong to. The format is //sgrp/dirName/groupName/. The groupName portion may include whitespace and any printable english character. You may make use of the com.wles.util.SubjectBuilder to construct and parse group names from Java objects rather then directly dealing the above format. Directory name, as parameter of methods should also be specified in a qualified format with prefix //dir/, Example: //dir/myDir Use a BLMContextManager to obtain an instance of a BLMLocalSubjectGroupManager.

See Also:
BLMContextManager, SubjectBuilder

Field Summary
static int ATTRIBUTE_QUERY_TYPE_DIRECT
          Attribute query type specifiying the attribute value assinged directly to the group.
static int ATTRIBUTE_QUERY_TYPE_ENFORCED
          Attribute query type specifiying the attribute value based on the attribute inheritance logic.
static int ATTRIBUTE_QUERY_TYPE_ENFORCED_FROM_CHILDREN
          Attribute query type specifiying the attribute value based on the RBAC attribute aggragation logic, ie, from the children to the parent.
static int ATTRIBUTE_QUERY_TYPE_INHERITED
          Attribute query type specifiying the attribute value inherited by the group, from a group membership.
static int ATTRIBUTE_QUERY_TYPE_INHERITED_FROM_CHILDREN
          Attribute query type specifiying the attribute value inheried by the group, from children.
 
Method Summary
 void addSubjectGroupToSubjectGroup(java.lang.String aChildSubjectGroupName, java.lang.String aParentSubjectGroupName)
          Adds a one group (child) as a member of another group (parent).
 void addUserToSubjectGroup(java.lang.String aLocalUserName, java.lang.String aLocalSubjectGroupName)
          Adds a user to a group.
 void create(java.lang.String name)
          Create a new group.
 java.lang.String filter(java.lang.String findPattern)
          Find all groups matching the specified filter pattern.
 boolean find(java.lang.String cID, java.lang.String name)
          Checks for a group within a group collection.
 java.lang.String getAllAncestorsSubjectGroups(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Get all the groups that the specified group is a member of.
 java.lang.String getAllDescendantsSubjectGroups(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Get all groups which are a member of the specified group.
 java.lang.String getAllMembers(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Get a list of all users and groups who are a member of the specified group.
 int getCount(java.lang.String cID)
          getCount Gets the size of the group or group attribute collection.
 java.lang.String getDirectAncestorsSubjectGroups(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Gets all groups the specified group is directly a member of.
 java.lang.String getDirectDescendantsSubjectGroups(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Get all groups which are directly (not via inheritance) a member of the specified group.
 java.lang.String getDirectUsers(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Gets all users who are directly members of the specified group.
 java.lang.String getEligibleSubjectGroupMembers(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Gets all groups who are not currently a member of the specified group.
 java.lang.String getEligibleUserMembers(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Gets all users who are not currently a member of the specified group.
 java.lang.String[] getReport(java.lang.String cID)
          Returns a report on a group collection.
 java.lang.String[] getReport(java.lang.String cID, int iStart, int iCount)
          Returns a report of a subset of a group collection.
 AttributeElement[] getReportOnSubjectGroupAttributes(java.lang.String cID)
          Returns the report of a group attribute collection.
 AttributeElement[] getReportOnSubjectGroupAttributes(java.lang.String cID, int iStart, int iCount)
          Returns the report of a subset of a group attribute collection.
 AttributeElement getSubjectGroupAttribute(java.lang.String aLocalSubjectGroupName, java.lang.String attrName, int attrQueryType)
          Gets the value of an attribute associated with the group.
 java.lang.String getSubjectGroupAttributes(java.lang.String aLocalSubjectGroupName, int attrQueryType)
          Finds attributes associated with a group.
 java.lang.String getSubjectGroupsWithAttribute(java.lang.String aDirName, AttributeElement attrElem)
          Finds all groups with the specified attribute value.
 java.lang.String getUserClosure(java.lang.String aLocalSubjectGroupName, java.lang.String filterString)
          Get all users who are a member of the specified group.
 void release(java.lang.String cID)
          Releases a group or group attribute collection.
 void remove(java.lang.String name)
          Remove a group from the system.
 void removeCascade(java.lang.String name)
          Remove a group from the system, including all rules referencing it.
 void removeSubjectGroupAttribute(java.lang.String name, java.lang.String attrName)
          Removes the value of a group's attribute.
 void removeSubjectGroupFromSubjectGroup(java.lang.String aChildSubjectGroupName, java.lang.String aParentSubjectGroupName)
          Removes a group (child) from another group's (parent) membership.
 void removeUserFromSubjectGroup(java.lang.String aLocalUserName, java.lang.String aLocalSubjectGroupName)
          Removes a user from a group.
 void rename(java.lang.String oldName, java.lang.String newName)
          Rename a group within the system.
 void setSubjectGroupAttribute(java.lang.String aLocalSubjectGroupName, AttributeElement attrElem)
          Sets the value of a group attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_QUERY_TYPE_DIRECT

public static final int ATTRIBUTE_QUERY_TYPE_DIRECT
Attribute query type specifiying the attribute value assinged directly to the group.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_ENFORCED

public static final int ATTRIBUTE_QUERY_TYPE_ENFORCED
Attribute query type specifiying the attribute value based on the attribute inheritance logic.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_ENFORCED_FROM_CHILDREN

public static final int ATTRIBUTE_QUERY_TYPE_ENFORCED_FROM_CHILDREN
Attribute query type specifiying the attribute value based on the RBAC attribute aggragation logic, ie, from the children to the parent.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_INHERITED

public static final int ATTRIBUTE_QUERY_TYPE_INHERITED
Attribute query type specifiying the attribute value inherited by the group, from a group membership.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_INHERITED_FROM_CHILDREN

public static final int ATTRIBUTE_QUERY_TYPE_INHERITED_FROM_CHILDREN
Attribute query type specifiying the attribute value inheried by the group, from children.

See Also:
Constant Field Values
Method Detail

addSubjectGroupToSubjectGroup

public void addSubjectGroupToSubjectGroup(java.lang.String aChildSubjectGroupName,
                                          java.lang.String aParentSubjectGroupName)
                                   throws com.wles.blm.BLMException
Adds a one group (child) as a member of another group (parent).

Parameters:
aChildSubjectGroupName - child group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
aParentSubjectGroupName - parent group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
com.wles.blm.BLMException

addUserToSubjectGroup

public void addUserToSubjectGroup(java.lang.String aLocalUserName,
                                  java.lang.String aLocalSubjectGroupName)
                           throws com.wles.blm.BLMException
Adds a user to a group.

Parameters:
aLocalUserName - user name
aLocalSubjectGroupName - group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
com.wles.blm.BLMException

create

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

Specified by:
create in class BLMComponentManager
Parameters:
name - name of the group to be created, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Returns:
boolean true = success
Throws:
BLMException

filter

public java.lang.String filter(java.lang.String findPattern)
                        throws com.wles.blm.BLMException
Find all groups matching the specified filter pattern. Returns a group collection ID.

Specified by:
filter in class BLMComponentManager
Parameters:
findPattern - pattern for the filter
Returns:
String id to the collection found
Throws:
com.wles.blm.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 group within a group collection.

Specified by:
find in class BLMComponentManager
Parameters:
cID - collection ID of the group collection
name - name of the group, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Returns:
boolean found = true
Throws:
BLMException

getAllAncestorsSubjectGroups

public java.lang.String getAllAncestorsSubjectGroups(java.lang.String aLocalSubjectGroupName,
                                                     java.lang.String filterString)
                                              throws com.wles.blm.BLMException
Get all the groups that the specified group is a member of. This includes all direct and indirect (inherited) group memeberships. Returns a group collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getAllDescendantsSubjectGroups

public java.lang.String getAllDescendantsSubjectGroups(java.lang.String aLocalSubjectGroupName,
                                                       java.lang.String filterString)
                                                throws com.wles.blm.BLMException
Get all groups which are a member of the specified group. This includes all direct and indirect (inherited) group memeberships. Returns a group collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getAllMembers

public java.lang.String getAllMembers(java.lang.String aLocalSubjectGroupName,
                                      java.lang.String filterString)
                               throws com.wles.blm.BLMException
Get a list of all users and groups who are a member of the specified group. This includes all direct and indirect (inherited) group memeberships. Returns a subject collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getCount

public int getCount(java.lang.String cID)
             throws com.wles.blm.BLMException
getCount Gets the size of the group or group attribute collection.

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

getDirectAncestorsSubjectGroups

public java.lang.String getDirectAncestorsSubjectGroups(java.lang.String aLocalSubjectGroupName,
                                                        java.lang.String filterString)
                                                 throws com.wles.blm.BLMException
Gets all groups the specified group is directly a member of. This does not include indirect (inherited) group memeberships. Returns a group collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getDirectDescendantsSubjectGroups

public java.lang.String getDirectDescendantsSubjectGroups(java.lang.String aLocalSubjectGroupName,
                                                          java.lang.String filterString)
                                                   throws com.wles.blm.BLMException
Get all groups which are directly (not via inheritance) a member of the specified group. Returns a group collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getDirectUsers

public java.lang.String getDirectUsers(java.lang.String aLocalSubjectGroupName,
                                       java.lang.String filterString)
                                throws com.wles.blm.BLMException
Gets all users who are directly members of the specified group. This does not include indirect (inherited) group memeberships. Returns a user collection ID. Use the BLMLocalUserManager collection methods to access the conents of this collection.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
Throws:
BLMException
See Also:
BLMLocalUserManager.getReport(String cID), BLMLocalUserManager.getReport(String cID, int iStart, int iCount), BLMLocalUserManager.getCount(String CID), BLMLocalUserManager.release(String cID), BLMLocalUserManager.find(String cID, String name)

getEligibleSubjectGroupMembers

public java.lang.String getEligibleSubjectGroupMembers(java.lang.String aLocalSubjectGroupName,
                                                       java.lang.String filterString)
                                                throws com.wles.blm.BLMException
Gets all groups who are not currently a member of the specified group. Returns a group collection ID.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
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)

getEligibleUserMembers

public java.lang.String getEligibleUserMembers(java.lang.String aLocalSubjectGroupName,
                                               java.lang.String filterString)
                                        throws com.wles.blm.BLMException
Gets all users who are not currently a member of the specified group. Returns a user collection ID. Use the BLMLocalUserManager collection methods to access the conents of this collection.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
Throws:
BLMException
See Also:
BLMLocalUserManager.getReport(String cID), BLMLocalUserManager.getReport(String cID, int iStart, int iCount), BLMLocalUserManager.getCount(String CID), BLMLocalUserManager.release(String cID), BLMLocalUserManager.find(String cID, String name)

getReport

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

Parameters:
cID - ID of the collection
Returns:
A String array of group 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 of a subset of a group collection.

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

getReportOnSubjectGroupAttributes

public AttributeElement[] getReportOnSubjectGroupAttributes(java.lang.String cID)
                                                     throws com.wles.blm.BLMException,
                                                            BadParameterException
Returns the report of a group attribute collection.

Parameters:
cID - ID of the collection
Returns:
An array of AttributeElement objects from the collection.
Throws:
BLMException
BadParameterException

getReportOnSubjectGroupAttributes

public AttributeElement[] getReportOnSubjectGroupAttributes(java.lang.String cID,
                                                            int iStart,
                                                            int iCount)
                                                     throws com.wles.blm.BLMException,
                                                            BadParameterException
Returns the report of a subset of a group attribute collection.

Parameters:
cID - ID of the collection
iStart - index of start of subset
iCount - size of subset
Returns:
An array of AttributeElement objects from the collection.
Throws:
BLMException
BadParameterException

getSubjectGroupAttribute

public AttributeElement getSubjectGroupAttribute(java.lang.String aLocalSubjectGroupName,
                                                 java.lang.String attrName,
                                                 int attrQueryType)
                                          throws com.wles.blm.BLMException,
                                                 BadParameterException
Gets the value of an attribute associated with the group.

Parameters:
aLocalSubjectGroupName - the group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
attrName - the attribute name
attrQueryType - ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
the AttributeElement containing the value of the group's attribute, or null if this attribute is not defined for the specified group.
Throws:
BLMException
BadParameterException
See Also:
ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED, ATTRIBUTE_QUERY_TYPE_INHERITED_FROM_CHILDREN, ATTRIBUTE_QUERY_TYPE_ENFORCED_FROM_CHILDREN

getSubjectGroupAttributes

public java.lang.String getSubjectGroupAttributes(java.lang.String aLocalSubjectGroupName,
                                                  int attrQueryType)
                                           throws com.wles.blm.BLMException
Finds attributes associated with a group. Returns a group attribute collection ID.

Parameters:
aLocalSubjectGroupName - group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
attrQueryType - ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
collection id containing the result set
Throws:
BLMException
See Also:
getReportOnSubjectGroupAttributes(String cID), getReportOnSubjectGroupAttributes(String cID, int iStart, int iCount), getCount(String cID), release(String cID), ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED, ATTRIBUTE_QUERY_TYPE_INHERITED_FROM_CHILDREN, ATTRIBUTE_QUERY_TYPE_ENFORCED_FROM_CHILDREN

getSubjectGroupsWithAttribute

public java.lang.String getSubjectGroupsWithAttribute(java.lang.String aDirName,
                                                      AttributeElement attrElem)
                                               throws com.wles.blm.BLMException,
                                                      BadParameterException
Finds all groups with the specified attribute value. Returns a group collection ID.

Parameters:
aDirName - directory name, should be specified in a qualified format with prefix //dir/, Example: //dir/myDir
attrElem - attribute element containing name and value
Returns:
The collection id of the result set.
Throws:
BLMException
BadParameterException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getUserClosure

public java.lang.String getUserClosure(java.lang.String aLocalSubjectGroupName,
                                       java.lang.String filterString)
                                throws com.wles.blm.BLMException
Get all users who are a member of the specified group. This includes all direct and indirect (inherited) group memeberships. Returns a user collection ID. Use the BLMLocalUserManager collection methods to access the conents of this collection.

Parameters:
aLocalSubjectGroupName - a group to be reported on, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
filterString - a pattern to filter the collection
Returns:
string unique collection id
Throws:
BLMException
See Also:
BLMLocalUserManager.getReport(String cID), BLMLocalUserManager.getReport(String cID, int iStart, int iCount), BLMLocalUserManager.getCount(String CID), BLMLocalUserManager.release(String cID), BLMLocalUserManager.find(String cID, String name)

release

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

Specified by:
release in class BLMComponentManager
Parameters:
cID - ID of the collection
Throws:
BLMException

remove

public void remove(java.lang.String name)
            throws com.wles.blm.BLMException
Remove a group from the system.

Specified by:
remove in class BLMComponentManager
Parameters:
name - name of the group to be removed, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
BLMException

removeCascade

public void removeCascade(java.lang.String name)
                   throws com.wles.blm.BLMException
Remove a group from the system, including all rules referencing it.

Parameters:
name - name of the group to be removed, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
BLMException

removeSubjectGroupAttribute

public void removeSubjectGroupAttribute(java.lang.String name,
                                        java.lang.String attrName)
                                 throws com.wles.blm.BLMException,
                                        BadParameterException
Removes the value of a group's attribute.

Parameters:
name - fully qualified name of the group, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
attrName - the name of the attribute to remove
Returns:
void
Throws:
BLMException
BadParameterException

removeSubjectGroupFromSubjectGroup

public void removeSubjectGroupFromSubjectGroup(java.lang.String aChildSubjectGroupName,
                                               java.lang.String aParentSubjectGroupName)
                                        throws com.wles.blm.BLMException
Removes a group (child) from another group's (parent) membership.

Parameters:
aChildSubjectGroupName - child group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
aParentSubjectGroupName - parent group name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
com.wles.blm.BLMException

removeUserFromSubjectGroup

public void removeUserFromSubjectGroup(java.lang.String aLocalUserName,
                                       java.lang.String aLocalSubjectGroupName)
                                throws com.wles.blm.BLMException
Removes a user from a group.

Parameters:
aLocalUserName - user name to be removed
aLocalSubjectGroupName - group name of which the user is a member of, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
com.wles.blm.BLMException

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws com.wles.blm.BLMException
Rename a group within the system. All rules and memberships referencing the specified group will automatically be updated.

Specified by:
rename in class BLMComponentManager
Parameters:
oldName - old name of the group, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
newName - new name of the group, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
Throws:
BLMException

setSubjectGroupAttribute

public void setSubjectGroupAttribute(java.lang.String aLocalSubjectGroupName,
                                     AttributeElement attrElem)
                              throws com.wles.blm.BLMException,
                                     BadParameterException
Sets the value of a group attribute. Groups only support multi-valued attributes. Specifying a null value will unset the user's attribute.

Parameters:
aLocalSubjectGroupName - subjectgroup name, should be specified in a qualified format with prefix //sgrp/dir/, Example: //sgrp/dir/myGroup
attrElem - contains the attribute name and value
Throws:
BLMException
BadParameterException


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.