com.sap.security.api
Interface IGroup

All Superinterfaces:
IPrincipal, IPrincipalMaint, IPrincipalSet, java.io.Serializable

public interface IGroup
extends IPrincipalSet

This interface provides read and write access to principals of type group.

If you want to keep and persist an identifier as a reference to an instance of IGroup you must use method IPrincipal.getUniqueID(). As this identifier contains internal information and is usually not readable, it should not be used in end user interfaces.

Use methods IPrincipal.getDisplayName() or getUniqueName() in order to display attributes with a nice name for user interfaces.

Version:
$Revision: #2 $

Field Summary
static java.lang.String VERSIONSTRING
           
 
Fields inherited from interface com.sap.security.api.IPrincipal
BYTE_TYPE, DEFAULT_NAMESPACE, DEFAULT_RELATION_NAMESPACE, DESCRIPTION, DISPLAYNAME, PRINCIPAL_CREATION_DATE, PRINCIPAL_MODIFY_DATE, PRINCIPAL_RELATION_MEMBER_ATTRIBUTE, PRINCIPAL_RELATION_PARENT_ATTRIBUTE, STRING_TYPE, TRANSIENT_NAMESPACE, UNIQUE_NAME
 
Method Summary
 boolean addGroupMember(java.lang.String uniqueIdOfGroup)
          Adds the specified group member to this group.
 void addToGroup(java.lang.String uniqueIdOfGroup)
          Assign this principal to the parent-group identified by uniqueIdOfGroup These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e.
 void addToRole(java.lang.String uniqueIdOfRole)
          Assign this principal to the role identified by uniqueIdOfRole.
 boolean addUserMember(java.lang.String uniqueIdOfUser)
          Adds the specified user member to the collection.
 java.lang.String getDescription()
          Returns the description of this principal.
 java.util.Iterator getGroupMembers(boolean getChildMembers)
          Returns principals of type group belonging to this group.
 java.util.Iterator getParentGroups(boolean recursive)
          Gets the list of all parent groups including parents, grandparents, ...
 java.util.Iterator getRoles(boolean recursive)
          Gets the list of all assigned roles of this principal including parent groups, grandparent groups,...
 java.lang.String getUniqueName()
          Get uniqueName of this IGroup object.
 java.util.Iterator getUserMembers(boolean getChildMembers)
          Returns principals of type user belonging to this group.
 boolean isGroupMember(java.lang.String uniqueIdOfGroup, boolean checkParents)
          Returns true if the passed principal of type groups is a member of this group.
 boolean isMemberOfGroup(java.lang.String uniqueIdOfGroup, boolean recursive)
          Checks if the principal belongs to the passed parentGroup identified by uniqueIdOfGroup.
 boolean isMemberOfRole(java.lang.String uniqueIdOfRole, boolean recursive)
          Checks if the principal belongs to the passed role identified by uniqueIdOfRole.
 boolean isUserMember(java.lang.String uniqueIdOfUser, boolean checkParents)
          Returns true if the passed principal of type user is a member of this group.
 void removeFromGroup(java.lang.String uniqueIdOfGroup)
          Unassign this group from the parent-group identified by uniqueIdOfGroup.
 void removeFromRole(java.lang.String uniqueIdOfRole)
          Unassign this principal from role identified by uniqueIdOfRole These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e.
 boolean removeGroupMember(java.lang.String uniqueIdOfGroup)
          Remove the specified group member from the collection.
 boolean removeUserMember(java.lang.String uniqueIdOfUser)
          Remove the specified user member from the group.
 boolean setDescription(java.lang.String description)
          Sets the description of this principal.
 
Methods inherited from interface com.sap.security.api.IPrincipalSet
addMember, getMembers, isMember, removeMember
 
Methods inherited from interface com.sap.security.api.IPrincipalMaint
commit, isModified, rollback, save, setAttribute, setBinaryAttribute, setDisplayName
 
Methods inherited from interface com.sap.security.api.IPrincipal
created, equals, getAttribute, getAttributeNames, getAttributeNamespaces, getAttributeType, getBinaryAttribute, getDisplayName, getParents, getUniqueID, hashCode, isExistenceChecked, isMutable, lastModified, refresh
 

Field Detail

VERSIONSTRING

public static final java.lang.String VERSIONSTRING
Method Detail

getUserMembers

public java.util.Iterator getUserMembers(boolean getChildMembers)
Returns principals of type user belonging to this group.
Parameters:
getChildMembers - if set to true, this method does a recursive search, that is children, grandchildren ... of this group are checked and all users of this group and its subgroups are returned. If this parameter is set to false only user members of this group are returned.
Returns:
Iterator of user members. The iterator contains uniqueIdOfUser strings

getGroupMembers

public java.util.Iterator getGroupMembers(boolean getChildMembers)
Returns principals of type group belonging to this group.
Parameters:
getChildMembers - if set to true, this method does a recursive search, that is children, grandchildren ... of this group are checked and all groups which are member of this group and its subgroups are returned. If this parameter is set to false only group members of this group are returned.
Returns:
Iterator of group members, The iterator contains uniqueIdOfGroup strings.

isUserMember

public boolean isUserMember(java.lang.String uniqueIdOfUser,
                            boolean checkParents)
Returns true if the passed principal of type user is a member of this group.
Parameters:
uniqueIdOfUser - - the uniqueIdOfUser which should be checked. uniqueIdOfUser must be a uniqueID which identifies a user object.
checkParents - - recursive search is done, that is parents, grandparents, ... of this group are checked if this user is a member of this or its parent groups
Returns:
true if the principal is a member of this group, false otherwise.

isGroupMember

