com.waveset.adapter
Class LDAPActiveSyncAdapterBase

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.LDAPResourceAdapterBase
          extended bycom.waveset.adapter.LDAPResourceAdapter
              extended bycom.waveset.adapter.LDAPActiveSyncAdapterBase
All Implemented Interfaces:
ActiveSync, ResourceAdapter
Direct Known Subclasses:
LDAPChangeLogActiveSyncAdapter, LDAPListenerActiveSyncAdapter, LDAPRoleSyncAdapter

public abstract class LDAPActiveSyncAdapterBase
extends LDAPResourceAdapter
implements ActiveSync

This is the base class for LDAP Active Sync adapters. It has the basic methods implemented for propogating changes - derived classes need to implement at least the method getUpdateRows to return changed objects that need to be synchronized. They also need to implement the staticCreatePrototypeResource method to provide XML for a blank resource. The updates that are received will be fetched from the LDAP server and an IAPI update built and submitted.


Nested Class Summary
protected  class LDAPActiveSyncAdapterBase.UpdateRow
          A row of data returned by getUpdateRows
protected  class LDAPActiveSyncAdapterBase.UpdateRows
          Returned by getUpdateRows, this has a list of rows to update and a single row that is the "last one" to be saved for the next search so that we know where to start from.
 
Nested classes inherited from class com.waveset.adapter.LDAPResourceAdapterBase
LDAPResourceAdapterBase.AcctIter, LDAPResourceAdapterBase.BlockAcctIter, LDAPResourceAdapterBase.VLVAcctIter
 
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 RA_ACTIVE_SYNC_OBJECT_CLASSES
           
static java.lang.String RA_ATTRIBUTE_FILTER
           
static java.lang.String RA_BLOCKSIZE
           
static java.lang.String RA_CHANGE_NUMBER_ATTRIBUTE_NAME
           
static java.lang.String RA_PROCESS_NAME
          deprecated As of IdM 5.5.
 
Fields inherited from class com.waveset.adapter.LDAPResourceAdapter
RA_ENABLE_PASSWORD_SYNC, RA_FILTER_CHANGES_BY, RA_LDAP_ACTIVATION, RA_LDAP_ACTIVATION_PARM, RA_OR_SEARCH_PARAMS_FILTER, RA_PASSWORD_ENCRYPTION_IV, RA_PASSWORD_ENCRYPTION_KEY, RA_PASSWORD_HASH_ALG
 
Fields inherited from class com.waveset.adapter.LDAPResourceAdapterBase
_accountActivator, _ctx, _encodePwd, ALL_NON_OPERATIONAL_ATTRIBUTES, LDAP_GROUPS_ATTR_NAME, LDAP_SEARCH_ATTRIBUTE_NAMES, LDAP_SEARCH_END_DATE, LDAP_SEARCH_FILTER_STRING, LDAP_SEARCH_OBJECT_CLASSES, LDAP_SEARCH_START_DATE, MICROSOFT, NETSCAPE, OPENLDAP, POSIX_GROUPS_ATTR_NAME, RA_ACTIVE_SYNC_LDAP_FILTER, RA_ENABLE_CONNECTION_POOLING, RA_GROUP_OBJCLASS, RA_GRP_MBR_ATTR, RA_HOST, RA_INCL_OBJCLASSES_IN_SEARCH_FILTER, RA_LDAP_SEARCH_FILTER, RA_MOD_NAMING_ATTR, RA_PASSWORD, RA_PORT, RA_SSL, RA_USE_BLOCKS, RA_USERDN, RA_VLV_SORT_ATTRIBUTE, RA_WSNAME, SUN, UNDISCOVERED, UNKNOWN
 
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
LDAPActiveSyncAdapterBase()
           
LDAPActiveSyncAdapterBase(Resource res, ObjectCache cache)
           
 
Method Summary
protected static void addResourceAttributes(Resource res)
          Add the resource attributes common to derived adapter classes.
protected  com.waveset.adapter.iapi.IAPI buildEvent(LDAPActiveSyncAdapterBase.UpdateRow row)
          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.
protected  WSUser fetchUser(GenericObject changeLogEntry)
          Take a change log entry and get the object associated with it.
 java.lang.Object getAttributeValue(java.lang.String name)
          Get or set an attribute value for the ActiveSync.
protected  GenericObject getLDIFAttributeValue(java.util.StringTokenizer st)
          Attributes can be single valued like name: value or multivalued name: value\nname: value2.
