com.waveset.adapter
Class VMSResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.GenericScriptResourceAdapter
          extended bycom.waveset.adapter.VMSResourceAdapter
All Implemented Interfaces:
ResourceAdapter, ResourcePolicyTimeouts

public class VMSResourceAdapter
extends GenericScriptResourceAdapter

Resource adapter supporting VMS 7.2 (and possibly other versions) by using shell script commands through a scripted telnet connection.


Nested Class Summary
protected  class VMSResourceAdapter.AcctIter
          AccountIterator implementation that can be built by construction from the output of "lsuser ALL".
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase
ResourceAdapterBase.SimpleAccountIterator
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType
 
Field Summary
static java.lang.String code_id
           
static java.lang.String DISPLAY_PASSWORD
           
static java.lang.String DISPLAY_USER
           
static java.lang.String LOGIN_PASSWORD
           
static java.lang.String LOGIN_USER
           
protected  java.lang.String loginPass
           
protected  ScriptToken.WaitFor loginPromptErrorWaitToken
           
protected  ScriptToken.WaitFor loginPromptWaitToken
           
protected  java.lang.String loginShellPrompt
           
protected  java.lang.String loginUser
           
static java.lang.String RA_CONN_TYPE
           
static java.lang.String RA_HOST
           
static java.lang.String RA_LISTUSER_ATTR_PARSE
           
static java.lang.String RA_LOGIN_PASSWORD
           
static java.lang.String RA_LOGIN_SHELL_PROMPT
           
static java.lang.String RA_LOGIN_USER
           
static java.lang.String RA_PORT
           
static java.lang.String RESOURCE_NAME
           
static java.lang.String RESOURCE_USER_FORM
           
protected  ScriptToken.WaitFor UAFContinuationPromptErrorWaitToken
           
protected  ScriptToken.WaitFor UAFPromptErrorWaitToken
           
protected  ScriptToken.WaitFor UAFPromptWaitToken
           
 
Fields inherited from class com.waveset.adapter.GenericScriptResourceAdapter
conn, RA_BLOCK_FETCH_TIMEOUT, RA_CONN_MAX, RA_CONN_TIMEOUT, RA_TERM
 
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
VMSResourceAdapter()
          No argument constructor.
VMSResourceAdapter(Resource res, ObjectCache cache)
          Constructor
 
Method Summary
 void addCopyLoginScriptToScript(Script script, WSUser user, boolean isUpdate)
          Add login script copy to the script.
 void addCreateDirToScript(Script script, WSUser user, boolean isUpdate)
          Add directory creation to the script.
protected  java.lang.String addUIC(WSUser user, java.lang.String userAttrParms)
           
protected  WSUser buildUser(java.lang.String userStr, WSUser targetUser)
          Build a WSUser from the output of the VMS "show user" command.
protected  java.lang.String constructUserAttributeParameter(java.lang.String key, java.lang.String value)
          Builds up a single user attribute value suitable for shell commands, given the parameter key and value.
 Resource createPrototypeResource()
          Non-static version of staticCreatePrototypeResource()
 void deleteDirectory(java.lang.String device, java.lang.String directory)
          Deletes a directory on the given device and directory.
protected  AccountIterator getAccountIteratorResult(CaptureList captureList)
          Generates an account iterator from the capture list that was built from running the getAccountIteratorScript generated script through the ScriptedConnection.
protected  Script getAccountIteratorScript()
          Returns a script that can be run on an opened and logged in ScriptedConnection to pull a list of users out of the system.
protected  WavesetResult getAuthenticateResult(java.util.HashMap loginInfo, CaptureList captureList)
          Takes the capture list from running the authenticate script through the resource and validates it.
protected  Script getAuthenticateScript(java.util.HashMap loginInfo)
          Generates a script for authenticating a user on the resource using the username and password in the loginInfo HashMap.
protected  WavesetResult getCheckCreateAccountResult(CaptureList captureList)
          Validates the capture list returned from the check create account script execution.
protected  Script getCheckCreateAccountScript()
          Returns a shell script to check the resource and determine if a create account request is likely to succeed.
protected  WavesetResult getCheckDeleteAccountResult(CaptureList captureList)
          Validates the capture list returned from the delete create account script execution.
protected  Script getCheckDeleteAccountScript()
          Returns a shell script to check the resource and determine if a delete account request is likely to succeed.
protected  WavesetResult getCheckUpdateAccountResult(CaptureList captureList)
          Validates the capture list returned from the check update account script execution.
protected  Script getCheckUpdateAccountScript()
          Returns a shell script to check the resource and determine if an update account request is likely to succeed.
protected  java.lang.String getConnectionType()
          Returns the scripted connection type of the resource.
protected  void getCreateUserResult(CaptureList captureList, WavesetResult result)
          Analyzes the capture list generated by executing the create user script on the scripted connection.
protected  Script getCreateUserScript(WSUser user)
          Generates a script that will create an account for the passed user on the resource.
protected  void getDeleteUserResult(CaptureList captureList)
          Analyzes the capture list generated by executing the delete user script on the scripted connection.
protected  Script getDeleteUserScript(WSUser user)
          Generates a script that will delete the account of the passed user on the resource.
protected  boolean getDisableUserResult(CaptureList captureList)
          Analyzes the capture list generated by executing the disable user script on the scripted connection.
protected  Script getDisableUserScript(WSUser user, java.lang.String password)
          Generates a script that will disable an account for the passed user on the resource.
protected  boolean getEnableUserResult(CaptureList captureList)
          Analyzes the capture list generated by executing the enable user script on the scripted connection.
protected  Script getEnableUserScript(WSUser user, java.lang.String password)
          Generates a script that will enable an account for the passed user on the resource.
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
protected  java.util.ArrayList getListAllObjectsResult(CaptureList captureList)
          Analyzes the captrure list generated by executing the listAllObjects script on the scripted connection.
protected  Script getListAllObjectsScript(java.lang.String resObjType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword)
          Returns a script which will return a list of objects of a specified type from the scriptedConnection.
protected  Script getLoginScript()
          Returns a script that will log the administrative user into the system and set up the shell if necessary.
protected  Script getLogoutScript()
          Returns a script that will log the administrative user out of the resource.
protected  ScriptedConnection getScriptedConnection()
          Creates and returns a ScriptedConnection to the resource.
protected  WavesetResult getTestConnectionResult(CaptureList captureList)
          Evaluates capture list from execution of generic test connection script.
protected  Script getTestConnectionScript()
          Creates a script to test the connection, does NOT login or logout.
protected  java.lang.String getUIC(WSUser user)
           
protected  void getUpdateUserResult(WSUser user, CaptureList captureList, WavesetResult result)
          Analyzes the capture list generated by executing the update user script on the scripted connection.
protected  Script getUpdateUserScript(WSUser user, java.lang.String password)
          Generates a script that will update an account for the passed user on the resource.
protected  WSUser getUserResult(CaptureList captureList, WSUser targetUser)
          Analyzes the capture list generated by executing the get user script on the scripted connection.
protected  Script getUserScript(WSUser user)
          Returns a script that sends commands to check for existence of the passed user on the resource.
protected  void init()
          Initialize the resource fields.
protected  boolean isAllowableUserAttribute(java.lang.String name)
          Reports whether a given attribute name is legal on the resource.
static void main(java.lang.String[] args)
           
 java.lang.Object nextUICMember(java.util.Map args)
          Returns the next member number for the given UIC group.
protected  java.lang.String removeInitialSpace(java.lang.String s)
          Utility method returns a string with initial spaces stripped.
protected  void setFromResource()
           
protected  void startConnection()
          Starts a scripted connection up and logs into it.
static Resource staticCreatePrototypeResource()
          Creates a resource based on the prototype xml.
 boolean supportsAccountDisable()
          Whether the resource can enable and disable accounts.
protected  void VMSReverseMap(WSUser user, java.util.Map map)
           
protected  void VMSReverseMapAttr(WSUser user, java.lang.String attr, java.lang.Object value)
          Map from a VMS resource tag to a waveset attribute and add them to the user.
 
