com.sap.security.api

Interface IGroup

All Superinterfaces:
IPrincipal, IPrincipalMaint, IPrincipalSet, 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.

NOTE: As this interface�can be extended, this interface can be freely used, but must not be implemented.


Field Summary
static String VERSIONSTRING
           
 
Fields inherited from interface com.sap.security.api.IPrincipal
BYTE_TYPE, CREATED_BY, DATASOURCE, DEFAULT_NAMESPACE, DEFAULT_RELATION_NAMESPACE, DESCRIPTION, DISPLAYNAME, LAST_MODIFIED_BY, PRINCIPAL_CREATION_DATE, PRINCIPAL_MODIFY_DATE, PRINCIPAL_RELATION_MEMBER_ATTRIBUTE, PRINCIPAL_RELATION_PARENT_ATTRIBUTE, STRING_TYPE, TRANSIENT_NAMESPACE, UNIQUE_NAME
 
Method Summary
 boolean addGroupMember(String uniqueIdOfGroup)
          Adds the specified group member to this group.
 void addToGroup(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. discard them) if appropriate.
 void addToRole(String uniqueIdOfRole)
          Assign this principal to the role identified by uniqueIdOfRole.
 boolean addUserMember(String uniqueIdOfUser)
          Adds the specified user member to the collection.
 String getDescription()
          Returns the description of this principal.
 Iterator getGroupMembers(boolean getChildMembers)
          Returns principals of type group belonging to this group.
 Iterator getParentGroups(boolean recursive)
          Gets the list of all parent groups including parents, grandparents, ...
 Iterator getRoles(boolean recursive)
          Gets the list of all assigned roles of this principal including parent groups, grandparent groups,...
 String getUniqueName()
          Get uniqueName of this IGroup object.
 Iterator getUserMembers(boolean getChildMembers)
          Returns principals of type user belonging to this group.
 boolean isGroupMember(String uniqueIdOfGroup, boolean checkParents)
          Returns true if the passed principal of type groups is a member of this group.
 boolean isMemberOfGroup(String uniqueIdOfGroup, boolean recursive)
          Checks if the principal belongs to the passed parentGroup identified by uniqueIdOfGroup.
 boolean isMemberOfRole(String uniqueIdOfRole, boolean recursive)
          Checks if the principal belongs to the passed role identified by uniqueIdOfRole.
 boolean isUserMember(String uniqueIdOfUser, boolean checkParents)
          Returns true if the passed principal of type user is a member of this group.
 void removeFromGroup(String uniqueIdOfGroup)
          Unassign this group from the parent-group identified by uniqueIdOfGroup.
 void removeFromRole(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. discard them) if appropriate.
 boolean removeGroupMember(String uniqueIdOfGroup)
          Remove the specified group member from the collection.
 boolean removeUserMember(String uniqueIdOfUser)
          Remove the specified user member from the group.
 boolean setDescription(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
addAttributeValue, commit, isModified, removeAttributeValue, rollback, save, setAttribute, setBinaryAttribute, setDisplayName
 
Methods inherited from interface com.sap.security.api.IPrincipal
created, equals, getAttribute, getAttributeNames, getAttributeNamespaces, getAttributeType, getBinaryAttribute, getDisplayName, getMessages, getParents, getUniqueID, hashCode, isExistenceChecked, isMutable, lastModified, refresh
 

Field Detail

VERSIONSTRING

static final String VERSIONSTRING
See Also:
Constant Field Values
Method Detail

getUserMembers

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

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

boolean isUserMember(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

boolean isGroupMember(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

boolean addUserMember(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

boolean addGroupMember(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

boolean removeUserMember(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

boolean removeGroupMember(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

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

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

boolean isMemberOfRole(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

boolean isMemberOfGroup(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

void addToGroup(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

void removeFromGroup(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:
uniqueIdOfGroup - of the parent group
Throws:
UMException

addToRole

void addToRole(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:
uniqueIdOfRole - id of the role
Throws:
UMException

removeFromRole

void removeFromRole(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

String getDescription()
Returns the description of this principal.

Returns:
String: the description of this principal null : if no description exists

setDescription

boolean setDescription(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

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
Access Rights

This class can be accessed from:


SC DC
[sap.com] ENGINEAPI [sap.com] com.sap.security.api.sda
[sap.com] ENGFACADE [sap.com] tc/je/usermanagement/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib


Copyright 2010 SAP AG Complete Copyright Notice