com.waveset.adapter
Class SAPResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.SAPResourceAdapter
All Implemented Interfaces:
ResourceAdapter
Direct Known Subclasses:
SAPHRActiveSyncAdapter

public class SAPResourceAdapter
extends ResourceAdapterBase

Provides an interface to SAP systems via SAP's Java Connector (JCO). Performs RFC calls called BAPIs to do the work of the adapter.


Nested Class Summary
protected  class SAPResourceAdapter.AcctIter
           
protected  class SAPResourceAdapter.Function
           
static interface SAPResourceAdapter.ObjectType
           
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase
ResourceAdapterBase.SimpleAccountIterator
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features
 
Field Summary
protected  java.util.Set _filteredAccounts
          Accounts listed here cannot be edited, listed, created, etc.
protected  java.lang.String _poolKey
           
protected  com.sap.mw.jco.JCO.Client _serverConnection
          Our connection to SAP Managed by connect() and disconnect() only.
protected  int _traceLevel
           
static java.lang.String AA_ACTIVITY_GROUP_OBJECTS_MAPNAME
           
static java.lang.String AA_ACTIVITY_GROUPS
           
static java.lang.String AA_ACTIVITY_GROUPS_MAPNAME
           
static java.lang.String AA_ACTIVITY_GROUPS_SHADOW
           
static java.lang.String AA_BAPI_CUA_SYSTEMS
          bapi based cua systems list
static java.lang.String AA_BAPI_CUA_SYSTEMS_MAPNAME
           
static java.lang.String AA_BAPI_CUA_SYSTEMS_SHADOW
           
static java.lang.String AA_DIRECT_ACTIVITY_GROUPS_SHADOW
           
static java.lang.String AA_DIRECT_LOCAL_ACTIVITYGROUPS
           
static java.lang.String AA_DIRECT_LOCAL_PROFILES
           
static java.lang.String AA_DIRECT_PROFILES_SHADOW
           
static java.lang.String AA_LOCAL_ACTIVITYGROUPS
           
static java.lang.String AA_LOCAL_PROFILES
          attributes for local profiles and activity groups
static java.lang.String AA_LOGONDATA_LTIME
           
static java.lang.String AA_PROFILES
          global profiles and activity groups
static java.lang.String AA_PROFILES_MAPNAME
           
static java.lang.String AA_PROFILES_SHADOW
           
static java.lang.String ACTIVITY_GROUP_FROM_DATE
           
static java.lang.String ACTIVITY_GROUP_NAME
           
static java.lang.String ACTIVITY_GROUP_TO_DATE
           
static java.lang.String code_id
           
static java.lang.String DISPLAY_PASSWORD
           
static java.lang.String DISPLAY_USER
           
protected  boolean jcoTrace
           
static java.lang.String LOGIN_PASSWORD
           
static java.lang.String LOGIN_USER
          Pass thru authentication variables.
static java.lang.String RA_BAPI_RETRY_COUNT
           
static java.lang.String RA_CONNECT_RETRY_COUNT
           
static java.lang.String RA_CONNECT_RETRY_WAIT_TIME
           
static java.lang.String RA_FILTERED_ACCOUNTS
           
static java.lang.String RA_GATEWAY
           
static java.lang.String RA_GATEWAY_SERVICE
           
static java.lang.String RA_HOST
          Resource attributes are the common names that will be visible in the GUI that will prompt the user for values.
static java.lang.String RA_JCO_TRACE_LEVEL
           
static java.lang.String RA_JCO_TRACE_PATH
           
static java.lang.String RA_LANGUAGE
           
static java.lang.String RA_NUMBER_OF_CONNECTIONS
           
static java.lang.String RA_PASSWORD
           
static java.lang.String RA_RETURN_SAP_TEMP_PWD
           
static java.lang.String RA_SAP_CLIENT
           
static java.lang.String RA_SYSTEM_NUMBER
           
static java.lang.String RA_UPPER_CASE_PASSWORDS
           
static java.lang.String RA_USE_CUA
           
static java.lang.String RA_USE_SAP_TEMP_PWD
           
static java.lang.String RA_USER
          The account name, password, and Language used to connect to the resource.
static java.lang.String RA_USER_PWD_ON_CHG
           
static java.lang.String RESOURCE_LOGIN_MODULE
           
static java.lang.String RESOURCE_NAME
           
static java.lang.String RESOURCE_USER_FORM
           
protected static java.util.Collection SAP_TIMEZONES
           
protected  com.sap.mw.jco.IRepository sapRepository
           
static java.lang.String TEMP_PASSWORD_RESULT
           
static java.lang.String WS_PASSWORD_EXPIRED
           
static java.lang.String WS_RESET_FAILED_LOGIN_COUNT
           
 
Fields inherited from class com.waveset.adapter.ResourceAdapterBase
_cache, _context, _excludedAccountsRule, _excludedAccountsRuleInited, _listAllObjectsAttrParse, _listAllObjectsAttrParseName, _listUserAttrParse, _listUserAttrParseName, _listUserGroupsAttrParse, _listUserGroupsAttrParseName, _resource, _thread, _trace, displayInfoCode, RA_BLOCKCOUNT, RA_LOGIN_ACTION, RA_LOGOFF_ACTION, RA_MULTI_VALUED_ATTRS, RA_TEST_MODE
 
Fields inherited from interface com.waveset.adapter.ResourceAdapter
CHANGE_PASSWORD_LOCATION, DISABLE, ENABLE, EXPIRE_PASSWORD, GUID, IGNORE_ATTR, NEW_ACCOUNT_ID, OP_DAYS_INACTIVE, OP_DISABLED, OP_DORMANT, OP_EXPIRED, OP_EXPIREDPWD, OP_INACTIVE, OP_LOCKED, OP_NO_PASSWORD_SET, OP_NOOWNERSHIP, OP_NOPASSWORDREQ, OP_NUMINACTIVEDAYS, OP_NUMPWDAYS, OP_PWNUMDAYS, RA_BASE_CTX, RA_DISPLAY_NAME_ATTR, RA_NEW_OBJECT_ID, RA_NEW_OBJECT_NAME, RA_OBJECT_ATTRIBUTES, RA_OBJECT_CLASS, RA_OBJECT_ID, RA_OBJECT_TYPE, RA_OP_TYPE, RA_RENAME_OP, RA_REQUESTOR, RA_SAVEAS_OP, RA_SEARCH_ATTRIBUTE_NAMES, RA_SEARCH_ATTRS_TO_GET, RA_SEARCH_CONTEXT, RA_SEARCH_FILTER, RA_SEARCH_RUN_AS_PASSWORD, RA_SEARCH_RUN_AS_USER, RA_SEARCH_SCOPE, RA_SEARCH_SCOPE_OBJECT, RA_SEARCH_SCOPE_ONE_LEVEL, RA_SEARCH_SCOPE_SUBTREE, RA_SEARCH_TIME_LIMIT, RESET_PASSWORD, SYSTEM_ATTRIBUTES, UNLOCK, WS_USER_PASSWORD
 
Constructor Summary
SAPResourceAdapter()
           
SAPResourceAdapter(Resource res, ObjectCache cache)
           
 
Method Summary
protected  void addAttrIfMapped(WSUser user, java.lang.String attrName, java.lang.Object value)
          Add the named attribute and value to the user.
protected  void addAttrIfMapped(WSUser user, java.lang.String attrName, java.lang.Object[] values)
           
 WavesetResult authenticate(java.util.HashMap loginInfo)
          Authenticates the user against the resource.
protected  java.lang.String booleanToString(boolean b)
          Deprecated. for release 7.0
protected  void callBAPIFunction(com.sap.mw.jco.JCO.Client serverConnection, com.sap.mw.jco.JCO.Function function)
          Deprecated. for release 7.0. use #callBAPIFunction(Function).
protected  void callBAPIFunction(SAPResourceAdapter.Function function)
          Makes the actual call to the SAP server.
protected  void changeUserPassword(WSUser user, WavesetResult result)
          Sets the user's password with a different BAPI call so that the password history and other password data (like "Password Last Changed Date") is set correctly.
 WavesetResult checkCreateAccount(WSUser user)
           
 WavesetResult checkDeleteAccount(WSUser user)
           
protected  boolean checkIfUserExists(WSUser user)
          Check the SAP resource to see if the specified user exists.
 WavesetResult checkUpdateAccount(WSUser user)
           
protected  void connect()
          Connect to the SAP system via the SAP JCO library.
protected  void connect(boolean retry)
          Connect to the SAP system via the SAP JCO library
protected  java.util.List convertAttrToList(WSAttribute attr)
           
protected  com.sap.mw.jco.JCO.Function createFunction(java.lang.String functionName)
          Deprecated. for release 7.0
protected  com.sap.mw.jco.JCO.Function createFunction(java.lang.String functionName, boolean retryConnectionOnFail)
          Deprecated. for release 7.0 use Function(String,boolean).
 Resource createPrototypeResource()
           
protected  java.lang.String dateToString(java.util.Date d)
          Deprecated. for release 7.0 use Util.dateToString(Date,String).
protected  void disconnect()
           
protected  int errorCheck(com.sap.mw.jco.JCO.Function function, int noErrorNum, WavesetResult result)
          Deprecated. for release 7.0
protected  void extractData(WSUser _newUser, com.sap.mw.jco.JCO.Function _function, java.lang.String structOrTable, java.lang.String attributeName, java.lang.String name)
          Deprecated. for release 7.0
protected  void extractData(WSUser _newUser, SAPResourceAdapter.Function function, java.lang.String structOrTable, java.lang.String attributeName, java.lang.String name)
           
 AccountIterator getAccountIterator()
           
protected  void getActivityGroups(WSUser user, com.sap.mw.jco.JCO.Function _function, WavesetResult result)
          Deprecated. for release 7.0.use #getActivityGroups(WSUser, Function, WavesetResult).
protected  void getActivityGroups(WSUser user, SAPResourceAdapter.Function function, WavesetResult result)
          Get the activity groups assigned to this user.
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
protected  java.util.List getHelpValues(java.lang.String objName, java.lang.String method, java.lang.String parameter, java.lang.String field, WavesetResult result, boolean throwException)
           
 java.lang.String getIdentity(WSUser user)
          Return the account id for the user, fetched from the resource info.
protected  int getIntRequiredResAttrVal(java.lang.String name)
           
protected  void getLocalActivityGroupsAndCUASystems(WSUser user, WavesetResult result)
          Get the local activity groups assigned to this user.
protected  void getLocalProfiles(WSUser user, WavesetResult result)
          Get the local profiles assigned to this user.
 WSUser getUser(WSUser user)
          Retrieves account information from the resource for the specified WSUser and returns a new WSUser based on the information from the resource.
protected  java.lang.String getUserPassword(WSUser user)
           
