com.waveset.adapter
Class SmartRolesResourceAdapter

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

public class SmartRolesResourceAdapter
extends ResourceAdapterBase
implements ActiveSync


Nested Class Summary
 class SmartRolesResourceAdapter.AcctIter
           
static class SmartRolesResourceAdapter.DataSourceIterator
          Wraps the ENDataSource object with an iterator interface in order to hide the paging that is part of the ENDataSource interface.
 
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 ATTR_ALL_ROLES
          Account attribute that contains the list of all roles that an account has.
static java.lang.String ATTR_DEPARTMENTS
          Account attribute that contains the departments that the account is a member of.
static java.lang.String ATTR_DERIVED_ROLES
          Account attribute that contains the list of roles that the account receives indirectly.
static java.lang.String ATTR_ENTITY_ID
          Account attribute that is the Universal ID (guid) of the Person.
static java.lang.String ATTR_FINANCIAL_GROUPS
          Account attribute that contains the financial groups that the account is a member of.
static java.lang.String ATTR_FINANCIAL_TEAMS
          Account attribute that contains the financial teams that the account is a member of.
static java.lang.String ATTR_FIRST_NAME
          This is a required attribute.
static java.lang.String ATTR_GRANT_ACCESS
          Boolean account attribute that determines whether a SmartRoles account can log into SmartRoles or not.
static java.lang.String ATTR_GRANTED_ROLES
          Account attribute that contains the list of roles that have been granted directly to an account.
static java.lang.String ATTR_GRANTED_ROLES_SPHERE
          Read/write attribute that contains the list of granted roles and the sphere of control (organizations) for each role.
static java.lang.String ATTR_GROUPS
          Account attribute that contains the groups that the account is a member of.
static java.lang.String ATTR_LAST_NAME
          This is a required attribute.
static java.lang.String ATTR_MIDDLE_NAME
           
static java.lang.String ATTR_ORGANIZATIONS
          Read/write attribute containing a person's organizational memberships.
static java.lang.String ATTR_POSITIONS
          Read/write attribute containing a person's assigned positions and organizations that position should be assigned to.
static java.lang.String ATTR_PREFERRED_NAME
          Defaults to "first_name plus last_name" according to SmartRoles javadoc.
static java.lang.String ATTR_REMOVE_WORKER
          Boolean account attribute that when set to true, will remove the Worker object associated with an account (Person).
static java.lang.String ATTR_TEAMS
          Account attribute that contains the teams that the account is a member of.
static java.lang.String ATTR_WORKER_TYPE
          Account attribute that determines whether or not a Worker object will be created an associated with the account (Person).
static java.lang.String code_id
           
static java.lang.String DISPLAY_PASSWORD
           
static java.lang.String DISPLAY_USER
           
static java.lang.String GO_ATTR_POSITIONS
           
static java.lang.String GO_ATTR_ROLES
           
static java.lang.String LOGIN_PASSWORD
           
static java.lang.String LOGIN_USER
          Pass thru authentication variables.
static java.lang.String OBJECT_TYPE_ORG
           
static java.lang.String OBJECT_TYPE_ROLE
           
static java.lang.String OPT_NAME_ATTRIBUTE
           
static java.lang.String RA_ACCT_ID_ATTR
          Resource attribute that specified the name of the attribute that is used for the ResourceInfo.accountId and the name of the WSUser when there isn't one already.
static java.lang.String RA_GENERATED_UIDS
           
static java.lang.String RA_HOST
          Resource attributes are the common names that will be visible in the GUI that will prompt the user for values.
static java.lang.String RA_PASSWORD
           
static java.lang.String RA_PORT
          The port on which to communicate to the resource.
static java.lang.String RA_USER
          The account name used to connect to the resource.
static java.lang.String RESOURCE_NAME
           
static java.lang.String RESOURCE_TYPE
           
 
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
SmartRolesResourceAdapter()
           
