public interface IPrincipal extends Serializable
IPrincipal
object.
User Management Engine (UME) provides a unique Identifier
getUniqueID()
for all instances of interface
IPrincipal
and subinterfaces for example IUser
,
IGroup
, IRole
, etc. You can use this identifier to
keep and persist references to principals. As this identifier contains
internal information and is usually not readable, it should not be used in
end user interfaces.
Use method getDisplayName()
in order to display an
attribute with a nice name for user interfaces.
Note: Every method of every object which implements this interface may throw a PrincipalNotAccessibleException if the instantiated object was deleted, or is not accessible because of other reasons. 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 |
BYTE_TYPE
Constant used for attribute byte type.
|
static String |
CREATED_BY
Constant used for attribute created by.
|
static String |
DATASOURCE
Constant used for datasource attribute.
|
static String |
DEFAULT_NAMESPACE
Constant used for default namespace.
|
static String |
DEFAULT_RELATION_NAMESPACE
Constant used for default relation namespace.
|
static String |
DESCRIPTION
Constant used for description attribute.
|
static String |
DISPLAYNAME
Constant used for displayname attribute.
|
static String |
LAST_MODIFIED_BY
Constant used for attribute last modified by.
|
static String |
PRINCIPAL_CREATION_DATE
Constant used for attribute creation date.
|
static String |
PRINCIPAL_MODIFY_DATE
Constant used for attribute modification date.
|
static String |
PRINCIPAL_RELATION_MEMBER_ATTRIBUTE
Constant used for member attribute.
|
static String |
PRINCIPAL_RELATION_PARENT_ATTRIBUTE
Constant used for parent member attribute.
|
static String |
STRING_TYPE
Constant used for attribute string type.
|
static String |
TRANSIENT_NAMESPACE
Constant used for transient data namespace.
|
static String |
UNIQUE_NAME
Constant used for uniquename attribute.
|
Modifier and Type | Method and Description |
---|---|
Date |
created()
Gets the date when the object's data record was created in the data
store.
|
boolean |
equals(Object another)
To compare the two instances of the implementation.
|
String[] |
getAttribute(String namespace,
String name)
Generic get method to access additional attributes.
|
String[] |
getAttributeNames(String namespace)
Gets the names of all attributes contained in the given
namespace , or null if that namespace does not
exist. |
String[] |
getAttributeNamespaces()
Gets all non-null namespaces defined for this user.
|
String |
getAttributeType(String namespace,
String attributeName)
Gets the type of the attribute.
|
byte[] |
getBinaryAttribute(String namespace,
String name)
Generic get method to access additional binary attributes.
|
String |
getDisplayName()
Gets the principal's display name.
|
Iterator |
getMessages(boolean clearPermanentMessages)
Returns an iterator which contains the
IMessage objects assigned to this
IPrincipal or null if no messages are assigned. |
Iterator |
getParents(String[] principalTypeIdentifiers,
boolean recursive)
Gets the list of all parent principals including parents, grandparents,
... which have the specified principal types (e.g.
|
String |
getUniqueID()
Gets the unique identifier which unambiguously identifies the object's
principal type and principal's data record(s) in the data store
(e.g. a relational database).
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isExistenceChecked()
Checks if this user's existence on the persistence storage was checked.
|
boolean |
isMutable()
Check if the object can be modified.
|
Date |
lastModified()
Gets the date when the object's data record was last modified in the data
store.
|
void |
refresh()
Refresh Object.
|
static final String DEFAULT_NAMESPACE
static final String DEFAULT_RELATION_NAMESPACE
static final String TRANSIENT_NAMESPACE
static final String PRINCIPAL_CREATION_DATE
static final String CREATED_BY
static final String PRINCIPAL_MODIFY_DATE
static final String LAST_MODIFIED_BY
static final String PRINCIPAL_RELATION_MEMBER_ATTRIBUTE
static final String PRINCIPAL_RELATION_PARENT_ATTRIBUTE
static final String DISPLAYNAME
static final String DESCRIPTION
static final String UNIQUE_NAME
static final String STRING_TYPE
static final String BYTE_TYPE
static final String DATASOURCE
String getUniqueID()
Note: the unique ID is a case sensitive string
Use this identifier to keep and persist references to principals. As this identifier contains internal information and is usually not readable, it should not be displayed in user interfaces.
UME implementation guarantees to return Strings which are not longer than 255 characters.
null
String identifying this principalDate created()
Date
object or null
if creation date
is not availableDate lastModified()
Date
object or null
if last
modification date is not availableString[] getAttribute(String namespace, String name)
null
. Each attribute can have multiple String values.namespace
- namespace the attribute is in (may be null
)name
- name of the attributenull
if
this namespace or attribute within this namespace does not existbyte[] getBinaryAttribute(String namespace, String name)
null
.namespace
- namespace the attribute is in (may be null
)name
- name of the attributenull
if
this namespace or attribute within this namespace does not existString[] getAttributeNamespaces()
null
exists, it is not
returned as an element in the array. Applications which need to access
the namespace null
must check for its existence and the
contained attributes explicitly via getAttributeNames(null)
.String[] getAttributeNames(String namespace)
namespace
, or null
if that namespace does not
exist. If namespace
exists but contains no attributes, an
empty array will be returned. To retrieve the names of all attributes
that are in no distinct namespace, call this method with the parameter
null
namespace
- namespace or null
namespace
or null
String getDisplayName()
boolean isExistenceChecked()
Note: This method will not check for the existence of the principal.
true
if the existence of this principal is already
checked. false
if the existence of this principal is
not checked yet.void refresh() throws UMException
Reads all attributes of this object again from data store
Note: The cached principal object is updated with this method. Calling this method has impact on performance and on load of the system because the principal object is read again from the data store.
UMException
- if object could not be refreshedboolean isMutable()
boolean equals(Object another)
int hashCode()
String getAttributeType(String namespace, String attributeName)
STRING_TYPE
if the
attribute is of type String, or BYTE_TYPE
if it is a binary
attribute. Returns null
if the attribute is not available.namespace
- attribute namespaceattributeName
- name of the attributeIterator getParents(String[] principalTypeIdentifiers, boolean recursive)
Note: Using this method can cause performance problems if used recursively, because the number of search requests depends on the principal hierarchy. In the worst case there will be principalTypeIdentifiers.length X depth of the hierarchy Level 1 | Level 2 | Level3 Example: USER u1 |-ROLE r1 |-GRUP g1 |-GRUP g4 |-GRUP g5 |-GRUP g6 |-GRUP g2 |-ROLE r2 |-ROLE r3 |-GRUP g3 getParents(new String[] {"USER","GRUP","ROLE"}, true); will lead to: 1 search for all parents of USER u1, 3 searches for parents of GRUP g1-g3, 3 searches for parents of GRUP g4-g6.
principalTypeIdentifiers
- principal types to be returnedrecursive
- true if recursive search should be performedIterator getMessages(boolean clearPermanentMessages)
IMessage
objects assigned to this
IPrincipal
or null
if no messages are assigned. If the method is called
with parameter true
, every subsequent call will return null
if no
new message was assigned to this IPrincipal
.clearPermanentMessages
- Specifies whether permanent messages with life time
IMessage.LIFETIME_PERMANENT
should be removed from the message buffer.IPrincipal
object or null
.Access 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