protected  java.lang.String getWsAttrsString()
          Deprecated. for release 7.0 - obsolete
protected  void init_internal()
           
protected  void jcoErrorStructureCheck(com.sap.mw.jco.JCO.Function function, WavesetResult result)
           
protected  void jcoErrorStructureCheck(SAPResourceAdapter.Function function, WavesetResult result)
           
protected  void jcoErrorTableCheck(com.sap.mw.jco.JCO.ParameterList returnTableList, WavesetResult result)
           
protected  void jcoErrorTableCheck(SAPResourceAdapter.Function function, WavesetResult result)
           
 java.util.ArrayList listAllObjects(java.lang.String resourceObjectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword)
          This method will return a list of object names of the specified object type.
protected  void maintainLocalActivityGroups(WSUser user, java.util.List groups, WavesetResult result)
          Set the local activity groups using BAPI_USER_LOCACTGROUPS_ASSIGN.
protected  void maintainLocalProfiles(WSUser user, java.util.List groups, WavesetResult result)
          Set the local activity groups using BAPI_USER_LOCPROFILES_ASSIGN.
protected  void maintainSapActivityGroups(WSUser user, WavesetResult result)
          Set the activity groups on the SAP user.
protected  void maintainSapProfiles(WSUser user, WavesetResult result)
           
protected  void realCreate(WSUser user, WavesetResult result)
          Needs to be overridden by subclass if default createAccounts() implementation is used.
protected  void realDelete(WSUser user, WavesetResult result)
          Needs to be overridden by subclass if default deleteAccounts() implementation is used.
 void realDisable(WSUser user, WavesetResult result)
           
 void realEnable(WSUser user, WavesetResult result)
           
protected  WSUser realGetUser(WSUser user)
           
protected  void realUpdate(WSUser user, WavesetResult result)
          Needs to be overridden by subclass if default updateAccounts() implementation is used.
protected  void resetFailedLoginCount(WSUser user, WavesetResult result)
          Unlocks an SAP user's account if the account was locked because the number of failed login attempts was exceeded.
protected  WSAttribute reverseMapAttr(java.lang.String attr, java.lang.Object value)
          Map from a resource attribute to a waveset attribute.
protected  WSAttribute reverseMapAttr(java.lang.String attr, java.lang.Object[] values)
          Map from a resource attribute to a waveset attribute.
protected  void reverseMapMultiAttr(java.lang.String attr, java.lang.Object value, WSUser user)
          Map from a resource attribute to multiple waveset attributes and add them to the user.
protected  void sapSetValues(com.sap.mw.jco.JCO.Function _function, java.lang.String structOrTable, java.lang.String attributeName, java.lang.String value, boolean update)
          Deprecated. for release 7.0
 void setResource(Resource res)
           
protected  void setupJCOTrace()
          Sets the jcoTrace variable and initializes JCO variables to the appropriate trace level.
protected  void setUserField(com.sap.mw.jco.JCO.Function function, java.lang.String identity)
          Deprecated. for release 7.0
protected  void startConnection()
          Creates a connection to the SAP server.
protected  void startConnectionWrapper()
          Needed so that test connection will not perform connection retries
static Resource staticCreatePrototypeResource()
           
protected  void stopConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
protected  boolean stringToBoolean(java.lang.String s)
          Deprecated. for release 7.0
protected  java.util.Date stringToDate(java.lang.String s)
          Deprecated. for release 7.0 use Util.stringToDate(String).
 boolean supportsAccountDisable()
          Indicates whether or not this resource supports account disable.
protected  void unexpirePassword(java.lang.String identity, java.lang.String currentPassword, java.lang.String newPassword, WavesetResult result)
          SAP passwords are expired in the default case.
protected  void unexpirePassword(java.lang.String identity, WavesetResult result)
          Deprecated. for release 7.0. use unexpirePassword(String,String,String,WavesetResult).
protected  void unexpirePassword(WSUser user, WavesetResult result)
          Deprecated. fro release 7.0. use unexpirePassword(String,String,String,WavesetResult).
 
Methods inherited from class com.waveset.adapter.ResourceAdapterBase
checkForNoPasswordInSchema, checkSyntax, createAccount, createAccounts, createIdentity, createObject, deleteAccount, deleteAccount, deleteAccounts, deleteObject, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountAttributes, getAccountIterator, getAccountIterator, getAction, getActionNotFoundErrorMessage, getActionNotFoundMessage, getActionRunAsPassword, getActionRunAsUser, getActionTimeout, getActionType, getAdapter, getAdapter, getAdapter, getAdapterProxy, getAdapterProxy, getAllAccounts, getAttrNameFromMapName, getAttrNameFromMapName, getAttrParse, getAttrTypeFromMapName, getAttrTypeFromMapName, getAUserName, getBaseContextAttrName, getBaseContextObject, getBaseContexts, getBlockSize, getContext, getExcludedAccountsRule, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, getObject, getOptionalBooleanResAttrVal, getOptionalBooleanResAttrVal, getOptionalEncryptedResAttrVal, getOptionalResAttrVal, getOptionalStringResAttrVal, getRequiredResAttr, getRequiredResAttr, getRequiredResAttrVal, getRequiredResAttrVal, getRequiredResAttrVals, getRequiredUserAttributeNames, getResAttrValActionOnUser, getResAttrVals, getResource, getResourceAccounts, getResourceInfo, getResourceObjectAttrValNameAttr, getResourceObjectClassAttr, getResourceObjectTypePrefix, getSchemaMap, getUser, getWSAttrByMapName, getWSAttrByMapName, getWSAttrFromMap, handleActionResult, handleJavascriptActionResult, isAccountAttributeSecret, isExcludedAccount, isExcludedAccount, isFeatureEnabled, isSupported, isTestMode, listAllObjects, listObjects, listObjects, listObjectsOfType, lookupAction, lookupAction, lookupActions, namesEqual, objectClassesMatchType, println, restoreResourceObjectClassAttr, run, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResourceObjectClassAttr, setResourceOptionAttrs, supportsAccountActions, supportsActions, supportsCaseInsensitiveAccountIds, supportsContainerObjectTypes, supportsExcludedAccounts, supportsResourceAccount, supportsScanning, testConfiguration, updateAccount, updateAccounts, updateObject, updateResourceAccount, updateResourceIdentity, vmStoreBoot, vmStoreGet, vmStoreInit, vmStoreLatch, vmStorePut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

RA_HOST

public static final java.lang.String RA_HOST
Resource attributes are the common names that will be visible in the GUI that will prompt the user for values. For example, the GUI will show "host" and have a box next to it for the user to enter a host name. The name of the host used to communicate with the resource.

See Also:
Constant Field Values

RA_SYSTEM_NUMBER

public static final java.lang.String RA_SYSTEM_NUMBER
See Also:
Constant Field Values

RA_USER

public static final java.lang.String RA_USER
The account name, password, and Language used to connect to the resource.

See Also:
Constant Field Values

RA_PASSWORD

public static final java.lang.String RA_PASSWORD
See Also:
Constant Field Values

RA_LANGUAGE

public static final java.lang.String RA_LANGUAGE
See Also:
Constant Field Values

RA_NUMBER_OF_CONNECTIONS

public static final java.lang.String RA_NUMBER_OF_CONNECTIONS
See Also:
Constant Field Values

RA_SAP_CLIENT

public static final java.lang.String RA_SAP_CLIENT
See Also:
Constant Field Values

RA_GATEWAY

public static final java.lang.String RA_GATEWAY
See Also:
Constant Field Values

RA_GATEWAY_SERVICE

public static final java.lang.String RA_GATEWAY_SERVICE
See Also:
Constant Field Values

RA_USE_CUA

public static final java.lang.String RA_USE_CUA
See Also:
Constant Field Values

RA_FILTERED_ACCOUNTS

public static final java.lang.String RA_FILTERED_ACCOUNTS
See Also:
Constant Field Values

RA_UPPER_CASE_PASSWORDS

public static final java.lang.String RA_UPPER_CASE_PASSWORDS
See Also:
Constant Field Values

RA_USER_PWD_ON_CHG

public static final java.lang.String RA_USER_PWD_ON_CHG
See Also:
Constant Field Values

RA_USE_SAP_TEMP_PWD

public static final java.lang.String RA_USE_SAP_TEMP_PWD
See Also:
Constant Field Values

RA_RETURN_SAP_TEMP_PWD

public static final java.lang.String RA_RETURN_SAP_TEMP_PWD
See Also:
Constant Field Values

RA_JCO_TRACE_LEVEL

public static final java.lang.String RA_JCO_TRACE_LEVEL
See Also:
Constant Field Values

RA_JCO_TRACE_PATH

public static final java.lang.String RA_JCO_TRACE_PATH
See Also:
Constant Field Values

RA_BAPI_RETRY_COUNT

public static final java.lang.String RA_BAPI_RETRY_COUNT
See Also:
Constant Field Values

RA_CONNECT_RETRY_COUNT

public static final java.lang.String RA_CONNECT_RETRY_COUNT
See Also:
Constant Field Values

RA_CONNECT_RETRY_WAIT_TIME

public static final java.lang.String RA_CONNECT_RETRY_WAIT_TIME
See Also:
Constant Field Values

LOGIN_USER

public static final java.lang.String LOGIN_USER
Pass thru authentication variables. Pass thru authentication is a process where a user or administrator can provide an account name and password which will be sent to the resource to be validated. The variables below are used to define the names of the various pieces of the Lighthouse implementation.

See Also:
Constant Field Values

LOGIN_PASSWORD

public static final java.lang.String LOGIN_PASSWORD
See Also:
Constant Field Values

DISPLAY_USER

public static final java.lang.String DISPLAY_USER
See Also:
Constant Field Values

DISPLAY_PASSWORD

public static final java.lang.String DISPLAY_PASSWORD
See Also:
Constant Field Values

RESOURCE_NAME

public static final java.lang.String RESOURCE_NAME
See Also:
Constant Field Values

RESOURCE_USER_FORM

public static final java.lang.String RESOURCE_USER_FORM
See Also:
Constant Field Values

RESOURCE_LOGIN_MODULE

public static final java.lang.String RESOURCE_LOGIN_MODULE
See Also:
Constant Field Values

TEMP_PASSWORD_RESULT

public static final java.lang.String TEMP_PASSWORD_RESULT
See Also:
Constant Field Values

AA_LOCAL_PROFILES

public static final java.lang.String AA_LOCAL_PROFILES
attributes for local profiles and activity groups

See Also:
Constant Field Values

AA_LOCAL_ACTIVITYGROUPS

public static final java.lang.String AA_LOCAL_ACTIVITYGROUPS
See Also:
Constant Field Values

AA_DIRECT_LOCAL_PROFILES

public static final java.lang.String AA_DIRECT_LOCAL_PROFILES
See Also:
Constant Field Values

AA_DIRECT_LOCAL_ACTIVITYGROUPS

public static final java.lang.String AA_DIRECT_LOCAL_ACTIVITYGROUPS
See Also:
Constant Field Values

AA_PROFILES

public static final java.lang.String AA_PROFILES
global profiles and activity groups

See Also:
Constant Field Values

AA_PROFILES_MAPNAME

public static final java.lang.String AA_PROFILES_MAPNAME
See Also:
Constant Field Values

AA_ACTIVITY_GROUPS

public static final java.lang.String AA_ACTIVITY_GROUPS
See Also:
Constant Field Values

AA_ACTIVITY_GROUPS_MAPNAME

public static final java.lang.String AA_ACTIVITY_GROUPS_MAPNAME
See Also:
Constant Field Values

AA_ACTIVITY_GROUP_OBJECTS_MAPNAME

public static final java.lang.String AA_ACTIVITY_GROUP_OBJECTS_MAPNAME
See Also:
Constant Field Values

ACTIVITY_GROUP_NAME

public static final java.lang.String ACTIVITY_GROUP_NAME
See Also:
Constant Field Values

ACTIVITY_GROUP_FROM_DATE

public static final java.lang.String ACTIVITY_GROUP_FROM_DATE
See Also:
Constant Field Values

ACTIVITY_GROUP_TO_DATE

public static final java.lang.String ACTIVITY_GROUP_TO_DATE
See Also:
Constant Field Values

AA_BAPI_CUA_SYSTEMS

public static final java.lang.String AA_BAPI_CUA_SYSTEMS
bapi based cua systems list

See Also:
Constant Field Values

AA_BAPI_CUA_SYSTEMS_MAPNAME

public static final java.lang.String AA_BAPI_CUA_SYSTEMS_MAPNAME
See Also:
Constant Field Values

AA_BAPI_CUA_SYSTEMS_SHADOW

public static final java.lang.String AA_BAPI_CUA_SYSTEMS_SHADOW
See Also:
Constant Field Values

AA_ACTIVITY_GROUPS_SHADOW

public static final java.lang.String AA_ACTIVITY_GROUPS_SHADOW
See Also:
Constant Field Values

AA_PROFILES_SHADOW

public static final java.lang.String AA_PROFILES_SHADOW
See Also:
Constant Field Values

AA_DIRECT_ACTIVITY_GROUPS_SHADOW

public static final java.lang.String AA_DIRECT_ACTIVITY_GROUPS_SHADOW
See Also:
Constant Field Values

AA_DIRECT_PROFILES_SHADOW

public static final java.lang.String AA_DIRECT_PROFILES_SHADOW
See Also:
Constant Field Values

AA_LOGONDATA_LTIME

public static final java.lang.String AA_LOGONDATA_LTIME
See Also:
Constant Field Values

WS_PASSWORD_EXPIRED

public static final java.lang.String WS_PASSWORD_EXPIRED
See Also:
Constant Field Values

WS_RESET_FAILED_LOGIN_COUNT

public static final java.lang.String WS_RESET_FAILED_LOGIN_COUNT
See Also:
Constant Field Values

_filteredAccounts

protected java.util.Set _filteredAccounts
Accounts listed here cannot be edited, listed, created, etc. Controlled by resource attribute RA_FILTERED_ACCOUNTS.


_serverConnection

protected com.sap.mw.jco.JCO.Client _serverConnection
Our connection to SAP Managed by connect() and disconnect() only.


_poolKey

protected java.lang.String _poolKey

sapRepository

protected com.sap.mw.jco.IRepository sapRepository

_traceLevel

protected int _traceLevel

SAP_TIMEZONES

protected static final java.util.Collection SAP_TIMEZONES

jcoTrace

protected boolean jcoTrace
Constructor Detail

SAPResourceAdapter

public SAPResourceAdapter(Resource res,
                          ObjectCache cache)

SAPResourceAdapter

public SAPResourceAdapter()
Method Detail

setResource

public void setResource(Resource res)
Specified by:
setResource in interface ResourceAdapter
Overrides:
setResource in class ResourceAdapterBase

init_internal

protected void init_internal()

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Throws:
WavesetException

createPrototypeResource

public Resource createPrototypeResource()
                                 throws WavesetException
Specified by:
createPrototypeResource in interface ResourceAdapter
Specified by:
createPrototypeResource in class ResourceAdapterBase
Throws:
WavesetException

getFeatures

public GenericObject getFeatures()
Expose features supported by the Resource Adapter. Note: ActiveSync is considered a facet, not a feature.

Specified by:
getFeatures in interface ResourceAdapter
Overrides:
getFeatures in class ResourceAdapterBase
Returns:
GenericObject containing Features, as both key and value, which are supported by this resource adapter.
See Also:
ResourceAdapter.Features

reverseMapAttr

protected WSAttribute reverseMapAttr(java.lang.String attr,
                                     java.lang.Object[] values)
Map from a resource attribute to a waveset attribute. Return null if there's no mapping.


reverseMapAttr

protected WSAttribute reverseMapAttr(java.lang.String attr,
                                     java.lang.Object value)
Map from a resource attribute to a waveset attribute. Return null if there's no mapping.


reverseMapMultiAttr

protected void reverseMapMultiAttr(java.lang.String attr,
                                   java.lang.Object value,
                                   WSUser user)
