com.sap.security.api

Interface IGroupFactory

All Superinterfaces:
IConfigurable

public interface IGroupFactory
extends IConfigurable

This interface for a groupfactory provides functionality to get group objects by providing required information. The group factory provides means to

  1. instantiate group objects
  2. create new groups (possibly by copying the data of an existing one)
  3. delete groups
  4. search for groups based on different criteria
  5. perform mass commit/rollback operations on a set of groups

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


Field Summary
static String ANONYMOUS_USERS
          Deprecated. use ANONYMOUS_USERS_UNIQUEID instead
static String ANONYMOUS_USERS_UNIQUEID
          Constant used to access build-in group Anonymous Users with uniqueId
static String AUTHENTICATED_USERS
          Deprecated. use AUTHENTICATED_USERS_UNIQUEID instead
static String AUTHENTICATED_USERS_UNIQUEID
          Constant used to access build-in group Authenticated Users with uniqueId
static String EVERYONE
          Deprecated. use EVERYONE_UNIQUEID instead
static String EVERYONE_UNIQUEID
          Constant used to access build-in group Everyone with uniqueId
static String VERSIONSTRING
           
 
Method Summary
 void addGroupToParent(String uniqueIdOfGroup, String uniqueIdOfParentGroup)
          assign group with uniqueIdOfGroup to parent group with uniqueIdOfParentGroup.
 void addUserToGroup(String uniqueIdOfUser, String uniqueIdOfGroup)
          assign user with uniqueIdOfUser to group with uniqueIdOfGroup.
 void deleteGroup(String uniqueID)
          Delete a group from the data store Note: deletes also all direct group and role assignments of this group.
 String[] getChildGroups(String uniqueIdOfGroup, boolean recursive)
          Returns principals of type group belonging to this groupId This method does a recursive search if the second parameter
 IGroup getGroup(String uniqueID)
          Gets the group object with the given unique ID
 IGroup getGroup(String uniqueID, AttributeList populateAttributes)
          Gets the group object with the given unique ID and populates the attributes which are defined in populateAttributes
 IGroup getGroupByUniqueName(String uniqueName)
          Gets the group object with the given uniqueName Note: If you use this method be prepared to get an exception if multiple objects with the same name are found
 IGroup[] getGroups(String[] uniqueIDs)
          Gets the group objects for multiple unique IDs
 IGroup[] getGroups(String[] uniqueIDs, AttributeList populateAttributes)
          Gets the group objects for multiple unique IDs and populates the attributes which are defined in populateAttributes
 IGroupSearchFilter getGroupSearchFilter()
          Returns an IGroupSearchFilter object to be used to specify query attributes IGroupSearchFilter only contains attributes which will be queried
 IGroup getMutableGroup(String uniqueID)
          Gets the group object identified by uniqueID which can be modified
 String[] getParentGroups(String uniqueIdOfGroup, boolean recursive)
          Gets the list of parent groups of group which is identified by uniqueIdOfGroup
 void invalidateCacheEntry(String uniqueid)
          removes the group object which has the specified uniqueid from the factory's cache Note: Use this method carefully, because calling it too often may cause performance problems
 void invalidateCacheEntryByUniqueName(String uniqueName)
          removes the group object which has the specified unique name from the factory's cache Note: Use this method carefully, because calling it too often may cause performance problems
 IGroup newGroup(String uniqueName)
          Creates a new, initially blank group object.
 void registerListener(GroupListener groupListener, int modifier)
          registerListener allows to subscribe to a predefined eventName GroupListener The caller has to provide a receiver object which implements GroupListener
 void registerListener(GroupListener groupListener, int modifier, boolean notifyAfterPhysicalCommitCompleted)
          registerListener allows to subscribe to a predefined eventName GroupListener The caller has to provide a receiver object which implements GroupListener
 void removeGroupFromParent(String uniqueIdOfGroup, String uniqueIdOfParentGroup)
          unassign group with uniqueIdOfGroup from parent group with uniqueIdOfParentGroup.
 void removeUserFromGroup(String uniqueIdOfUser, String uniqueIdOfGroup)
          unassign user with uniqueIdOfUser from group with uniqueIdOfGroup.
 ISearchResult searchGroups(IGroupSearchFilter filter)
          Search for groups in the group store which match the criteria specified in the given filter.
 void unregisterListener(GroupListener groupListener)
          unregisterListener unsubscribes a receiver from a previously subscribed event.
 
Methods inherited from interface com.sap.security.api.IConfigurable
initialize
 

Field Detail

VERSIONSTRING

static final String VERSIONSTRING
See Also:
Constant Field Values

EVERYONE

