public interface IPrincipalFactory extends IConfigurable
Note: As this interface can be extended, this interface can be freely used, but must not be implemented.
Modifier and Type | Field and Description |
---|---|
static String |
ICUSTOM_OBJECT
Deprecated.
|
static String |
IGROUP |
static String |
IPRINCIPAL |
static String |
IPRINCIPALSET |
static String |
IROLE |
static String |
IUSER |
static String |
IUSERACCOUNT |
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(InputStream configuration)
Adds a new datasource dynamically to IPrincipalFactory.
|
void |
addPrincipalToParent(String customObjectId,
String parentPrincipalId)
assign customObject with customObjectId to parent-customOjbect with
parentPrincipalId.
|
void |
commitPrincipals(IPrincipalMaint[] objects)
Commit the changes applied to a set of
objects to the object
store in one pass. |
void |
deletePrincipal(String uniqueID)
Delete a object from the use store
|
void |
deletePrincipals(String[] uniqueIDs)
Delete objects from the principal store
|
void |
deregisterPrincipalMetaData(String principalTypeIdentifier)
Deregisters the IPrincipalMetaData object.
|
IPrincipalMetaData[] |
getAvailablePrincipalMetaData()
Get all available IPrincipalMetaData objects.
|
IPrincipalMaint |
getMutablePrincipal(String uniqueId)
Get a object which can be modified.
|
IPrincipal |
getPrincipal(String uniqueId)
Get a principal by using its id.
|
IPrincipal |
getPrincipal(String uniqueId,
AttributeList populateAttributes)
Get a principal by using its uniqueId and the populateAttributes which
should be populated.
|
IPrincipalMetaData |
getPrincipalMetaData(String principalTypeIdentifier)
Get a IPrincipalMetaData object for the given
principal type identifier . |
IPrincipal[] |
getPrincipals(String[] uniqueIDs)
Gets the objects for multiple unique IDs.
|
IPrincipal[] |
getPrincipals(String[] uniqueIDs,
AttributeList populateAttributes)
Gets the objects for multiple unique IDs and populates all attributes in
populateAttributes.
|
IPrincipalSearchFilter |
getPrincipalSearchFilter(boolean orMode,
String principalTypeIdentifier)
Returns an IPrincipalSearchFilter object to be used to specify query
attributes
IPrincipalSearchFilter only contains attributes which will be queried
|
String |
getPrincipalType(String uniqueId)
get the data type out of a principal's uniqueId.
|
String |
getPrincipalTypeIdentifier(String uniqueId)
Get the principal type identifier for this custom object.
|
boolean |
isPrincipalAttributeModifiable(IPrincipal principal,
String namespace,
String attributename)
Checks whether a specific attribute of the given principal is modifiable.
|
boolean |
isPrincipalAttributeModifiable(String uniqueId,
String namespace,
String attributename)
Checks whether a specific attribute of the principal with the given
uniqueId is modifiable.
|
boolean |
isPrincipalDeletable(String uniqueId)
Checks whether the principal with the given uniqueId can be deleted.
|
boolean |
isPrincipalModifiable(String uniqueId)
Checks whether at least one attribute of the principal with the given
uniqueId is modifiable.
|
IPrincipalMaint |
newPrincipal(IPrincipal copyFrom)
Creates a new object.
|
IPrincipalMaint |
newPrincipal(String principalTypeIdentifier)
Creates a new, initially blank object.
|
IPrincipalMetaData |
newPrincipalMetaData(String principalTypeIdentifier,
int principalType)
Returns a new IPrincipalMetaData object, or throws a
ObjectAlreadyExistsException, if there is already a IPrincipalMetaData
object for the given principalTypeIdentifier.
|
IPrincipalMaint[] |
newPrincipals(String principalTypeIdentifier,
int num)
Creates new, initially blank object objects.
|
IPrincipalSet |
newPrincipalSet(IPrincipalSet copyFrom)
Creates a new object.
|
IPrincipalSet |
newPrincipalSet(String principalTypeIdentifier)
Creates a new, initially blank object.
|
void |
registerListener(PrincipalListener objectListener,
int modifier)
This method allows to subscribe to a predefined eventName
PrincipalListener The caller has to provide a receiver object
which implements PrincipalListener |
void |
registerListener(PrincipalListener objectListener,
int modifier,
boolean notifyAfterPhysicalCommitCompleted)
This method allows to subscribe to a predefined eventName
PrincipalListener The caller has to provide a receiver object
which implements PrincipalListener |
void |
registerPrincipalMetaData(IPrincipalMetaData metadata)
Registers the given
IPrincipalMetaData object. |
void |
removePrincipalFromParent(String customObjectId,
String parentPrincipalId)
Unassigns customObject with customObjectId to parent-customOjbect with
parentPrincipalId.
|
void |
rollbackPrincipals(IPrincipalMaint[] objects)
Roll back (i.e. discard) the changes applied to a set of
objects
. |
void |
savePrincipals(IPrincipalMaint[] objects)
Batch save, the data is not made permanent until
commitPrincipals(IPrincipalMaint[]) is called. |
ISearchResult |
searchPrincipals(IPrincipalSearchFilter filter)
Search for objects in the objects store which match the criteria
specified in the
given
filter . |
ISearchResult |
simplePrincipalSearch(String searchCriteria,
String principalType,
int mode,
boolean caseSensitive,
Map searchAttributes)
Search for principals using the default attributes (or combined) which
are defined in the UME configuration.
|
void |
unregisterListener(PrincipalListener objectListener)
This method unsubscribes a receiver from a previously subscribed event.
|
initialize
static final String IUSER
static final String IUSERACCOUNT
static final String IGROUP
static final String IROLE
static final String IPRINCIPAL
static final String IPRINCIPALSET
static final String ICUSTOM_OBJECT
String getPrincipalType(String uniqueId) throws UMException
IUSER
, IUSERACCOUNT
, IGROUP
, IROLE
,
IPRINCIPAL
, IPRINCIPALSET
uniqueId
- The unique id of a principalUMException
- if could not get the principal's data typeIPrincipal getPrincipal(String uniqueId) throws UMException
Note: This operation will search for the principal only on the responsible datasource for this principal.
uniqueId
- The unique id of the principalUMException
- if the principal doesn't existIPrincipal getPrincipal(String uniqueId, AttributeList populateAttributes) throws UMException
Note: This operation will search for the principal only on the responsible datasource for this principal.
uniqueId
- The unique id of the principalpopulateAttributes
- The attributes which should be populatedUMException
- if the principal doesn't existboolean isPrincipalModifiable(String uniqueId) throws UMException
uniqueId
- The unique id of the principalUMException
- if an error occurs during the checkboolean isPrincipalDeletable(String uniqueId) throws UMException
uniqueId
- The unique id of the principalUMException
- if an error occurs during the checkboolean isPrincipalAttributeModifiable(IPrincipal principal, String namespace, String attributename) throws UMException
principal
- The principalnamespace
- The namespace of the attributeattributename
- The name of the attributeUMException
- if an error occurs during the checkboolean isPrincipalAttributeModifiable(String uniqueId, String namespace, String attributename) throws UMException
uniqueId
- The unique id of the principalnamespace
- The namespace of the attributeattributename
- The name of the attributeUMException
- if an error occurs during the checkIPrincipal[] getPrincipals(String[] uniqueIDs) throws NoSuchPrincipalException
Note: This operation will search for the principals only on the responsible datasource for the given principal.
uniqueIDs
- array of uniqueIDs which are used to identify the
principal objectsNoSuchPrincipalException
- if one or more of the given unique
IDs are not assigned to any objectIPrincipal[] getPrincipals(String[] uniqueIDs, AttributeList populateAttributes) throws NoSuchPrincipalException
Note: This operation will search for the principals only on the responsible datasource for the given principal.
uniqueIDs
- array of uniqueIDs which are used to identify the
principal objectspopulateAttributes
- AttributeList
NoSuchPrincipalException
- if one or more of the given unique
IDs are not assigned to any objectIPrincipalMaint newPrincipal(String principalTypeIdentifier)
IPrincipalMaint.commit()
.
Note: Don't forget to add this type to the data source configuration. One data source has to be home for this object type.
principalTypeIdentifier
- 4 letter Identifier for this new principalIPrincipalSet newPrincipalSet(String principalTypeIdentifier)
newPrincipal(String)
After setting
the appropriate data via IPrincipalMaint's set-methods, the object object
must be commited to the object store via IPrincipalMaint.commit()
.
Note: Don't forget to add this type to the data source configuration. One data source has to be home for this object type.
principalTypeIdentifier
- 4 letter Identifier for this new principalIPrincipalSet newPrincipalSet(IPrincipalSet copyFrom)
copyFrom
will be
used as a template, i.e. some (but not necessarily all) attributes will
be copied to the new object. The unique ID for the new object will be
generated by the object factory. After setting the appropriate data via
set-methods, the principal object must be commited to the principal store
via IPrincipalMaint.commit()
.copyFrom
- The object which is used as a blueprintIPrincipalMaint newPrincipal(IPrincipal copyFrom)
copyFrom
will be
used as a template, i.e. some (but not necessarily all) attributes will
be copied to the new object. The unique ID for the new object will be
generated by the object factory. After setting the appropriate data via
set-methods, the principal object must be commited to the principal store
via IPrincipalMaint.commit()
.copyFrom
- The object which is used as a blueprintvoid deletePrincipal(String uniqueID) throws UMException
uniqueID
- The unique id of the principalUMException
- if the object can't be deletedvoid deletePrincipals(String[] uniqueIDs) throws UMException
uniqueIDs
- The unique ids of the principalsUMException
- if the objects can't be deletedvoid commitPrincipals(IPrincipalMaint[] objects) throws UMException
objects
to the object
store in one pass. Depending on the object factory's implementation, this
will result in better performance than calling
IPrincipalMaint.commit()
on each object object individually. Note
that either committing or rolling back changes will be required to unlock
objects if the object factory employs pessimistic locking.objects
- Objects which should be stored to the data storeUMException
- if one or more of the IPrincipalMaint objects cannot
be stored successfully.void rollbackPrincipals(IPrincipalMaint[] objects) throws UMException
objects
. Note that either committing or rolling back changes will be
required to unlock objects if the object factory employs pessimistic
locking.objects
- Objects which should be stored to the data storeUMException
- if one or more of the IPrincipalMaint objects cannot
be discarded successfully.ISearchResult searchPrincipals(IPrincipalSearchFilter filter) throws UMException
given filter
. In order to get a principal search filter use
getPrincipalSearchFilter(boolean,String)
. You can define a
search filter using methods of IPrincipalSearchFilter
.
Note: This operation can be time consuming, depending on the
filter
that is passed to the method.
filter
- filter defined to search for principalsUMException
- if an error occurs.void savePrincipals(IPrincipalMaint[] objects) throws UMException
commitPrincipals(IPrincipalMaint[])
is called.objects
- objects which should be savedUMException
- if an error occurred.IPrincipalMaint[] newPrincipals(String principalTypeIdentifier, int num)
IPrincipalMaint.commit()
. For batch save and commit
savePrincipals(IPrincipalMaint[])
and
commitPrincipals(IPrincipalMaint[])
principalTypeIdentifier
- The principal type identifiernum
- number of new blank objects requestedIPrincipalMaint getMutablePrincipal(String uniqueId) throws UMException
IPrincipalMaint
interface which contains the
corresponding set-methods.
Note: This operation will search for the principal only on the responsible datasource for this principal.
uniqueId
- The unique id of a principalUMException
- if no modifiable object can be provided.String getPrincipalTypeIdentifier(String uniqueId) throws UMException
uniqueId
- the unique id of the objectUMException
- if an error occurred.IPrincipalSearchFilter getPrincipalSearchFilter(boolean orMode, String principalTypeIdentifier) throws UMException
IPrincipalSearchFilter only contains attributes which will be queried
orMode
- used to define the logical operator of the searched
attributes. If orMode is true
the searchfilter
will combine the specified attributes with the logical OR
operator. If orMode is false
the defined search
attributes are combined with the logical AND operator.principalTypeIdentifier
- specifies the type of the principal.
Examples of reserved principal types are "USER", "ROLE" or
"GRUP". For details about the principalTypeIdentifier see
newPrincipal(String)
UMException
- if an error occurred.FeatureNotAvailableException
- if the feature is not availablevoid addPrincipalToParent(String customObjectId, String parentPrincipalId) throws UMException
customObjectId
- uniqueId of PrincipalparentPrincipalId
- uniqueId of the parent PrincipalUMException
- if data cannot be stored successfullyvoid removePrincipalFromParent(String customObjectId, String parentPrincipalId) throws UMException
customObjectId
- uniqueId of PrincipalparentPrincipalId
- uniqueId of the parent PrincipalUMException
- if data cannot be stored successfullyvoid registerListener(PrincipalListener objectListener, int modifier)
PrincipalListener
The caller has to provide a receiver object
which implements PrincipalListenerobjectListener
- object which should be registeredmodifier
- constant defined in PrincipalListener
void registerListener(PrincipalListener objectListener, int modifier, boolean notifyAfterPhysicalCommitCompleted)
PrincipalListener
The caller has to provide a receiver object
which implements PrincipalListenerobjectListener
- object which should be registeredmodifier
- constant defined in PrincipalListener
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.void unregisterListener(PrincipalListener objectListener)
objectListener
- object which should be unregisteredIPrincipalMetaData newPrincipalMetaData(String principalTypeIdentifier, int principalType) throws UMException
principalTypeIdentifier
- The principalTypeIdentifier
which is described by the new
IPrincipalMetaData objectprincipalType
- The semantic principal type, e.g.
IPrincipalMetaData.IPrincipalSet or
IPrincipalMetaData.IPrincipalObjectAlreadyExistsException
- if there is already a object for the
given principal typeUMException
void registerPrincipalMetaData(IPrincipalMetaData metadata) throws UMException
IPrincipalMetaData
object. After the
registration the IPrincipalMetaData
object is visible for
other applications and returned by the method
getAvailablePrincipalMetaData()
. This method modifies a already
existing IPrincipalMetaData
object which has the same.
principal type identifier
as the given one.
The object becomes persistent, and will also be available after the
restart of the system.metadata
- The IPrincipalMetaData object that should be registeredUMException
- if an error occurs.void deregisterPrincipalMetaData(String principalTypeIdentifier) throws UMException
principalTypeIdentifier
- The principal
type identifier
.UMException
- if an error occurs.IPrincipalMetaData[] getAvailablePrincipalMetaData() throws UMException
UMException
- if an error occurs.IPrincipalMetaData getPrincipalMetaData(String principalTypeIdentifier) throws NoSuchObjectException, UMException
principal type identifier
. If no
IPrincipalMetaData object is registered for the given
principal type identifier
, a
NoSuchObjectException is thrown.principalTypeIdentifier
- The principal
type identifier
NoSuchObjectException
- If no IPrincipalMetaData object is
registered for the given principal type identifierUMException
void addDataSource(InputStream configuration) throws UMException
Note: The configuration of the new datasource has to be compatible to the configurations of already loaded datasources. Otherwise malfunctions might occur. The implementing class must be accessible from UME-core.
configuration
- a java.io.InputStream containing the data source
information in xml format which should be used to initialize
the given datasourceUMException
- if an error occurs.ISearchResult simplePrincipalSearch(String searchCriteria, String principalType, int mode, boolean caseSensitive, Map searchAttributes) throws UMException
Note: This method will perform a search on every available data source. That may include: PCD, Portal producers (in FPN scenarios), LDAP Servers, ABAP Servers, UME Database, etc.
Note: this operation can be rather expensive, depending on:
principalType
.
searchCriteria
- The search criteria which may contain wild cards if
ISearchAttribute.LIKE_OPERATOR
is used as mode.principalType
- The type of principal to search. Possible values
are: IUSER
, IUSERACCOUNT
, IGROUP
,
IROLE
mode
- The modes defined in ISearchAttribute
(e.g.
ISearchAttribute.EQUALS_OPERATOR
)caseSensitive
- The case sensitivitysearchAttributes
- A map with additional search attributes like
key:"company", value:"SAP"PrincipalIterator
UMException
- if an error occursAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] CORE-TOOLS
|
[sap.com]
|
default
|
BC-JAS
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/usermanagement/api
|
api
|
BC-JAS-SEC
|
[sap.com] ENGINEAPI
|
[sap.com]
|
-
|
BC-JAS-SEC-UME
|
[sap.com] ENGINEAPI
|
[sap.com]
|
default
|
BC-JAS-SEC-UME
|
Copyright 2018 SAP AG Complete Copyright Notice