com.waveset.adapter
Class ResourceAdapterBase

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
All Implemented Interfaces:
ResourceAdapter
Direct Known Subclasses:
AccessManagerResourceAdapter, ActivCardResourceAdapter, AgentResourceAdapter, AuthSSOResourceAdapter, BlackberryResourceAdapter, ClearTrustResourceAdapter, DB2ResourceAdapter, ExampleSPML2ResourceAdapter, GenericScriptResourceAdapter, GetAccessResourceAdapter, HostAccessResourceAdapter, IDMResourceAdapter, IMailResourceAdapter, INISafeNexessResourceAdapter, JdbcResourceAdapter, JmsListenerResourceAdapter, LDAPResourceAdapterBase, MySQLResourceAdapter, ONTDirectorySmartResourceAdapter, OS400ResourceAdapter, PeopleSoftCompIntfcAdapter, PeopleSoftComponentResourceAdapterBase, PeopleSoftResourceAdapter, RequestResourceAdapter, SAPPortalResourceAdapter, SAPResourceAdapter, SiebelCRMResourceAdapter, SiebelResourceAdapter, SiteminderAdminResourceAdapter, SkeletonActiveSyncResourceAdapter, SkeletonResourceAdapter, SkeletonStandardAndActiveSyncResourceAdapter, SkeletonStandardResourceAdapter, SmartRolesResourceAdapter, SMEResourceAdapter, SunAccessManagerRealmResourceAdapter, SunAccessManagerResourceAdapter, TestResourceAdapter, VerityResourceAdapter, XMLResourceAdapter

public abstract class ResourceAdapterBase
extends java.lang.Object
implements ResourceAdapter


Nested Class Summary
protected  class ResourceAdapterBase.SimpleAccountIterator
          A simple implementation of an AccountIterator which given an Iterator over a set of account ids will use getUser() to fetch each account.
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType
 
Field Summary
protected  ObjectCache _cache
           
protected  LighthouseContext _context
           
protected  Rule _excludedAccountsRule
           
protected  boolean _excludedAccountsRuleInited
           
protected  AttrParse _listAllObjectsAttrParse
           
protected  java.lang.String _listAllObjectsAttrParseName
           
protected  AttrParse _listUserAttrParse
           
protected  java.lang.String _listUserAttrParseName
           
protected  AttrParse _listUserGroupsAttrParse
           
protected  java.lang.String _listUserGroupsAttrParseName
           
protected  Resource _resource
           
protected  java.lang.Thread _thread
           
protected static Trace _trace
           
static java.lang.String CLASS
           
static java.lang.String code_id
           
static java.lang.String displayInfoCode
          The exit code that an action should return if the action output needs to be displayed, but there is not a fatal error.
static java.lang.String RA_BLOCKCOUNT
           
static java.lang.String RA_LOGIN_ACTION
           
static java.lang.String RA_LOGOFF_ACTION
           
static java.lang.String RA_MULTI_VALUED_ATTRS
           
static java.lang.String RA_TEST_MODE
          This is the name of an optional property, which if set to "true", can be used to run an adapter in test mode.
 
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
ResourceAdapterBase()
           
ResourceAdapterBase(Resource res, LighthouseContext context)
           
ResourceAdapterBase(Resource res, ObjectCache cache)
           
 
Method Summary
abstract  WavesetResult authenticate(java.util.HashMap loginInfo)
          Authenticates the user against the resource.
abstract  WavesetResult checkCreateAccount(WSUser user)
           
abstract  WavesetResult checkDeleteAccount(WSUser user)
           
protected  void checkForNoPasswordInSchema(Resource resource, WavesetResult result, WSUser user)
          Verify that if a user has a password to be set that the resource has password mapped in its schema.
protected  void checkSyntax(Syntax syntax, AccountAttributeType attrType, java.lang.String mapName)
          Confirm that the specified syntax matches that of the attribute.
abstract  WavesetResult checkUpdateAccount(WSUser user)
           
 WavesetResult createAccount(WSUser user)
           
 WavesetResult createAccounts(WSUser[] users)
           
 java.lang.String createIdentity(WSUser user)
          Create the user's identity (account name) based on the resource's identity template and the user's attributes.
 WavesetResult createObject(GenericObject object, java.util.Map options)
          Creates the specified objectId of type objectType using the list of attributes provided.
abstract  Resource createPrototypeResource()
           
 WavesetResult deleteAccount(WSUser user)
           
 WavesetResult deleteAccount(WSUser user, long milliseconds)
          Delete the resource account specified by the input WSUser.
 WavesetResult deleteAccounts(WSUser[] users)
           
 WavesetResult deleteObject(GenericObject object, java.util.Map options)
          Deletes the requested objectId of the requested objectType from the resource.
 WavesetResult disableAccount(WSUser user)
           
 WavesetResult disableAccounts(WSUser[] users)
           
protected  boolean dnsEqual(java.lang.String dn1, java.lang.String dn2)
          This method will return true if dn1 equals dn2.
static boolean dnsEqual(java.lang.String dn1, java.lang.String dn2, boolean isCaseSensitive)
          This method will return true if dn1 equals dn2.
 WavesetResult enableAccount(WSUser user)
           
 WavesetResult enableAccounts(WSUser[] users)
           
protected  java.lang.String executeResourceAttributeJavascriptAction(java.lang.String resAttrName, java.util.Map globals)
           
static void fillInResourceInfo(WSUser user, Resource r, java.lang.String resoAcctId, ResourceAdapter ra)
          Called by the loader to flesh out a ResourceInfo object for a resource we've discovering through the load.
static void fillInResourceInfo(WSUser user, Resource r, java.lang.String resoAcctId, java.lang.String guid, ResourceAdapter ra)
          Called by the loader to flesh out a ResourceInfo object for a resource we've discovering through the load.
 WSAttributes getAccountAttributes(java.lang.String accountIdentity)
          This method is obsolete.
 AccountIterator getAccountIterator()
           
 AccountIterator getAccountIterator(long milliseconds)
           
 AccountIterator getAccountIterator(java.util.Map filterParams)
          Like getAccountIterator but takes a Map param.
protected  java.lang.String getAction(ResourceAction action, WavesetResult result)
           
protected  ErrorMessage getActionNotFoundErrorMessage(java.lang.String action, java.lang.String resType, java.lang.String resName, Severity severity)
           
protected  Message getActionNotFoundMessage(java.lang.String action, java.lang.String resType, java.lang.String resName)
          Deprecated. Use getActionNotFoundErrorMessage() instead.