SmartRolesResourceAdapter(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)
           
 WavesetResult createObject(GenericObject object, java.util.Map options)
          Creates the specified objectId of type objectType using the list of attributes provided.
 Resource createPrototypeResource()
           
 WavesetResult deleteObject(GenericObject object, java.util.Map options)
          Deletes the requested objectId of the requested objectType from the resource
protected  WavesetResult doCreateOrUpdateObjectRequest(java.lang.String objectType, java.lang.String objectId, GenericObject attributes, java.util.Map options, java.lang.String cmd)
           
 WSAttributes getAccountAttributes(java.lang.String accountIdentity)
          This method is obsolete.
 AccountIterator getAccountIterator()
           
 java.lang.Object getAttributeValue(java.lang.String name)
          These are methods implemented in sources to get and set attributes.
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
 GenericObject getObject(java.lang.String objectType, java.lang.String objectId, java.util.List attrsToGet, java.util.Map options)
          Returns the requested objectId of the requested objectType from the resource
 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 objectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword)
          This method will return a list of object names of the specified object type.
 java.util.List listObjects(java.lang.String objectType, java.util.Map options)
          Returns a list of objects matching the requested objectType and options
protected  void logUpdate(int level, java.util.Map update, WavesetResult result)
          Log whatever we want to from an update.
 int poll()
          Called at a configurable interval, this polls the remote resource for changes, converts them to IAPI calls, and posts them back to the server.
protected  int processUpdates(java.util.List list)
          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 user account on the resource
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.
 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)
          These are methods implemented in sources to get and set attributes.
 void shutdown()
          Called once when the adapter is unloaded.
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()
          This method indicates to the server that this resource natively supports account enable and disable.
 boolean supportsActions()
           
 boolean supportsCaseInsensitiveAccountIds()
          This method will return whether the resource adapter supports case insensitive account Ids or not.
 boolean supportsExcludedAccounts()
           
 WavesetResult testConfiguration()
          Default implementation of test method, calls check create.
 WavesetResult updateObject(GenericObject object, java.util.Map options)
          Updates the specified objectId of type objectType using the list of attributes provided.
 
Methods inherited from class com.waveset.adapter.ResourceAdapterBase
checkForNoPasswordInSchema, checkSyntax, createAccount, createAccounts, createIdentity, deleteAccount, deleteAccount, deleteAccounts, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountIterator, 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, getIdentity, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, 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, listObjectsOfType, lookupAction, lookupAction, lookupActions, namesEqual, objectClassesMatchType, println, restoreResourceObjectClassAttr, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnectionWrapper, supportsAccountActions, supportsContainerObjectTypes, supportsResourceAccount, supportsScanning, updateAccount, updateAccounts, 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

ATTR_ALL_ROLES

public static final java.lang.String ATTR_ALL_ROLES
Account attribute that contains the list of all roles that an account has. Includes both derived (indirect) roles and granted (direct) roles. This attribute cannot be changed directly. Only granted roles can be modified directly through the account.

See Also:
Constant Field Values

ATTR_GRANTED_ROLES

public static final java.lang.String ATTR_GRANTED_ROLES
Account attribute that contains the list of roles that have been granted directly to an account. This attribute cannot be modified to change the roles granted directly to an account. Use ATTR_GRANTED_ROLES_SPHERE.

See Also:
Constant Field Values

ATTR_GRANTED_ROLES_SPHERE

public static final java.lang.String ATTR_GRANTED_ROLES_SPHERE
Read/write attribute that contains the list of granted roles and the sphere of control (organizations) for each role. The roles are directly granted to the person object. It is a complex (generic) attribute with the following schema: roles[*] roleName organizations - list of controlled organizations

See Also:
Constant Field Values

ATTR_DERIVED_ROLES

public static final java.lang.String ATTR_DERIVED_ROLES
Account attribute that contains the list of roles that the account receives indirectly. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_POSITIONS

public static final java.lang.String ATTR_POSITIONS
Read/write attribute containing a person's assigned positions and organizations that position should be assigned to. It is a complex (generic) attribute with the following schema: positions[*] title jobCode duties organizations[*] orgName memberRoles (list) duties

See Also:
Constant Field Values

ATTR_ORGANIZATIONS

public static final java.lang.String ATTR_ORGANIZATIONS
Read/write attribute containing a person's organizational memberships. It is a complex (generic) attribute with the following schema: organizations[*] orgName memberRoles (list) duties viaWorker - "true" when the org membership is through the Worker

See Also:
Constant Field Values

ATTR_DEPARTMENTS

public static final java.lang.String ATTR_DEPARTMENTS
Account attribute that contains the departments that the account is a member of. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_FINANCIAL_GROUPS

public static final java.lang.String ATTR_FINANCIAL_GROUPS
Account attribute that contains the financial groups that the account is a member of. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_FINANCIAL_TEAMS

public static final java.lang.String ATTR_FINANCIAL_TEAMS
Account attribute that contains the financial teams that the account is a member of. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_GROUPS

public static final java.lang.String ATTR_GROUPS
Account attribute that contains the groups that the account is a member of. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_TEAMS

public static final java.lang.String ATTR_TEAMS
Account attribute that contains the teams that the account is a member of. This attribute cannot be modified.

See Also:
Constant Field Values

ATTR_REMOVE_WORKER

public static final java.lang.String ATTR_REMOVE_WORKER
Boolean account attribute that when set to true, will remove the Worker object associated with an account (Person). This is a write-only attribute.

See Also:
Constant Field Values

ATTR_ENTITY_ID

public static final java.lang.String ATTR_ENTITY_ID
Account attribute that is the Universal ID (guid) of the Person. It is an optional attribute; SmartRoles will generate one if it is not specified.

See Also:
Constant Field Values

ATTR_FIRST_NAME

public static final java.lang.String ATTR_FIRST_NAME
This is a required attribute.

See Also:
Constant Field Values

ATTR_LAST_NAME

public static final java.lang.String ATTR_LAST_NAME
This is a required attribute.

See Also:
Constant Field Values

ATTR_MIDDLE_NAME

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

ATTR_PREFERRED_NAME

public static final java.lang.String ATTR_PREFERRED_NAME
Defaults to "first_name plus last_name" according to SmartRoles javadoc.

See Also:
Constant Field Values

ATTR_GRANT_ACCESS

public static final java.lang.String ATTR_GRANT_ACCESS
Boolean account attribute that determines whether a SmartRoles account can log into SmartRoles or not. This attribute is set to false to disable an account.

See Also:
Constant Field Values

ATTR_WORKER_TYPE

public static final java.lang.String ATTR_WORKER_TYPE
Account attribute that determines whether or not a Worker object will be created an associated with the account (Person). Allowable types are "REGULAR", "TEMP", "AGN_TEMP" (Agency Temporary), and "CONTR" (Independent Contractor).

See Also:
Constant Field Values

OBJECT_TYPE_ORG

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

OBJECT_TYPE_ROLE

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

OPT_NAME_ATTRIBUTE

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

GO_ATTR_ROLES

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

GO_ATTR_POSITIONS

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

RA_HOST

public static final java.lang.String RA_HOST
Resource attributes are the common names that will be visible in the GUI that will prompt the user for values. For example, the GUI will show "host" and have a box next to it for the user to enter a host name. The name of the host used to communicate with the resource.

See Also:
Constant Field Values

RA_PORT

public static final java.lang.String RA_PORT
The port on which to communicate to the resource.

See Also:
Constant Field Values

RA_USER

public static final java.lang.String RA_USER
The account name used to connect to the resource.

See Also:
Constant Field Values

RA_PASSWORD

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

RA_ACCT_ID_ATTR

public static final java.lang.String RA_ACCT_ID_ATTR
Resource attribute that specified the name of the attribute that is used for the ResourceInfo.accountId and the name of the WSUser when there isn't one already. It should be an attribute that is defined on every account and that is unique.

See Also:
Constant Field Values

