com.waveset.adapter
Class OracleERPResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.JdbcResourceAdapter
          extended bycom.waveset.adapter.OracleERPResourceAdapter
All Implemented Interfaces:
AccountIterator, ResourceAdapter

public class OracleERPResourceAdapter
extends JdbcResourceAdapter
implements AccountIterator


Nested Class Summary
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase
ResourceAdapterBase.SimpleAccountIterator
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType
 
Field Summary
static java.lang.String ACTIVE_ACCOUNTS_ONLY
           
 int adminUserId
           
static java.lang.String APP
           
static java.lang.String APPS
           
static java.lang.String code_id
           
static java.lang.String CUST_ID
           
static java.lang.String DESCR
           
static java.lang.String DIRECT_RESP
           
static java.lang.String EMAIL
           
static java.lang.String EMP_ID
           
static java.lang.String EMP_NUM
           
static java.lang.String END_DATE
           
static java.lang.String EXP_PWD
           
static java.lang.String FAX
           
static java.lang.String INDIRECT_RESP
           
static java.lang.String LAST_LOGON_DATE
           
static java.lang.String OWNER
           
static java.lang.String PATTERN
           
static java.lang.String PWD_ACCESSES_LEFT
           
static java.lang.String PWD_DATE
           
static java.lang.String PWD_LIFE_ACCESSES
           
static java.lang.String PWD_LIFE_DAYS
           
static java.lang.String RESP
           
static java.lang.String RESP_NAME
           
static java.lang.String RESP_NAMES
           
static java.lang.String RESPKEYS
           
static java.lang.String SEC_ATTRS
           
static java.lang.String SEC_GROUPS
           
static java.lang.String SESS_NUM
           
static java.lang.String START_DATE
           
static java.lang.String SUPP_ID
           
static java.lang.String UNENCRYPT_PWD
           
 
Fields inherited from class com.waveset.adapter.JdbcResourceAdapter
RA_DATABASE, RA_DRIVER, RA_HOST, RA_PASSWORD, RA_PORT, RA_QUOTING, RA_URL_PREFIX, RA_URL_TEMPLATE, RA_USER
 
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
OracleERPResourceAdapter()
          Create an adapater instance, without a resource.
OracleERPResourceAdapter(Resource res, ObjectCache cache)
          Create an adapter instance for a resource.
 
Method Summary
 WavesetResult authenticate(java.util.HashMap loginInfo)
          Check to see if a user account and password is valid.
 WSUser buildUser(java.lang.String id)
          Build the base user object given an id.
 WavesetResult checkCreateAccount(WSUser user)
          Checks connection to DB
 WavesetResult checkDeleteAccount(WSUser user)
          Check account deletion.
 WavesetResult checkUpdateAccount(WSUser user)
          Check the ability to perform an account update.
 void close()
          Close the account iterator, and clean up resources.
 Resource createPrototypeResource()
          Create the prototype instance.
protected  void finalize()
          The finalizer helps prevent Oracle connection leakage.
 AccountIterator getAccountIterator()
           
 java.lang.String getColumn(java.sql.ResultSet result, int col)
          Get a string from a result set, trimming trailing blanks.
 GenericObject getObject(java.lang.String objectType, java.lang.String objectId, java.util.List attrsToGet, java.util.Map options)
          getObject
 java.lang.String getRespKey(java.lang.String resp)
          get responsibility keys (resp_name, app_name, sec_group)
 java.util.ArrayList getRespKeys(java.util.ArrayList resps)
          get responsibility keys (resp_name, app_name, sec_group)
 WSUser getUser(WSUser idUser)
          Public adapter method to get the current user information.
 boolean hasNext()
          Do most of the work.
 java.util.ArrayList listAllObjects(java.lang.String resourceObjectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword)
          Return all objects of specific type.
 java.util.List listObjects(java.lang.String resourceObjectType, java.util.Map options)
          listObjects
 WSUser next()
           
protected  void realCreate(WSUser user, WavesetResult result)
          Create a new account.
protected  void realDelete(WSUser user, WavesetResult result)
          Delete the account, which really means disable the account.
protected  void realDisable(WSUser user, WavesetResult result)
          Disable
protected  void realEnable(WSUser user, WavesetResult result)
          Enable
protected  void realUpdate(WSUser user, WavesetResult result)
          Perform the actual account update.
protected  void startConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
static Resource staticCreatePrototypeResource()
          Create the prototype instance.
protected  void stopConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
 boolean supportsAccountDisable()
          Whether the resource can enable and disable accounts.
 
