|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.adapter.ResourceAdapterBase
com.waveset.adapter.JdbcResourceAdapter
com.waveset.adapter.DatabaseTableResourceAdapter
The DatabaseTableResourceAdapter is a basic, but easy to use adapter for accounts in a relational database.
It supports create, update, and delete actions. It can also be used for pass-thru authentication, although it assumes the password is in clear text in the database. It supports reconcilation via getAccountIterator().
This adapter assumes that all the user account data is stored in a single database table. The delete action is implemented to simply remove the row from the table.
A custom form 'Resource Wizard Database Table' has been written to make configuration very easy.
It now also supports active sync. The active sync configuration permits additional attributes to allow you to restrict the accounts returned for active sync create/update processing. Currently there is no means to perform active sync delete processing since the default delete behavior is to delete the row.
Nested Class Summary | |
static class |
DatabaseTableResourceAdapter.Param
|
static class |
DatabaseTableResourceAdapter.StrictMapResolver
A class that implements the VariableResolver interface. |
static class |
DatabaseTableResourceAdapter.VariableChecker
VariableChecker verifies that a variables appear in the LHS of the schema map. |
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 |
DEFAULT_DRIVER
The default value for the RA_DRIVER resource attribute. |
static java.lang.String |
DEFAULT_PORT
The default connect DB Server Port. |
static java.lang.String |
DEFAULT_TEMPLATE
The default connect URL template. |
static java.lang.String |
LAST_FETCHED_CONJUNCTION
|
static java.lang.String |
LAST_FETCHED_PREDICATE
|
static java.lang.String |
ORDER_BY_CLAUSE
|
static java.lang.String |
RA_KEY_COLUMN
|
static java.lang.String |
RA_NO_PASSWORDS
|
static java.lang.String |
RA_PASSWORD_COLUMN
|
static java.lang.String |
RA_PROCESS_NAME
Deprecated. As of IdM 5.5. Use RA_PROCESS_RULE instead. |
static java.lang.String |
RA_STATIC_SEARCH_PREDICATE
Active Sync-related resource attribute names |
static java.lang.String |
RA_TABLE
|
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 |
Constructor Summary | |
DatabaseTableResourceAdapter()
|
Method Summary | |
WavesetResult |
activeSyncTestConfiguration()
|
void |
addQuotedName(java.lang.StringBuffer b,
java.lang.String s)
Add a quoted string to a SQL statement we're building in a buffer. |
static void |
addQuotedName(java.lang.StringBuffer b,
java.lang.String s,
java.lang.String quoting)
|
WavesetResult |
authenticate(java.util.HashMap loginInfo)
Check to see if a user account and password is valid. |
protected com.waveset.adapter.iapi.IAPI |
buildEventLegacy(com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRow row,
java.lang.String command)
Extract the user identity information and attributes, create: - an IAPIUser object to update Lighthouse, or - an IAIProcess object for launching a workflow and return it. |
void |
callCompleted(com.waveset.adapter.iapi.IAPI call)
An call generated by this resource adapter has completed. |
WavesetResult |
checkCreateAccount(WSUser user)
|
WavesetResult |
checkDeleteAccount(WSUser user)
|
WavesetResult |
checkUpdateAccount(WSUser user)
|
void |
closeConnection(java.sql.Connection con)
Close a connection, making sure that autocommit is true before closing. |
Resource |
createPrototypeResource()
|
protected void |
execOracleSqlWithParams(java.lang.String id,
java.sql.Connection con,
java.lang.String stmt,
DatabaseTableResourceAdapter.Param[] params,
int ignoreError)
Execute a statment, with multiple parameter substitutions. |
protected void |
execSqlWithParams(java.lang.String id,
java.sql.Connection con,
java.lang.String stmt,
DatabaseTableResourceAdapter.Param[] params)
Execute a statment, with multiple parameter substitutions. |
protected void |
execSqlWithParams(java.lang.String id,
java.sql.Connection con,
java.lang.String stmt,
DatabaseTableResourceAdapter.Param[] params,
int ignoreError)
Execute a statment, with multiple parameter substitutions. |
protected void |
execStandardSqlWithParams(java.lang.String id,
java.sql.Connection con,
java.lang.String stmt,
DatabaseTableResourceAdapter.Param[] params,
int ignoreError)
|
AccountIterator |
getAccountIterator()
Return an iterator that will iterate over all the accounts on a resource. |
AccountIterator |
getAccountIterator(java.util.Map searchParams)
Like getAccountIterator but takes a Map param. |
java.lang.Object |
getAttributeValue(java.lang.String name)
Required method implementation to get an attribute value. |
protected byte[] |
getBytesFromObject(java.lang.String columnName,
java.lang.Object binaryObj)
Return the byte[] value from binaryObj. |
java.sql.Connection |
getConnection()
Get a connection to the default database with the proxy user. |
GenericObject |
getFeatures()
Expose features supported by the Resource Adapter. |
WSUser |
getUser(WSUser idUser)
Public adapter method to get the current user information. |
void |
init()
Initialize the source adapter. |
int |
poll()
the poll method. |
protected void |
processUpdates(com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRows updateRows,
java.lang.String command,
com.waveset.adapter.iapi.IAPI prox)
Take a list of Maps that are rows of the audit data and turn them into IAPI calls. |
protected void |
realCreate(WSUser user,
WavesetResult result)
Create a new account. |
protected void |
realDelete(WSUser user,
WavesetResult result)
Delete the account for real. |
protected void |
realUpdate(WSUser user,
WavesetResult result)
Update a user |
void |
setAttributeValue(java.lang.String name,
java.lang.Object value)
Required method implementation to set an attribute value. |
protected void |
setBinaryParam(java.sql.PreparedStatement statement,
int statementIndex,
byte[] value)
Set a value in a PreparedStatement for binary parameter. |
void |
shutdown()
Called once when the adapter is unloaded. |
void |
startConnection()
Needs to be overridden by subclass if default createAccounts() implementation is used. |
static Resource |
staticCreatePrototypeResource()
Create the prototype resource. |
void |
stopConnection()
Needs to be overridden by subclass if default createAccounts() implementation is used. |
WavesetResult |
testConfiguration()
Default implementation of test method, calls check create. |
protected void |
traceAndLog(long traceLevel,
java.lang.String method,
int logLevel,
java.lang.String message)
|
protected void |
traceAndLogCommand(long traceLevel,
java.lang.String method,
int logLevel,
com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRow update,
java.lang.String command,
WavesetResult result)
Log whatever we want to from an update. |
protected boolean |
useLegacyEventGeneration()
Determines if the adapter should generate IAPI events with the legacy logic or use the standard rules based event generation logic. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String RA_TABLE
public static final java.lang.String RA_KEY_COLUMN
public static final java.lang.String RA_PASSWORD_COLUMN
public static final java.lang.String RA_NO_PASSWORDS
public static final java.lang.String DEFAULT_PORT
public static final java.lang.String DEFAULT_DRIVER
public static final java.lang.String DEFAULT_TEMPLATE
public static final java.lang.String RA_STATIC_SEARCH_PREDICATE
public static final java.lang.String RA_PROCESS_NAME
public static final java.lang.String LAST_FETCHED_PREDICATE
public static final java.lang.String LAST_FETCHED_CONJUNCTION
public static final java.lang.String ORDER_BY_CLAUSE
Constructor Detail |
public DatabaseTableResourceAdapter()
Method Detail |
public static Resource staticCreatePrototypeResource() throws WavesetException
WavesetException
public Resource createPrototypeResource() throws WavesetException
createPrototypeResource
in interface ResourceAdapter
createPrototypeResource
in class ResourceAdapterBase
WavesetException
public void startConnection() throws WavesetException
ResourceAdapterBase
startConnection
in class ResourceAdapterBase
WavesetException
public void stopConnection() throws WavesetException
ResourceAdapterBase
stopConnection
in class ResourceAdapterBase
WavesetException
public WavesetResult checkCreateAccount(WSUser user) throws WavesetException
checkCreateAccount
in interface ResourceAdapter
checkCreateAccount
in class ResourceAdapterBase
WavesetException
protected void realCreate(WSUser user, WavesetResult result) throws WavesetException
realCreate
in class ResourceAdapterBase
WavesetException
public WavesetResult checkUpdateAccount(WSUser user) throws WavesetException
checkUpdateAccount
in interface ResourceAdapter
checkUpdateAccount
in class ResourceAdapterBase
WavesetException
protected void realUpdate(WSUser user, WavesetResult result) throws WavesetException
realUpdate
in class ResourceAdapterBase
WavesetException
public WavesetResult checkDeleteAccount(WSUser user) throws WavesetException
checkDeleteAccount
in interface ResourceAdapter
checkDeleteAccount
in class ResourceAdapterBase
WavesetException
protected void realDelete(WSUser user, WavesetResult result) throws WavesetException
realDelete
in class ResourceAdapterBase
WavesetException
public WSUser getUser(WSUser idUser) throws WavesetException
getUser
in interface ResourceAdapter
getUser
in class ResourceAdapterBase
WavesetException
protected byte[] getBytesFromObject(java.lang.String columnName, java.lang.Object binaryObj) throws java.sql.SQLException, InternalError, WavesetException
This method can be overridden if needed to define additional coercions.
columnName
- the binary column name from which the value was retrieved via a call to ResultSet#getObject()binaryObj
- the value retrieved for the binary column
java.sql.SQLException
InternalError
WavesetException
- if no conversion definedprotected void setBinaryParam(java.sql.PreparedStatement statement, int statementIndex, byte[] value) throws java.sql.SQLException
Override this if it needs to something other than:
statement.setBytes(statementIndex, value);
statement
- the statementstatementIndex
- the index of the parameter to setvalue
- the byte[] value to which the parameter should be set
java.sql.SQLException
public WavesetResult authenticate(java.util.HashMap loginInfo) throws WavesetException
authenticate
in interface ResourceAdapter
authenticate
in class ResourceAdapterBase
WavesetException
public WavesetResult testConfiguration() throws WavesetException
ResourceAdapterBase
testConfiguration
in interface ResourceAdapter
testConfiguration
in class ResourceAdapterBase
WavesetException
protected void execSqlWithParams(java.lang.String id, java.sql.Connection con, java.lang.String stmt, DatabaseTableResourceAdapter.Param[] params) throws WavesetException
id
- user idcon
- JDBC Connectionstmt
- SQL statement to execute (with '?' holders for parameter substitutions)params
- the values to set for the parameter substitutions
WavesetException
protected void execSqlWithParams(java.lang.String id, java.sql.Connection con, java.lang.String stmt, DatabaseTableResourceAdapter.Param[] params, int ignoreError) throws WavesetException
id
- user idcon
- JDBC Connectionstmt
- SQL statement to execute (with '?' holders for parameter substitutions)params
- the values to set for the parameter substitutions
WavesetException
protected void execStandardSqlWithParams(java.lang.String id, java.sql.Connection con, java.lang.String stmt, DatabaseTableResourceAdapter.Param[] params, int ignoreError) throws WavesetException
WavesetException
protected void execOracleSqlWithParams(java.lang.String id, java.sql.Connection con, java.lang.String stmt, DatabaseTableResourceAdapter.Param[] params, int ignoreError) throws WavesetException
id
- user idcon
- JDBC Connectionstmt
- SQL statement to execute (with '?' holders for parameter substitutions)params
- the values to set for the parameter substitutions
WavesetException
public AccountIterator getAccountIterator() throws WavesetException
getAccountIterator
in interface ResourceAdapter
getAccountIterator
in class ResourceAdapterBase
WavesetException
public AccountIterator getAccountIterator(java.util.Map searchParams) throws WavesetException
ResourceAdapter
getAccountIterator
in interface ResourceAdapter
getAccountIterator
in class ResourceAdapterBase
WavesetException
public GenericObject getFeatures()
getFeatures
in interface ResourceAdapter
getFeatures
in class ResourceAdapterBase
ResourceAdapter.Features
public void init() throws java.lang.Exception
init
in interface ActiveSync
java.lang.Exception
public void shutdown()
shutdown
in interface ActiveSync
public java.lang.Object getAttributeValue(java.lang.String name) throws WavesetException
getAttributeValue
in interface ActiveSync
WavesetException
public void setAttributeValue(java.lang.String name, java.lang.Object value) throws WavesetException
setAttributeValue
in interface ActiveSync
WavesetException
public int poll()
poll
in interface ActiveSync
public void callCompleted(com.waveset.adapter.iapi.IAPI call)
If this does not delete the call, there must be something else that deletes it - or it will just go away when it expires.
protected com.waveset.adapter.iapi.IAPI buildEventLegacy(com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRow row, java.lang.String command) throws WavesetException, com.waveset.adapter.iapi.IAPIException
row
- - the data to build an event from. @see UpdateRow
WavesetException
com.waveset.adapter.iapi.IAPIException
protected boolean useLegacyEventGeneration()
protected void processUpdates(com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRows updateRows, java.lang.String command, com.waveset.adapter.iapi.IAPI prox) throws WavesetException, com.waveset.adapter.iapi.IAPIException
WavesetException
com.waveset.adapter.iapi.IAPIException
protected void traceAndLogCommand(long traceLevel, java.lang.String method, int logLevel, com.waveset.adapter.DatabaseTableResourceAdapter.UpdateRow update, java.lang.String command, WavesetResult result)
public WavesetResult activeSyncTestConfiguration() throws WavesetException
WavesetException
protected void traceAndLog(long traceLevel, java.lang.String method, int logLevel, java.lang.String message)
public void addQuotedName(java.lang.StringBuffer b, java.lang.String s)
public static void addQuotedName(java.lang.StringBuffer b, java.lang.String s, java.lang.String quoting)
public java.sql.Connection getConnection() throws WavesetException
getConnection
in class JdbcResourceAdapter
WavesetException
public void closeConnection(java.sql.Connection con)
closeConnection
in class JdbcResourceAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |