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

Version:
$Revision: #2 $

Field Summary
static java.lang.String ANONYMOUS_USERS
          Deprecated. use ANONYMOUS_USERS_UNIQUEID instead
static java.lang.String ANONYMOUS_USERS_UNIQUEID
          Constant used to access build-in group Anonymous Users with uniqueId
static java.lang.String AUTHENTICATED_USERS
          Deprecated. use AUTHENTICATED_USERS_UNIQUEID instead
static java.lang.String AUTHENTICATED_USERS_UNIQUEID
          Constant used to access build-in group Authenticated Users with uniqueId
static java.lang.String EVERYONE
          Deprecated. use EVERYONE_UNIQUEID instead
static java.lang.String EVERYONE_UNIQUEID
          Constant used to access build-in group Everyone with uniqueId
static java.lang.String VERSIONSTRING
           
 
Method Summary
 void addGroupToParent(java.lang.String uniqueIdOfGroup, java.lang.String uniqueIdOfParentGroup)
          assign group with uniqueIdOfGroup to parent group with uniqueIdOfParentGroup.
 void addUserToGroup(java.lang.String uniqueIdOfUser, java.lang.String uniqueIdOfGroup)
          assign user with uniqueIdOfUser to group with uniqueIdOfGroup.
 void deleteGroup(java.lang.String uniqueID)
          Delete a group from the data store Note: deletes also all direct group and role assignments of this group.
 java.lang.String[] getChildGroups(java.lang.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(java.lang.String uniqueID)
          Gets the group object with the given unique ID
 IGroup getGroup(java.lang.String uniqueID, AttributeList populateAttributes)
          Gets the group object with the given unique ID and populates the attributes which are defined in populateAttributes
 IGroup getGroupByUniqueName(java.lang.String uniqueName)
          Gets the group object with the given uniqueName
 IGroup[] getGroups(java.lang.String[] uniqueIDs)
          Gets the group objects for multiple unique IDs
 IGroup[] getGroups(java.lang.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
 IGroup getMutableGroup(java.lang.String uniqueID)
          Gets the group object identified by uniqueID which can be modified
 java.lang.String[] getParentGroups(java.lang.String uniqueIdOfGroup, boolean recursive)
          Gets the list of parent groups of group which is identified by uniqueIdOfGroup
 void invalidateCacheEntry(java.lang.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(java.lang.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(java.lang.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 removeGroupFromParent(java.lang.String uniqueIdOfGroup, java.lang.String uniqueIdOfParentGroup)
          unassign group with uniqueIdOfGroup from parent group with uniqueIdOfParentGroup.
 void removeUserFromGroup(java.lang.String uniqueIdOfUser, java.lang.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

public static final java.lang.String VERSIONSTRING

EVERYONE

public static final java.lang.String EVERYONE
Deprecated. use EVERYONE_UNIQUEID instead

Constant used to access build-in group Everyone

EVERYONE_UNIQUEID

public static final java.lang.String EVERYONE_UNIQUEID
Constant used to access build-in group Everyone with uniqueId

AUTHENTICATED_USERS

public static final java.lang.String AUTHENTICATED_USERS
Deprecated. use AUTHENTICATED_USERS_UNIQUEID instead

Constant used to access build-in group Authenticated Users

AUTHENTICATED_USERS_UNIQUEID

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

ANONYMOUS_USERS

public static final java.lang.String ANONYMOUS_USERS
Deprecated. use ANONYMOUS_USERS_UNIQUEID instead

Constant used to access build-in group Anonymous Users

ANONYMOUS_USERS_UNIQUEID

public static final java.lang.String ANONYMOUS_USERS_UNIQUEID
Constant used to access build-in group Anonymous Users with uniqueId
Method Detail

getGroup

public IGroup getGroup(java.lang.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

public IGroup getGroup(java.lang.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

public IGroup newGroup(java.lang.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

getGroupByUniqueName

public IGroup getGroupByUniqueName(java.lang.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

public void deleteGroup(java.lang.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

public 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:
IGroupSearchFilter - filter defined to search for groups
Returns:
ISearchResult result of the search operation ISearchResult

getGroups

public IGroup[] getGroups(java.lang.String[] uniqueIDs)
                   throws NoSuchGroupException,
                          UMException
Gets the group objects for multiple unique IDs
Parameters:
String[] - 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

getGroups

public IGroup[] getGroups(java.lang.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:
String[] - 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

getMutableGroup

public IGroup getMutableGroup(java.lang.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.

registerListener

public 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

unregisterListener

public void unregisterListener(GroupListener groupListener)
unregisterListener unsubscribes a receiver from a previously subscribed event.
Parameters:
GroupListener - object which implements interface GroupListener

getParentGroups

public java.lang.String[] getParentGroups(java.lang.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.

getChildGroups

public java.lang.String[] getChildGroups(java.lang.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

addGroupToParent

public void addGroupToParent(java.lang.String uniqueIdOfGroup,
                             java.lang.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

public void addUserToGroup(java.lang.String uniqueIdOfUser,
                           java.lang.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

public void removeGroupFromParent(java.lang.String uniqueIdOfGroup,
                                  java.lang.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

public void removeUserFromGroup(java.lang.String uniqueIdOfUser,
                                java.lang.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

public 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

public void invalidateCacheEntryByUniqueName(java.lang.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

public void invalidateCacheEntry(java.lang.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


Copyright © 2002 SAP AG All Rights Reserved.