static final String EVERYONE
Deprecated. use EVERYONE_UNIQUEID instead
Constant used to access build-in group Everyone

See Also:
Constant Field Values

EVERYONE_UNIQUEID

static final String EVERYONE_UNIQUEID
Constant used to access build-in group Everyone with uniqueId

See Also:
Constant Field Values

AUTHENTICATED_USERS

static final String AUTHENTICATED_USERS
Deprecated. use AUTHENTICATED_USERS_UNIQUEID instead
Constant used to access build-in group Authenticated Users

See Also:
Constant Field Values

AUTHENTICATED_USERS_UNIQUEID

static final String AUTHENTICATED_USERS_UNIQUEID
Constant used to access build-in group Authenticated Users with uniqueId

See Also:
Constant Field Values

ANONYMOUS_USERS

static final String ANONYMOUS_USERS
Deprecated. use ANONYMOUS_USERS_UNIQUEID instead
Constant used to access build-in group Anonymous Users

See Also:
Constant Field Values

ANONYMOUS_USERS_UNIQUEID

static final String ANONYMOUS_USERS_UNIQUEID
Constant used to access build-in group Anonymous Users with uniqueId

See Also:
Constant Field Values
Method Detail

getGroup

IGroup getGroup(String uniqueID)
                throws UMException
Gets the group object with the given unique ID

Parameters:
uniqueID - of group
Returns:
IGroup the group object
Throws:
UMException - if no group with the given unique ID exists

getGroup

IGroup getGroup(String uniqueID,
                AttributeList populateAttributes)
                throws UMException
Gets the group object with the given unique ID and populates the attributes which are defined in populateAttributes

Parameters:
uniqueID - of group
populateAttributes - AttributeList
Returns:
IGroup the group object
Throws:
UMException - if no group with the given unique ID exists

newGroup

IGroup newGroup(String uniqueName)
                throws UMException
Creates a new, initially blank group object. After setting the appropriate data via set-methods, the group object must be commited to the group store via IPrincipalMaint.commit().

Parameters:
uniqueName - of new group Note: This name has to be unique for ALL data stores
Returns:
IGroup the group object
Throws:
GroupAlreadyExistsException - if group with uniqueName already exists
UMException

getGroupByUniqueName

IGroup getGroupByUniqueName(String uniqueName)
                            throws UMException
Gets the group object with the given uniqueName

Note: If you use this method be prepared to get an exception if multiple objects with the same name are found

Parameters:
uniqueName - of group
Returns:
IGroup the group object
Throws:
NoSuchGroupException - if no group with the given uniqueName exists
UMException - if given unique name is not unique

deleteGroup

void deleteGroup(String uniqueID)
                 throws UMException
Delete a group from the data store Note: deletes also all direct group and role assignments of this group.

Parameters:
uniqueID - of group which should be deleted
Throws:
UMException - if the group can't be deleted
NoSuchGroupException - if the group does not exist

searchGroups

ISearchResult searchGroups(IGroupSearchFilter filter)
                           throws UMException
Search for groups in the group store which match the criteria specified in the given filter. In order to get a group search filter use getGroupSearchFilter(). You can define a search filter using methods of class IGroupSearchFilter.

Parameters:
filter - defined to search for groups
Returns:
ISearchResult result of the search operation ISearchResult
Throws:
UMException

getGroups

IGroup[] getGroups(String[] uniqueIDs)
                   throws NoSuchGroupException,
                          UMException
Gets the group objects for multiple unique IDs

Parameters:
uniqueIDs - array of uniqueIDs which are used to get an array of IGroup objects.
Returns:
IGroup[] an array of group objects
Throws:
NoSuchGroupException - if one or more of the given unique IDs are not assigned to any group
UMException

getGroups

IGroup[] getGroups(String[] uniqueIDs,
                   AttributeList populateAttributes)
                   throws NoSuchGroupException,
                          UMException
Gets the group objects for multiple unique IDs and populates the attributes which are defined in populateAttributes

Parameters:
uniqueIDs - array of uniqueIDs which are used to get an array of IGroup objects.
populateAttributes - AttributeList
Returns:
IGroup[] an array of group objects
Throws:
NoSuchGroupException - if one or more of the given unique IDs are not assigned to any group
UMException

getMutableGroup

IGroup getMutableGroup(String uniqueID)
                       throws NoSuchGroupException,
                              UMException
Gets the group object identified by uniqueID which can be modified

Parameters:
uniqueID - of group object
Returns:
a mutable Group object which can be modified.
Throws:
NoSuchGroupException - if the unique ID does not exist
NoSuchGroupException - if group with given uniqueID does not exist.
UMException

registerListener