RA_GENERATED_UIDS

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

LOGIN_USER

public static final java.lang.String LOGIN_USER
Pass thru authentication variables. Pass thru authentication is a process where a user or administrator can provide an account name and password which will be sent to the resource to be validated. The variables below are used to define the names of the various pieces of the Lighthouse implementation.

See Also:
Constant Field Values

LOGIN_PASSWORD

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

DISPLAY_USER

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

DISPLAY_PASSWORD

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

RESOURCE_NAME

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

RESOURCE_TYPE

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

SmartRolesResourceAdapter

public SmartRolesResourceAdapter(Resource res,
                                 ObjectCache cache)

SmartRolesResourceAdapter

public SmartRolesResourceAdapter()
Method Detail

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

supportsCaseInsensitiveAccountIds

public boolean supportsCaseInsensitiveAccountIds()
This method will return whether the resource adapter supports case insensitive account Ids or not. If the resource does support allow case insensitive names, then this method should be removed as the default implementation, in ResourceAdapterBase, returns true. If the resource supports case sensitive names, then this method should be implemented to return false.

Specified by:
supportsCaseInsensitiveAccountIds in interface ResourceAdapter
Overrides:
supportsCaseInsensitiveAccountIds in class ResourceAdapterBase

supportsExcludedAccounts

public boolean supportsExcludedAccounts()
Specified by:
supportsExcludedAccounts in interface ResourceAdapter
Overrides:
supportsExcludedAccounts in class ResourceAdapterBase

supportsAccountDisable

public boolean supportsAccountDisable()
This method indicates to the server that this resource natively supports account enable and disable. If the resource does not natively support account enable and disable, then this method should be removed as the default implementation, in ResourceAdapterBase, returns false.

Specified by:
supportsAccountDisable in interface ResourceAdapter
Overrides:
supportsAccountDisable in class ResourceAdapterBase

getUser

public WSUser getUser(WSUser user)
               throws WavesetException
Retrieve information about an account, and package it as a WSUser object.

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.

Returns "null" if there is no account that corresponds to the user.

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

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
Create a new user account on the resource

Overrides:
realCreate in class ResourceAdapterBase
Throws:
WavesetException

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
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default updateAccounts() implementation is used.

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

realDelete