Map from a resource attribute to multiple waveset attributes and add them to the user.


getIntRequiredResAttrVal

protected int getIntRequiredResAttrVal(java.lang.String name)
                                throws WavesetException,
                                       java.lang.NumberFormatException
Throws:
WavesetException
java.lang.NumberFormatException

addAttrIfMapped

protected void addAttrIfMapped(WSUser user,
                               java.lang.String attrName,
                               java.lang.Object value)
                        throws WavesetException
Add the named attribute and value to the user. Handle null names and values. Also coerse the attribute value into the mapped type, or at least do the best that we can.

Throws:
WavesetException

addAttrIfMapped

protected void addAttrIfMapped(WSUser user,
                               java.lang.String attrName,
                               java.lang.Object[] values)

getUserPassword

protected java.lang.String getUserPassword(WSUser user)

getIdentity

public java.lang.String getIdentity(WSUser user)
                             throws WavesetException
Description copied from class: ResourceAdapterBase
Return the account id for the user, fetched from the resource info. If the resource info has a GUID, prefer that.

Overrides:
getIdentity in class ResourceAdapterBase
Throws:
WavesetException

setUserField

protected void setUserField(com.sap.mw.jco.JCO.Function function,
                            java.lang.String identity)
Deprecated. for release 7.0

Obsolete. Sets the USERNAME field for a JCO.Function object. Some JCO.Function objects may not contain a USERNAME field, but most of them that are used in this adapter do.

Parameters:
function - - the JCO.Function object to set the USERNAME
identity - - the value to set for USERNAME.
Returns:
the JCO.Field containing the username

checkIfUserExists

protected boolean checkIfUserExists(WSUser user)
                             throws WavesetException
Check the SAP resource to see if the specified user exists.

Parameters:
user - - the user in question
Returns:
true if the user exists, false otherwise
Throws:
WavesetException

stringToBoolean

protected boolean stringToBoolean(java.lang.String s)
Deprecated. for release 7.0


booleanToString

protected java.lang.String booleanToString(boolean b)
Deprecated. for release 7.0


stringToDate

protected java.util.Date stringToDate(java.lang.String s)
                               throws WavesetException
Deprecated. for release 7.0 use Util.stringToDate(String).

Throws:
WavesetException

dateToString

protected java.lang.String dateToString(java.util.Date d)
                                 throws WavesetException
Deprecated. for release 7.0 use Util.dateToString(Date,String).

Throws:
WavesetException

startConnectionWrapper

protected void startConnectionWrapper()
                               throws WavesetException
Needed so that test connection will not perform connection retries

Overrides:
startConnectionWrapper in class ResourceAdapterBase
Throws:
WavesetException

startConnection

protected void startConnection()
                        throws WavesetException
Creates a connection to the SAP server.

Overrides:
startConnection in class ResourceAdapterBase
Throws:
WavesetException

connect

protected void connect()
                throws WavesetException
Connect to the SAP system via the SAP JCO library. Always perform connection retries. Needed for backward compatibility.

Throws:
WavesetException

connect

protected void connect(boolean retry)
                throws WavesetException
Connect to the SAP system via the SAP JCO library

Parameters:
retry - perform connection retries
Throws:
WavesetException

stopConnection

protected void stopConnection()
                       throws WavesetException
Needs to be overridden by subclass if default createAccounts() implementation is used.

Overrides:
stopConnection in class ResourceAdapterBase
Throws:
WavesetException

disconnect

protected void disconnect()

authenticate

public WavesetResult authenticate(java.util.HashMap loginInfo)
                           throws WavesetException
Authenticates the user against the resource. Return the authenticated id if authentication succeeds. The authenticate method is used to verify a user account and password are valid. If the user account name does not exist on the resource, the password does not match, or multiple matches exist, then throw an exception. If the resource has multiple contexts (for example LDAP or NDS), the authenticate method should not stop when it finds the first match, instead it should continue through the entire list. If it finds more than one match, then an exception should be thrown.

Specified by:
authenticate in interface ResourceAdapter
Specified by:
authenticate in class ResourceAdapterBase
Throws:
WavesetException

checkDeleteAccount

public WavesetResult checkDeleteAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkDeleteAccount in interface ResourceAdapter
Specified by:
checkDeleteAccount in class ResourceAdapterBase
Throws:
WavesetException

checkUpdateAccount

public WavesetResult checkUpdateAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkUpdateAccount in interface ResourceAdapter
Specified by:
checkUpdateAccount in class ResourceAdapterBase
Throws:
WavesetException

checkCreateAccount

public WavesetResult checkCreateAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkCreateAccount in interface ResourceAdapter
Specified by:
checkCreateAccount in class ResourceAdapterBase
Throws:
WavesetException

realDisable

public void realDisable(WSUser user,
                        WavesetResult result)
                 throws WavesetException
Overrides:
realDisable in class ResourceAdapterBase
Throws:
WavesetException

realEnable

public void realEnable(WSUser user,
                       WavesetResult result)
                throws WavesetException
Overrides:
realEnable in class ResourceAdapterBase
Throws:
WavesetException

realDelete

