com.sap.security.api.umap
Interface IUserMapping


public interface IUserMapping

Provides an entry point to the user mapping functionality. In order to get mapping information for a specific user call getUserMappingData(String,IPrincipal,Map). In order to get R/3 user ids corresponding to an IUser object call getR3UserName(IUser,String,Map,boolean). In order to make a reverse lookup after a mapped user id, call getInverseMappingData(String,String,byte).


Field Summary
static java.lang.String UMAP_ENCRYPTION_ALGO_ALIAS
          for internal use
static java.lang.String UMAP_ENCRYPTION_KEYTYPE_ALIAS
          for internal use
static java.lang.String UMAP_EP6_ALIAS_PREFIX
          prefix for system ids in usermapping
static java.lang.String UMAP_R3_MASTER
          for internal use
static java.lang.String UMAP_R3_MASTER_UID_MODE
          for internal use
static java.lang.String[] UMAP_SYSTEM_FIELDS
          Deprecated.  
static java.lang.String UMAP_SYSTEM_TYPE
          SystemType key for system attributes
static byte UMAP_SYSTEM_TYPE_EP6_ALIAS
          flag to identify a system as an Enterprise Portal 6.0 system landscape alias
static java.lang.String UMAP_SYSTEMATTRS_LOGONMETHOD
          logon method key for system attributes
static java.lang.String UMAP_SYSTEMATTRS_R3NAMEREF
          Deprecated. r3referencesystem key for system attributes
static java.lang.String UMAP_USERMAPPING_FIELDS
          usermappingfields key for system attributes
static java.lang.String UMAP_USERMAPPING_TYPE
          usermappingfield key for system attributes
 
Method Summary
 java.util.Map getInverseMappingData(java.lang.String[] mappedUsers, ISystemLandscapeObject system)
          Call for user mapping data optimized for mass calls.
 java.lang.String getInverseMappingData(java.lang.String mappedUser, ISystemLandscapeObject system)
          Searches for IUser objects which have maintained a user mapping for the specified system with the given user id.
 java.lang.String getInverseMappingData(java.lang.String sysid, java.lang.String userid, byte system_type)
          This function creates a ISystemLandscapeObject from sysid and calls (String,ISystemLandscapeObject).
 java.lang.String getR3UserName(IUser user, ISystemLandscapeObject system, boolean bGenerateId)
          Tells the caller the R/3 user id of the provided IUser object.
 java.lang.String getR3UserName(IUser pri, java.lang.String sysid, java.util.Map sysAttrBag, boolean bGenerateId)
          This function creates a ISystemLandscapeObject from sysid and calls (IUser,ISystemLandscapeObject,boolean).
 IUserMappingData getUserMappingData(ISystemLandscapeObject system, IPrincipal pri)
          Gets an IUserMappingData object to perform user mapping activities.
 IUserMappingData getUserMappingData(java.lang.String sysid, IPrincipal pri, java.util.Map sysAttrBag)
          do not use this function anymore.
 

Field Detail

UMAP_SYSTEMATTRS_LOGONMETHOD

public static final java.lang.String UMAP_SYSTEMATTRS_LOGONMETHOD
logon method key for system attributes

UMAP_SYSTEMATTRS_R3NAMEREF

public static final java.lang.String UMAP_SYSTEMATTRS_R3NAMEREF
Deprecated. r3referencesystem key for system attributes


UMAP_USERMAPPING_FIELDS

public static final java.lang.String UMAP_USERMAPPING_FIELDS
usermappingfields key for system attributes

UMAP_USERMAPPING_TYPE

public static final java.lang.String UMAP_USERMAPPING_TYPE
usermappingfield key for system attributes

UMAP_SYSTEM_TYPE

public static final java.lang.String UMAP_SYSTEM_TYPE
SystemType key for system attributes

UMAP_EP6_ALIAS_PREFIX

public static final java.lang.String UMAP_EP6_ALIAS_PREFIX
prefix for system ids in usermapping

UMAP_SYSTEM_TYPE_EP6_ALIAS

public static final byte UMAP_SYSTEM_TYPE_EP6_ALIAS
flag to identify a system as an Enterprise Portal 6.0 system landscape alias

UMAP_SYSTEM_FIELDS

public static final java.lang.String[] UMAP_SYSTEM_FIELDS
Deprecated.  


UMAP_ENCRYPTION_KEYTYPE_ALIAS

public static final java.lang.String UMAP_ENCRYPTION_KEYTYPE_ALIAS
for internal use

UMAP_ENCRYPTION_ALGO_ALIAS

public static final java.lang.String UMAP_ENCRYPTION_ALGO_ALIAS
for internal use

UMAP_R3_MASTER

public static final java.lang.String UMAP_R3_MASTER
for internal use

UMAP_R3_MASTER_UID_MODE

public static final java.lang.String UMAP_R3_MASTER_UID_MODE
for internal use
Method Detail

getUserMappingData

public IUserMappingData getUserMappingData(ISystemLandscapeObject system,
                                           IPrincipal pri)
Gets an IUserMappingData object to perform user mapping activities.
Parameters:
system - a system object. Can be null, if only ticket-related enrich calls (e.g. IUserMappingEnrich#enrich(HttpURLConnection), IUserMappingEnrich#enrich(Properties)) are to be performed.
pri - Principal the user mapping is to be carried out for. Commonly, this is a IUser object.
Returns:
an IUserMappingData object.

getUserMappingData

public IUserMappingData getUserMappingData(java.lang.String sysid,
                                           IPrincipal pri,
                                           java.util.Map sysAttrBag)
do not use this function anymore. Use getUserMappingData(ISystemLandscapeObject,IPrincipal) instead.

getR3UserName

public java.lang.String getR3UserName(IUser pri,
                                      java.lang.String sysid,
                                      java.util.Map sysAttrBag,
                                      boolean bGenerateId)
                               throws UMException
This function creates a ISystemLandscapeObject from sysid and calls (IUser,ISystemLandscapeObject,boolean). Please see there for a complete documentation.
Parameters:
pri - IUser the SAP user name is searched for
sysid - system identifier. The function ISystemLandscapeObject#getSystemByAlias(String) will be called in order to get a ISystemLandscapeObject object to pass to (IUser,ISystemLandscapeObject,boolean).
sysAttrBag - will be ignored
bGenerateId - see (IUser,ISystemLandscapeObject,boolean).
Throws:
UMException - if the underlying user management operations fail with an Exception.

getInverseMappingData

public java.lang.String getInverseMappingData(java.lang.String sysid,
                                              java.lang.String userid,
                                              byte system_type)
                                       throws NoLogonDataAvailableException,
                                              UMException
This function creates a ISystemLandscapeObject from sysid and calls (String,ISystemLandscapeObject).
Parameters:
sysid - system identifier. The function ISystemLandscapeObject#getSystemByAlias(String) will be called in order to get a ISystemLandscapeObject object to pass to (IUser,ISystemLandscapeObject,boolean).
userid - user id in the remote system
you - must pass UMAP_SYSTEM_TYPE_EP6_ALIAS here.
Throws:
UMException - if the underlying user management operations fail with an Exception.
NoLogonDataAvailableException - if on of the underlying user mapping operations fail.
MultipleHitException - thrown if more than one user object was found with a mapped user = userid for system sysid. In order to get the string array of users found call MultipleHitException.getUserNames().

getR3UserName

public java.lang.String getR3UserName(IUser user,
                                      ISystemLandscapeObject system,
                                      boolean bGenerateId)
                               throws UMException
Tells the caller the R/3 user id of the provided IUser object.
The return value is as follows:
case 1: logonmethod (sysid) == SAPLOGONTICKET:
     Meaning
Value of ume.r3.mastersystem.uid.mode
0 the function returns a user id if one is maintained, otherwise null
1 the function returns a user id if one is maintained, otherwise the logon id.
2 the function returns a user id if one is maintained, otherwise one is generated and stored in the user mapping (unless bGenerateId is false)
case 2: logonmethod (sysid) == UIDPW:
    user id of sysid or null.
In case of logon method X509CERT null is returned since in this case the logon id is maintained internally within R/3 and not known to UME.
Parameters:
user - user id of the user the mapped id is queried for
system - system that the mapped id is queried for. You can
bGenerateId - controls the generation of R/3 userids (please see explanation above).
Returns:
user id of the R/3 system

getInverseMappingData

public java.lang.String getInverseMappingData(java.lang.String mappedUser,
                                              ISystemLandscapeObject system)
                                       throws NoLogonDataAvailableException,
                                              UMException
Searches for IUser objects which have maintained a user mapping for the specified system with the given user id. This function performs a lookup in the custom attribute table for user objects which have a mapping maintained for the given system with the given mapped user id. Even if no mapping is maintained, a non-null value is returned if the following three conditions apply: In this case the unique id of the UME user with logon uid mappedUser is returned. In other words: Like getR3UserName(IUser,ISystemLandscapeObject,boolean) the identity mapping should always work (in this case in the opposite direction) without addition user interaction. If this behaviour is not convenient, it can be switched off with the parameter ume.r3.mastersystem.uid.mode=0.

Parameters:
mappedUser - the mapped user id the user searched for has maintained.
system - system object that identifies the system in question. If null the system identified by the parameter ume.r3.mastersystem is used. If no system landscape is installed (e.g. if UME running in a non-portal environment) then the call behaves as if no user mapping was available for a system with logon method SAPLOGONMETHOD.
Returns:
returns the unique id of a user that has maintained a specified mapping. To get the corresponding IUser object call IUserFactory.getUser(String)
Throws:
NoLogonDataAvailableException - thrown if the search over all user objects returned no result
MultipleHitException - thrown if more than one user object was found with a mapped user = userid for system sysid. In order to get the string array of users found call MultipleHitException.getUserNames().

getInverseMappingData

public java.util.Map getInverseMappingData(java.lang.String[] mappedUsers,
                                           ISystemLandscapeObject system)
                                    throws NoLogonDataAvailableException,
                                           UMException
Call for user mapping data optimized for mass calls. The logic is identical to the one of getInverseMappingData(String,ISystemLandscapeObject) except that the search is performed for a set of users simultaneously.
Parameters:
mappedUsers - array of mapped users
system - system the reverse mapping is to be searched for
Returns:
result map. In order to get a UME user that is mapped to mappedUsers[idx], for instance, call map.get (mappedUsers[idx]). If the result is non-null it can be casted to IUser.


Copyright © 2002 SAP AG All Rights Reserved.