Methods inherited from class com.waveset.adapter.GenericScriptResourceAdapter
authenticate, checkCreateAccount, checkDeleteAccount, checkUpdateAccount, constructUserAttributeParameters, constructUserAttributeParameters, createObject, deleteObject, getAccountActionResult, getAccountActionScript, getAccountAttributeFromMapName, getAccountAttributes, getAccountIterator, getAccountIterator, getAccountIteratorScript, getActionResult, getActionScript, getCapture, getCreateObjectResult, getCreateObjectScript, getDeleteObjectResult, getDeleteObjectScript, getGetObjectResult, getGetObjectScript, getListAllObjectsResult, getListObjectsResult, getListObjectsScript, getObject, getRenameObjectResult, getRenameObjectScript, getResourceAccounts, getScanningResult, getScanningScript, getTestConfigurationResult, getTestConfigurationScript, getUpdateObjectResult, getUpdateObjectScript, getUpdateUserResult, getUpdateUserScript, getUser, getWaitFor, getWaitForIgnoreCase, listAllObjects, listObjects, lookupAndRunAction, realCreate, realDelete, realDisable, realEnable, realUpdate, renameObject, reverseMapAttr, reverseMapAttr, reverseMapMultiAttr, run, runAction, runAction, runAfterAction, runBeforeAction, scan, stopConnection, testConfiguration, updateObject, updateResourceAccount, wellFormedUserAttributeName
 
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, 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, 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, setCache, setContext, setDisabled, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnectionWrapper, supportsAccountActions, supportsActions, supportsCaseInsensitiveAccountIds, supportsContainerObjectTypes, supportsExcludedAccounts, supportsResourceAccount, supportsScanning, updateAccount, updateAccounts, updateResourceIdentity, vmStoreBoot, vmStoreGet, vmStoreInit, vmStoreLatch, vmStorePut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

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

RA_LOGIN_PASSWORD

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

RA_LOGIN_SHELL_PROMPT

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

RA_LOGIN_USER

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

RA_PORT

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

RA_CONN_TYPE

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

RA_HOST

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

RA_LISTUSER_ATTR_PARSE

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

LOGIN_USER

public static final java.lang.String LOGIN_USER
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_USER_FORM

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

loginUser

protected java.lang.String loginUser

loginPass

protected java.lang.String loginPass

loginShellPrompt

protected java.lang.String loginShellPrompt

loginPromptWaitToken

protected ScriptToken.WaitFor loginPromptWaitToken

loginPromptErrorWaitToken

protected ScriptToken.WaitFor loginPromptErrorWaitToken

UAFPromptWaitToken

protected ScriptToken.WaitFor UAFPromptWaitToken

UAFPromptErrorWaitToken

protected ScriptToken.WaitFor UAFPromptErrorWaitToken

UAFContinuationPromptErrorWaitToken

protected ScriptToken.WaitFor UAFContinuationPromptErrorWaitToken
Constructor Detail

VMSResourceAdapter

public VMSResourceAdapter()
                   throws WavesetException
No argument constructor.


VMSResourceAdapter

public VMSResourceAdapter(Resource res,
                          ObjectCache cache)
                   throws WavesetException
Constructor

Method Detail

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Creates a resource based on the prototype xml.

Throws:
WavesetException

setFromResource

protected void setFromResource()
Overrides:
setFromResource in class ResourceAdapterBase

init

protected void init()
             throws WavesetException
Initialize the resource fields.

Throws:
WavesetException

constructUserAttributeParameter

protected java.lang.String constructUserAttributeParameter(java.lang.String key,
                                                           java.lang.String value)
Builds up a single user attribute value suitable for shell commands, given the parameter key and value.

Specified by:
constructUserAttributeParameter in class GenericScriptResourceAdapter

createPrototypeResource

public Resource createPrototypeResource()
                                 throws WavesetException
Non-static version of staticCreatePrototypeResource()

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

getAccountIteratorResult

protected AccountIterator getAccountIteratorResult(CaptureList captureList)
Generates an account iterator from the capture list that was built from running the getAccountIteratorScript generated script through the ScriptedConnection.

Specified by:
getAccountIteratorResult in class GenericScriptResourceAdapter

getAccountIteratorScript

protected Script getAccountIteratorScript()
Returns a script that can be run on an opened and logged in ScriptedConnection to pull a list of users out of the system.

Specified by:
getAccountIteratorScript in class GenericScriptResourceAdapter

getListAllObjectsResult

protected java.util.ArrayList getListAllObjectsResult(CaptureList captureList)
                                               throws WavesetException
Analyzes the captrure list generated by executing the listAllObjects script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Throws:
WavesetException

getListAllObjectsScript

protected Script getListAllObjectsScript(java.lang.String resObjType,
                                         java.util.Map options,
                                         java.lang.String runAsUser,
                                         EncryptedData runAsPassword)
                                  throws WavesetException
Returns a script which will return a list of objects of a specified type from the scriptedConnection. This script should login as the username and password, if specified, or login as the authoritative account.

Overrides:
getListAllObjectsScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getAuthenticateResult

protected WavesetResult getAuthenticateResult(java.util.HashMap loginInfo,
                                              CaptureList captureList)
                                       throws WavesetException
Takes the capture list from running the authenticate script through the resource and validates it. Throws if it is invalid.

Specified by:
getAuthenticateResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getAuthenticateScript

protected Script getAuthenticateScript(java.util.HashMap loginInfo)
                                throws WavesetException
Generates a script for authenticating a user on the resource using the username and password in the loginInfo HashMap. Should NOT login or logout.

Specified by:
getAuthenticateScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckCreateAccountResult

protected WavesetResult getCheckCreateAccountResult(CaptureList captureList)
                                             throws WavesetException
Validates the capture list returned from the check create account script execution. Returns a result if create account is likely to succeed, otherwise throws. The executing script may also throw if check fails.

Specified by:
getCheckCreateAccountResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckCreateAccountScript

protected Script getCheckCreateAccountScript()
                                      throws WavesetException
Returns a shell script to check the resource and determine if a create account request is likely to succeed. Running the script through the scripted connection may cause a failure and throw, or evaluating the resulting capture list may result in a throw. The script should NOT login or logout.

Specified by:
getCheckCreateAccountScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckDeleteAccountResult

protected WavesetResult getCheckDeleteAccountResult(CaptureList captureList)
                                             throws WavesetException
Validates the capture list returned from the delete create account script execution. Returns a result if delete account is likely to succeed, otherwise throws. The executing script may also throw if check fails.

Specified by:
getCheckDeleteAccountResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckDeleteAccountScript

protected Script getCheckDeleteAccountScript()
                                      throws WavesetException
Returns a shell script to check the resource and determine if a delete account request is likely to succeed. Running the script through the scripted connection may cause a failure and throw, or evaluating the resulting capture list may result in a throw. The script should NOT login or logout.

Specified by:
getCheckDeleteAccountScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckUpdateAccountResult

protected WavesetResult getCheckUpdateAccountResult(CaptureList captureList)
                                             throws WavesetException
Validates the capture list returned from the check update account script execution. Returns a result if update account is likely to succeed, otherwise throws. The executing script may also throw if check fails.

Specified by:
getCheckUpdateAccountResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getCheckUpdateAccountScript

protected Script getCheckUpdateAccountScript()
                                      throws WavesetException
Returns a shell script to check the resource and determine if an update account request is likely to succeed. Running the script through the scripted connection may cause a failure and throw, or evaluating the resulting capture list may result in a throw. The script should NOT login or logout.

Specified by:
getCheckUpdateAccountScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getConnectionType

protected java.lang.String getConnectionType()
                                      throws WavesetException
Returns the scripted connection type of the resource.

Specified by:
getConnectionType in class GenericScriptResourceAdapter
Throws:
WavesetException

getCreateUserResult

protected void getCreateUserResult(CaptureList captureList,
                                   WavesetResult result)
                            throws WavesetException
Analyzes the capture list generated by executing the create user script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Specified by:
getCreateUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getCreateUserScript

protected Script getCreateUserScript(WSUser user)
                              throws WavesetException
Generates a script that will create an account for the passed user on the resource. The script can be executed on a ScriptedConnection. Should NOT login or logout.

Specified by:
getCreateUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getDeleteUserResult

protected void getDeleteUserResult(CaptureList captureList)
                            throws WavesetException
Analyzes the capture list generated by executing the delete user script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Specified by:
getDeleteUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getDeleteUserScript

protected Script getDeleteUserScript(WSUser user)
                              throws WavesetException
Generates a script that will delete the account of the passed user on the resource. The script can be executed on a ScriptedConnection. Should NOT login or logout.

Specified by:
getDeleteUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getDisableUserResult

protected boolean getDisableUserResult(CaptureList captureList)
                                throws WavesetException
Analyzes the capture list generated by executing the disable user script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Specified by:
getDisableUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getDisableUserScript

protected Script getDisableUserScript(WSUser user,
                                      java.lang.String password)
                               throws WavesetException
Generates a script that will disable an account for the passed user on the resource. The script can be executed on a ScriptedConnection. Should NOT login or logout.

Specified by:
getDisableUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getEnableUserResult

protected boolean getEnableUserResult(CaptureList captureList)
                               throws WavesetException
Analyzes the capture list generated by executing the enable user script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Specified by:
getEnableUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getEnableUserScript

protected Script getEnableUserScript(WSUser user,
                                     java.lang.String password)
                              throws WavesetException
Generates a script that will enable an account for the passed user on the resource. The script can be executed on a ScriptedConnection. Should NOT login or logout.

Specified by:
getEnableUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getLoginScript

protected Script getLoginScript()
                         throws WavesetException
Returns a script that will log the administrative user into the system and set up the shell if necessary.

Specified by:
getLoginScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getLogoutScript

protected Script getLogoutScript()
                          throws WavesetException
Returns a script that will log the administrative user out of the resource.

Specified by:
getLogoutScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getScriptedConnection

protected ScriptedConnection getScriptedConnection()
                                            throws WavesetException
Creates and returns a ScriptedConnection to the resource.

Specified by:
getScriptedConnection in class GenericScriptResourceAdapter
Throws:
WavesetException

getTestConnectionResult

protected WavesetResult getTestConnectionResult(CaptureList captureList)
                                         throws WavesetException
Evaluates capture list from execution of generic test connection script.

Throws:
WavesetException

getTestConnectionScript

protected Script getTestConnectionScript()
                                  throws WavesetException
Creates a script to test the connection, does NOT login or logout.

Throws:
WavesetException

getUIC

protected java.lang.String getUIC(WSUser user)

getUpdateUserResult

protected void getUpdateUserResult(WSUser user,
                                   CaptureList captureList,
                                   WavesetResult result)
                            throws WavesetException
Analyzes the capture list generated by executing the update user script on the scripted connection. Throws if the capture list indicates failure. The executing script may throw on failure also.

Specified by:
getUpdateUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

addUIC

protected java.lang.String addUIC(WSUser user,
                                  java.lang.String userAttrParms)

addCreateDirToScript

public void addCreateDirToScript(Script script,
                                 WSUser user,
                                 boolean isUpdate)
                          throws WavesetException
Add directory creation to the script. The directory will be created on the given device and directory. The owner of the directory will be set to the given userid.

Throws:
WavesetException

addCopyLoginScriptToScript

public void addCopyLoginScriptToScript(Script script,
                                       WSUser user,
                                       boolean isUpdate)
                                throws WavesetException
Add login script copy to the script. The login script will be copied to the given device and directory.

Throws:
WavesetException

getUpdateUserScript

protected Script getUpdateUserScript(WSUser user,
                                     java.lang.String password)
                              throws WavesetException
Generates a script that will update an account for the passed user on the resource. The script can be executed on a ScriptedConnection. Should NOT login or logout.

Specified by:
getUpdateUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

getUserResult

protected WSUser getUserResult(CaptureList captureList,
                               WSUser targetUser)
                        throws WavesetException
Analyzes the capture list generated by executing the get user script on the scripted connection. Returns null if the capture list indicates failure. Otherwise returns the new user. Should probably be called getGetUserResult for consistency, but that would look funny.

Specified by:
getUserResult in class GenericScriptResourceAdapter
Throws:
WavesetException

getUserScript

protected Script getUserScript(WSUser user)
                        throws WavesetException
Returns a script that sends commands to check for existence of the passed user on the resource. Upon execution, captures necessary text for analysis by getUserResult method.

Specified by:
getUserScript in class GenericScriptResourceAdapter
Throws:
WavesetException

removeInitialSpace

protected java.lang.String removeInitialSpace(java.lang.String s)
Utility method returns a string with initial spaces stripped.


isAllowableUserAttribute

protected boolean isAllowableUserAttribute(java.lang.String name)
Reports whether a given attribute name is legal on the resource.

Specified by:
isAllowableUserAttribute in class GenericScriptResourceAdapter

startConnection

protected void startConnection()
                        throws WavesetException
Starts a scripted connection up and logs into it.

Overrides:
startConnection in class GenericScriptResourceAdapter
Throws:
WavesetException

supportsAccountDisable

public boolean supportsAccountDisable()
Whether the resource can enable and disable accounts.

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

VMSReverseMap

protected void VMSReverseMap(WSUser user,
                             java.util.Map map)
                      throws WavesetException
Throws:
WavesetException

VMSReverseMapAttr

protected void VMSReverseMapAttr(WSUser user,
                                 java.lang.String attr,
                                 java.lang.Object value)
Map from a VMS resource tag to a waveset attribute and add them to the user.


buildUser

protected WSUser buildUser(java.lang.String userStr,
                           WSUser targetUser)
                    throws WavesetException
Build a WSUser from the output of the VMS "show user" command. The output is formatted like this: Username: TEST14 Owner: TEST14 Account: UIC: [200,214] ([TEST14]) CLI: DCL Tables: DCLTABLES Default: [TEST14] LGICMD: Flags: DisUser Primary days: Mon Tue Wed Thu Fri Secondary days: Sat Sun No access restrictions Expiration: (none) Pwdminimum: 6 Login Fails: 0 Pwdlifetime: 90 00:00 Pwdchange: 4-FEB-2002 15:11 Last Login: 18-FEB-2002 09:55 (interactive), 12-FEB-2002 10:41 (non-interactive) Maxjobs: 0 Fillm: 100 Bytlm: 64000 Maxacctjobs: 0 Shrfillm: 0 Pbytlm: 0 Maxdetach: 0 BIOlm: 150 JTquota: 4096 Prclm: 8 DIOlm: 150 WSdef: 2000 Prio: 4 ASTlm: 250 WSquo: 4000 Queprio: 4 TQElm: 10 WSextent: 16384 CPU: (none) Enqlm: 2000 Pgflquo: 50000 Authorized Privileges: NETMBX TMPMBX Default Privileges: NETMBX TMPMBX Notice that this is not the nicest stream to tokenize or parse. The following will parse all VMS tags except when they restrict access to the account using the /ACCESS account modifier. Also we assume that any text contained in parentheses is garbage and it is ignored.

Throws:
WavesetException

deleteDirectory

public void deleteDirectory(java.lang.String device,
                            java.lang.String directory)
                     throws WavesetException
Deletes a directory on the given device and directory.

Throws:
WavesetException

nextUICMember

public java.lang.Object nextUICMember(java.util.Map args)
                               throws WavesetException
Returns the next member number for the given UIC group. It doesn't attempt to try and fill in holes in the UIC sequence, it just adds one to the largest member found for the given UIC group.

Throws:
WavesetException

getFeatures

public GenericObject getFeatures()
Description copied from class: ResourceAdapterBase
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 GenericScriptResourceAdapter

main

public static void main(java.lang.String[] args)