com.waveset.adapter
Class MIISResourceAdapter

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

public class MIISResourceAdapter
extends JdbcResourceAdapter
implements ActiveSync

Note: Although MIISResourceAdapter implements ActiveSync, the functionality is not supported, and syncSource='false'. The interface is needed for _util which is used throughout the ActiveSync methods located at the end of the file.


Nested Class Summary
static class MIISResourceAdapter.DatabaseTableAccountIterator
          The implementation of the AccountIterator returned by getAccountIterator.
 
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 RA_DISABLE_VALUE
           
static java.lang.String RA_ENABLE_DISABLE_COLUMN
           
static java.lang.String RA_ENABLE_VALUE
           
static java.lang.String RA_KEY_COLUMN
           
static java.lang.String RA_PASS_THROUGH_AUTH_RESOURCE
           
static java.lang.String RA_PASSWORD_COLUMN
           
static java.lang.String RA_REMOVE_ROW
           
static java.lang.String RA_TABLE
           
static java.lang.String RA_USE_GUID
           
 
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.ActiveSync
ACTIVE_SYNC_EVENT_RES_ATTRS_XML, ACTIVE_SYNC_STD_RES_ATTRS_XML, ATTR_IS_DELETED, DATE_FORMAT, DATE_TIME_FORMAT, RA_APPLY_META_VIEW, RA_ASSIGN_SOURCE_ON_CREATE, RA_CONFIRMATION_RULE, RA_CORRELATION_RULE, RA_CREATE_UNMATCHED, RA_DELETE_RULE, RA_FORM, RA_ID, RA_IDM_NAME_RULE, RA_LEGACY_EVENT_GEN, RA_LOG_LEVEL, RA_LOG_PATH, RA_LOG_SIZE, RA_MAX_AGE_LENGTH, RA_MAX_AGE_UNIT, RA_MAX_ARCHIVES, RA_NAME, RA_PARAMETERIZED_INPUT_FORM, RA_POPULATE_GLOBAL, RA_POSTPOLL_WORKFLOW, RA_PREPOLL_WORKFLOW, RA_PROCESS_RULE, RA_PROXY_ADMINISTRATOR, RA_RESET_TO_TODAY, RA_RESOLVE_PROCESS_RULE, RA_SCHEDULE_INTERVAL, RA_SCHEDULE_INTERVAL_COUNT, RA_SCHEDULE_START_DATE, RA_SCHEDULE_START_TIME, RA_SYNC_CONFIG_MODE, RA_SYNC_POST_PROCESS_FORM, RA_UPDATE_IF_DELETE, RA_USE_INPUT_FORM, TIME_FORMAT, TRACE_LEVEL_DEBUG, TRACE_LEVEL_ERROR, TRACE_LEVEL_INFO, TRACE_LEVEL_NONE, TRACE_LEVEL_WARNING
 
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
MIISResourceAdapter()
           
 
Method Summary
 WavesetResult authenticate(java.util.HashMap loginInfo)
          Check to see if a user account and password is valid.
protected  com.waveset.adapter.iapi.IAPI buildEvent(com.waveset.adapter.MIISResourceAdapter.UpdateRow row, java.lang.String command)
          Extract the user identity information and attributes, create an IAPIUser object to update Lighthouse, and return it.
 void callCompleted(com.waveset.adapter.iapi.IAPI call)
          An call generated by this resource adapter has completed.
 WavesetResult checkCreateAccount(WSUser user)
          Check to see if an account can be created.
 WavesetResult checkDeleteAccount(WSUser user)
          Check account deletion.
 WavesetResult checkUpdateAccount(WSUser user)
          Check to see if an account can be updated.
protected  void connect()
           
protected  void createNewResourceAccount(WSUser user, WavesetResult result)
          Create a new account.
 Resource createPrototypeResource()
           
protected  void disconnect()
           
 AccountIterator getAccountIterator()
          Return an iterator that will iterate over all the accounts on a resource.
 AccountIterator getAccountIterator(java.util.Map filterParams)
          Like getAccountIterator but takes a Map param.
 java.lang.Object getAttributeValue(java.lang.String name)
          Required method implementation to get an attribute value.
protected  java.lang.String getEnableDisableColumnName()
           
protected  java.lang.String getLoginAttrName(java.lang.String key)
          Get the attribute name to use for the login info key that is passed in.
 WSUser getUser(WSUser idUser)
          Public adapter method to get the current user information.
 WSUser getUser(WSUser idUser, boolean strict)
          Public adapter method to get the current user information.
 void init()
          Initialize the source adapter.
protected  void logCommand(int level, com.waveset.adapter.MIISResourceAdapter.UpdateRow update, java.lang.String command, WavesetResult result)
          Log whatever we want to from an update.
 int poll()
          the poll method.
protected  void processUpdates(java.util.List list, java.lang.String command)
          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 realDisable(WSUser user, WavesetResult result)
           
protected  void realEnable(WSUser user, WavesetResult result)
           
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.
 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()
          Whether the resource can enable and disable accounts.
protected  void updateResourceAccount(java.lang.String id, java.util.Map map)
           
 
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, 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, 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, listAllObjects, listObjects, 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, 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_TABLE

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

RA_KEY_COLUMN

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

RA_PASSWORD_COLUMN

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

RA_ENABLE_DISABLE_COLUMN

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

RA_REMOVE_ROW

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

RA_PASS_THROUGH_AUTH_RESOURCE

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

RA_ENABLE_VALUE

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

RA_DISABLE_VALUE

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

RA_USE_GUID

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

DEFAULT_PORT

public static final java.lang.String DEFAULT_PORT
The default connect DB Server Port.

