com.bea.ales.management
Class Group

java.lang.Object
  |
  +--com.bea.ales.management.Subject
        |
        +--com.bea.ales.management.Group

public class Group
extends Subject

Group is typically a collection of users that share some common property. A group can contain either users or other groups. Users or groups who belong to a group are called members of that group. Nested memberships of groups within a group form a hierarchy. A group can only include users or groups within the same directory.


Method Summary
 void addMember(Subject subject)
          Add a single subject to this group.
 void addMembers(java.util.Collection subjs)
          Add a collection of subjects to this group.
 boolean equals(java.lang.Object obj)
          Determine if the pass in obj equals to this group.
 GroupQueryResult getAncestorGroups(int queryType, java.lang.String filter)
          Find ancestors of the group.
 AttributeElement getAttribute(java.lang.String attrName, int queryType)
          Get an attribute of this group which has the specified name.
 AttributeQueryResult getAttributes(int queryType)
          Get attributes of the group.
 IdentityQueryContainer getEligibleMembers(int subjType, java.lang.String filter)
          Find subjects (users or groups) than can be added to this group.
 IdentityQueryContainer getMembers(int queryType, int subjType, java.lang.String filter)
          Get all users or groups which are directly or indirectly belongs to the group.
 int hashCode()
          Return the hash code of this group object.
 boolean isSecurityEnabled()
           
 void removeAttribute(AttributeElement attributeElement)
          Remove an attribute from this group.
 void removeMember(Subject subj)
          Remove a specific subject from this group.
 void removeMembers(java.util.Collection subjs)
          Remove a collection of subjects from this group.
 void rename(java.lang.String newName)
          Rename this group.
 void setAttributeValue(AttributeElement attributeElement)
          Set the attribute value for this group.
 
Methods inherited from class com.bea.ales.management.Subject
getDirectory, getDirectoryShortName, getName, getType, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getMembers

public IdentityQueryContainer getMembers(int queryType,
                                         int subjType,
                                         java.lang.String filter)
                                  throws ManagementException
Get all users or groups which are directly or indirectly belongs to the group.

Parameters:
queryType - one of:
  • QueryType.DIRECT - Direct members of this group.
  • QueryType.ALL - Both direct and indirect members of this group.
subjType - what kind of subjects to find:
  • SubjectType.USER - only find users.
  • SubjectType.GROUP - only find groups.
  • SubjectType.ALL - find both users and groups.
filter - pattern of the name to match.
Returns:
an IdentityQueryContainer which contains the result.
Throws:
ManagementException - if the operation fails.
See Also:
IdentityQueryContainer

getEligibleMembers

public IdentityQueryContainer getEligibleMembers(int subjType,
                                                 java.lang.String filter)
                                          throws ManagementException
Find subjects (users or groups) than can be added to this group.

Parameters:
subjType - what kind of subjects to find:
  • SubjectType.USER - only find users.
  • SubjectType.GROUP - only find groups.
  • SubjectType.ALL - find both users and groups.
filter - pattern of name to match.
Returns:
an IdentityQueryContainer which contains the result.
Throws:
ManagementException - if the operation fails.
See Also:
IdentityQueryContainer

getAncestorGroups

public GroupQueryResult getAncestorGroups(int queryType,
                                          java.lang.String filter)
                                   throws ManagementException
Find ancestors of the group. We say Group A is an direct/indirect ancestor of group B if group B directly/indirectly belongs to group A. Note a group can directly belong to multiple groups.

Parameters:
queryType - one of:
  • QueryType.DIRECT - Direct ancestors of this group.
  • QueryType.ALL - Both direct and indirect ancestors of this group.
filter - pattern of ancestor names to match
Returns:
a GroupQueryResult object which contains the result.
Throws:
ManagementException - if the operation fails.
See Also:
GroupQueryResult

addMembers

public void addMembers(java.util.Collection subjs)
                throws ManagementException
Add a collection of subjects to this group.

Parameters:
subjs - a collection of subjects to be added.
Throws:
ManagementException - if the operation fails.
See Also:
removeMembers(Collection subjs)

addMember

public void addMember(Subject subject)
               throws ManagementException
Add a single subject to this group.

Parameters:
subject - the new member.
Throws:
ManagementException - if the operation fails.

removeMembers

public void removeMembers(java.util.Collection subjs)
                   throws ManagementException
Remove a collection of subjects from this group.

Parameters:
subjs - a collection of subjects to be removed
Throws:
ManagementException - if the operation fails.
See Also:
#addMembers(Subject[])

removeMember

public void removeMember(Subject subj)
                  throws ManagementException
Remove a specific subject from this group.

Parameters:
subj - the subject to be removed.
Throws:
ManagementException - if the operation fails.
See Also:
#addMembers(Subject[])

getAttributes

public AttributeQueryResult getAttributes(int queryType)
                                   throws ManagementException,
                                          java.lang.IllegalArgumentException
Get attributes of the group.

Parameters:
queryType - - One of:
  • QueryType.DIRECT - Only direct attributes of this group.
  • QueryType.ALL - Both inherited and direct attributes of this group.
  • QueryType.INHERITTED - Only inherited attributes of this gruop.
Returns:
an AttributeQueryResult object contains the result.
Throws:
ManagementException - if the operation fails.
See Also:
AttributeQueryResult

getAttribute

public AttributeElement getAttribute(java.lang.String attrName,
                                     int queryType)
                              throws ManagementException
Get an attribute of this group which has the specified name.

Parameters:
attrName - name of the attribute.
queryType - - One of:
  • QueryType.DIRECT - Only direct attribute of this group.
  • QueryType.ALL - Both inherited and direct attribute of this group.
Returns:
the attribute which has the specified name; or null if not found.
Throws:
ManagementException - if the operation fails.

setAttributeValue

public void setAttributeValue(AttributeElement attributeElement)
                       throws ManagementException
Set the attribute value for this group.

Parameters:
attributeElement - The name of this passed in attribute is used to find attribute to be set of the group. The value of this passed in attribute is set to the value of the found attribute of the group.
Throws:
ManagementException - if the operation fails.

removeAttribute

public void removeAttribute(AttributeElement attributeElement)
                     throws ManagementException
Remove an attribute from this group.

Parameters:
attributeElement - The attribute to be removed from this group.

rename

public void rename(java.lang.String newName)
            throws ManagementException
Rename this group.

Parameters:
newName - new group name. This name should be short name without ALES prefix.
Throws:
ManagementException - if the operation fails.

equals

public boolean equals(java.lang.Object obj)
Determine if the pass in obj equals to this group.

Parameters:
obj - the object to compare with.
Returns:
true if equals; false otherwise.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Return the hash code of this group object.

Returns:
hash code of this object.
Overrides:
hashCode in class java.lang.Object

isSecurityEnabled

public boolean isSecurityEnabled()


Copyright © 2006 BEA Systems Inc. All Rights Reserved.