com.waveset.adapter
Class OracleResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.JdbcResourceAdapter
          extended bycom.waveset.adapter.OracleResourceAdapter
All Implemented Interfaces:
ResourceAdapter

public class OracleResourceAdapter
extends JdbcResourceAdapter


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 code_id
           
static java.lang.String NO_CASCADE
           
static java.lang.String ORACLE_AUTH_EXTERNAL
           
static java.lang.String ORACLE_AUTH_GLOBAL
           
static java.lang.String ORACLE_AUTH_LOCAL
           
static java.lang.String ORACLE_AUTHENTICATION_ATTR_NAME
           
static java.lang.String ORACLE_DEF_TS_ATTR_NAME
           
static java.lang.String ORACLE_DEF_TS_QUOTA_ATTR_NAME
           
static java.lang.String ORACLE_EXPIRE_PASSWORD
           
static java.lang.String ORACLE_GLOBAL_ATTR_NAME
           
static java.lang.String ORACLE_PRIVS_ATTR_NAME
           
static java.lang.String ORACLE_PROFILES_ATTR_NAME
           
static java.lang.String ORACLE_ROLES_ATTR_NAME
           
static java.lang.String ORACLE_TEMP_TS_ATTR_NAME
           
static java.lang.String ORACLE_TEMP_TS_QUOTA_ATTR_NAME
           
 
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
OracleResourceAdapter()
           
OracleResourceAdapter(Resource res, ObjectCache cache)
           
 
Method Summary
 WavesetResult authenticate(java.util.HashMap loginInfo)
          Authenticates the user against the resource.
 WavesetResult checkCreateAccount(WSUser user)
           
 WavesetResult checkDeleteAccount(WSUser user)
           
 WavesetResult checkUpdateAccount(WSUser user)
           
 Resource createPrototypeResource()
           
 WavesetResult deleteAccounts(WSUser[] users)
          Overrides ResourceAdapterBase method deleteAccounts in order to wait until all accounts are deleted before performing the commit.
protected  void finalize()
          The finalizer helps prevent Oracle connection leakage.
 java.util.List getAllAccounts()
          Returns all of the accounts in this resource as a list of WSUser objects.
 java.lang.String getColumn(java.sql.ResultSet result, int col)
          Get a string from a result set, trimming trailing blanks.
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
 WSUser getUser(WSUser user)
          Return a fully populated user from the resource if it exists.
 java.util.ArrayList listAllObjects(java.lang.String resourceObjectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword)
          Return all objects of specific type.
protected  void realCreate(WSUser user, WavesetResult result)
          realCreate Build SQL to add the user and set her authentication mechanism.
protected  void realDelete(WSUser user, WavesetResult result, boolean commit)
           
protected  void realDisable(WSUser user, WavesetResult result)
          Sets ACCOUNT LOCK and ResourceInfo Disabled 'true'
protected  void realEnable(WSUser user, WavesetResult result)
          Sets ACCOUNT UNLOCK and ResourceInfo Disabled 'false'
protected  void realUpdate(WSUser user, WavesetResult result)
          realUpdate Build SQL to update the user.
protected  void startConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
static Resource staticCreatePrototypeResource()
           
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, deleteObject, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountAttributes, getAccountIterator, getAccountIterator, getAccountIterator, getAction, getActionNotFoundErrorMessage, getActionNotFoundMessage, getActionRunAsPassword, getActionRunAsUser, getActionTimeout, getActionType, getAdapter, getAdapter, getAdapter, getAdapterProxy, getAdapterProxy, getAttrNameFromMapName, getAttrNameFromMapName, getAttrParse, getAttrTypeFromMapName, getAttrTypeFromMapName, getAUserName, getBaseContextAttrName, getBaseContextObject, getBaseContexts, getBlockSize, getContext, getExcludedAccountsRule, getIdentity, 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, realDelete, 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

ORACLE_ROLES_ATTR_NAME

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

ORACLE_PRIVS_ATTR_NAME

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

ORACLE_PROFILES_ATTR_NAME

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