See Also:
Constant Field Values

DEFAULT_DRIVER

public static final java.lang.String DEFAULT_DRIVER
The default value for the RA_DRIVER resource attribute.

See Also:
Constant Field Values

DEFAULT_TEMPLATE

public static final java.lang.String DEFAULT_TEMPLATE
The default connect URL template.

See Also:
Constant Field Values
Constructor Detail

MIISResourceAdapter

public MIISResourceAdapter()
Method Detail

staticCreatePrototypeResource

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

Throws:
WavesetException

createPrototypeResource

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

startConnection

public 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

public 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

checkCreateAccount

public WavesetResult checkCreateAccount(WSUser user)
                                 throws WavesetException
Check to see if an account can be created. We ping the server and see if the user already exists.

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

createNewResourceAccount

protected void createNewResourceAccount(WSUser user,
                                        WavesetResult result)
                                 throws WavesetException
Create a new account.

Throws:
WavesetException

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Create a new account.

Overrides:
realCreate in class ResourceAdapterBase
Throws:
WavesetException

checkUpdateAccount

public WavesetResult checkUpdateAccount(WSUser user)
                                 throws WavesetException
Check to see if an account can be updated. We ping the server and see if the user exists.

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

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Update a user

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 for real.

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

getUser

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

Throws:
WavesetException

getEnableDisableColumnName

protected java.lang.String getEnableDisableColumnName()

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
Overrides:
realEnable in class ResourceAdapterBase
Throws:
WavesetException

realDisable

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

updateResourceAccount

protected void updateResourceAccount(java.lang.String id,
                                     java.util.Map map)
                              throws WavesetException
Throws:
WavesetException

getLoginAttrName

protected java.lang.String getLoginAttrName(java.lang.String key)
Get the attribute name to use for the login info key that is passed in. This basically maps login info keys to attribute names that will be used by the resource.


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

getAccountIterator

public AccountIterator getAccountIterator()
                                   throws WavesetException
Return an iterator that will iterate over all the accounts on a resource.

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

getAccountIterator

public AccountIterator getAccountIterator(java.util.Map filterParams)
                                   throws WavesetException
Description copied from interface: ResourceAdapter
Like getAccountIterator but takes a Map param. Supported entries are: "Search Filter String" : a String to put in the LDAP search filter. For standard object types (group, user), this will be appended in a string like (&(objectclass=class))

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

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
                                   throws WavesetException
Required method implementation to get an attribute value. Since this is a source with a resource, this just a pass-thru method to get resource attribute values.

Specified by:
getAttributeValue in interface ActiveSync
Throws:
WavesetException

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
                       throws WavesetException
Required method implementation to set an attribute value. Since this is a source with a resource, this just a pass-thru method to set resource attribute values. This is an "in memory" change only.

Specified by:
setAttributeValue in interface ActiveSync
Throws:
WavesetException

init

public void init()
          throws java.lang.Exception
Initialize the source adapter. Throw exception if initialization failed and the adapter will not be loaded. After init, poll() will be called at each scheduling interval and shutdown() when the adapter is unloaded.

Specified by:
init in interface ActiveSync
Throws:
java.lang.Exception

shutdown

public void shutdown()
Called once when the adapter is unloaded. This is where you can cleanup sockets, etc. If the server is just shutdown, though, this is not called.

Specified by:
shutdown in interface ActiveSync

connect

protected void connect()
                throws WavesetException
Throws:
WavesetException

disconnect

protected void disconnect()

buildEvent

protected com.waveset.adapter.iapi.IAPI buildEvent(com.waveset.adapter.MIISResourceAdapter.UpdateRow row,
                                                   java.lang.String command)
                                            throws WavesetException,
                                                   com.waveset.adapter.iapi.IAPIException
Extract the user identity information and attributes, create an IAPIUser object to update Lighthouse, and return it. The attributes that are placed in the IAPI object will end up in the resource form under the global namespace. For example, if the following code is used: Map attrs = new HashMap; attrs.put("name","bob"); IAPI iapi = IAPIFactory.getIAPIUser(null, userMap,IAPIUser.COMMAND_UPDATE,(ResourceAdapterBase)this); in the form, you could have a field like: global.name and username would get the name bob.

Parameters:
row - - the data to build an event from. @see UpdateRow
Returns:
an IAPI object ready for submit(). Return null if this event should be dropped.
Throws:
WavesetException
com.waveset.adapter.iapi.IAPIException

processUpdates

protected void processUpdates(java.util.List list,
                              java.lang.String command)
                       throws WavesetException,
                              com.waveset.adapter.iapi.IAPIException
Take a list of Maps that are rows of the audit data and turn them into IAPI calls.

Parameters:
list - - a List of UpdateRow objects from getUpdateRows.
Throws:
WavesetException
com.waveset.adapter.iapi.IAPIException

poll

public int poll()
the poll method. Called at a configurable interval, this polls the remote resource for changes, converts them to IAPI calls, and posts them back to the server.

Specified by:
poll in interface ActiveSync
Returns:
0 if no work done, n if n calls processed

logCommand

protected void logCommand(int level,
                          com.waveset.adapter.MIISResourceAdapter.UpdateRow update,
                          java.lang.String command,
                          WavesetResult result)
Log whatever we want to from an update.


callCompleted

public void callCompleted(com.waveset.adapter.iapi.IAPI call)
An call generated by this resource adapter has completed. Check the result of the call, propogate the result back to the source (like updating a column in a database), and delete it if we are done.

If this does not delete the call, there must be something else that deletes it - or it will just go away when it expires.

See Also:
IAPI