protected  EncryptedData getActionRunAsPassword(ResourceAction action)
           
protected  java.lang.String getActionRunAsUser(ResourceAction action)
           
protected  int getActionTimeout(ResourceAction action)
           
protected  java.lang.String getActionType(ResourceAction action)
           
static ResourceAdapter getAdapter(Resource res, LighthouseContext context)
          Deprecated. As of IdM 5.5, use getAdapterProxy(Resource, LighthouseContext)
static ResourceAdapter getAdapter(Resource res, ObjectCache cache)
          Deprecated. As of IdM 5.5, use getAdapterProxy( Resource, LighthouseContext )
static ResourceAdapter getAdapter(Resource res, ObjectCache cache, WSUser user)
          Deprecated. - Use getAdapterProxy(Resource, ObjectCache).
static ResourceAdapter getAdapterProxy(Resource res, LighthouseContext context)
          The preferred factory method to a proxy to the ResourceAdapter for the resource, which provides common functionality across adapters.
static ResourceAdapter getAdapterProxy(Resource res, ObjectCache cache)
          Supported, but not the preferred factory method.
 java.util.List getAllAccounts()
          Returns all of the accounts in this resource as a list of WSUser objects.
protected  java.lang.String getAttrNameFromMapName(java.lang.String mapName)
          Get the Waveset attribute name that corresponds to the resource user attribute (or map) name.
protected  java.lang.String getAttrNameFromMapName(java.lang.String mapName, boolean ignoreCase)
          Get the Waveset attribute name that corresponds to the resource user attribute (or map) name.
protected  AttrParse getAttrParse(java.lang.String attrParseName)
           
protected  AccountAttributeType getAttrTypeFromMapName(java.lang.String mapName)
          Get the AccountAttributeType that corresponds to the resource user attribute (or map name).
protected  AccountAttributeType getAttrTypeFromMapName(java.lang.String mapName, boolean ignoreCase)
          Get the AccountAttributeType that corresponds to the resource user attribute (or map name).
 java.lang.String getAUserName(WSUser user)
          Returns a non-empty, non-null name for the user for this adapter.
 java.lang.String getBaseContextAttrName()
          Deprecated. As of 4.0 use getBaseContexts().
 GenericObject getBaseContextObject(java.lang.String baseContext)
           
 java.util.List getBaseContexts()
          Needs to be overridden by subclass in order to support browsing and editing of resource objects
 int getBlockSize()
           
 LighthouseContext getContext()
           
 Rule getExcludedAccountsRule()
           
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
 java.lang.String getIdentity(WSUser user)
          Return the account id for the user, fetched from the resource info.
protected  AttrParse getListAllObjectsAttrParse()
           
protected  AttrParse getListUserAttrParse()
           
protected  AttrParse getListUserGroupsAttrParse()
           
 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
 java.lang.Boolean getOptionalBooleanResAttrVal(java.lang.String name)
          True if the value is 1, true, or yes, false otherwise.
protected  java.lang.Boolean getOptionalBooleanResAttrVal(java.lang.String name, boolean defaultValue)
          True if the value is 1, true, or yes, false otherwise if the value exists.
protected  EncryptedData getOptionalEncryptedResAttrVal(java.lang.String name)
           
protected  java.lang.Object getOptionalResAttrVal(java.lang.String name)
           
protected  java.lang.String getOptionalStringResAttrVal(java.lang.String name)
           
static ResourceAttribute getRequiredResAttr(Resource resource, java.lang.String name)
           
protected  ResourceAttribute getRequiredResAttr(java.lang.String name)
           
static java.lang.Object getRequiredResAttrVal(Resource resource, java.lang.String name)
           
protected  java.lang.Object getRequiredResAttrVal(java.lang.String name)
           
protected  java.util.List getRequiredResAttrVals(java.lang.String name)
           
static java.lang.String[] getRequiredUserAttributeNames(Resource resource)
          Given a resource, get the names of required attributes to create a user there.
 com.waveset.adapter.util.ActionOnUser getResAttrValActionOnUser(java.lang.String cName, java.lang.String pName, java.lang.Class type)
           
protected  java.util.List getResAttrVals(java.lang.String name)
           
 Resource getResource()
           
 java.util.List getResourceAccounts(java.util.List attributes)
           
protected  ResourceInfo getResourceInfo(WSUser user)
          Helper method used to return the ResourceInfo on the user that corresponds to this resource adapter.
protected  java.lang.String getResourceObjectAttrValNameAttr(java.lang.String attrName, java.lang.String objectType, java.lang.String defaultName)
           
protected  java.util.List getResourceObjectClassAttr()
           
protected static java.lang.String getResourceObjectTypePrefix(java.lang.String objType)
           
protected  java.util.Map getSchemaMap()
          Get a Map of schema map entries (keyed by the right hand side, values are the names of the left hand side).
 WSUser getUser(WSUser user)
          Retrieves account information from the resource for the specified WSUser and returns a new WSUser based on the information from the resource.
 WSUser getUser(WSUser user, long milliseconds)
           
protected  WSAttribute getWSAttrByMapName(WSUser user, java.lang.String mapName)
           
protected  WSAttribute getWSAttrByMapName(WSUser user, java.lang.String mapName, boolean ignoreCase)
           
protected  WSAttribute getWSAttrFromMap(AccountAttributeType attrType, java.util.Map map, boolean supportMultiValuedAttrs)
           
protected  boolean handleActionResult(WavesetResult result, java.lang.String actionType, boolean warnOnError)
           
protected  void handleJavascriptActionResult(WavesetResult result, java.lang.String actionName)
          Reprocess the WavesetResult to generate standard visible messages for the invocation of a Javascript action
protected  boolean isAccountAttributeSecret(java.lang.String mapName)
          Determines if a specified RHS attribute is secret.
 boolean isExcludedAccount(java.lang.String account)
          Deprecated. See ResourceAdapterProxy#isExcludedAccount(String, Map, ResourceOperation, Rule)
 boolean isExcludedAccount(java.lang.String account, Rule excludedRule)
          Deprecated. See ResourceAdapterProxy#isExcludedAccount(String, Map, ResourceOperation, Rule)
protected  boolean isFeatureEnabled(java.lang.String feature)
          Utility method to check if the specified Feature is supported and enabled.
 boolean isSupported(java.lang.String feature)
           
protected  boolean isTestMode()
           
 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.ArrayList listAllObjects(java.lang.String objectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword, long milliseconds)
           
 java.util.List listObjects(java.util.Map options)
          List objects (of any valid object type) that match the search criteria specified in
 java.util.List listObjects(java.lang.String objectType, java.util.Map options)
          Default implementation calls older method listAllObjects(String, Map, String, EncryptedData), which does not support newer options (such as "searchContext" or "searchFilter").
 java.util.List listObjectsOfType(java.lang.String objectType, java.util.Map options)
          List objects of the specified object type that match the search criteria specified in
protected  ResourceAction lookupAction(java.lang.String actionName)
           
protected  ResourceAction lookupAction(WSUser user, java.lang.String operation, java.lang.String timing)
           
protected  java.util.List lookupActions(WSUser user, java.lang.String operation, java.lang.String timing)
           
 boolean namesEqual(java.lang.String name1, java.lang.String name2)
          This method will return true if name1 equals name2.
protected  boolean objectClassesMatchType(GenericObject obj, java.lang.String objtype, java.lang.String objClassAttrName, boolean matchIfNoObjectClasses)
          Utility function to determine if obj really is of type objtype.
protected static void println(java.lang.Object o)
           
protected  void realCreate(WSUser user, WavesetResult result)
          Needs to be overridden by subclass if default createAccounts() implementation is used.
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.
protected  void restoreResourceObjectClassAttr(java.util.List prevObjClasses)
           
 WavesetResult run(ResourceAction action)
          Runs a ResourceAction - The implementation almost always calls run(ResourceAction, Map) with a null Map.
 WavesetResult run(ResourceAction action, java.util.Map args)
          This is NOT supported by default.
protected  void runResourceAttributeJavascriptAction(java.lang.String resAttrName, java.util.Map globals)
           
 WavesetResult scan(java.util.Map parameters)
           
 void setCache(ObjectCache cache)
           
 void setContext(LighthouseContext context)
           
protected  void setDisabled(WSUser user, boolean disabled)
          Helper function to set the disabled on flag on the specified user on the ResourceInfo that corresponds to this resource adapter.
protected  void setFromResource()
           
 void setResource(Resource res)
           
 void setResourceObjectClassAttr(java.lang.String objectType, boolean primary)
          Set the object class attr value, return the old one.
static void setResourceOptionAttrs(Resource res, java.util.Map options, java.lang.String roTypePrefix)
           
protected  void startConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
protected  void startConnectionWrapper()
           
protected  void stopConnection()
          Needs to be overridden by subclass if default createAccounts() implementation is used.
 boolean supportsAccountActions()
           
 boolean supportsAccountDisable()
          Indicates whether or not this resource supports account disable.
 boolean supportsActions()
           
 boolean supportsCaseInsensitiveAccountIds()
          This method will return whether the resource adapter supports case insensitive account Ids or not.
 boolean supportsContainerObjectTypes()
          Returns true if the resource adapter is a directory that supports container objects like organizations, containers, and organizational units.
 boolean supportsExcludedAccounts()
           
 boolean supportsResourceAccount()
          Returns true if the resource adapter supports modifications to the resource account.
 boolean supportsScanning()
           
 WavesetResult testConfiguration()
          Default implementation of test method, calls check create.
 WavesetResult updateAccount(WSUser user)
           
 WavesetResult updateAccounts(WSUser[] users)
           
 WavesetResult updateObject(GenericObject object, java.util.Map options)
          Updates the specified objectId of type objectType using the list of attributes provided.
 WavesetResult updateResourceAccount(GenericObject account)
           
protected  void updateResourceIdentity(WSUser user)
           
 boolean vmStoreBoot(java.util.Map map)
          If the current resource does not possess a map, then set the current resource's vmStore map to the map given.
 java.lang.Object vmStoreGet(java.lang.String key)
           
 java.util.Map vmStoreInit(java.util.Map map)
          Replace the current resource's map with the given map
 java.lang.Object vmStoreLatch(java.lang.String key, java.lang.Object value)
          Store the given object at the key given if, and only if, the current object found at the key is null or doesn't exist.
 java.lang.Object vmStorePut(java.lang.String key, java.lang.Object value)
           
 
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_BLOCKCOUNT

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

RA_LOGIN_ACTION

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

RA_LOGOFF_ACTION

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

RA_MULTI_VALUED_ATTRS

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

RA_TEST_MODE

public static final java.lang.String RA_TEST_MODE
This is the name of an optional property, which if set to "true", can be used to run an adapter in test mode. Supported by the isTestMode() method.

See Also:
Constant Field Values

CLASS

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

displayInfoCode

public static final java.lang.String displayInfoCode
The exit code that an action should return if the action output needs to be displayed, but there is not a fatal error. Unix shells return an 8 bit integer, therefore this number must be < 256.

See Also:
Constant Field Values

_context

protected LighthouseContext _context

_cache

protected ObjectCache _cache

_resource

protected Resource _resource

_thread

protected java.lang.Thread _thread

_excludedAccountsRule

protected Rule _excludedAccountsRule

_excludedAccountsRuleInited

protected boolean _excludedAccountsRuleInited

_trace

protected static Trace _trace

_listAllObjectsAttrParseName

protected java.lang.String _listAllObjectsAttrParseName

_listAllObjectsAttrParse

protected AttrParse _listAllObjectsAttrParse

_listUserAttrParseName

protected java.lang.String _listUserAttrParseName

_listUserAttrParse

protected AttrParse _listUserAttrParse

_listUserGroupsAttrParseName

protected java.lang.String _listUserGroupsAttrParseName

_listUserGroupsAttrParse

protected AttrParse _listUserGroupsAttrParse
Constructor Detail

ResourceAdapterBase

public ResourceAdapterBase()

ResourceAdapterBase

public ResourceAdapterBase(Resource res,
                           ObjectCache cache)

ResourceAdapterBase

public ResourceAdapterBase(Resource res,
                           LighthouseContext context)
Method Detail

println

protected static void println(java.lang.Object o)

vmStoreBoot

public boolean vmStoreBoot(java.util.Map map)
If the current resource does not possess a map, then set the current resource's vmStore map to the map given.

Parameters:
map -
Returns:
true if the given map is THE map for being used for this resource

vmStoreGet

public java.lang.Object vmStoreGet(java.lang.String key)
Parameters:
key -
Returns:
the object associated, if any, to the given key

vmStoreInit

public java.util.Map vmStoreInit(java.util.Map map)
Replace the current resource's map with the given map

Parameters:
map -
Returns:
the old Map, if any

vmStoreLatch

public java.lang.Object vmStoreLatch(java.lang.String key,
                                     java.lang.Object value)
Store the given object at the key given if, and only if, the current object found at the key is null or doesn't exist. Ergo: storing a non null object "throws a latch" that indicates the object can not be overwritten via subsequent calls to vmStoreLatch. Note: vmStorePut doesn't adhere to the never replace restriction.

Parameters:
key - (must be a string)
value - (arbitrary object)
Returns:
the value suppliled if this is the first put for the given key or the object stored for the key is null. Otherwise the object found in the map for the given key is returned.

vmStorePut

public java.lang.Object vmStorePut(java.lang.String key,
                                   java.lang.Object value)
Parameters:
key -
value -
Returns:
the old value, if any, associated with the given key

getListAllObjectsAttrParse

protected AttrParse getListAllObjectsAttrParse()
                                        throws WavesetException
Throws:
WavesetException

getListUserAttrParse

protected AttrParse getListUserAttrParse()
                                  throws WavesetException
Throws:
WavesetException

getListUserGroupsAttrParse

protected AttrParse getListUserGroupsAttrParse()
                                        throws WavesetException
Throws:
WavesetException

setResource

public void setResource(Resource res)
Specified by:
setResource in interface ResourceAdapter

setFromResource

protected void setFromResource()

setCache

public void setCache(ObjectCache cache)
Specified by:
setCache in interface ResourceAdapter

setContext

public void setContext(LighthouseContext context)
Specified by:
setContext in interface ResourceAdapter

getContext

public LighthouseContext getContext()

getResAttrValActionOnUser

public com.waveset.adapter.util.ActionOnUser getResAttrValActionOnUser(java.lang.String cName,
                                                                       java.lang.String pName,
                                                                       java.lang.Class type)
Parameters:
cName -
pName -
type -
Returns:
a non null ActionOnUser object

getResource

public Resource getResource()
Specified by:
getResource in interface ResourceAdapter

createPrototypeResource

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

getAdapterProxy

public static ResourceAdapter getAdapterProxy(Resource res,
                                              LighthouseContext context)
                                       throws WavesetException
The preferred factory method to a proxy to the ResourceAdapter for the resource, which provides common functionality across adapters. Passing a LighthouseContext (rather than an ObjectCache) permits the adapter maximum flexibility. In particular, an ActiveSync adapter may need a LighthouseContext in order to submit IAPI events.

Parameters:
res -
context -
Returns:
Throws:
WavesetException

getAdapterProxy

public static ResourceAdapter getAdapterProxy(Resource res,
                                              ObjectCache cache)
                                       throws WavesetException
Supported, but not the preferred factory method. Passing a LighthouseContext (rather than an ObjectCache) permits the adapter maximum flexibility. In particular, an ActiveSync adapter may need a LighthouseContext in order to submit IAPI events.

Throws:
WavesetException

getAdapter

public static ResourceAdapter getAdapter(Resource res,
                                         ObjectCache cache,
                                         WSUser user)
                                  throws WavesetException
Deprecated. - Use getAdapterProxy(Resource, ObjectCache).

Throws:
WavesetException

getAdapter

public static ResourceAdapter getAdapter(Resource res,
                                         LighthouseContext context)
                                  throws WavesetException
Deprecated. As of IdM 5.5, use getAdapterProxy(Resource, LighthouseContext)

Passing a LighthouseContext (rather than an ObjectCache) permits the adapter maximum flexibility. In particular, an ActiveSync adapter may need a LighthouseContext in order to submit IAPI events.

Throws:
WavesetException

getAdapter

public static ResourceAdapter getAdapter(Resource res,
                                         ObjectCache cache)
                                  throws WavesetException
Deprecated. As of IdM 5.5, use getAdapterProxy( Resource, LighthouseContext )

Passing a LighthouseContext (rather than an ObjectCache) permits the adapter maximum flexibility. In particular, an ActiveSync adapter may need a LighthouseContext in order to submit IAPI events.

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
Returns:
Features supported by this resource adapter.
See Also:
ResourceAdapter.Features

isSupported

public boolean isSupported(java.lang.String feature)
Specified by:
isSupported in interface ResourceAdapter

startConnectionWrapper

protected void startConnectionWrapper()
                               throws WavesetException
Throws:
WavesetException

startConnection

protected void startConnection()
                        throws WavesetException
Needs to be overridden by subclass if default createAccounts() implementation is used.

Throws:
WavesetException

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Needs to be overridden by subclass if default createAccounts() implementation is used.

Throws:
WavesetException

stopConnection

protected void stopConnection()
                       throws WavesetException
Needs to be overridden by subclass if default createAccounts() implementation is used.

Throws:
WavesetException

checkCreateAccount

public abstract WavesetResult checkCreateAccount(WSUser user)
                                          throws WavesetException
Specified by:
checkCreateAccount in interface ResourceAdapter
Throws:
WavesetException

createAccounts

public WavesetResult createAccounts(WSUser[] users)
                             throws WavesetException
Specified by:
createAccounts in interface ResourceAdapter
Throws:
WavesetException

checkUpdateAccount

public abstract WavesetResult checkUpdateAccount(WSUser user)
                                          throws WavesetException
Specified by:
checkUpdateAccount in interface ResourceAdapter
Throws:
WavesetException

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Needs to be overridden by subclass if default updateAccounts() implementation is used.

Throws:
WavesetException

updateAccounts

public WavesetResult updateAccounts(WSUser[] users)
                             throws WavesetException
Specified by:
updateAccounts in interface ResourceAdapter
Throws:
WavesetException

checkDeleteAccount

public abstract WavesetResult checkDeleteAccount(WSUser user)
                                          throws WavesetException
Specified by:
checkDeleteAccount in interface ResourceAdapter
Throws:
WavesetException

realDelete

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

Throws:
WavesetException

deleteAccounts

public WavesetResult deleteAccounts(WSUser[] users)
                             throws WavesetException
Specified by:
deleteAccounts in interface ResourceAdapter
Throws:
WavesetException

getUser

public WSUser getUser(WSUser user)
               throws WavesetException
Description copied from interface: ResourceAdapter
Retrieves account information from the resource for the specified WSUser and returns a new WSUser based on the information from the resource. Returns null if the account does not exist.

Specified by:
getUser in interface ResourceAdapter
Throws:
WavesetException

authenticate

public abstract WavesetResult authenticate(java.util.HashMap loginInfo)
                                    throws WavesetException
Description copied from interface: ResourceAdapter
Authenticates the user against the resource. If authentication is successful, the authenticated id will be returned. If more info is required to complete authentication the result will contain the required info

Specified by:
authenticate in interface ResourceAdapter
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
Throws:
WavesetException

createAccount

public WavesetResult createAccount(WSUser user)
                            throws WavesetException
Specified by:
createAccount in interface ResourceAdapter
Throws:
WavesetException

updateAccount

public WavesetResult updateAccount(WSUser user)
                            throws WavesetException
Specified by:
updateAccount in interface ResourceAdapter
Throws:
WavesetException

deleteAccount

public WavesetResult deleteAccount(WSUser user)
                            throws WavesetException
Specified by:
deleteAccount in interface ResourceAdapter
Throws:
WavesetException

getRequiredResAttr

protected ResourceAttribute getRequiredResAttr(java.lang.String name)
                                        throws WavesetException
Throws:
WavesetException

getRequiredResAttr

public static ResourceAttribute getRequiredResAttr(Resource resource,
                                                   java.lang.String name)
                                            throws WavesetException
Throws:
WavesetException

getRequiredResAttrVals

protected java.util.List getRequiredResAttrVals(java.lang.String name)
                                         throws WavesetException
Throws:
WavesetException

getResAttrVals

protected java.util.List getResAttrVals(java.lang.String name)

getRequiredResAttrVal

protected java.lang.Object getRequiredResAttrVal(java.lang.String name)
                                          throws WavesetException
Throws:
WavesetException

getRequiredResAttrVal

public static java.lang.Object getRequiredResAttrVal(Resource resource,
                                                     java.lang.String name)
                                              throws WavesetException
Throws:
WavesetException

getOptionalStringResAttrVal

protected java.lang.String getOptionalStringResAttrVal(java.lang.String name)

getOptionalResAttrVal

protected java.lang.Object getOptionalResAttrVal(java.lang.String name)

getOptionalBooleanResAttrVal

public java.lang.Boolean getOptionalBooleanResAttrVal(java.lang.String name)
True if the value is 1, true, or yes, false otherwise. Will always return a Boolean object.


getOptionalBooleanResAttrVal

protected java.lang.Boolean getOptionalBooleanResAttrVal(java.lang.String name,
                                                         boolean defaultValue)
True if the value is 1, true, or yes, false otherwise if the value exists. Otherwise, returns defaultValue.


getOptionalEncryptedResAttrVal

protected EncryptedData getOptionalEncryptedResAttrVal(java.lang.String name)

createIdentity

public java.lang.String createIdentity(WSUser user)
                                throws WavesetException
Create the user's identity (account name) based on the resource's identity template and the user's attributes.

Specified by:
createIdentity in interface ResourceAdapter
Throws:
WavesetException

getIdentity

public java.lang.String getIdentity(WSUser user)
                             throws WavesetException
Return the account id for the user, fetched from the resource info. If the resource info has a GUID, prefer that.

Throws:
WavesetException

getAUserName

public java.lang.String getAUserName(WSUser user)
Returns a non-empty, non-null name for the user for this adapter. Preferably it will get the identity on this resource (ResourceInfo._accountId), but it will use the WSUser._name if the identity is null. If WSUser._name is null, it will return "unknown". This method is typically used when tracing information about a user.


supportsExcludedAccounts

public boolean supportsExcludedAccounts()
Specified by:
supportsExcludedAccounts in interface ResourceAdapter
Returns:
true if the resource adapter supports rules testing if specified accountIDs are to be excluded from certain listings; otherwise false. The default is return false.

Any adapter for a resource with support for exclusion of accounts should override this method to return true.


getExcludedAccountsRule

public Rule getExcludedAccountsRule()
                             throws WavesetException
Throws:
WavesetException

isExcludedAccount

public boolean isExcludedAccount(java.lang.String account)
                          throws WavesetException
Deprecated. See ResourceAdapterProxy#isExcludedAccount(String, Map, ResourceOperation, Rule)

Returns true if the resource account is to be excluded in listings as determined by the optional rule.

Throws:
WavesetException

isExcludedAccount

public boolean isExcludedAccount(java.lang.String account,
                                 Rule excludedRule)
                          throws WavesetException
Deprecated. See ResourceAdapterProxy#isExcludedAccount(String, Map, ResourceOperation, Rule)

Returns true if the resource account is to be excluded in listings as determined by the optional rule.

Throws:
WavesetException

getAllAccounts

public java.util.List getAllAccounts()
                              throws WavesetException
Returns all of the accounts in this resource as a list of WSUser objects.

jsl - this is temporary, need to come up with an efficient way to iterate over the accounts.

Specified by:
getAllAccounts in interface ResourceAdapter
Throws:
WavesetException

getAccountIterator

public AccountIterator getAccountIterator()
                                   throws WavesetException
Specified by:
getAccountIterator in interface ResourceAdapter
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
Throws:
WavesetException

scan

public WavesetResult scan(java.util.Map parameters)
                   throws WavesetException
Specified by:
scan in interface ResourceAdapter
Throws:
WavesetException

supportsScanning

public boolean supportsScanning()
                         throws WavesetException
Specified by:
supportsScanning in interface ResourceAdapter
Throws:
WavesetException

supportsContainerObjectTypes

public boolean supportsContainerObjectTypes()
                                     throws WavesetException
Returns true if the resource adapter is a directory that supports container objects like organizations, containers, and organizational units. Otherwise, returns false. This will allow us to query for a list of resources that are LDAP directories.

Specified by:
supportsContainerObjectTypes in interface ResourceAdapter
Throws:
WavesetException

supportsResourceAccount

public boolean supportsResourceAccount()
                                throws WavesetException
Returns true if the resource adapter supports modifications to the resource account.

Specified by:
supportsResourceAccount in interface ResourceAdapter
Throws:
WavesetException

getBaseContextAttrName

public java.lang.String getBaseContextAttrName()
                                        throws WavesetException
Deprecated. As of 4.0 use getBaseContexts().

Needs to be overridden by subclass in order to support browsing and editing of resource objects

Specified by:
getBaseContextAttrName in interface ResourceAdapter
Returns:
the name, if any, of the attribute used by the resource as the base context or the context to which all operations is bound
Throws:
WavesetException

getBaseContexts

public java.util.List getBaseContexts()
                               throws WavesetException
Needs to be overridden by subclass in order to support browsing and editing of resource objects

Specified by:
getBaseContexts in interface ResourceAdapter
Returns:
a list of the base context strings, if any. Return null if base contexts are not supported or defined. For backwards compatibility, this implementation will call the deprecated method getBaseContextAttrName() to get the name of the base context resource attribute, if any. It will then return the value of that attribute.
Throws:
WavesetException

getBaseContextObject

public GenericObject getBaseContextObject(java.lang.String baseContext)
                                   throws WavesetException
Specified by:
getBaseContextObject in interface ResourceAdapter
Throws:
WavesetException

objectClassesMatchType

protected boolean objectClassesMatchType(GenericObject obj,
                                         java.lang.String objtype,
                                         java.lang.String objClassAttrName,
                                         boolean matchIfNoObjectClasses)
                                  throws WavesetException
Utility function to determine if obj really is of type objtype. This is done by looking at the values of the "objectclass" attribute of obj and checking to see if it matches the object classes that are specified in the definition of objtype. The matchIfNoObjectClasses parameter value will be returned if obj does not contain the objectclass attribute. Note: we will look up the object class attr name to use to get the object classes for a give object type. If no value is set, the default is "objectclass" (case insensitive).

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
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

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
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
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

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
Parameters:
options - - not currently used because the objectId and objectType parameters uniquely identify the object to delete.
object -
Throws:
WavesetException

listObjectsOfType

public java.util.List listObjectsOfType(java.lang.String objectType,
                                        java.util.Map options)
                                 throws WavesetException
List objects of the specified object type that match the search criteria specified in

Specified by:
listObjectsOfType in interface ResourceAdapter
Parameters:
options -
Throws:
WavesetException

listObjects

public java.util.List listObjects(java.util.Map options)
                           throws WavesetException
List objects (of any valid object type) that match the search criteria specified in

Specified by:
listObjects in interface ResourceAdapter
Parameters:
options -

Throws:
WavesetException
See Also:
ResourceAdapter.listObjects(String, Map).

getResourceObjectClassAttr

protected java.util.List getResourceObjectClassAttr()

setResourceObjectClassAttr

public void setResourceObjectClassAttr(java.lang.String objectType,
                                       boolean primary)
Set the object class attr value, return the old one.

Specified by:
setResourceObjectClassAttr in interface ResourceAdapter

restoreResourceObjectClassAttr

protected void restoreResourceObjectClassAttr(java.util.List prevObjClasses)

setResourceOptionAttrs

public static void setResourceOptionAttrs(Resource res,
                                          java.util.Map options,
                                          java.lang.String roTypePrefix)

listObjects

public java.util.List listObjects(java.lang.String objectType,
                                  java.util.Map options)
                           throws WavesetException
Default implementation calls older method listAllObjects(String, Map, String, EncryptedData), which does not support newer options (such as "searchContext" or "searchFilter").

Each ResourceAdapter subclass should override this default implementation as soon as possible with an implementation that supports the options specified in {#listObjects(ObjectType, Map)}.

Specified by:
listObjects in interface ResourceAdapter
Parameters:
objectType - the name of an object class that is valid for the resource specified by the value of option "resId". If objectType is null, this method will list objects of the types specified in the resource's section.

options - control the behavior of the search. Supported options include:
searchContext
the target context to search. If not specified, this method will attempt to get a value from RA_BASE_CONTEXT. If this method cannot obtain a context value, this method will search from logical top.
Returns:
a list of objects matching the requested objectType and options

Must be overridden by each subclass in order to support browsing and editing of resource objects.

Throws:
WavesetException
See Also:
searchFilter
an LDAP search filter as specified in RFC 1558. String value consists of one or more object tuples
  
either and'ed or or'ed together. If not specified, this method will construct a search filter using the specified objectType.
,
searchScope
specifies how deeply to search. Valid values are:
"object"
search only on the current object
"oneLevel"
search directly within the specified "searchContext"
"subTree"
search every subcontext beneath the specified "searchContext"
,
"searchTimeLimit"
the timelimit in milliseconds} a search should not exceed.,
"searchAttrsToGet"
the list of objectType-specific attribute names to return for each listed object. @see #RA_SEARCH_ATTRS_TO_GET
"runAsUser"
user name as which to run this method. If not specified, defaults to resource proxy admin user.
"runAsPassword"
password of runAsUser. Required in order to authenticate with resource so that we can to execute the list request as the specified user.

What is the format? Is it encrypted and base-64-encoded, as returned by EncyptedData.toString()?


getResourceObjectTypePrefix

protected static java.lang.String getResourceObjectTypePrefix(java.lang.String objType)

getResourceObjectAttrValNameAttr