protected void realDelete(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Description copied from class: ResourceAdapterBase
Needs to be overridden by subclass if default deleteAccounts() implementation is used.

Overrides:
realDelete in class ResourceAdapterBase
Throws:
WavesetException

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

getAccountAttributes

public WSAttributes getAccountAttributes(java.lang.String accountIdentity)
                                  throws WavesetException
Description copied from interface: ResourceAdapter
This method is obsolete. ResourceAdapterBase provides a default implementation that throws a "not implemented" WavesetException.

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

getAccountIterator

public AccountIterator getAccountIterator()
                                   throws WavesetException
Specified by:
getAccountIterator in interface ResourceAdapter
Overrides:
getAccountIterator in class ResourceAdapterBase
Throws:
WavesetException

createObject

public WavesetResult createObject(GenericObject object,
                                  java.util.Map options)
                           throws WavesetException
Creates the specified objectId of type objectType using the list of attributes provided.

Specified by:
createObject in interface ResourceAdapter
Overrides:
createObject in class ResourceAdapterBase
Parameters:
object - - a GenericObject containing the objectType, objectId, and list of attributes to be set on the new object
options - - several options can be specified which control the behavior of the search for referenced objects (e.g. group members). They include:
    "searchContext" - the value of this option determines within what context to perform search (ResourceAdapter.RA_SEARCH_CONTEXT). If no value, will assume search should be done from logical top.
  1. "searchScope" - specifies whether the search should be done on the current object, only within the context of the specified "searchContainer", or in all subcontext within the specified "searchContainer" (ResourceAdapter.RA_SEARCH_SCOPE). Valid values are "object", "oneLevel", or "subTree" indicates that the search should be performed on all sub containers within the specified "searchContainer".
  2. "searchTimeLimit" - the timelimit in milliseconds a search should not exceed (ResourceAdapter.RA_SEARCH_TIME_LIMIT).
  3. "searchAttributeNames" - a list of one or more attribute names used as the component of the tuple when searching for referenced objects (Resource_Adapter.RA_SEARCH_ATTRIBUTES).
    Throws:
    WavesetException

updateObject

public WavesetResult updateObject(GenericObject object,
                                  java.util.Map options)
                           throws WavesetException
Updates the specified objectId of type objectType using the list of attributes provided.

Specified by:
updateObject in interface ResourceAdapter
Overrides:
updateObject in class ResourceAdapterBase
Parameters:
object - - a GenericObject containing the objectType, objectId, and list of new and changed attributes to be set on the object
options - - several options can be specified which control the behavior of the search for referenced objects (e.g. group members). They include:
    "searchContext" - the value of this option determines within what context to perform search (ResourceAdapter.RA_SEARCH_CONTEXT). If no value, will assume search should be done from logical top.
  1. "searchScope" - specifies whether the search should be done on the current object, only within the context of the specified "searchContainer", or in all subcontext within the specified "searchContainer" (ResourceAdapter.RA_SEARCH_SCOPE). Valid values are "object", "oneLevel", or "subTree" indicates that the search should be performed on all sub containers within the specified "searchContainer".
  2. "searchTimeLimit" - the timelimit in milliseconds a search should not exceed (ResourceAdapter.RA_SEARCH_TIME_LIMIT).
  3. "searchAttributeNames" - a list of one or more attribute names used as the component of the tuple when searching for referenced objects (Resource_Adapter.RA_SEARCH_ATTRIBUTES).
    Throws:
    WavesetException

doCreateOrUpdateObjectRequest

protected WavesetResult doCreateOrUpdateObjectRequest(java.lang.String objectType,
                                                      java.lang.String objectId,
                                                      GenericObject attributes,
                                                      java.util.Map options,
                                                      java.lang.String cmd)
                                               throws WavesetException
Throws:
WavesetException

deleteObject

public WavesetResult deleteObject(GenericObject object,
                                  java.util.Map options)
                           throws WavesetException
Deletes the requested objectId of the requested objectType from the resource

Specified by:
deleteObject in interface ResourceAdapter
Overrides:
deleteObject in class ResourceAdapterBase
Parameters:
object - - Object to delete.
options - - Map containing objectType and objectId of object to delete.
Throws:
WavesetException

listAllObjects

public java.util.ArrayList listAllObjects(java.lang.String objectType,
                                          java.util.Map options,
                                          java.lang.String runAsUser,
                                          EncryptedData runAsPassword)
                                   throws WavesetException
Description copied from interface: ResourceAdapter
This method will return a list of object names of the specified object type. If you need to be able to specify which attrs to return, use listObjects instead

Specified by:
listAllObjects in interface ResourceAdapter
Overrides:
listAllObjects in class ResourceAdapterBase
Parameters:
objectType - - a type of object that is either well-known, defined as a Resource object, or is a Smart Roles object type.
options - - a map of options. Supported options:
nameAttribute
The name of the object attribute to return in the list. This is only needed for object types that are defined by the resource.
runAsUser - - Not supported.
runAsPassword - - Not supported.
Returns:
a list of all object names of a specified type.
Throws:
WavesetException

listObjects

public java.util.List listObjects(java.lang.String objectType,
                                  java.util.Map options)
                           throws WavesetException
Returns a list of objects matching the requested objectType and options

Specified by:
listObjects in interface ResourceAdapter
Overrides:
listObjects in class ResourceAdapterBase
Parameters:
objectType - - the name of a valid object class for this specified "resId".
options - - several options can be specified which control the behavior of the search. They include:
    "searchContext" - the value of this option determines within what context to perform search (ResourceAdapter.RA_SEARCH_CONTEXT). This option is only used when listing organizations using a searchScope other than "subTree". If not specified, all top-level organizations will be listed. Otherwise, it must be the name of an organization from which to start the search.
  1. "searchFilter" - optional specification, in the form of a Map that contains a set of key/value pairs that will be used to filter the list of objects returned. Those objects will have attributes with values that match the corresponding values in the Map. (ResourceAdapter.RA_SEARCH_FILTER).
  2. "searchScope" - specifies whether the search should be done on the current object, only within the context of the specified "searchContext", or in all subcontext within the specified "searchContext" (ResourceAdapter.RA_SEARCH_SCOPE). Valid values are "object", "oneLevel", or "subTree". The default is "subTree". This option is ignored for all object types except organizations. //*
  3. //* "searchTimeLimit" - the timelimit in milliseconds a //* search should not exceed //* (ResourceAdapter.RA_SEARCH_TIME_LIMIT).
  4. "searchAttrsToGet" - the list of objectType specific attribute names to get per object //*
  5. //* "runAsUser" - user name this request is to be run as. //* If not specified, defaults to resource proxy admin user. //*
  6. //* "runAsPassword" - password of runAsUser. Required to //* authenticate with resource in order to run the list //* request as the specified user
Throws:
WavesetException

getObject

public GenericObject getObject(java.lang.String objectType,
                               java.lang.String objectId,
                               java.util.List attrsToGet,
                               java.util.Map options)
                        throws WavesetException
Returns the requested objectId of the requested objectType from the resource

Specified by:
getObject in interface ResourceAdapter
Overrides:
getObject in class ResourceAdapterBase
Parameters:
objectType - - a valid object type defined in the resource's section
objectId - - a valid fully qualified object identifier on this resource (e.g. "dn")
attrsToGet - - a list of attribute names supported by the specified objectType to be returned with the object
options - - not currently used since the objectId/objectType provide a unique identifier of the object being requested
Throws:
WavesetException

supportsActions

public boolean supportsActions()
Specified by:
supportsActions in interface ResourceAdapter
Overrides:
supportsActions in class ResourceAdapterBase

run

public WavesetResult run(ResourceAction action,
                         java.util.Map args)
                  throws WavesetException
Runs a ResourceAction with additional args; could be null.

Specified by:
run in interface ResourceAdapter
Overrides:
run in class ResourceAdapterBase
Parameters:
action - the action to run
args - passed to the action script; can be null
Returns:
a result with the results of the action execution.
Throws:
WavesetException

authenticate

public WavesetResult authenticate(java.util.HashMap loginInfo)
                           throws WavesetException
Authenticates the user against the resource. Return the authenticated id if authentication succeeds.

The authenticate method is used to verify a user account and password are valid. If the user account name does not exist on the resource, the password does not match, or multiple matches exist, then throw an exception.

If the resource has multiple contexts (for example LDAP or NDS), the authenticate method should not stop when it finds the first match, instead it should continue through the entire list. If it finds more than one match, then an exception should be thrown.

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

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
                                   throws WavesetException
These are methods implemented in sources to get and set attributes. Since this is a source with a resource, just pass the calls through.

Specified by:
getAttributeValue in interface ActiveSync
Throws:
WavesetException

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
                       throws WavesetException
These are methods implemented in sources to get and set attributes. Since this is a source with a resource, just pass the calls through.

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

processUpdates

protected int 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.

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

poll

public int poll()
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

logUpdate

protected void logUpdate(int level,
                         java.util.Map update,
                         WavesetResult result)
Log whatever we want to from an update.


testConfiguration

public WavesetResult testConfiguration()
                                throws WavesetException
Description copied from class: ResourceAdapterBase
Default implementation of test method, calls check create. It is strongly preferred that this is overrided by derived classes so that a real test can be done without burdening the checkCreate method with a large overhead. On errors, an exception can be thrown or the error can be returned in the WavesetResult. Errors in the result will generate a test failure message, messages will appear for success or failure.

Specified by:
testConfiguration in interface ResourceAdapter
Overrides:
testConfiguration 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