com.waveset.adapter
Class HostAccessResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.HostAccessResourceAdapter
All Implemented Interfaces:
ResourceAdapter
Direct Known Subclasses:
ACF2ResourceAdapter, NaturalResourceAdapter, RACFResourceAdapter, ScriptedHostResourceAdapter, TopSecretResourceAdapter

public abstract class HostAccessResourceAdapter
extends ResourceAdapterBase


Nested Class Summary
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase
ResourceAdapterBase.SimpleAccountIterator
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType
 
Field Summary
static java.lang.String CLASS
           
static java.lang.String code_id
           
static java.lang.String HOST_ACCESS_GLOBAL_NAME
          Standard global variable name which is expected to be available to mainframe Javascript resource actions.
static java.lang.String JAVASCRIPT_GLOBALS_ACTION_PROPERTY
          Name of property on ResourceAction which contains map of globals to be passed to javascript
static java.lang.String USER_ATTRS_GLOBAL_NAME
          Standard global variable name which is expected to be available to mainframe Javascript resource actions.
static java.lang.String USER_IDENTITY_GLOBAL_NAME
          Standard global variable name which is expected to be available to mainframe Javascript resource actions.
 
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.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
HostAccessResourceAdapter()
           
HostAccessResourceAdapter(Resource res, ObjectCache cache)
           
 
Method Summary
protected  void filterAndParseData(java.lang.String resp, boolean verbose, java.io.BufferedWriter bw, boolean asHtml)
           
protected  void formatOutputStr(java.lang.String s, java.io.BufferedWriter bw, boolean asHtml)
           
protected  HostAccess getHostAccess()
           
protected  java.lang.String getResourceId()
           
protected  void lookupAndRunJavascriptAction(HostAccess hostAccess, WSUser user, java.lang.String operation, java.lang.String timing, WavesetResult result)
          Lookup and run (if present) the specified resource action (assumed to be Javascript for mainframe).
 boolean parseDataFromFile(java.util.Map args, java.lang.StringBuffer resultString)
           
protected  java.lang.String readDataFile(java.lang.String fileName, java.io.BufferedWriter bw, boolean asHtml)
           
 WavesetResult run(ResourceAction resAction, java.util.Map args)
          run() provides the support for the ACTIONS feaure
protected  void runAfterJavascriptAction(HostAccess hostAccess, WSUser user, WavesetResult result, java.lang.String operation)
          Convenience wrapper around lookupAndRunJavascriptAction(HostAccess,WSUser,String,String,WavesetResult)
protected  void runBeforeJavascriptAction(HostAccess hostAccess, WSUser user, WavesetResult result, java.lang.String operation)
          Convenience wrapper around lookupAndRunJavascriptAction(HostAccess,WSUser,String,String,WavesetResult)
static void runJavascript(java.lang.String script, java.lang.String label, java.util.Map globals, WavesetResult result)
          Run a Javascript script, allowing for stdout, stderr, and return value capture into a WavesetResult.
 WavesetResult runJavascriptAction(ResourceAction resAction, java.util.Map globals)
          Run the ResourceAction.
protected  void runResourceAttributeJavascriptAction(java.lang.String resAttrName, HostAccess hostAccess, HostAccessLogin hostAccessLogin, java.lang.String user, EncryptedData password)
           
 boolean supportsActions()
           
protected  void verifyUsers(java.util.ArrayList users, boolean verbose, java.io.BufferedWriter bw, boolean asHtml)
           
 
Methods inherited from class com.waveset.adapter.ResourceAdapterBase
authenticate, checkCreateAccount, checkDeleteAccount, checkForNoPasswordInSchema, checkSyntax, checkUpdateAccount, createAccount, createAccounts, createIdentity, createObject, createPrototypeResource, deleteAccount, deleteAccount, deleteAccounts, deleteObject, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountAttributes, getAccountIterator, 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, getFeatures, getIdentity, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, getObject, getOptionalBooleanResAttrVal, getOptionalBooleanResAttrVal, getOptionalEncryptedResAttrVal, getOptionalResAttrVal, getOptionalStringResAttrVal, getRequiredResAttr, getRequiredResAttr, getRequiredResAttrVal, getRequiredResAttrVal, getRequiredResAttrVals, getRequiredUserAttributeNames, getResAttrValActionOnUser, getResAttrVals, getResource, getResourceAccounts, getResourceInfo, getResourceObjectAttrValNameAttr, getResourceObjectClassAttr, getResourceObjectTypePrefix, getSchemaMap, getUser, getUser, getWSAttrByMapName, getWSAttrByMapName, getWSAttrFromMap, handleActionResult, handleJavascriptActionResult, isAccountAttributeSecret, isExcludedAccount, isExcludedAccount, isFeatureEnabled, isSupported, isTestMode, listAllObjects, listAllObjects, listObjects, listObjects, listObjectsOfType, lookupAction, lookupAction, lookupActions, namesEqual, objectClassesMatchType, println, realCreate, realDelete, realDisable, realEnable, realUpdate, restoreResourceObjectClassAttr, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnection, startConnectionWrapper, stopConnection, supportsAccountActions, supportsAccountDisable, supportsCaseInsensitiveAccountIds, supportsContainerObjectTypes, supportsExcludedAccounts, supportsResourceAccount, supportsScanning, testConfiguration, updateAccount, updateAccounts, updateObject, updateResourceAccount, updateResourceIdentity, vmStoreBoot, vmStoreGet, vmStoreInit, vmStoreLatch, vmStorePut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

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

CLASS

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

HOST_ACCESS_GLOBAL_NAME

public static final java.lang.String HOST_ACCESS_GLOBAL_NAME
Standard global variable name which is expected to be available to mainframe Javascript resource actions. The instance will be a HostAccess instance.

See Also:
Constant Field Values

USER_ATTRS_GLOBAL_NAME

public static final java.lang.String USER_ATTRS_GLOBAL_NAME
Standard global variable name which is expected to be available to mainframe Javascript resource actions. The instance will be a Map of user attributes.

See Also:
Constant Field Values

USER_IDENTITY_GLOBAL_NAME

public static final java.lang.String USER_IDENTITY_GLOBAL_NAME
Standard global variable name which is expected to be available to mainframe Javascript resource actions. The instance will be a String holding the account id for the user, fetched from the resource info

See Also:
Constant Field Values

JAVASCRIPT_GLOBALS_ACTION_PROPERTY

public static final java.lang.String JAVASCRIPT_GLOBALS_ACTION_PROPERTY
Name of property on ResourceAction which contains map of globals to be passed to javascript

See Also:
Constant Field Values
Constructor Detail

HostAccessResourceAdapter

public HostAccessResourceAdapter(Resource res,
                                 ObjectCache cache)
                          throws WavesetException

HostAccessResourceAdapter

public HostAccessResourceAdapter()
                          throws WavesetException
Method Detail

getHostAccess

protected HostAccess getHostAccess()

getResourceId

protected java.lang.String getResourceId()

runResourceAttributeJavascriptAction

protected void runResourceAttributeJavascriptAction(java.lang.String resAttrName,
                                                    HostAccess hostAccess,
                                                    HostAccessLogin hostAccessLogin,
                                                    java.lang.String user,
                                                    EncryptedData password)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

runBeforeJavascriptAction

protected void runBeforeJavascriptAction(HostAccess hostAccess,
                                         WSUser user,
                                         WavesetResult result,
                                         java.lang.String operation)
                                  throws WavesetException
Convenience wrapper around lookupAndRunJavascriptAction(HostAccess,WSUser,String,String,WavesetResult)

Throws:
WavesetException

runAfterJavascriptAction

protected void runAfterJavascriptAction(HostAccess hostAccess,
                                        WSUser user,
                                        WavesetResult result,
                                        java.lang.String operation)
                                 throws WavesetException
Convenience wrapper around lookupAndRunJavascriptAction(HostAccess,WSUser,String,String,WavesetResult)

Throws:
WavesetException

lookupAndRunJavascriptAction

protected void lookupAndRunJavascriptAction(HostAccess hostAccess,
                                            WSUser user,
                                            java.lang.String operation,
                                            java.lang.String timing,
                                            WavesetResult result)
                                     throws WavesetException
Lookup and run (if present) the specified resource action (assumed to be Javascript for mainframe).

Parameters:
hostAccess - HostAccess to pass to Javascript
user - user info to pass to Javascript
operation - specifies which action (e.g. "delete" "create" )
timing - specifies which action ("before" or "after")
result -
Throws:
WavesetException

run

public WavesetResult run(ResourceAction resAction,
                         java.util.Map args)
                  throws WavesetException
run() provides the support for the ACTIONS feaure

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

supportsActions

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

runJavascriptAction

public WavesetResult runJavascriptAction(ResourceAction resAction,
                                         java.util.Map globals)
                                  throws WavesetException
Run the ResourceAction. The action script must be Javascript. Pass the globals map as globals to the Javascript.

Throws:
WavesetException

runJavascript

public static void runJavascript(java.lang.String script,
                                 java.lang.String label,
                                 java.util.Map globals,
                                 WavesetResult result)
                          throws WavesetException
Run a Javascript script, allowing for stdout, stderr, and return value capture into a WavesetResult. Maybe this should be moved to ResourceAdapterBase?

Parameters:
script - javascript string to execute
label - string to use in javascript error messages
globals - globals to make available to script
result - where to store output
Throws:
WavesetException

readDataFile

protected java.lang.String readDataFile(java.lang.String fileName,
                                        java.io.BufferedWriter bw,
                                        boolean asHtml)
                                 throws WavesetException,
                                        java.io.IOException
Throws:
WavesetException
java.io.IOException

verifyUsers

protected void verifyUsers(java.util.ArrayList users,
                           boolean verbose,
                           java.io.BufferedWriter bw,
                           boolean asHtml)
                    throws WavesetException,
                           java.io.IOException
Throws:
WavesetException
java.io.IOException

parseDataFromFile

public boolean parseDataFromFile(java.util.Map args,
                                 java.lang.StringBuffer resultString)

filterAndParseData

protected void filterAndParseData(java.lang.String resp,
                                  boolean verbose,
                                  java.io.BufferedWriter bw,
                                  boolean asHtml)
                           throws java.io.IOException,
                                  WavesetException
Throws:
java.io.IOException
WavesetException

formatOutputStr

protected void formatOutputStr(java.lang.String s,
                               java.io.BufferedWriter bw,
                               boolean asHtml)
                        throws java.io.IOException
Throws:
java.io.IOException