com.sap.security.api
Interface IRole

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

public interface IRole
extends IPrincipalSet

This interface provides read and write access to attributes and properties of instances of type IRole. IRole extends IPrincipalSet and defines additional role specific characteristics.

If you want to keep and persist an identifier as a reference to an instance of IRole 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:
1.0

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 newMember)
          Adds the specified group member to this role.
 boolean addUserMember(java.lang.String newMember)
          Adds the specified user member to this role.
 java.lang.String getDescription()
          Returns the description of this principal.
 java.util.Iterator getGroupMembers(boolean getChildMembers)
          Returns IDs of group principals belonging to this role
 java.lang.String getUniqueName()
          Get uniqueName of this IRole object.
 java.util.Iterator getUserMembers(boolean getChildMembers)
          Returns IDs of user principals belonging to this role
 boolean isGroupMember(java.lang.String member, boolean checkChildren)
          Returns true if the passed principal is a member of this role.
 boolean isUserMember(java.lang.String member, boolean checkChildren)
          Returns true if the passed principal of type user is assigned to this role.
 boolean removeGroupMember(java.lang.String oldMember)
          Remove the specified group member from this role.
 boolean removeUserMember(java.lang.String oldMember)
          Remove the specified user member from this role.
 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 IDs of user principals belonging to this role
Parameters:
getChildMembers. - This method does a recursive search if the parameter getChildMembers is set to true.
Returns:
iterator of Strings of uniqueIds of this role
Throws:
NoSuchPCDRoleException - if the role does not exist

getGroupMembers

public java.util.Iterator getGroupMembers(boolean getChildMembers)
Returns IDs of group principals belonging to this role
Parameters:
getChildMembers. - This method does a recursive search if parameter getChildMembers is set to true.
Returns:
iterator of Strings of uniqueIds of this role
Throws:
NoSuchPCDRoleException - if the role does not exist

isUserMember

public boolean isUserMember(java.lang.String member,
                            boolean checkChildren)
Returns true if the passed principal of type user is assigned to this role.
Parameters:
member - - uniqueId of the principal whose membership is to be checked.
checkChildren: - this method does a recursive search if this parameter is set to true
Returns:
true if the principal is a member of this collection, false otherwise.

isGroupMember

public boolean isGroupMember(java.lang.String member,
                             boolean checkChildren)
Returns true if the passed principal is a member of this role.
Parameters:
member - - uniqueId of the principal whose membership is to be checked.
checkChildren: - this method does a recursive search if this parameter is set to true If a group is member of a group which is assigned to this role, true is returned.
Returns:
true if the group is assigned to this role, false otherwise.

addUserMember

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

addGroupMember

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

removeUserMember

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

removeGroupMember

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

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.
Parameters:
description: - String representing the description of a role
Throws:
UMException - if the description could not be set

getUniqueName

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

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.