com.waveset.adapter
Class SP2ResourceAdapter

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

public class SP2ResourceAdapter
extends AIXResourceAdapter

Resource adapter for the IBM SP2 - a distributed computing cluster in which each node runs AIX. Uses the AIXResourceAdapter for most things but listAllObjects needs capability to list the nodes in the cluster.


Nested Class Summary
 
Nested classes inherited from class com.waveset.adapter.AIXResourceAdapter
AIXResourceAdapter.AcctIter, AIXResourceAdapter.BlockAcctIter
 
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 ACCT_BACKUP_CW
           
static java.lang.String ACCT_NODES
           
static java.lang.String CLASS
           
static java.lang.String code_id
           
protected  java.lang.String hostlistCmd
          Default command for obtaining the list of nodes
protected  Script listNodesScript
           
static java.lang.String RA_BACKUP_CW
           
static java.lang.String RESOURCE_NAME
           
static java.lang.String RESOURCE_USER_FORM
           
 
Fields inherited from class com.waveset.adapter.AIXResourceAdapter
allowedNISAttributes, ATTR_COMMENT, ATTR_GROUP, ATTR_HOME, ATTR_PWD_ADMCHG, ATTR_PWD_ADMIN, ATTR_PWD_NOCHECK, ATTR_SHELL, CMD_CHGROUP, CMD_CHGRPMEM, CMD_CHSEC, CMD_CHUSER, CMD_LSSEC, CMD_LSUSER, CMD_MKGROUP, CMD_MKUSER, CMD_PASSWD, CMD_PWUSER, CMD_RMGROUP, CMD_RMUSER, DEFAULT_SHELL, DEFAULT_SHELLS, DISPLAY_PASSWORD, DISPLAY_USER, grpMutexFile, grpPidFile, isAdminUser, LOGIN_PASSWORD, LOGIN_USER, pwdMutexFile, pwdPidFile, RA_IS_ADMIN_USER, RA_RM_USER_FROM_ETC_SECURITY, rmUserFlag, tmpGrpMutexFile, tmpPwdMutexFile
 
Fields inherited from class com.waveset.adapter.UnixResourceAdapter
CMD_AWK, CMD_CAT, CMD_CHMOD, CMD_CHOWN, CMD_CP, CMD_CUT, CMD_DIFF, CMD_ECHO, CMD_GREP, CMD_GROUPADD, CMD_GROUPDEL, CMD_GROUPMOD, CMD_LAST, CMD_LISTUSERS, CMD_LOGINS, CMD_LS, CMD_MAKE, CMD_MV, CMD_RM, CMD_SED, CMD_SLEEP, CMD_SORT, CMD_SUDO, CMD_TAIL, CMD_TOUCH, CMD_USERADD, CMD_USERDEL, CMD_USERMOD, CMD_WHICH, CMD_YPCAT, CMD_YPMATCH, CMD_YPPASSWD, loginPass, loginShellPrompt, loginUser, ONE_TAIL, RA_ALT_ROOT_SHELL_PROMPT, RA_DEL_HOME_DIR, RA_HOME_BASEDIR, RA_LOGIN_SHELL_PROMPT, RA_NISDIR, RA_NISPWDDIR, RA_NISSRCDIR, RA_ROOT_PASSWORD, RA_ROOT_SHELL_PROMPT, RA_ROOT_USER, RA_SUDO_AUTH, RA_SYS_DB_TYPE, removeAction, rootPass, rootPromptCaptureToken, rootPromptCaptureTokenOrig, rootPromptWaitToken, rootPromptWaitTokenOrig, rootShellPrompt, rootShellPromptOrig, rootUser, sudoResetCmd, sudoResetToken, sudoStartCmd, sudoStartToken, wavesetRootPrompt, wavesetRootPromptCaptureToken, wavesetRootPromptWaitToken
 
Fields inherited from class com.waveset.adapter.GenericScriptResourceAdapter
conn, RA_BLOCK_FETCH_TIMEOUT, RA_CONN_MAX, RA_CONN_TIMEOUT, RA_CONN_TYPE, RA_HOST, RA_LOGIN_PASSWORD, RA_LOGIN_USER, RA_PORT, 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
SP2ResourceAdapter()
          No argument constructor.
SP2ResourceAdapter(Resource res, ObjectCache cache)
          Constructor
 
Method Summary
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  java.util.ArrayList getRequiredCmds()
          Creates a list of required commands for the resource.
protected  WSUser getUserResult(CaptureList captureList, WSUser targetUser)
          Overrides getUserResult in order to add the node list to the attributes.
protected  Script getUserScript(WSUser user)
          Returns a script that sends commands to check for existence of the passed user on the resource.
protected  ResourceAction lookupAction(WSUser user, java.lang.String operation, java.lang.String timing)
          Overrides the method from GenericScriptedResourceAdapter because enable/disable and certain other operations use Views which means that only the changed attributes are sent to the resource.
protected  void runAction(java.lang.String action, WSUser user, java.lang.String operation, int timeout, WavesetResult result)
          Only one action at a time is allowed to run on the SP2 because each action performs a propogation from the control workstation to the nodes of the cluster.
protected  void setNodeListAttr(WSUser user, java.lang.String dshOut)
          Parses the output of "dsh ...
protected  void startConnection()
          Starts a scripted connection up and logs into it.
static Resource staticCreatePrototypeResource()
          Creates a resource based on the prototype xml.
 
Methods inherited from class com.waveset.adapter.AIXResourceAdapter
addNISMake, addNISPasswordUpdate, addNISShellUpdate, addPwdAdmAttr, addPwdAdmCmd, addPwdAdmFlag, addPwdAdmFlag, addUid, addUpdatePwdAdmCmd, badGroupsMessage, buildUser, changeNISGroupMembers, checkGroups, constructNISUserAttributeParameters, constructUserAttributeParameter, createPrototypeResource, filterPwdAdmFlag, getAccountIteratorResult, getAccountIteratorScript, getAccountIteratorScript, getAccountIteratorScript, getAuthenticateResult, getAuthenticateScript, getBlockAccountIteratorScript, getCheckCreateAccountResult, getCheckCreateAccountScript, getCheckDeleteAccountResult, getCheckDeleteAccountScript, getCheckUpdateAccountResult, getCheckUpdateAccountScript, getConnectionTestResult, getConnectionTestScript, getConnectionType, getCreateNativeGroupScript, getCreateNativeUserScript, getCreateNISGroupScript, getCreateNISUserScript, getCreateUserResult, getCreateUserResult, getCreateUserScript, getDefaultShellsList, getDeleteNativeGroupScript, getDeleteNativeUserScript, getDeleteNativeUserScript, getDeleteNISGroupScript, getDeleteNISUserScript, getDeleteUserResult, getDeleteUserScript, getDisableUserResult, getDisableUserScript, getEnableUserResult, getEnableUserScript, getFeatures, getGetGroupResult, getGetGroupScript, getGetUserResult, getGetUserScript, getListAllObjectsResult, getLoginScript, getLogoutScript, getMutexAcquireScript, getMutexReleaseScript, getNISDir, getNISNewGidScript, getNISNewUidScript, getNISPwddir, getPwdAdmFlagAttrValue, getReadOnlyTestCmds, getRemoveGroupTmpFiles, getRemovePwdTmpFiles, getRequiredGroupCmds, getRequiredNISCmds, getRequiredUserCmds, getScanningResult, getScanningScript, getShellsScript, getTestConnectionResult, getTestConnectionScript, getUid, getUpdateNativeGroupScript, getUpdateNativeUserResult, getUpdateNativeUserScript, getUpdateNISGroupScript, getUpdateNISUserResult, getUpdateNISUserScript, getUpdateUserResult, getUpdateUserResult, getUpdateUserScript, getUpdateUserScript, getWhichScript, handleUnsetPwdAttr, isAllowableUserAttribute, removeInitialSpace, setPwdAdmAttrs, supportsAccountDisable, supportsResourceAccount
 
Methods inherited from class com.waveset.adapter.UnixResourceAdapter
addActionScript, addResultItem, addScriptArguments, addSudoReset, addSudoStart, authenticate, createResourceAttr, divideString, escape, getAccountActionResult, getAccountActionScript, getAccountIterator, getAccountIterator, getActionResult, getActionScript, getCaptureItem, getCreateGroupResult, getCreateGroupScript, getCreateObjectResult, getCreateObjectScript, getCreateUserScript, getDeleteGroupScript, getDeleteObjectScript, getDeleteUserScript, getGetObjectResult, getGetObjectScript, getListObjectsResult, getListObjectsScript, getReadOnlyNISTestCmds, getRenameGroupResult, getRenameGroupScript, getRenameObjectResult, getRenameObjectScript, getRenameUserResult, getRenameUserScript, getRequiredFileCmds, getResourceAccounts, getScriptedConnection, getTestConfigurationResult, getTestConfigurationScript, getUpdateGroupResult, getUpdateGroupScript, getUpdateObjectResult, getUpdateObjectScript, getUpdateUserScript, init, isNIS, quoteString, replaceSpaces, setWavesetPrompt, stopConnection, stopConnection, sudoAuthorization, supportsActions, supportsCaseInsensitiveAccountIds, supportsExcludedAccounts, testConnection
 
