com.ibm.jsdt.support.deploymenthelper
Class AixDeploymentHelper

java.lang.Object
  extended by com.ibm.jsdt.common.Base
      extended by com.ibm.jsdt.support.deploymenthelper.DeploymentHelper
          extended by com.ibm.jsdt.support.deploymenthelper.AixDeploymentHelper

public class AixDeploymentHelper
extends DeploymentHelper

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/ directory.
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/ directory.
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.support.deploymenthelper.DeploymentHelper
arraySearch, checkFreeSpaceAvailable, checkTargetDirectory, compareVersions, copyAndRenameFile, copyDirectory, copyFile, deleteFile, determineLogFileName, directorySearch, endOfFileScan, executeCommand, fileExists, fileGrep, fileLength, fileScan, fileSearchAndReplace, fileSearchAndReplaceLine, fileSearchAndReturnLinesWithSearch, getAgentRelease, getBackLevelDeployerMessage, getBackLevelJsdtMessage, getDeployerLocale, getDeploymentPackageJarName, getDeploymentWizardSpecificationVersion, getDomain, getEntryResponseFilePath, getEntryResponseFilePath, getExitResponseFilePath, getExitResponseFilePath, getGroupLocale, getHostName, getIbmNsiISMPPropValue, getIbmNsiProperties, getIbmnsiPropertyKeyPrefix, getIbmNsiPropValue, getIbmNsiPropValueByKey, getIimInstallLocationArray, getIimVersionArray, getKeyValue, getLogFileName, getLogger, getLogsDir, getMainResponseFilePath, getMainResponseFilePath, getOSType, getPartitionCapacity, getPartitionFileSystemType, getPartitionVolumeLabel, getPasswordValue, getPasswordValueByKey, getPreDeploymentCheckerResponseFilePath, getPreDeploymentCheckerResponseFilePath, getProductInstallingBundleProperties, getProductInstallingId, getProductInstallingVersion, getPropertyLogFileName, getQualifiedHostName, getQualifiedTiedPasswordValue, getQualifiedTiedVariableValue, getResourceString, getResponseFilePath, getResponseFilePath, getResponseFileProperties, getResponseFileProperty, getResponseFileValue, getSelectedTaskList, getSetupFileRemovalSetting, getStringFromCommandArray, getSystemEnvVar, getTaskApplicationList, getTaskHostnameList, getTempDir, getTiedPasswordValue, getTiedPasswordValueForKey, getTiedVariableValue, getTiedVariableValueForKey, getTranslatedMessage, getUnpackedDir, getVariableValueForTaskApplication, getVpdInstallLocationArray, getVpdPropertyList, getVpdVersionArray, isAix, isAixOSType, isApplicationVersionEqual, isEnoughTargetDirSpaceAvailable, isHPUX, isHPUXOSType, isIpv6Address, isLinux, isLinuxOSType, isLinuxX86_32, isLinuxX86_64, isOS400, isOS400OSType, isPortOpen, isPortRegistered, isPowerLinuxOSType, isSameDirectoryName, isSunOS, isSunOSType, isVersionSupported, isWindows, isWindowsOSType, log, log, logAppendFile, logAppendFile, logNewLine, logStatus, modifyResponseFile, postCompletionMessageToDeployerUI, postErrorMessageToDeployerMainUI, postErrorMessageToDeployerUI, postInformationMessageToDeployerMainUI, postInformationMessageToDeployerUI, postSuccessMessageToDeployerMainUI, postSuccessMessageToDeployerUI, postWarningMessageToDeployerMainUI, postWarningMessageToDeployerUI, readFile, removeAlphaCharsFromString, replaceSubstring, runAs, runAs, setIbmNsiProperty, setKeyValue, setLogFileName, setMainResources, setResponseFileProperty, setResponseFileValue, trace, trace, trace, trimDoubleQuotes, unPackJar, valueExists, waitForFile, writeFile
 
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

AixDeploymentHelper

public AixDeploymentHelper()
Sole constructor.

Method Detail

chmodDirPermissions

public static void chmodDirPermissions(java.lang.String path,
                                       java.lang.String chmodValue)
Changes the permissions on a folder. This method changes the permissions of all files in the given folder to the chmod value specified (such as "0755"). This recursively blankets all files with the new permissions.

Parameters:
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..

chmodFilePermissions

public static void chmodFilePermissions(java.lang.String fileName,
                                        java.lang.String chmodValue)
Changes the permissions on a file. This method changes the permissions of a single file to the chmod value specified (such as "0755").

Parameters:
fileName - - a String file name of the file on which to set permission
chmodValue - - a String chmod value indicating level of permission to set on the file

getPackageVersion

public static java.lang.String getPackageVersion(java.lang.String aixPackage)
Gets the version of an installed package.

Parameters:
aixPackage - - String AIX package name.
Returns:
The version of an installed package

getLppInstalledDirs

public 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).

Parameters:
aixNameStem - - prefix of AIX file name convention
Returns:
An array of folder paths of existing installations

getAixVersion

public static java.lang.String getAixVersion()
Gets the version of AIX on the target system.

Returns:
the version of AIX

isAix42Plus

public static boolean isAix42Plus()
Determines whether the current AIX installation version is 4.2 or later.

Returns:
A Boolean value of
  • true if the version is 4.2 or later
  • false otherwise

isAixPackageInstalled

public static boolean isAixPackageInstalled(java.lang.String aixPackage)
Determines whether a given package is installed on the AIX system.

Parameters:
aixPackage - - an AIX package name
Returns:
A Boolean value of
  • true if the package is installed
  • false otherwise

doesUserExist

public static boolean doesUserExist(java.lang.String userName)
Verifies the existence of a user ID.

Parameters:
userName - - user name
Returns:
a boolean
  • true if found
  • false all else

doesGroupExist

public static boolean doesGroupExist(java.lang.String groupName)
Verifies the existence of a user group.

Parameters:
groupName - - a group name
Returns:
a boolean
  • true if found
  • false all else

createAixUser

public 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/ directory.

Parameters:
userName - - a user name
password - - a password
Returns:
a boolean
  • true if successfully created
  • false all else

createGroup

public static boolean createGroup(java.lang.String groupName)
Creates a new user ID group.

Parameters:
groupName - - a group name
Returns:
a boolean
  • true if created
  • false all else

addUserToGroup

public static boolean addUserToGroup(java.lang.String groupName,
                                     java.lang.String userName)
Adds a user to a group.

Parameters:
groupName - - a Aix group name
userName - - a userName
Returns:
a boolean
  • true if userName is added to group successfully
  • false all else

createUser

public 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.

Parameters:
userName - - a user name
password - - a password
groupName - - a group name
Returns:
a boolean
  • true if successfully created
  • false all else

isUserAndPasswordValid

public static boolean isUserAndPasswordValid(java.lang.String userName,
                                             java.lang.String password)
Verifies if the given user and password are valid.

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.

Parameters:
userName - - a user name
password - - a user password
Returns:
a boolean
  • true if valid
  • false all else

createAixUser

public 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/ directory.

The commands to create the new user will be run as "root". The password for "root" is required.

Type Parameters:
code - String userId
code - String password
code - String root password
Returns:
boolean success indicator

runCommandAsUser

public 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.

Type Parameters:
code - String userId
code - String password
code - String command
Returns:
int the return code of the command.

runCommandAsUser

public 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.

Type Parameters:
code - String userId
code - String password
code - String command
code - boolean turn command output logging on/off
Returns:
int the return code of the command.