|
||||||||||
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.ScriptedJdbcResourceAdapter
The ScriptedJdbcResourceAdapter is used to provision users which are represented as entries in one or more database tables. The adapter is agnostic of the particular table(s) in which the users are represented. The real logic of how to provision the users into the tables is delegated to scripts provided by the customer. The scripts (currently Beanshell and Javascript supported) are passed salient parameters like JDBC connection, user attributes, etc.).
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 |
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 |
DIRECT_MAP_MODE
Possible values for RA_ATTR_MAP_MODE |
static java.lang.String |
RA_ACCT_ITER_ACTIONS
|
static java.lang.String |
RA_ACTIVE_SYNC_ITER_ACTIONS
|
static java.lang.String |
RA_ATTR_MAP_MODE
|
static java.lang.String |
RA_AUTHENTICATION_ACTIONS
|
static java.lang.String |
RA_CREATE_USER_ACTIONS
|
static java.lang.String |
RA_DELETE_USER_ACTIONS
|
static java.lang.String |
RA_DISABLE_USER_ACTIONS
|
static java.lang.String |
RA_ENABLE_USER_ACTIONS
|
static java.lang.String |
RA_GET_USER_ACTIONS
The list of resource attributes which will hold the name of a ResourceAction to accomplish the respective operation. |
static java.lang.String |
RA_LISTALL_ACTIONS
|
static java.lang.String |
RA_TEST_ACTIONS
|
static java.lang.String |
RA_UPDATE_USER_ACTIONS
|
static java.lang.String |
RESOURCE_NAME
|
static java.lang.String |
RESOURCE_USER_FORM
|
static java.lang.String |
STRING_MAP_MODE
|
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 | |
ScriptedJdbcResourceAdapter()
|
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)
|
void |
closeConnection(java.sql.Connection con)
Close a connection, making sure that autocommit is true before closing. |
Resource |
createPrototypeResource()
|
WSUser |
createWSUserFromAttributes(java.lang.String identity,
boolean isDisabled,
java.util.Map attributeValues)
|
AccountIterator |
getAccountIterator()
Return an iterator that will iterate over all the accounts on a resource. |
AccountIterator |
getAccountIterator(java.util.Map options)
Return an iterator that will iterate over all the accounts on a resource. |
java.lang.Object |
getAttributeValue(java.lang.String name)
Required method implementation to get an attribute value. |
java.sql.Connection |
getConnection()
Get a connection to the default database with the proxy user. |
GenericObject |
getFeatures()
Expose features supported by the Resource Adapter. |
protected java.util.List |
getResourceAttributeActions(java.lang.String resAttrName,
boolean required)
|
WSUser |
getUser(WSUser user)
Retrieve information about an account, and package it as a WSUser object. |
void |
init()
Initialize the source adapter. |
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. |
int |
poll()
the poll method. |
protected void |
processUpdates(java.util.List updates,
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)
Needs to be overridden by subclass if default createAccounts() implementation is used. |
protected void |
realCreateOrUpdate(WSUser user,
WavesetResult result,
java.lang.String operation)
This method is called by realCreate and realUpdate |
protected void |
realDelete(WSUser user,
WavesetResult result)
Needs to be overridden by subclass if default deleteAccounts() implementation is used. |
protected void |
realDisable(WSUser user,
WavesetResult result)
|
protected void |
realEnable(WSUser user,
WavesetResult result)
|
protected void |
realUpdate(WSUser user,
WavesetResult result)
Needs to be overridden by subclass if default updateAccounts() implementation is used. |
WSAttributes |
reverseMap(java.util.Map map)
Convert the host attribute map into WSAttributes |
WavesetResult |
run(ResourceAction action,
java.util.Map args)
Runs a ResourceAction with additional args; could be null. |
void |
setAttributeValue(java.lang.String name,
java.lang.Object value)
Required method implementation to set an attribute value. |
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. |
boolean |
supportsAccountDisable()
Indicates whether or not this resource supports account disable. |
boolean |
supportsActions()
|
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,
java.util.Map user,
java.lang.String command,
WavesetResult result)
Log whatever we want to from an update. |
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 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_ATTR_MAP_MODE
public static final java.lang.String DIRECT_MAP_MODE
public static final java.lang.String STRING_MAP_MODE
public static final java.lang.String RA_GET_USER_ACTIONS
public static final java.lang.String RA_CREATE_USER_ACTIONS
public static final java.lang.String RA_UPDATE_USER_ACTIONS
public static final java.lang.String RA_DELETE_USER_ACTIONS
public static final java.lang.String RA_DISABLE_USER_ACTIONS
public static final java.lang.String RA_ENABLE_USER_ACTIONS
public static final java.lang.String RA_AUTHENTICATION_ACTIONS
public static final java.lang.String RA_LISTALL_ACTIONS
public static final java.lang.String RA_ACCT_ITER_ACTIONS
public static final java.lang.String RA_ACTIVE_SYNC_ITER_ACTIONS
public static final java.lang.String RA_TEST_ACTIONS
public static final java.lang.String RESOURCE_NAME
public static final java.lang.String RESOURCE_USER_FORM
Constructor Detail |
public ScriptedJdbcResourceAdapter()
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
public WavesetResult checkUpdateAccount(WSUser user) throws WavesetException
checkUpdateAccount
in interface ResourceAdapter
checkUpdateAccount
in class ResourceAdapterBase
WavesetException
public WavesetResult checkDeleteAccount(WSUser user) throws WavesetException
checkDeleteAccount
in interface ResourceAdapter
checkDeleteAccount
in class ResourceAdapterBase
WavesetException
public WSUser getUser(WSUser user) throws WavesetException
Information required to identify the resource account is supplied in another WSUser object.
The returned user object will resemble the source object, but will have its account attribute list filled in.
getUser
in interface ResourceAdapter
getUser
in class ResourceAdapterBase
WavesetException
protected void realCreate(WSUser user, WavesetResult result) throws WavesetException
ResourceAdapterBase
realCreate
in class ResourceAdapterBase
WavesetException
protected void realUpdate(WSUser user, WavesetResult result) throws WavesetException
ResourceAdapterBase
realUpdate
in class ResourceAdapterBase
WavesetException
protected void realDelete(WSUser user, WavesetResult result) throws WavesetException
ResourceAdapterBase
realDelete
in class ResourceAdapterBase
WavesetException
protected void realEnable(WSUser user, WavesetResult result) throws WavesetException
realEnable
in class ResourceAdapterBase
WavesetException
protected void realDisable(WSUser user, WavesetResult result) throws WavesetException
realDisable
in class ResourceAdapterBase
WavesetException
public boolean supportsActions()
supportsActions
in interface ResourceAdapter
supportsActions
in class ResourceAdapterBase
public WavesetResult run(ResourceAction action, java.util.Map args) throws WavesetException
run
in interface ResourceAdapter
run
in class ResourceAdapterBase
action
- the action to runargs
- passed to the action script; can be null
WavesetException
public WavesetResult authenticate(java.util.HashMap loginInfo) throws WavesetException
ResourceAdapter
authenticate
in interface ResourceAdapter
authenticate
in class ResourceAdapterBase
WavesetException
public GenericObject getFeatures()
ResourceAdapterBase
getFeatures
in interface ResourceAdapter
getFeatures
in class ResourceAdapterBase
ResourceAdapter.Features
public boolean supportsAccountDisable()
ResourceAdapter
supportsAccountDisable
in interface ResourceAdapter
supportsAccountDisable
in class ResourceAdapterBase
public WSUser createWSUserFromAttributes(java.lang.String identity, boolean isDisabled, java.util.Map attributeValues) throws WavesetException
createWSUserFromAttributes
in interface com.waveset.adapter.script.ScriptedAdapter
WavesetException
public WSAttributes reverseMap(java.util.Map map) throws WavesetException
map
- Map of host field names and values
WavesetException
protected java.util.List getResourceAttributeActions(java.lang.String resAttrName, boolean required) throws WavesetException
resAttrName
-
WavesetException
public WavesetResult testConfiguration() throws WavesetException
ResourceAdapterBase
testConfiguration
in interface ResourceAdapter
testConfiguration
in class ResourceAdapterBase
WavesetException
public java.util.ArrayList listAllObjects(java.lang.String resourceObjectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword) throws WavesetException
ResourceAdapter
listAllObjects
in interface ResourceAdapter
listAllObjects
in class ResourceAdapterBase
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(ACCOUNT)
should return a list of all account names.options
- - a map of optionsrunAsUser
- - (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.
WavesetException
protected void realCreateOrUpdate(WSUser user, WavesetResult result, java.lang.String operation) throws WavesetException
WavesetException
public AccountIterator getAccountIterator() throws WavesetException
getAccountIterator
in interface ResourceAdapter
getAccountIterator
in class ResourceAdapterBase
WavesetException
public AccountIterator getAccountIterator(java.util.Map options) throws WavesetException
getAccountIterator
in interface ResourceAdapter
getAccountIterator
in class ResourceAdapterBase
WavesetException
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
protected void processUpdates(java.util.List updates, java.lang.String command, com.waveset.adapter.iapi.IAPI prox) throws WavesetException, com.waveset.adapter.iapi.IAPIException
WavesetException
com.waveset.adapter.iapi.IAPIException
public void closeConnection(java.sql.Connection con)
closeConnection
in class JdbcResourceAdapter
public java.sql.Connection getConnection() throws WavesetException
getConnection
in class JdbcResourceAdapter
WavesetException
protected void traceAndLogCommand(long traceLevel, java.lang.String method, int logLevel, java.util.Map user, java.lang.String command, WavesetResult result)
protected void traceAndLog(long traceLevel, java.lang.String method, int logLevel, java.lang.String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |