com.waveset.adapter
Class SolarisResourceAdapter

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

public class SolarisResourceAdapter
extends SVIDResourceAdapter

Resource adapter for Solaris 5.8 (should work on other OS releases). Supports a fixed set of user attributes, specified in SVIDResourceAdapter.paramToFlagMap. They are: uid, group, dir, shell, comment, new_logname, inactive, expire, authorization, profile, role. Meanings can be found in the usermod(1M) man page. The Solaris usermod/useradd/userdel commands use flags (-u, -g, etc) to specify the user attributes. To make it easier for the administrator, these flags have been mapped in a hashmap SVIDResourceAdapter.paramToFlagMap.


Nested Class Summary
 
Nested classes inherited from class com.waveset.adapter.SVIDResourceAdapter
SVIDResourceAdapter.AcctIter, SVIDResourceAdapter.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 CLASS_NAME
           
protected static java.lang.String CMD_AUTHS
           
protected static java.lang.String CMD_PROFILES
           
protected static java.lang.String CMD_ROLES
           
static java.lang.String code_id
           
protected static java.lang.String DEFAULT_SHELL
           
static java.lang.String[] DEFAULT_SHELLS
           
static java.lang.String LOGIN_PASSWORD
           
static java.lang.String LOGIN_USER
           
static java.lang.String RESOURCE_NAME
           
static java.lang.String RESOURCE_USER_FORM
           
static java.lang.String RESTYPE_DISPLAY_NAME
           
 
Fields inherited from class com.waveset.adapter.SVIDResourceAdapter
AA_LAST_LOGIN_TIME, allowedNISAttributes, DISPLAY_PASSWORD, DISPLAY_USER, grpMutexFile, grpPidFile, paramToFlagMap, PASSWD_CLEAR, PASSWD_FORCE_CHANGE, PASSWD_LOCK, PASSWD_MAX, PASSWD_MIN, PASSWD_WARN, pwdMutexFile, pwdPidFile, RA_LOGIN_SHELL_PROMPT, RA_MAKE_DIR, RA_NISSHADOW, RA_ROOT_PASSWORD, RA_ROOT_SHELL_PROMPT, RA_ROOT_USER, RA_SKEL_DIR, RESOURCE_LOGIN_MODULE, tmpGrpMutexFile, tmpPwdMutexFile, USER_AUTHORIZATION, USER_COMMENT, USER_DIR, USER_EXPIRE, USER_GROUP, USER_INACTIVE, USER_NEW_LOGNAME, USER_PROFILE, USER_ROLE, USER_SECONDARY_GROUP, USER_SHELL, USER_TIME_LAST_LOGIN, USER_UID
 
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_PASSWD, 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_NISDIR, RA_NISPWDDIR, RA_NISSRCDIR, 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
SolarisResourceAdapter()
          No argument constructor.
SolarisResourceAdapter(Resource res, ObjectCache cache)
          Constructor.
 
Method Summary
 Resource createPrototypeResource()
          Non-static version of staticCreatePrototypeResource()
protected  Script getCreateNativeUserScript(WSUser user, java.lang.String accountID, java.lang.String password)
          Generates a script that will create an account for the passed user on the resource.
protected  java.util.List getDefaultShellsList()
           
 java.lang.String getLoginPasswordAttrName()
           
 java.lang.String getLoginUserAttrName()
           
protected  java.util.ArrayList getReadOnlyTestCmds()
          Dynamic list of commands to test for permissions to execute.
protected  java.util.ArrayList getRequiredUserCmds()
          The list of required user commands for all unix adapters.
protected  Script getShellsScript(Script script)
          The default command that will return the shells from a Linux system.
protected  Script getUpdateNativeUserScript(WSUser user, java.lang.String accountID, java.lang.String newName, java.lang.String password)
          Generates a script that will create an account for the passed user on the resource.
protected  void realCreate(WSUser user, WavesetResult result)
          Note: This method is overriden from the GenericScriptResourceAdapter class.
protected  void realUpdate(WSUser user, WavesetResult result)
          Note: This method is overriden from the GenericScriptResourceAdapter class.
static Resource staticCreatePrototypeResource()
          Create prototype resource We start with the generic SVID prototype XML and modify it to be specific to Solaris (if you change something here, you probably need to make the change in the other classes that extend SVIDResourceAdapter.
 
Methods inherited from class com.waveset.adapter.SVIDResourceAdapter
addAttributeIfMapped, addLastLogin, addNISMake, addNISPasswordUpdate, addNISShellUpdate, buildUser, buildUser, buildUser, changeGroupMembers, constructNISUserAttributeParameters, constructUseraddParameters, constructUserAttributeParameter, constructUserPasswordParameters, createAcctAttrType, getAccountIteratorResult, getAccountIteratorScript, getAccountIteratorScript, getAccountIteratorScript, getAuthenticateResult, getAuthenticateScript, getBlockAccountIteratorScript, getCheckCreateAccountResult, getCheckCreateAccountScript, getCheckDeleteAccountResult, getCheckDeleteAccountScript, getCheckUpdateAccountResult, getCheckUpdateAccountScript, getConnectionTestResult, getConnectionTestScript, getConnectionType, getCreateGroupResult, getCreateNativeGroupScript, getCreateNISGroupScript, getCreateNISUserScript, getCreateUserResult, getDeleteNativeGroupScript, getDeleteNativeUserScript, getDeleteNISGroupScript, getDeleteNISUserScript, getDeleteUserResult, getDisableUserResult, getDisableUserScript, getEnableUserResult, getEnableUserScript, getFeatures, getGetGroupResult, getGetGroupScript, getListAllObjectsResult, getListAllObjectsScript, getLoginScript, getLogoutScript, getMutexAcquireScript, getMutexReleaseScript, getNativeUserScript, getNISDir, getNISNewGidScript, getNISNewUidScript, getNISPwddir, getNISUserResult, getNISUserScript, getRemoveGroupTmpFiles, getRemovePwdTmpFiles, getRenameGroupResult, getRenameGroupScript, getScanningResult, getScanningScript, getTestConnectionResult, getTestConnectionScript, getUpdateGroupResult, getUpdateNativeGroupScript, getUpdateNISGroupScript, getUpdateNISUserScript, getUpdateUserResult, getUpdateUserScript, getUserResult, getUserScript, isAllowableUserAttribute, isNISShadow, startConnection, staticCreatePrototypeResource, 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, getCreateGroupScript, getCreateObjectResult, getCreateObjectScript, getCreateUserResult, getCreateUserScript, getCreateUserScript, getDeleteGroupScript, getDeleteObjectScript, getDeleteUserScript, getDeleteUserScript, getGetObjectResult, getGetObjectScript, getGetUserResult, getGetUserScript, getListObjectsResult, getListObjectsScript, getReadOnlyNISTestCmds, getRenameObjectResult, getRenameObjectScript, getRenameUserResult, getRenameUserScript, getRequiredCmds, getRequiredFileCmds, getRequiredGroupCmds, getRequiredNISCmds, getResourceAccounts, getScriptedConnection, getTestConfigurationResult, getTestConfigurationScript, getUpdateGroupScript, getUpdateObjectResult, getUpdateObjectScript, getUpdateUserResult, getUpdateUserScript, getUpdateUserScript, getWhichScript, 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, realDelete, realDisable, realEnable, renameObject, reverseMapAttr, reverseMapAttr, reverseMapMultiAttr, run, runAction, 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, 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

RESOURCE_NAME

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

RESTYPE_DISPLAY_NAME

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

CLASS_NAME

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

RESOURCE_USER_FORM

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

CMD_PROFILES

protected static final java.lang.String CMD_PROFILES
See Also:
Constant Field Values

CMD_AUTHS

protected static final java.lang.String CMD_AUTHS
See Also:
Constant Field Values

CMD_ROLES

protected static final java.lang.String CMD_ROLES
See Also:
Constant Field Values

DEFAULT_SHELL

protected static final java.lang.String DEFAULT_SHELL
See Also:
Constant Field Values

DEFAULT_SHELLS

public static final java.lang.String[] DEFAULT_SHELLS
Constructor Detail

SolarisResourceAdapter

public SolarisResourceAdapter()
No argument constructor.


SolarisResourceAdapter

public SolarisResourceAdapter(Resource res,
                              ObjectCache cache)
Constructor.

Method Detail

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Create prototype resource We start with the generic SVID prototype XML and modify it to be specific to Solaris (if you change something here, you probably need to make the change in the other classes that extend SVIDResourceAdapter.

Throws:
WavesetException

createPrototypeResource

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

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

getLoginUserAttrName

public java.lang.String getLoginUserAttrName()
Specified by:
getLoginUserAttrName in class SVIDResourceAdapter

getLoginPasswordAttrName

public java.lang.String getLoginPasswordAttrName()
Specified by:
getLoginPasswordAttrName in class SVIDResourceAdapter

getCreateNativeUserScript

protected Script getCreateNativeUserScript(WSUser user,
                                           java.lang.String accountID,
                                           java.lang.String password)
                                    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.

Overrides:
getCreateNativeUserScript in class SVIDResourceAdapter
Throws:
WavesetException

getUpdateNativeUserScript

protected Script getUpdateNativeUserScript(WSUser user,
                                           java.lang.String accountID,
                                           java.lang.String newName,
                                           java.lang.String password)
                                    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. If the userID is passed in, the update will fail if the Id is in use by another user, but will succeed if the userId is the same or is a new value. Changing the user's ID will not change the files owned by that user. If you make changes here, check to see if the changes should be applied to implementations in subclasses (eg HPUXResourceAdapter)

Overrides:
getUpdateNativeUserScript in class SVIDResourceAdapter
Throws:
WavesetException

realCreate

protected void realCreate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Note: This method is overriden from the GenericScriptResourceAdapter class. This needs to be overridden here in order to make sure the uid "mutex" is released in the event an exception is thrown while running the useradd script. Create a new user account on the resource This method is called by createAccounts (the multiuser create method). CreateAccounts will open a connection, call realCreate for each user being created, then close the connection. Defers to abstract methods getCreateUserScript and getCreateUserResult for resource specific behavior.

Overrides:
realCreate in class GenericScriptResourceAdapter
Throws:
WavesetException

realUpdate

protected void realUpdate(WSUser user,
                          WavesetResult result)
                   throws WavesetException
Note: This method is overriden from the GenericScriptResourceAdapter class. This needs to be overridden here in order to make sure the uid "mutex" is released in the event an exception is thrown while running the usermod script. Updates a user account on the resource This method is called by updateAccounts (the multiuser update method). UpdateAccounts will open a connection, call realUpdate for each user being created, then close the connection. Defers to abstract methods getUpdateUserScript and getUpdateUserResult for resource specific behavior.

Overrides:
realUpdate in class GenericScriptResourceAdapter
Throws:
WavesetException

getRequiredUserCmds

protected java.util.ArrayList getRequiredUserCmds()
Description copied from class: UnixResourceAdapter
The list of required user commands for all unix adapters. Override this methods to add or remove commands for a particular adapter.

Overrides:
getRequiredUserCmds in class UnixResourceAdapter
Returns:
Returns a list of require commands to create, update, and delete a user.

getReadOnlyTestCmds

protected java.util.ArrayList getReadOnlyTestCmds()
Description copied from class: UnixResourceAdapter
Dynamic list of commands to test for permissions to execute.

Overrides:
getReadOnlyTestCmds in class UnixResourceAdapter

getDefaultShellsList

protected java.util.List getDefaultShellsList()
Overrides:
getDefaultShellsList in class UnixResourceAdapter

getShellsScript

protected Script getShellsScript(Script script)
The default command that will return the shells from a Linux system.

Overrides:
getShellsScript in class UnixResourceAdapter
Returns:
a String that is the command that will return a list of shells for a system.