public boolean isGroupMember(java.lang.String uniqueIdOfGroup,
                             boolean checkParents)
Returns true if the passed principal of type groups is a member of this group.
Parameters:
uniqueIdOfGroup - - the uniqueIdOfGroup which should be checked. uniqueIdOfGroup must be a uniqueID which identifies a group object.
checkParents - - recursive search is done, that is parents, grandparents, ... of this group are checked if this group is a member of this or its parent groups
Returns:
true if the principal is a member of this group, false otherwise.

addUserMember

public boolean addUserMember(java.lang.String uniqueIdOfUser)
                      throws UMException
Adds the specified user member to the collection.
Parameters:
uniqueIdOfUser - - the uniqueIdOfUser to add to this collection.
Returns:
:true if the member was successfully added These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Throws:
UMException - if an error occurs

addGroupMember

public boolean addGroupMember(java.lang.String uniqueIdOfGroup)
                       throws UMException
Adds the specified group member to this group.
Parameters:
uniqueIdOfGroup - - the uniqueIdOfGroup to add to this group.
Returns:
:true if the member was successfully added These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Throws:
UMException - if an error occurs

removeUserMember

public boolean removeUserMember(java.lang.String uniqueIdOfUser)
                         throws UMException
Remove the specified user member from the group.
Parameters:
uniqueIdOfUser - - the uniqueIdOfUser to remove from this group
Returns:
:true if the member was successfully removed These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Throws:
UMException - if an error occurs

removeGroupMember

public boolean removeGroupMember(java.lang.String uniqueIdOfGroup)
                          throws UMException
Remove the specified group member from the collection.
Parameters:
uniqueIdOfGroup - - the uniqueIdOfGroup to remove from this collection.
Returns:
:true if the member was successfully removed. These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Throws:
UMException - if an error occurs

getRoles

public java.util.Iterator getRoles(boolean recursive)
Gets the list of all assigned roles of this principal including parent groups, grandparent groups,...
Parameters:
recursive - if true returns all directly assigned roles and also the roles which are assigned to parent groups (indirectly assigned roles).
Returns:
an iterator of all roles for this principal. The iterator contains uniqueIdOfRole strings.

getParentGroups

public java.util.Iterator getParentGroups(boolean recursive)
Gets the list of all parent groups including parents, grandparents, ...
Parameters:
recursive - if true returns all parent groups of this group. If this parameter is set to false only the groups are returned which have a member of this group.
Returns:
iterator of all parent principals of this collection. The iterator contains uniqueIdOfGroup strings.

isMemberOfRole

public boolean isMemberOfRole(java.lang.String uniqueIdOfRole,
                              boolean recursive)
Checks if the principal belongs to the passed role identified by uniqueIdOfRole.
Parameters:
uniqueIdOfRole - of role which should be checked
recursive - - a recursive search is done if this parameter is set to true. If this group is member of a group which is assigned to role identified by uniqueIdOfRole, true is returned. If this parameter is set to false it is only checked if this group is directly assigned to the role.
Returns:
true if this group is directly or indirectly (via group membership) assigned to role identified by uniqueIdOfRole. false if this group is not assigned to this role

isMemberOfGroup

public boolean isMemberOfGroup(java.lang.String uniqueIdOfGroup,
                               boolean recursive)
Checks if the principal belongs to the passed parentGroup identified by uniqueIdOfGroup.
Parameters:
uniqueIdOfGroup - the ID of the collection
recursive - - a recursive search is done if this parameter is set to true. If this group is member of a group which is a member of the group identified by uniqueIdOfGroup, true is returned. If this parameter is set to false it is only checked if this group is a direct member of this group. returns true if this group is a member of the group identified by uniqueIdOfGroup.

addToGroup

public void addToGroup(java.lang.String uniqueIdOfGroup)
                throws UMException
Assign this principal to the parent-group identified by uniqueIdOfGroup These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Parameters:
uniqueIdOfGroup - uniqueIdOfGroup of the parent group
Throws:
UMException -  

removeFromGroup

public void removeFromGroup(java.lang.String uniqueIdOfGroup)
                     throws UMException
Unassign this group from the parent-group identified by uniqueIdOfGroup. These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Parameters:
String - uniqueIdOfGroup of the parent group
Throws:
UMException -  

addToRole

public void addToRole(java.lang.String uniqueIdOfRole)
               throws UMException
Assign this principal to the role identified by uniqueIdOfRole. These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Parameters:
String - uniqueIdOfRole id of the role
Throws:
UMException -  

removeFromRole

public void removeFromRole(java.lang.String uniqueIdOfRole)
                    throws UMException
Unassign this principal from role identified by uniqueIdOfRole These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Parameters:
uniqueIdOfRole - of the role
Throws:
UMException -  

getDescription

public java.lang.String getDescription()
Returns the description of this principal.
Returns:
String: the description of this principal null : if no description exists

setDescription

public boolean setDescription(java.lang.String description)
                       throws UMException
Sets the description of this principal. These changes will only take effect if you commit these changes to the group store IPrincipalMaint.commit() or to roll them back (i.e. discard them) if appropriate.
Throws:
UMException - if the description could not be set

getUniqueName

public java.lang.String getUniqueName()
Get uniqueName of this IGroup object. A (usually) unique readable name of an instance of IGroup.

Note: Depending on the persistence layer it is not guaranteed that this name is unique. The uniqueName may change over time. Thus, do not persist the uniqueName. Always use the unique identifier (UniqueID) of IPrincipal.getUniqueID() for this purpose.

Use the uniqueName for searching and displaying in user interfaces.

Returns:
uniqueName of object


Copyright © 2002 SAP AG All Rights Reserved.