protected  GenericObject getRootDSE()
          Get the root DSE and extract some needed attributes about the changelog.
 void init()
          initialize yourself.
protected  void logUpdate(int level, LDAPActiveSyncAdapterBase.UpdateRow update, WavesetResult result)
          Log whatever we want to from an update.
 int poll()
          the poll method.
protected  void processUpdates(java.util.List list)
          Take a list of Maps that are rows of the audit data and turn them into IAPI calls.
 void setAttributeValue(java.lang.String name, java.lang.Object value)
           
 void setResource(Resource r)
           
 void shutdown()
          shutdown
static Resource staticCreatePrototypeResource()
          Override this method - it should be abstract but static and abstract are conflicting.
 
Methods inherited from class com.waveset.adapter.LDAPResourceAdapter
addAttributes, createPrototypeResource, getAccountActivator
 
Methods inherited from class com.waveset.adapter.LDAPResourceAdapterBase
addUserToGroup, addUserToGroup, addUserToGroups, addUserToGroups, authenticate, buildBaseUrl, buildBaseUrl, buildEvent, checkCreateAccount, checkDeleteAccount, checkUpdateAccount, closeConnection, constructAccountFilter, constructAccountFilter, constructObjectClassFilter, createAccounts, createObject, deleteAccounts, deleteObject, doCreateOrUpdateObjectRequest, doCreateOrUpdateObjectRequest, encodePwd, ensureObjectClassInSchemaMap, fetchUser, getAccountAttributes, getAccountIterator, getAccountIterator, getBaseContextAttrName, getBaseContexts, getContextEnv, getFeatures, getGroups, getGroups, getLdapAccountAttributeNames, getLdapAccountAttributeNamesForQuery, getLDAPAttributes, getLDAPAttributes, getLDAPAttributes, getObject, getrn, getServerVendor, getUser, getUser, getUser, getUserCheckForDisabled, isAccountObjectType, isPoolingEnabled, listAllObjects, listObjects, logUpdate, makeConnection, makeConnection, makeUnpooledConnection, mapLDAPAttributes, mapLDAPAttributes, mapLDAPAttributes, modifyObject, namesEqual, parseAttrValue, parseOutRDN, realCreate, realDelete, realDisable, realEnable, realUpdate, removeAttributeDelta, removeNameFromAttribute, removeNameFromAttribute, removeUserFromAllGroups, removeUserFromAllGroups, removeUserFromGroup, removeUserFromGroup, removeUserFromGroups, removeUserFromGroups, renameUserAcrossGroups, renameUserAcrossGroups, renameUserAcrossPosixGroups, setLdapObjectAttribute, setLdapObjectAttributeMultivalued, setLdapObjectAttributeMultivalued, startConnection, stopConnection, supportsAccountDisable, supportsExcludedAccounts, testConfiguration, updateAccounts, updateObject, userActivation
 
Methods inherited from class com.waveset.adapter.ResourceAdapterBase
checkForNoPasswordInSchema, checkSyntax, createAccount, createIdentity, deleteAccount, deleteAccount, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountIterator, getAction, getActionNotFoundErrorMessage, getActionNotFoundMessage, getActionRunAsPassword, getActionRunAsUser, getActionTimeout, getActionType, getAdapter, getAdapter, getAdapter, getAdapterProxy, getAdapterProxy, getAllAccounts, getAttrNameFromMapName, getAttrNameFromMapName, getAttrParse, getAttrTypeFromMapName, getAttrTypeFromMapName, getAUserName, getBaseContextObject, getBlockSize, getContext, getExcludedAccountsRule, getIdentity, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, getOptionalBooleanResAttrVal, getOptionalBooleanResAttrVal, getOptionalEncryptedResAttrVal, getOptionalResAttrVal, getOptionalStringResAttrVal, getRequiredResAttr, getRequiredResAttr, getRequiredResAttrVal, getRequiredResAttrVal, getRequiredResAttrVals, getRequiredUserAttributeNames, getResAttrValActionOnUser, getResAttrVals, getResource, getResourceAccounts, getResourceInfo, getResourceObjectAttrValNameAttr, getResourceObjectClassAttr, getResourceObjectTypePrefix, getSchemaMap, getWSAttrByMapName, getWSAttrByMapName, getWSAttrFromMap, handleActionResult, handleJavascriptActionResult, isAccountAttributeSecret, isExcludedAccount, isExcludedAccount, isFeatureEnabled, isSupported, isTestMode, listAllObjects, listObjects, listObjectsOfType, lookupAction, lookupAction, lookupActions, objectClassesMatchType, println, restoreResourceObjectClassAttr, run, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnectionWrapper, supportsAccountActions, supportsActions, supportsCaseInsensitiveAccountIds, supportsContainerObjectTypes, supportsResourceAccount, supportsScanning, updateAccount, 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_BLOCKSIZE

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