Methods inherited from class com.waveset.adapter.GenericScriptResourceAdapter
checkCreateAccount, checkDeleteAccount, checkUpdateAccount, constructUserAttributeParameters, constructUserAttributeParameters, createObject, deleteObject, getAccountAttributeFromMapName, getAccountAttributes, getCapture, getDeleteObjectResult, getObject, getUpdateUserResult, getUser, getWaitFor, getWaitForIgnoreCase, listAllObjects, listObjects, lookupAndRunAction, realCreate, realDelete, realDisable, realEnable, realUpdate, renameObject, reverseMapAttr, reverseMapAttr, reverseMapMultiAttr, run, runAction, runAfterAction, runBeforeAction, scan, 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, lookupActions, namesEqual, objectClassesMatchType, println, restoreResourceObjectClassAttr, run, runResourceAttributeJavascriptAction, setCache, setContext, setDisabled, setFromResource, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnectionWrapper, supportsAccountActions, supportsContainerObjectTypes, 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
 
Methods inherited from interface com.waveset.adapter.ResourceAdapter
checkCreateAccount, checkDeleteAccount, checkUpdateAccount, createAccount, createAccounts, createIdentity, createObject, deleteAccount, deleteAccount, deleteAccounts, deleteObject, disableAccount, disableAccounts, enableAccount, enableAccounts, getAccountAttributes, getAccountIterator, getAllAccounts, getBaseContextAttrName, getBaseContextObject, getBaseContexts, getObject, getResource, getUser, getUser, isSupported, listAllObjects, listAllObjects, listObjects, listObjects, listObjectsOfType, namesEqual, run, run, scan, setCache, setContext, setResource, setResourceObjectClassAttr, supportsContainerObjectTypes, supportsScanning, testConfiguration, updateAccount, updateAccounts, updateObject, updateResourceAccount
 

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

RA_BACKUP_CW

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

ACCT_BACKUP_CW

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

ACCT_NODES

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

hostlistCmd

protected java.lang.String hostlistCmd
Default command for obtaining the list of nodes


listNodesScript

protected Script listNodesScript
Constructor Detail

SP2ResourceAdapter

public SP2ResourceAdapter()
No argument constructor.


SP2ResourceAdapter

public SP2ResourceAdapter(Resource res,
                          ObjectCache cache)
Constructor

Method Detail

staticCreatePrototypeResource

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

Throws:
WavesetException

lookupAction

protected ResourceAction lookupAction(WSUser user,
                                      java.lang.String operation,
                                      java.lang.String timing)
                               throws WavesetException
Overrides the method from GenericScriptedResourceAdapter because enable/disable and certain other operations use Views which means that only the changed attributes are sent to the resource. The action names don't change, so they are never sent. This causes the actionName local variable to return null and the action is never run. As a workaround, these actions will be hard coded until a suitable fix can be implemented. Here are the required names of the actions: create: after-create update: after-update delete: after-delete enable: after-enable disable: after-disable

Overrides:
lookupAction in class ResourceAdapterBase
Parameters:
user - - the Waveset user object
operation - - the operation (i.e create, update, delete, enable, disable)
timing - - specifies when to run action (before or after)
Returns:
ResourceAction object that is the action to perform.
Throws:
WavesetException - thrown if the resource action can't be found.

getUserResult

protected WSUser getUserResult(CaptureList captureList,
                               WSUser targetUser)
                        throws WavesetException
Overrides getUserResult in order to add the node list to the attributes.

Overrides:
getUserResult in class AIXResourceAdapter
Throws:
WavesetException

setNodeListAttr

protected void setNodeListAttr(WSUser user,
                               java.lang.String dshOut)
Parses the output of "dsh ... lsuser -a account_locked to determine which nodes the user is enabled/disabled on.


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.

Overrides:
getUserScript in class AIXResourceAdapter
Throws:
WavesetException

startConnection

protected void startConnection()
                        throws WavesetException
Description copied from class: AIXResourceAdapter
Starts a scripted connection up and logs into it.

Overrides:
startConnection in class AIXResourceAdapter
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 AIXResourceAdapter
Throws:
WavesetException

runAction

protected void runAction(java.lang.String action,
                         WSUser user,
                         java.lang.String operation,
                         int timeout,
                         WavesetResult result)
                  throws WavesetException
Only one action at a time is allowed to run on the SP2 because each action performs a propogation from the control workstation to the nodes of the cluster. This propogation can't be interupted.

Overrides:
runAction in class GenericScriptResourceAdapter
Parameters:
action - - the shell script to execute
user - - the Waveset User object
operation - - a String representing the operation to perform.
result - - the Waveset result object to store the output and results into.
Throws:
WavesetException - thrown if there is an error in the action

getRequiredCmds

protected java.util.ArrayList getRequiredCmds()
Description copied from class: UnixResourceAdapter
Creates a list of required commands for the resource.

Overrides:
getRequiredCmds in class UnixResourceAdapter
Returns:
Returns a list of all required commands for the resource including user, group, and file commands.