ORACLE_DEF_TS_ATTR_NAME

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

ORACLE_TEMP_TS_ATTR_NAME

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

ORACLE_GLOBAL_ATTR_NAME

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

ORACLE_AUTHENTICATION_ATTR_NAME

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

ORACLE_DEF_TS_QUOTA_ATTR_NAME

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

ORACLE_TEMP_TS_QUOTA_ATTR_NAME

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

ORACLE_EXPIRE_PASSWORD

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

ORACLE_AUTH_LOCAL

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

ORACLE_AUTH_EXTERNAL

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

ORACLE_AUTH_GLOBAL

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

NO_CASCADE

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

OracleResourceAdapter

public OracleResourceAdapter(Resource res,
                             ObjectCache cache)

OracleResourceAdapter

public OracleResourceAdapter()
Method Detail

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

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

checkCreateAccount

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

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
realCreate Build SQL to add the user and set her authentication mechanism. LOCAL (password), EXTERNAL (OS), and GLOBAL (Global Name) are supported. If GLOBAL, must get Global Name for create sql statement. Ignores any password passed in unless authentication is LOCAL. Also, check for expire password if LOCAL. After user is created, user is 'altered' with supported attributes. Supported attributes in addAttributes() are: Roles, Privileges, Profile, Default TableSpace, Default TablesSpace Quota, Temporary TableSpace, Temporary TableSpace Quota, Expire Password Do not create user if there is an error on any step (rollback).

Overrides:
realCreate in class ResourceAdapterBase
Throws:
WavesetException

getUser

public WSUser getUser(WSUser user)
               throws WavesetException
Return a fully populated user from the resource if it exists. Throws an informative waveset exception if the user is not found.

Specified by:
getUser in interface ResourceAdapter
Overrides:
getUser in class ResourceAdapterBase
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

checkUpdateAccount

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

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
realUpdate Build SQL to update the user. Supported attributes in addAttributes() are: Authentication(LOCAL, GLOBAL, EXTERNAL), Roles, Privileges, Profile, Default TableSpace, Default TablesSpace Quota Temporary TableSpace, Temporary TableSpace Quota, Expire Password

Overrides:
realUpdate 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

deleteAccounts

public WavesetResult deleteAccounts(WSUser[] users)
                             throws WavesetException
Overrides ResourceAdapterBase method deleteAccounts in order to wait until all accounts are deleted before performing the commit. VS - should this be done for update and createAccounts methods as well?

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

realDelete

protected void realDelete(WSUser user,
                          WavesetResult result,
                          boolean commit)
                   throws WavesetException
Throws:
WavesetException

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

getAllAccounts

public java.util.List getAllAccounts()
                              throws WavesetException
Returns all of the accounts in this resource as a list of WSUser objects.

jsl - this is temporary, need to come up with an effecient way to iterate over the accounts.

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

authenticate

public WavesetResult authenticate(java.util.HashMap loginInfo)
                           throws WavesetException
Description copied from interface: ResourceAdapter
Authenticates the user against the resource. If authentication is successful, the authenticated id will be returned. If more info is required to complete authentication the result will contain the required info

Specified by:
authenticate in interface ResourceAdapter
Specified by:
authenticate 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
Return all objects of specific type. Supported 'types' for Oracle Adapter are: ROLE, PRIVILEGE, PROFILE, PERM_TABLESPACE, TEMP_TABLESPACE

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

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
Sets ACCOUNT UNLOCK and ResourceInfo Disabled 'false'

Overrides:
realEnable in class ResourceAdapterBase
Parameters:
user - the user to Enable
Returns:
none
Throws:
WavesetException - if ENABLED fails

realDisable

protected void realDisable(WSUser user,
                           WavesetResult result)
                    throws WavesetException
Sets ACCOUNT LOCK and ResourceInfo Disabled 'true'

Overrides:
realDisable in class ResourceAdapterBase
Parameters:
user - the user to Disable
Returns:
none
Throws:
WavesetException - if DISABLED fails