RA_CHANGE_NUMBER_ATTRIBUTE_NAME

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

RA_ACTIVE_SYNC_OBJECT_CLASSES

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

RA_ATTRIBUTE_FILTER

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

RA_PROCESS_NAME

public static final java.lang.String RA_PROCESS_NAME
deprecated As of IdM 5.5. Use RA_PROCESS_RULE instead.

See Also:
Constant Field Values
Constructor Detail

LDAPActiveSyncAdapterBase

public LDAPActiveSyncAdapterBase(Resource res,
                                 ObjectCache cache)

LDAPActiveSyncAdapterBase

public LDAPActiveSyncAdapterBase()
Method Detail

setResource

public void setResource(Resource r)
Specified by:
setResource in interface ResourceAdapter
Overrides:
setResource in class ResourceAdapterBase

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Override this method - it should be abstract but static and abstract are conflicting.

Throws:
WavesetException

addResourceAttributes

protected static void addResourceAttributes(Resource res)
                                     throws WavesetException
Add the resource attributes common to derived adapter classes.

Throws:
WavesetException

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
                                   throws WavesetException
Description copied from interface: ActiveSync
Get or set an attribute value for the ActiveSync. Setting an attribute value only changes the in-memory copy of the attribute, not the persistent value. Set is typically only used for status or scheduling updates.

Specified by:
getAttributeValue in interface ActiveSync
Overrides:
getAttributeValue in class LDAPResourceAdapterBase
Throws:
WavesetException

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
                       throws WavesetException
Specified by:
setAttributeValue in interface ActiveSync
Overrides:
setAttributeValue in class LDAPResourceAdapterBase
Throws:
WavesetException

init

public void init()
          throws java.lang.Exception
initialize yourself. throw exception if initialization failed

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

shutdown

public void shutdown()
Description copied from interface: ActiveSync
shutdown

Specified by:
shutdown in interface ActiveSync
Overrides:
shutdown in class LDAPResourceAdapterBase

getRootDSE

protected GenericObject getRootDSE()
                            throws WavesetException
Get the root DSE and extract some needed attributes about the changelog. The method looks a little strange, but seems to be the only one supported for getting this configuration information.

Overrides:
getRootDSE in class LDAPResourceAdapterBase
Throws:
WavesetException

buildEvent

protected com.waveset.adapter.iapi.IAPI buildEvent(LDAPActiveSyncAdapterBase.UpdateRow row)
                                            throws WavesetException,
                                                   com.waveset.adapter.iapi.IAPIException
Extract the user identity information and attributes, create an IAPIUser object to update Lighthouse, and return it.

Throws:
WavesetException
com.waveset.adapter.iapi.IAPIException

processUpdates

protected void processUpdates(java.util.List list)
                       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.

Overrides:
processUpdates in class LDAPResourceAdapterBase
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
Overrides:
poll in class LDAPResourceAdapterBase
Returns:
0 if no work done, n if n calls processed

logUpdate

protected void logUpdate(int level,
                         LDAPActiveSyncAdapterBase.UpdateRow update,
                         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.

Overrides:
callCompleted in class LDAPResourceAdapterBase
Parameters:
call -
See Also:


fetchUser

protected WSUser fetchUser(GenericObject changeLogEntry)
                    throws WavesetException
Take a change log entry and get the object associated with it.

Overrides:
fetchUser in class LDAPResourceAdapterBase
Throws:
WavesetException

getLDIFAttributeValue

protected GenericObject getLDIFAttributeValue(java.util.StringTokenizer st)
Attributes can be single valued like name: value or multivalued name: value\nname: value2. In either case they are terminated by a line \n- \n. Return a String for single valued attrs, a List of String for multiple values. Assume that the passed-in tokenizer is at the first name/value pair, tokenizes on \n and should consume the training \n- \n line.

Overrides:
getLDIFAttributeValue in class LDAPResourceAdapterBase