Methods inherited from class com.waveset.adapter.JdbcResourceAdapter
addAttributeValue, addQuoted, attributeRequiresQuotingInSQL, closeConnection, closeResult, closeStatement, decodeCommaList, dumpResult, encodeCommaList, execProcedure, execProcedure, execSql, execSql, execSql, flushResults, flushResultsQuietly, formatTemplateUrl, formatUrl, formatUrl, getConnection, getConnection, getConnection, getConnectionString, getConnectionUrl, getConnectionUrl, getEncryptedResourceAttribute, getResourceAttribute, mergeCommaLists, mergeStringLists, println, queryInt, queryString, setDebug
 
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, getFeatures, getIdentity, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, 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, listObjectsOfType, lookupAction, lookupAction, lookupActions, namesEqual, objectClassesMatchType, println, restoreResourceObjectClassAttr, run, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnectionWrapper, 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, 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

ACTIVE_ACCOUNTS_ONLY

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

adminUserId

public int adminUserId

OWNER

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

UNENCRYPT_PWD

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

SESS_NUM

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

START_DATE

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

END_DATE

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

LAST_LOGON_DATE

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

DESCR

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

PWD_DATE

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

PWD_ACCESSES_LEFT

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

PWD_LIFE_ACCESSES

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

PWD_LIFE_DAYS

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

EMP_ID

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

EMP_NUM

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

EMAIL

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

FAX

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

CUST_ID

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

SUPP_ID

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

EXP_PWD

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

RESP

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

RESPKEYS

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

RESP_NAMES

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

RESP_NAME

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

APPS

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

APP

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

SEC_GROUPS

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

SEC_ATTRS

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

PATTERN

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

DIRECT_RESP

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

INDIRECT_RESP

public static final java.lang.String INDIRECT_RESP
See Also:
Constant Field Values
Constructor Detail

OracleERPResourceAdapter

public OracleERPResourceAdapter(Resource res,
                                ObjectCache cache)
Create an adapter instance for a resource.


OracleERPResourceAdapter

public OracleERPResourceAdapter()
Create an adapater instance, without a resource.

Method Detail

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Create the prototype instance.

Throws:
WavesetException

createPrototypeResource

public Resource createPrototypeResource()
                                 throws WavesetException
Create the prototype instance.

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

finalize

protected void finalize()
                 throws java.lang.Throwable
The finalizer helps prevent Oracle connection leakage. NEEDS to be replaced by connection pooling code!!!

Throws:
java.lang.Throwable

startConnection

protected void startConnection()
                        throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default createAccounts() implementation is used.

Overrides:
startConnection in class ResourceAdapterBase
Throws:
WavesetException

stopConnection

protected void stopConnection()
                       throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default createAccounts() implementation is used.

Overrides:
stopConnection in class ResourceAdapterBase
Throws:
WavesetException

getAccountIterator

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

close

public void close()
Close the account iterator, and clean up resources.

Specified by:
close in interface AccountIterator

hasNext

public boolean hasNext()
                throws WavesetException
Do most of the work. If there is no connection or result set, connect and get a result set. Fetch the first result row and stash it, to be returned in the next() call. SIDE EFFECTS: _ctx connected if needed _s turned into an SQL statment _rs holds the result set of the query

Specified by:
hasNext in interface AccountIterator
Throws:
WavesetException

next

public WSUser next()
            throws java.util.NoSuchElementException,
                   WavesetException
Specified by:
next in interface AccountIterator
Returns:
the next account

Throws:
java.util.NoSuchElementException
WavesetException

checkCreateAccount

public WavesetResult checkCreateAccount(WSUser user)
                                 throws WavesetException
Checks connection to DB

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

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Create a new account. .fnd_user_pkg.CreateUser ( x_user_name, x_owner, x_unencrypted_password, x_session_number, x_start_date, x_end_date, x_last_logon_date, x_description, x_password_date, x_password_accesses_left, x_password_lifespan_accesses, x_password_lifespan_days, x_employee_id, x_email_address, x_fax, x_customer_id, x_supplier_id);

Overrides:
realCreate in class ResourceAdapterBase
Throws:
WavesetException

checkUpdateAccount

public WavesetResult checkUpdateAccount(WSUser user)
                                 throws WavesetException
Check the ability to perform an account update. The account must exist.

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

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Perform the actual account update.

The account ID cannot be changed.

Password changes are indiciated with a non-null password stored in the ResourceInfo object for this resource.

Changes to group membership require that we read the current group list so we can determine which memberships to add, and which to remove.

Attribute changes will be collected in a Map which will then be used to construct a SQL update statement. Update account. .fnd_user_pkg.UpdateUser ( x_user_name, x_owner, x_unencrypted_password, x_session_number, x_start_date, x_end_date, x_last_logon_date, x_description, x_password_date, x_password_accesses_left, x_password_lifespan_accesses, x_password_lifespan_days, x_employee_id, x_email_address, x_fax, x_customer_id, x_supplier_id x_old_password);

Overrides:
realUpdate in class ResourceAdapterBase
Throws:
WavesetException

checkDeleteAccount

public WavesetResult checkDeleteAccount(WSUser user)
                                 throws WavesetException
Check account deletion. We don't care if the account doesn't exist, just make sure the server is accessable.

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

realDelete

protected void realDelete(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Delete the account, which really means disable the account.

Overrides:
realDelete in class ResourceAdapterBase
Throws:
WavesetException

supportsAccountDisable

public boolean supportsAccountDisable()
Whether the resource can enable and disable accounts.

Specified by:
supportsAccountDisable in interface ResourceAdapter
Overrides:
supportsAccountDisable in class ResourceAdapterBase
Returns:
boolean if Account Disable supported

realEnable

protected void realEnable(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Enable

Overrides:
realEnable in class ResourceAdapterBase
Throws:
WavesetException

realDisable

protected void realDisable(WSUser user,
                           WavesetResult result)
                    throws WavesetException
Disable

Overrides:
realDisable in class ResourceAdapterBase
Throws:
WavesetException

getUser

public WSUser getUser(WSUser idUser)
               throws WavesetException
Public adapter method to get the current user information.

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

buildUser

public WSUser buildUser(java.lang.String id)
Build the base user object given an id.


listAllObjects

public java.util.ArrayList listAllObjects(java.lang.String resourceObjectType,
                                          java.util.Map options,
                                          java.lang.String runAsUser,
                                          EncryptedData runAsPassword)
                                   throws WavesetException
Return all objects of specific type. Supported 'types' for Oracle ERP are: Responsibilities, Responsibility Names, Applications, Security Groups

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

listObjects

public java.util.List listObjects(java.lang.String resourceObjectType,
                                  java.util.Map options)
                           throws WavesetException
listObjects

Specified by:
listObjects in interface ResourceAdapter
Overrides:
listObjects in class ResourceAdapterBase
Returns:
list of objects of specific type. Supported 'types' for Oracle ERP are: responsibilities, responsibilityNames, applications, securityGroups, auditorResps If auditorResps is requested, a list of genericObjects are returned containing responsibility name and attributes requested
Throws:
WavesetException

getColumn

public java.lang.String getColumn(java.sql.ResultSet result,
                                  int col)
                           throws java.sql.SQLException
Get a string from a result set, trimming trailing blanks.

Throws:
java.sql.SQLException

getRespKeys

public java.util.ArrayList getRespKeys(java.util.ArrayList resps)
                                throws WavesetException
get responsibility keys (resp_name, app_name, sec_group)

Throws:
WavesetException

getRespKey

public java.lang.String getRespKey(java.lang.String resp)
                            throws WavesetException
get responsibility keys (resp_name, app_name, sec_group)

Throws:
WavesetException

authenticate

public WavesetResult authenticate(java.util.HashMap loginInfo)
                           throws WavesetException
Check to see if a user account and password is valid.

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

getObject

public GenericObject getObject(java.lang.String objectType,
                               java.lang.String objectId,
                               java.util.List attrsToGet,
                               java.util.Map options)
                        throws WavesetException
getObject

Specified by:
getObject in interface ResourceAdapter
Overrides:
getObject in class ResourceAdapterBase
Parameters:
objectId - - a valid fully qualified object identifier on this resource Name of responsibility in the form Responsibility||Application
attrsToGet - - a list of attribute names supported by the specified objectType to be returned with the object Valid Attributes are: name formIds formNames menuIds userMenuNames userFormNames functionIds userFunctionNames readOnlyFormIds readWriteOnlyFormIds readOnlyFormNames readOnlyUserFormNames readWriteOnlyFormNames readWriteOnlyUserFormNames activeRespsOnly - return attributes of active responsibilities on user
options - - Not currently supported
objectType - - a valid object type defined in the resource's section
Returns:
Return the requested objectId of the requested objectType from the resource and requested attributes ion the attrToGet list.
Throws:
WavesetException