void registerListener(GroupListener groupListener,
                      int modifier)
registerListener allows to subscribe to a predefined eventName GroupListener The caller has to provide a receiver object which implements GroupListener

Parameters:
groupListener - object which implements interface GroupListener
modifier - constant defined in GroupListener

registerListener

void registerListener(GroupListener groupListener,
                      int modifier,
                      boolean notifyAfterPhysicalCommitCompleted)
registerListener allows to subscribe to a predefined eventName GroupListener The caller has to provide a receiver object which implements GroupListener

Parameters:
groupListener - object which implements interface GroupListener
modifier - constant defined in GroupListener
notifyAfterPhysicalCommitCompleted - Allows callers when set to false, to get a notification before the physical transaction is completed in order to include their actions into the same physical transaction.

unregisterListener

void unregisterListener(GroupListener groupListener)
unregisterListener unsubscribes a receiver from a previously subscribed event.

Parameters:
groupListener - object which implements interface GroupListener

getParentGroups

String[] getParentGroups(String uniqueIdOfGroup,
                         boolean recursive)
                         throws UMException
Gets the list of parent groups of group which is identified by uniqueIdOfGroup

Parameters:
uniqueIdOfGroup - which should be used
recursive - if recursive set to true recursive parent groups are checked including parents, grandparents, ...
Returns:
String[] of uniqueIds of parent group
Throws:
NoSuchGroupException - if group with given uniqueIdOfGroup does not exist.
UMException

getChildGroups

String[] getChildGroups(String uniqueIdOfGroup,
                        boolean recursive)
                        throws UMException
Returns principals of type group belonging to this groupId This method does a recursive search if the second parameter

Parameters:
uniqueIdOfGroup - given uniqueId of group object
recursive - if recursive is set to true all children, grandchildren, ... will be returned. If false only children of uniqueIdOfGroup are returned.
Returns:
String[] of uniqueIds of child groups
Throws:
NoSuchGroupException - if one or more of the given unique IDs
UMException

addGroupToParent

void addGroupToParent(String uniqueIdOfGroup,
                      String uniqueIdOfParentGroup)
                      throws UMException
assign group with uniqueIdOfGroup to parent group with uniqueIdOfParentGroup. Implicitly a commit is done if you call this method.

Parameters:
uniqueIdOfGroup - id of group
uniqueIdOfParentGroup - id of the parent group
Throws:
UMException - if group cannot be added to parent

addUserToGroup

void addUserToGroup(String uniqueIdOfUser,
                    String uniqueIdOfGroup)
                    throws UMException
assign user with uniqueIdOfUser to group with uniqueIdOfGroup. Implicitly a commit is done if you call this method.

Parameters:
uniqueIdOfUser - id of user
uniqueIdOfGroup - id of the group
Throws:
UMException - if user cannot be added to group

removeGroupFromParent

void removeGroupFromParent(String uniqueIdOfGroup,
                           String uniqueIdOfParentGroup)
                           throws UMException
unassign group with uniqueIdOfGroup from parent group with uniqueIdOfParentGroup. Implicitly a commit is done if you call this method.

Parameters:
uniqueIdOfGroup - id of group
uniqueIdOfParentGroup - id of the parent group
Throws:
UMException - if group cannot be removed from parent group

removeUserFromGroup

void removeUserFromGroup(String uniqueIdOfUser,
                         String uniqueIdOfGroup)
                         throws UMException
unassign user with uniqueIdOfUser from group with uniqueIdOfGroup. Implicitly a commit is done if you call this method.

Parameters:
uniqueIdOfUser - id of user
uniqueIdOfGroup - id of the group
Throws:
UMException - if user cannot be removed from group

getGroupSearchFilter

IGroupSearchFilter getGroupSearchFilter()
                                        throws UMException
Returns an IGroupSearchFilter object to be used to specify query attributes

IGroupSearchFilter only contains attributes which will be queried

Returns:
IGroupSearchFilter container for values to be used as a search filter
Throws:
UMException - if filter cannot be provided

invalidateCacheEntryByUniqueName

void invalidateCacheEntryByUniqueName(String uniqueName)
                                      throws UMException
removes the group object which has the specified unique name from the factory's cache Note: Use this method carefully, because calling it too often may cause performance problems

Parameters:
uniqueName - the uniqueName of the group
Throws:
UMException - if a error occurs

invalidateCacheEntry

void invalidateCacheEntry(String uniqueid)
                          throws UMException
removes the group object which has the specified uniqueid from the factory's cache Note: Use this method carefully, because calling it too often may cause performance problems

Parameters:
uniqueid - the uniqueid of the group
Throws:
UMException - if a error occurs
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