protected java.lang.String getResourceObjectAttrValNameAttr(java.lang.String attrName,
                                                            java.lang.String objectType,
                                                            java.lang.String defaultName)
                                                     throws WavesetException
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
Parameters:
objectType - - 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(ObjectType.ACCOUNT, null, null, null) should return a list of all account names.
options - - a map of options
runAsUser - - (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.
Returns:
a list of all object names of a specified type.
Throws:
WavesetException

getResourceAccounts

public java.util.List getResourceAccounts(java.util.List attributes)
                                   throws WavesetException
Specified by:
getResourceAccounts in interface ResourceAdapter
Parameters:
attributes - a list of attribute names whose values are to be returned with the account object.
Returns:
a list of objects which are used to identify accounts used to connect to the resource. The returned objects also contain the values of the requested attributes.

Throws:
WavesetException

updateResourceAccount

public WavesetResult updateResourceAccount(GenericObject account)
                                    throws WavesetException
Specified by:
updateResourceAccount in interface ResourceAdapter
Throws:
WavesetException

getBlockSize

public int getBlockSize()
                 throws WavesetException
Throws:
WavesetException

supportsCaseInsensitiveAccountIds

public boolean supportsCaseInsensitiveAccountIds()
This method will return whether the resource adapter supports case insensitive account Ids or not. By default it will always return true since most resources do not allow case sensitive user names. However, for those that do, they should override this method implementation in their respective resource adapter class to return false.

Specified by:
supportsCaseInsensitiveAccountIds in interface ResourceAdapter
Returns:
true if the resource adapter supports case-insensitive account Ids; otherwise false. The default is return true, since most resources do not allow case-sensitive user names.

Any adapter for a resource with case-sensitive account ids should override this method to return false.


namesEqual

public boolean namesEqual(java.lang.String name1,
                          java.lang.String name2)
This method will return true if name1 equals name2. The default implementation will do a simple string compare. However, for complex names (e.g. dn's ) associated with specific resource types (e.g. LDAP, NDS, AD, etc.) this method can be overridden to do necessary validation and normalization of both names prior to doing the string compare.

Whether we do a case sensitive compare of the normalized names or a case insensitive compare will be determined by asking the resource which one it supports (via supportsCaseInsensitiveAccountIds()).

Specified by:
namesEqual in interface ResourceAdapter
Returns:
true if name1 equals name2. The default implementation will do a simple string compare. However, for complex names (e.g. dn's ) associated with specific resource types (e.g. LDAP, NDS, AD, etc.) this method can be overridden to do necessary validation and normalization of both names prior to doing the string compare.

dnsEqual

protected boolean dnsEqual(java.lang.String dn1,
                           java.lang.String dn2)
This method will return true if dn1 equals dn2. It can be called from a specific resource adapter's override of the namesEqual method for resource adapters that support distinguished names (dns) as the means for uniquely identifying objects their namespace.

We will normalize the two dns before checking for equality. Normalization will be done using an implementation of RFC2253 which specifies the standard for the string representation of distinguished names handling issue such as capitalization, component ordering, special characters, internationalized characters, trimming spaces, etc.

Whether we do a case sensitive compare of the normalized names or a case insensitive compare will be determined by asking the resource which one it supports (via supportsCaseInsensitiveAccountIds()).


dnsEqual

public static boolean dnsEqual(java.lang.String dn1,
                               java.lang.String dn2,
                               boolean isCaseSensitive)
This method will return true if dn1 equals dn2. It can be called from a specific resource adapter's override of the namesEqual method for resource adapters that support distinguished names (dns) as the means for uniquely identifying objects their namespace.

We will normalize the two dns before checking for equality. Normalization will be done using an implementation of RFC2253 which specifies the standard for the string representation of distinguished names handling issue such as capitalization, component ordering, special characters, internationalized characters, trimming spaces, etc.


setDisabled

protected void setDisabled(WSUser user,
                           boolean disabled)
Helper function to set the disabled on flag on the specified user on the ResourceInfo that corresponds to this resource adapter.


disableAccount

public WavesetResult disableAccount(WSUser user)
                             throws WavesetException
Specified by:
disableAccount in interface ResourceAdapter
Throws:
WavesetException

supportsAccountDisable

public boolean supportsAccountDisable()
Description copied from interface: ResourceAdapter
Indicates whether or not this resource supports account disable. If it does not, the provisioning engine will attempt to simulate disable by generating random passwords. If we end up with more of these "can you do this" methods, we might want to generalize it into a more extensible way to describe features and levels of support.

Specified by:
supportsAccountDisable in interface ResourceAdapter

realDisable

protected void realDisable(WSUser user,
                           WavesetResult result)
                    throws WavesetException
Throws:
WavesetException

disableAccounts

public WavesetResult disableAccounts(WSUser[] users)
                              throws WavesetException
Specified by:
disableAccounts in interface ResourceAdapter
Throws:
WavesetException

enableAccount

public WavesetResult enableAccount(WSUser user)
                            throws WavesetException
Specified by:
enableAccount in interface ResourceAdapter
Throws:
WavesetException

realEnable

protected void realEnable(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Throws:
WavesetException

enableAccounts

public WavesetResult enableAccounts(WSUser[] users)
                             throws WavesetException
Specified by:
enableAccounts in interface ResourceAdapter
Throws:
WavesetException

updateResourceIdentity

protected void updateResourceIdentity(WSUser user)
                               throws WavesetException
Throws:
WavesetException

getAttrTypeFromMapName

protected AccountAttributeType getAttrTypeFromMapName(java.lang.String mapName)
Get the AccountAttributeType that corresponds to the resource user attribute (or map name).


getAttrTypeFromMapName

protected AccountAttributeType getAttrTypeFromMapName(java.lang.String mapName,
                                                      boolean ignoreCase)
Get the AccountAttributeType that corresponds to the resource user attribute (or map name).


getSchemaMap

protected java.util.Map getSchemaMap()
Get a Map of schema map entries (keyed by the right hand side, values are the names of the left hand side).


getAttrNameFromMapName

protected java.lang.String getAttrNameFromMapName(java.lang.String mapName)
Get the Waveset attribute name that corresponds to the resource user attribute (or map) name.


getAttrNameFromMapName

protected java.lang.String getAttrNameFromMapName(java.lang.String mapName,
                                                  boolean ignoreCase)
Get the Waveset attribute name that corresponds to the resource user attribute (or map) name.


getWSAttrByMapName

protected WSAttribute getWSAttrByMapName(WSUser user,
                                         java.lang.String mapName)

getWSAttrByMapName

protected WSAttribute getWSAttrByMapName(WSUser user,
                                         java.lang.String mapName,
                                         boolean ignoreCase)

getWSAttrFromMap

protected WSAttribute getWSAttrFromMap(AccountAttributeType attrType,
                                       java.util.Map map,
                                       boolean supportMultiValuedAttrs)
                                throws WavesetException
Throws:
WavesetException

getResourceInfo

protected ResourceInfo getResourceInfo(WSUser user)
Helper method used to return the ResourceInfo on the user that corresponds to this resource adapter. Returns null if a corresponding ResourceInfo was not found.


checkSyntax

protected void checkSyntax(Syntax syntax,
                           AccountAttributeType attrType,
                           java.lang.String mapName)
                    throws WavesetException
Confirm that the specified syntax matches that of the attribute.

Throws:
WavesetException

supportsActions

public boolean supportsActions()
Specified by:
supportsActions in interface ResourceAdapter

run

public WavesetResult run(ResourceAction action,
                         java.util.Map args)
                  throws WavesetException
This is NOT supported by default. If you have enabled the Featrues.ACTIONS feature, then this MUST be supported.

Specified by:
run in interface ResourceAdapter
Parameters:
action - The action to execute
args - Additional args, can be null.
Returns:
A WavesetResult.
Throws:
WavesetException

run

public WavesetResult run(ResourceAction action)
                  throws WavesetException
Description copied from interface: ResourceAdapter
Runs a ResourceAction - The implementation almost always calls run(ResourceAction, Map) with a null Map.

Specified by:
run in interface ResourceAdapter
Parameters:
action -
Returns:
The result of the action.
Throws:
WavesetException
See Also:
run(com.waveset.object.ResourceAction, java.util.Map)

lookupAction

protected ResourceAction lookupAction(WSUser user,
                                      java.lang.String operation,
                                      java.lang.String timing)
                               throws WavesetException
Throws:
WavesetException

lookupAction

protected ResourceAction lookupAction(java.lang.String actionName)
                               throws WavesetException
Throws:
WavesetException

lookupActions

protected java.util.List lookupActions(WSUser user,
                                       java.lang.String operation,
                                       java.lang.String timing)
                                throws WavesetException
Throws:
WavesetException

getAction

protected java.lang.String getAction(ResourceAction action,
                                     WavesetResult result)

getActionType

protected java.lang.String getActionType(ResourceAction action)

getActionRunAsUser

protected java.lang.String getActionRunAsUser(ResourceAction action)

getActionRunAsPassword

protected EncryptedData getActionRunAsPassword(ResourceAction action)

getAttrParse

protected AttrParse getAttrParse(java.lang.String attrParseName)
                          throws WavesetException
Throws:
WavesetException

runResourceAttributeJavascriptAction

protected void runResourceAttributeJavascriptAction(java.lang.String resAttrName,
                                                    java.util.Map globals)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

executeResourceAttributeJavascriptAction

protected java.lang.String executeResourceAttributeJavascriptAction(java.lang.String resAttrName,
                                                                    java.util.Map globals)
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

getActionNotFoundMessage

protected Message getActionNotFoundMessage(java.lang.String action,
                                           java.lang.String resType,
                                           java.lang.String resName)
Deprecated. Use getActionNotFoundErrorMessage() instead.


getActionNotFoundErrorMessage

protected ErrorMessage getActionNotFoundErrorMessage(java.lang.String action,
                                                     java.lang.String resType,
                                                     java.lang.String resName,
                                                     Severity severity)

getActionTimeout

protected int getActionTimeout(ResourceAction action)

handleActionResult

protected boolean handleActionResult(WavesetResult result,
                                     java.lang.String actionType,
                                     boolean warnOnError)
                              throws WavesetException
Throws:
WavesetException

handleJavascriptActionResult

protected void handleJavascriptActionResult(WavesetResult result,
                                            java.lang.String actionName)
                                     throws WavesetException
Reprocess the WavesetResult to generate standard visible messages for the invocation of a Javascript action

Parameters:
result - in/out WavesetResult
actionName - ResoureAction name
Throws:
WavesetException

supportsAccountActions

public boolean supportsAccountActions()

isTestMode

protected boolean isTestMode()
Returns:
true if RA_TEST_MODE resource attribute is equal to "true", otherwise false

testConfiguration

public WavesetResult testConfiguration()
                                throws WavesetException
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
Throws:
WavesetException

getRequiredUserAttributeNames

public static java.lang.String[] getRequiredUserAttributeNames(Resource resource)
                                                        throws WavesetException
Given a resource, get the names of required attributes to create a user there. This will be the builtin waveset user attributes and the resource's

Throws:
WavesetException

checkForNoPasswordInSchema

protected void checkForNoPasswordInSchema(Resource resource,
                                          WavesetResult result,
                                          WSUser user)
                                   throws WavesetException
Verify that if a user has a password to be set that the resource has password mapped in its schema. If the user has a password set and the resource does not have password mapped; add a message and set the password to null. Setting the password to null tells the provisioner that the password was set correctly. This isn't the case here but we want to tell the provisioner that we have handled it (the message).

Throws:
WavesetException

getUser

public WSUser getUser(WSUser user,
                      long milliseconds)
               throws WavesetException,
                      java.lang.InterruptedException
Specified by:
getUser in interface ResourceAdapter
Parameters:
milliseconds - how many milliseconds to wait
Returns:
a WSUser object representing the resource account (specified as the input WSUser). Returns null if the account does not exist.

Throws:
java.lang.InterruptedException - if the operation does not complete within the specified timeout.
WavesetException

deleteAccount

public WavesetResult deleteAccount(WSUser user,
                                   long milliseconds)
                            throws WavesetException,
                                   java.lang.InterruptedException
Description copied from interface: ResourceAdapter
Delete the resource account specified by the input WSUser.

Specified by:
deleteAccount in interface ResourceAdapter
Parameters:
milliseconds - how many milliseconds to wait
Throws:
java.lang.InterruptedException - if the operation does not complete within the specified timeout.
WavesetException

getAccountIterator

public AccountIterator getAccountIterator(long milliseconds)
                                   throws WavesetException,
                                          java.lang.InterruptedException
Specified by:
getAccountIterator in interface ResourceAdapter
Parameters:
milliseconds - how many milliseconds to wait
Returns:
an account iterator.

Throws:
java.lang.InterruptedException - if the operation does not complete within the specified timeout.
WavesetException

listAllObjects

public java.util.ArrayList listAllObjects(java.lang.String objectType,
                                          java.util.Map options,
                                          java.lang.String runAsUser,
                                          EncryptedData runAsPassword,
                                          long milliseconds)
                                   throws WavesetException,
                                          java.lang.InterruptedException
Specified by:
listAllObjects in interface ResourceAdapter
Parameters:
milliseconds - how many milliseconds to wait
Returns:
a list containing names of objects of the specified type. If you need to be able to specify which attrs to return, use listObjects instead.

Throws:
java.lang.InterruptedException - if the operation does not complete within the specified timeout.
WavesetException

fillInResourceInfo

public static void fillInResourceInfo(WSUser user,
                                      Resource r,
                                      java.lang.String resoAcctId,
                                      ResourceAdapter ra)
                               throws WavesetException
Called by the loader to flesh out a ResourceInfo object for a resource we've discovering through the load. Leave behind a ResourceInfo object with the given id, and set the created flag to true.

Throws:
WavesetException

fillInResourceInfo

public static void fillInResourceInfo(WSUser user,
                                      Resource r,
                                      java.lang.String resoAcctId,
                                      java.lang.String guid,
                                      ResourceAdapter ra)
                               throws WavesetException
Called by the loader to flesh out a ResourceInfo object for a resource we've discovering through the load. Leave behind a ResourceInfo object with the given id, and set the created flag to true.

Throws:
WavesetException

isAccountAttributeSecret

protected boolean isAccountAttributeSecret(java.lang.String mapName)
Determines if a specified RHS attribute is secret. If the LHS is "password" or the syntax in encrypted, return true.

Parameters:
mapName - - the RHS attribute name
Returns:
true if LHS is "password" or the syntax in encrypted

isFeatureEnabled

protected final boolean isFeatureEnabled(java.lang.String feature)
Utility method to check if the specified Feature is supported and enabled.

Parameters:
feature - Feature string, see ResourceAdapter.Features
Returns:
Whether the feature is both supported and not disabled.