protected void realDelete(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default deleteAccounts() implementation is used.

Overrides:
realDelete in class ResourceAdapterBase
Throws:
WavesetException

getUser

public WSUser getUser(WSUser user)
               throws WavesetException
Description copied from interface: ResourceAdapter
Retrieves account information from the resource for the specified WSUser and returns a new WSUser based on the information from the resource. Returns null if the account does not exist.

Specified by:
getUser in interface ResourceAdapter
Overrides:
getUser in class ResourceAdapterBase
Throws:
WavesetException

getWsAttrsString

protected java.lang.String getWsAttrsString()
Deprecated. for release 7.0 - obsolete


sapSetValues

protected void sapSetValues(com.sap.mw.jco.JCO.Function _function,
                            java.lang.String structOrTable,
                            java.lang.String attributeName,
                            java.lang.String value,
                            boolean update)
                     throws WavesetException
Deprecated. for release 7.0

Obsolete.

Throws:
WavesetException

extractData

protected void extractData(WSUser _newUser,
                           com.sap.mw.jco.JCO.Function _function,
                           java.lang.String structOrTable,
                           java.lang.String attributeName,
                           java.lang.String name)
                    throws WavesetException
Deprecated. for release 7.0

Obsolete.

Throws:
WavesetException

extractData

protected void extractData(WSUser _newUser,
                           SAPResourceAdapter.Function function,
                           java.lang.String structOrTable,
                           java.lang.String attributeName,
                           java.lang.String name)
                    throws WavesetException
Throws:
WavesetException

callBAPIFunction

protected void callBAPIFunction(com.sap.mw.jco.JCO.Client serverConnection,
                                com.sap.mw.jco.JCO.Function function)
Deprecated. for release 7.0. use #callBAPIFunction(Function).

Obsolete. Makes the actual call to the SAP server. Does not perform BAPI retries.

Parameters:
serverConnection - - the JCO Client to use
function - - the JCO.Function to call.

callBAPIFunction

protected void callBAPIFunction(SAPResourceAdapter.Function function)
                         throws com.sap.mw.jco.JCO.Exception
Makes the actual call to the SAP server.

Throws:
com.sap.mw.jco.JCO.Exception

realGetUser

protected WSUser realGetUser(WSUser user)
                      throws WavesetException
Throws:
WavesetException

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default createAccounts() implementation is used.

Overrides:
realCreate in class ResourceAdapterBase
Throws:
WavesetException

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default updateAccounts() implementation is used.

Overrides:
realUpdate in class ResourceAdapterBase
Throws:
WavesetException

supportsAccountDisable

public boolean supportsAccountDisable()
Description copied from interface: ResourceAdapter
Indicates whether or not this resource supports account disable. If it does not, the provisioning engine will attempt to simulate disable by generating random passwords. If we end up with more of these "can you do this" methods, we might want to generalize it into a more extensible way to describe features and levels of support.

Specified by:
supportsAccountDisable in interface ResourceAdapter
Overrides:
supportsAccountDisable in class ResourceAdapterBase

errorCheck

protected int errorCheck(com.sap.mw.jco.JCO.Function function,
                         int noErrorNum,
                         WavesetResult result)
                  throws WavesetException
Deprecated. for release 7.0

Obsolete

Throws:
WavesetException

jcoErrorTableCheck

protected void jcoErrorTableCheck(SAPResourceAdapter.Function function,
                                  WavesetResult result)
                           throws WavesetException
Throws:
WavesetException

jcoErrorTableCheck

protected void jcoErrorTableCheck(com.sap.mw.jco.JCO.ParameterList returnTableList,
                                  WavesetResult result)
                           throws WavesetException
Parameters:
returnTableList -
result -
Throws:
WavesetException

jcoErrorStructureCheck

protected void jcoErrorStructureCheck(SAPResourceAdapter.Function function,
                                      WavesetResult result)
                               throws WavesetException
Throws:
WavesetException

jcoErrorStructureCheck

protected void jcoErrorStructureCheck(com.sap.mw.jco.JCO.Function function,
                                      WavesetResult result)
                               throws WavesetException
Parameters:
function -
result -
Throws:
WavesetException

maintainSapProfiles

protected void maintainSapProfiles(WSUser user,
                                   WavesetResult result)
                            throws WavesetException
Throws:
WavesetException

unexpirePassword

protected void unexpirePassword(WSUser user,
                                WavesetResult result)
                         throws WavesetException
Deprecated. fro release 7.0. use unexpirePassword(String,String,String,WavesetResult).

Obsolete. SAP passwords are expired in the default case. This is called to explicitly unexpire the password.

Throws:
WavesetException

unexpirePassword

protected void unexpirePassword(java.lang.String identity,
                                WavesetResult result)
                         throws WavesetException
Deprecated. for release 7.0. use unexpirePassword(String,String,String,WavesetResult).

Obsolete. SAP passwords are expired in the default case. This is called to explicitly unexpire the password.

Throws:
WavesetException

unexpirePassword

protected void unexpirePassword(java.lang.String identity,
                                java.lang.String currentPassword,
                                java.lang.String newPassword,
                                WavesetResult result)
                         throws WavesetException
SAP passwords are expired in the default case. This is called to explicitly unexpire the password.

Throws:
WavesetException

resetFailedLoginCount

protected void resetFailedLoginCount(WSUser user,
                                     WavesetResult result)
                              throws WavesetException
Unlocks an SAP user's account if the account was locked because the number of failed login attempts was exceeded. This differs from enable/disable in that this is not an SAP administrative function. This type of lock only occurs when the number of failed login attempts is exceeded.

Throws:
WavesetException

getHelpValues

protected java.util.List getHelpValues(java.lang.String objName,
                                       java.lang.String method,
                                       java.lang.String parameter,
                                       java.lang.String field,
                                       WavesetResult result,
                                       boolean throwException)
                                throws WavesetException
Throws:
WavesetException

maintainLocalActivityGroups

protected void maintainLocalActivityGroups(WSUser user,
                                           java.util.List groups,
                                           WavesetResult result)
                                    throws WavesetException
Set the local activity groups using BAPI_USER_LOCACTGROUPS_ASSIGN. This will set the distribution systems and activity groups - any already set will be eliminated.

Parameters:
user - - user to get attributes from
groups - - a List of String of the format system:groupname
result - - a result to add errors and messages to
Throws:
WavesetException

maintainLocalProfiles

protected void maintainLocalProfiles(WSUser user,
                                     java.util.List groups,
                                     WavesetResult result)
                              throws WavesetException
Set the local activity groups using BAPI_USER_LOCPROFILES_ASSIGN. This will set the distribution systems and profiles - any already set will be eliminated.

Parameters:
user - - user to get attributes from
groups - - a List of String of the format system:profileName
result - - a result to add errors and messages to
Throws:
WavesetException

getActivityGroups

protected void getActivityGroups(WSUser user,
                                 com.sap.mw.jco.JCO.Function _function,
                                 WavesetResult result)
                          throws WavesetException
Deprecated. for release 7.0.use #getActivityGroups(WSUser, Function, WavesetResult).

Obsolete.

Throws:
WavesetException

getActivityGroups

protected void getActivityGroups(WSUser user,
                                 SAPResourceAdapter.Function function,
                                 WavesetResult result)
                          throws WavesetException
Get the activity groups assigned to this user. Nothing happens if this is not a mapped attribute on the user.

Throws:
WavesetException

getLocalActivityGroupsAndCUASystems

protected void getLocalActivityGroupsAndCUASystems(WSUser user,
                                                   WavesetResult result)
                                            throws WavesetException
Get the local activity groups assigned to this user. The names are in the format subsystem:name. Nothing happens if this is not a mapped attribute on the user. While we are at it, till out the cus systems attribute since the systems are controlled by local activity groups.

Throws:
WavesetException

getLocalProfiles

protected void getLocalProfiles(WSUser user,
                                WavesetResult result)
                         throws WavesetException
Get the local profiles assigned to this user. The names are in the format subsystem:name. Nothing happens if this is not a mapped attribute on the user. Also supports global profiles - when CUA is in use but the profiles are forced the same on each subsystem. Really just useful for demos.

Throws:
WavesetException

maintainSapActivityGroups

protected void maintainSapActivityGroups(WSUser user,
                                         WavesetResult result)
                                  throws WavesetException
Set the activity groups on the SAP user. Maintain the CUA local activity groups and systems if the adapter is setup for CUA.

Throws:
WavesetException

getAccountIterator

public AccountIterator getAccountIterator()
                                   throws WavesetException
Specified by:
getAccountIterator in interface ResourceAdapter
Overrides:
getAccountIterator in class ResourceAdapterBase
Throws:
WavesetException

listAllObjects

public java.util.ArrayList listAllObjects(java.lang.String resourceObjectType,
                                          java.util.Map options,
                                          java.lang.String runAsUser,
                                          EncryptedData runAsPassword)
                                   throws WavesetException
Description copied from interface: ResourceAdapter
This method will return a list of object names of the specified object type. If you need to be able to specify which attrs to return, use listObjects instead

Specified by:
listAllObjects in interface ResourceAdapter
Overrides:
listAllObjects in class ResourceAdapterBase
Parameters:
resourceObjectType - - a type of object that is either well-known or is meaningful to the resource. Every resource is expected to recognize certain values. For example, listAllObjects(ObjectType.ACCOUNT, null, null, null) should return a list of all account names.
options - - a map of options
runAsUser - - (optional) if specified, connect as this user to list all objects of the specified type.
runAsPassword - - (optional) if specified, connect with this password to list all objects of the specified type.
Returns:
a list of all object names of a specified type.
Throws:
WavesetException

convertAttrToList

protected java.util.List convertAttrToList(WSAttribute attr)

changeUserPassword

protected void changeUserPassword(WSUser user,
                                  WavesetResult result)
                           throws WavesetException
Sets the user's password with a different BAPI call so that the password history and other password data (like "Password Last Changed Date") is set correctly. Although this BAPI is executed as the admin, the concept is that the password is changed as the user.

Parameters:
user - - the target Waveset user
result - - Waveset result
Throws:
WavesetException

setupJCOTrace

protected void setupJCOTrace()
Sets the jcoTrace variable and initializes JCO variables to the appropriate trace level. The JCO properties are a static class variable so turning trace on will turn it on for all SAP and SAPHR resource adapters.


createFunction

protected com.sap.mw.jco.JCO.Function createFunction(java.lang.String functionName)
                                              throws WavesetException
Deprecated. for release 7.0

Creates a JCO.Function object that is used to interface with SAP.

Parameters:
functionName - - the BAPI name
Returns:
the JCO.Function that is created.
Throws:
WavesetException

createFunction

protected com.sap.mw.jco.JCO.Function createFunction(java.lang.String functionName,
                                                     boolean retryConnectionOnFail)
                                              throws WavesetException
Deprecated. for release 7.0 use Function(String,boolean).

Creates a JCO.Function object that is used to interface with SAP.

Parameters:
functionName - - the BAPI name
retryConnectionOnFail - - if true, reset the connection and try to create the function again.
Returns:
the JCO.Function that is created.
Throws:
WavesetException