|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jsdt.common.Base
com.ibm.jsdt.support.deploymenthelper.DeploymentHelper
com.ibm.jsdt.support.deploymenthelper.AixDeploymentHelper
public class AixDeploymentHelper
AIX specific helper functionality.
Field Summary |
---|
Fields inherited from class com.ibm.jsdt.support.deploymenthelper.DeploymentHelper |
---|
DEPLOYER_SPECIFICATION_VERSION_KEY, ENTRY_STAGE, EXIT_STAGE, FAILURE, ISMP_GLOBAL_PROPERTY, ISMP_PRODUCT_PROPERTY, ISMP_WIZARD_PROPERTY, MAIN_STAGE, PDC_CANCEL_INSTALL, PDC_DO_NOT_INSTALL, PDC_DOES_NOT_EXIST, PDC_EXISTS, resourceBundle, SELECTED_TASK_NAMES_KEY, sNEWLN, SUCCESS, VERSIONCHECKER_STAGE, VPD_INSTALL_LOCATION_PIPE, VPD_VERSION_PIPE |
Fields inherited from class com.ibm.jsdt.common.Base |
---|
NEW_LINE, OS_NAME, SLASH |
Constructor Summary | |
---|---|
AixDeploymentHelper()
Sole constructor. |
Method Summary | |
---|---|
static boolean |
addUserToGroup(java.lang.String groupName,
java.lang.String userName)
Adds a user to a group. |
static void |
chmodDirPermissions(java.lang.String path,
java.lang.String chmodValue)
Changes the permissions on a folder. |
static void |
chmodFilePermissions(java.lang.String fileName,
java.lang.String chmodValue)
Changes the permissions on a file. |
static boolean |
createAixUser(java.lang.String userName,
java.lang.String password)
Creates a new user ID using the Aix system's native password hashing/encryption algorithm and creates the /home/ |
static boolean |
createAixUser(java.lang.String user,
java.lang.String password,
java.lang.String rootPassword)
Creates a new user ID using the Aix system's native password hashing/encryption algorithm and creates the /home/ |
static boolean |
createGroup(java.lang.String groupName)
Creates a new user ID group. |
static boolean |
createUser(java.lang.String userName,
java.lang.String password,
java.lang.String groupName)
Creates a new user ID and add it to a group. |
static boolean |
doesGroupExist(java.lang.String groupName)
Verifies the existence of a user group. |
static boolean |
doesUserExist(java.lang.String userName)
Verifies the existence of a user ID. |
static java.lang.String |
getAixVersion()
Gets the version of AIX on the target system. |
static java.lang.String[] |
getLppInstalledDirs(java.lang.String aixNameStem)
Gets a String[] of folder paths to versions of software products
that use a common naming convention (the products must be installed in the standard
/usr/lpp folder). |
static java.lang.String |
getPackageVersion(java.lang.String aixPackage)
Gets the version of an installed package. |
static boolean |
isAix42Plus()
Determines whether the current AIX installation version is 4.2 or later. |
static boolean |
isAixPackageInstalled(java.lang.String aixPackage)
Determines whether a given package is installed on the AIX system. |
static boolean |
isUserAndPasswordValid(java.lang.String userName,
java.lang.String password)
Verifies if the given user and password are valid. |
static int |
runCommandAsUser(java.lang.String userId,
java.lang.String password,
java.lang.String command)
Runs the command on the local computer as the specified user. |
static int |
runCommandAsUser(java.lang.String userId,
java.lang.String password,
java.lang.String command,
boolean shouldLogOutput)
Runs the command on the local computer as the specified user. |
Methods inherited from class com.ibm.jsdt.common.Base |
---|
getBuildPropertiesAccessor, getFullVersion, getMainResources, getResourceString, getResourceString, getResourceString, getResourceString, getResourceString, getResourceStringArray, getResourceStringArray, showBuildProperties, showFullVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AixDeploymentHelper()
Method Detail |
---|
public static void chmodDirPermissions(java.lang.String path, java.lang.String chmodValue)
path
- - a String
path indicating the folder on which to set permission.chmodValue
- - a String
valid chmod argument indicating the permission level to set on the folder..public static void chmodFilePermissions(java.lang.String fileName, java.lang.String chmodValue)
fileName
- - a String
file name of the file on which to set permissionchmodValue
- - a String
chmod value indicating level of permission to set on the filepublic static java.lang.String getPackageVersion(java.lang.String aixPackage)
aixPackage
- - String AIX package name.
public static java.lang.String[] getLppInstalledDirs(java.lang.String aixNameStem)
String[]
of folder paths to versions of software products
that use a common naming convention (the products must be installed in the standard
/usr/lpp folder).
aixNameStem
- - prefix of AIX file name convention
public static java.lang.String getAixVersion()
public static boolean isAix42Plus()
Boolean
value oftrue
if the version is 4.2 or later
false
otherwise public static boolean isAixPackageInstalled(java.lang.String aixPackage)
aixPackage
- - an AIX package name
Boolean
value oftrue if the package is installed
false
otherwise
public static boolean doesUserExist(java.lang.String userName)
userName
- - user name
boolean
true
if found
false
all elsepublic static boolean doesGroupExist(java.lang.String groupName)
groupName
- - a group name
boolean
true
if found
false
all elsepublic static boolean createAixUser(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a password
boolean
true
if successfully created
false
all elsepublic static boolean createGroup(java.lang.String groupName)
groupName
- - a group name
boolean
true
if created
false
all elsepublic static boolean addUserToGroup(java.lang.String groupName, java.lang.String userName)
groupName
- - a Aix group nameuserName
- - a userName
boolean
true
if userName is added to group successfully
false
all elsepublic static boolean createUser(java.lang.String userName, java.lang.String password, java.lang.String groupName)
userName
- - a user namepassword
- - a passwordgroupName
- - a group name
boolean
true
if successfully created
false
all elsepublic static boolean isUserAndPasswordValid(java.lang.String userName, java.lang.String password)
This method works for Aix password storage mechanism. Note: If the target machine uses DES password encryption, it is possible that a password match could occur even if the passwords do not completely match. This is a limitation of DES encryption. DES only matches the first 8 characters. If the root password is "passw0rd", "passw0rd1" will be accepted because the first 8 characters match. A machine with DES password encryption would accept "password1" as a valid root password.
userName
- - a user namepassword
- - a user password
boolean
true
if valid
false
all elsepublic static boolean createAixUser(java.lang.String user, java.lang.String password, java.lang.String rootPassword)
The commands to create the new user will be run as "root". The password for "root" is required.
code
- String userIdcode
- String passwordcode
- String root password
boolean
success indicatorpublic static int runCommandAsUser(java.lang.String userId, java.lang.String password, java.lang.String command)
code
- String userIdcode
- String passwordcode
- String command
int
the return code of the command.public static int runCommandAsUser(java.lang.String userId, java.lang.String password, java.lang.String command, boolean shouldLogOutput)
code
- String userIdcode
- String passwordcode
- String commandcode
- boolean turn command output logging on/off
int
the return code of the command.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |