|
|||||||||||
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
public class DeploymentHelper
Utility class for pre-deployment checker, entry, exit, and main programs. The
DeploymentHelper
provides operating system independent utilities
commonly used in user programs developed for an application wrapper.
Field Summary | |
---|---|
static java.lang.String |
copyright
|
static java.lang.String |
DEPLOYER_SPECIFICATION_VERSION_KEY
|
protected static int |
ENTRY_STAGE
|
protected static int |
EXIT_STAGE
|
static int |
FAILURE
|
static java.lang.String |
ISMP_GLOBAL_PROPERTY
|
static java.lang.String |
ISMP_PRODUCT_PROPERTY
|
static java.lang.String |
ISMP_WIZARD_PROPERTY
|
protected static int |
MAIN_STAGE
|
static int |
PDC_CANCEL_INSTALL
|
static int |
PDC_DO_NOT_INSTALL
|
static int |
PDC_DOES_NOT_EXIST
|
static int |
PDC_EXISTS
|
static java.lang.String |
resourceBundle
|
static java.lang.String |
SELECTED_TASK_NAMES_KEY
|
static java.lang.String |
sNEWLN
System independent line separator. |
static int |
SUCCESS
|
protected static int |
VERSIONCHECKER_STAGE
|
static int |
VPD_INSTALL_LOCATION_PIPE
|
static int |
VPD_VERSION_PIPE
|
Fields inherited from class com.ibm.jsdt.common.Base |
---|
NEW_LINE, OS_NAME, SLASH |
Constructor Summary | |
---|---|
DeploymentHelper()
|
Method Summary | |
---|---|
static boolean |
arraySearch(java.lang.String[] messageArray,
java.lang.String searchString)
Search for a string in the array. |
static long |
checkFreeSpaceAvailable(java.lang.String path)
Gets the amount of free disk space in a path. |
static long |
checkTargetDirectory(java.lang.String path)
Determines the validity of a destination directory stored in the ibmnsi.properties file. |
static int |
compareVersions(java.lang.String version,
java.lang.String compareVersion)
Compares two dotted version strings. |
static OperationStatus |
copyAndRenameFile(java.lang.String source,
java.lang.String target,
java.lang.String newName)
Copies a file to another location and renames the file in the new target location. |
static OperationStatus |
copyDirectory(java.lang.String source,
java.lang.String target)
Copies a directory tree from the source to the target. |
static OperationStatus |
copyFile(java.lang.String source,
java.lang.String target)
This method copies a file to another location. |
static OperationStatus |
deleteFile(java.lang.String pathname)
Deletes a file. |
static java.lang.String |
determineLogFileName()
Determines the name of the log file |
static java.lang.String[] |
directorySearch(java.lang.String directoryName,
java.lang.String dotFileExtensionRegExpression)
Searches all of the files that end with the specified file extension under the directory specified. |
static OperationStatus |
endOfFileScan(java.lang.String filePathName,
java.lang.String searchString,
int numOfCharsToSearch)
Scans a file for a string, starting from the end. |
static ProgramOutput |
executeCommand(java.lang.String cmdLaunchDir,
java.lang.String[] commandEnvironmentArray,
boolean isLocalInteractive,
boolean waitForOutput,
java.lang.String commandToLog,
java.lang.String command)
Executes the specified command in a separate process through Runtime.exec() with the specified environment and working
directory and waits for it to finish. |
static boolean |
fileExists(java.lang.String pathname)
Checks for existence of a file. |
static boolean |
fileGrep(java.lang.String filePath,
java.lang.String searchString,
int startIndex)
Scans a file for a string. |
static long |
fileLength(java.lang.String fileName)
Returns the length of the file in bytes |
static OperationStatus |
fileScan(java.lang.String filePathName,
java.lang.String searchString,
int startIndex)
Scans a file for a string. |
static int |
fileSearchAndReplace(java.lang.String filePathName,
java.lang.String findString,
java.lang.String replaceString,
boolean ignoreCase,
boolean createBackup)
Performs a find and replace in a given file. |
static int |
fileSearchAndReplaceLine(java.lang.String filePathName,
java.lang.String findLine,
java.lang.String replaceLine,
boolean ignoreCase,
boolean ignoreWhitespace,
boolean createBackup)
Performs a find and replace of a line in the specified file. |
static java.lang.String[] |
fileSearchAndReturnLinesWithSearch(java.lang.String filename,
java.lang.String find,
int startSearchPosition)
Searches each line of a file to find a particular string. |
static java.lang.String |
getAgentRelease()
Retrieves the release of the IBM Installation Agent code base. |
protected static java.lang.String |
getBackLevelDeployerMessage(java.lang.String methodName,
java.lang.String sinceVersion)
Obtains a back-level version message when an unavailable new API is called that is dependent on the version of the deployment wizard. |
protected static java.lang.String |
getBackLevelJsdtMessage(java.lang.String methodName)
Obtains a back-level version message when an unavailable new API is called. |
static java.util.Locale |
getDeployerLocale()
Retrieves the Locale of the deployment wizard so that a
translatable message can be created for display. |
static java.lang.String |
getDeploymentPackageJarName()
Retrieves the deployment package JAR file name. |
static java.lang.String |
getDeploymentWizardSpecificationVersion()
Retrieves the specification-version of the deployment wizard. |
static java.lang.String |
getDomain()
Retrieves the domain suffix for the local host. |
static java.lang.String |
getEntryResponseFilePath()
Retrieves the name of the response file specified for the entry program prepended with the directory path containing the logs file. |
static java.lang.String |
getEntryResponseFilePath(java.lang.String originalResponseFileName)
Retrieves the name of the response file specified for the Entry program prepended with the logs directory path. |
static java.lang.String |
getExitResponseFilePath()
Retrieves the name of the response file specified for the exit program prepended with the directory path containing the log files. |
static java.lang.String |
getExitResponseFilePath(java.lang.String originalResponseFilePath)
Retrieves the name of the response file specified for the Exit program prepended with the logs directory. |
static java.util.Locale |
getGroupLocale()
Gets the locale of the installation group from the server. |
static java.lang.String |
getHostName()
Retrieves the unqualified local host name. |
static java.lang.String |
getIbmNsiISMPPropValue(java.lang.String variable,
java.lang.String propertyKeyType)
Gets a value from the ibmnsi.properties file. |
static java.util.Properties |
getIbmNsiProperties()
Loads and retrieves the properties from the ibmnsi.properties file from disk. |
static java.lang.String |
getIbmnsiPropertyKeyPrefix()
Retrieves the appropriate key prefix for a value in the ibmnsi.properties file. |
static java.lang.String |
getIbmNsiPropValue(java.lang.String variable)
Gets a value from the ibmnsi.properties file. |
static java.lang.String |
getIbmNsiPropValueByKey(java.lang.String key)
Gets a value from the ibmnsi.properties file. |
static java.lang.String[] |
getIimInstallLocationArray(java.lang.String packageId)
Retrieves String |
static java.lang.String[] |
getIimVersionArray(java.lang.String packageId)
Retrieves String |
static java.lang.String |
getKeyValue(java.lang.String key,
java.lang.String responseFileName)
Scans a file for a key and returns the string value found. |
static java.lang.String |
getLogFileName()
Gets the log file name that has been set directly by DeploymentHelper |
static java.util.logging.Logger |
getLogger()
Return a standard java.util.logging.Logger that can be used to log trace
information to the support framework trace. |
static java.lang.String |
getLogsDir()
Gets the directory containing the logs files. |
static java.lang.String |
getMainResponseFilePath()
Retrieves the name of the response file specified for the main program prepended with the directory path containing the log files. |
static java.lang.String |
getMainResponseFilePath(java.lang.String originalResponseFilePath)
Retrieves the name of the response file specified for the Main program prepended with the logs directory. |
static java.lang.String |
getOSType(java.lang.String os)
Determines the operating system type for a given operating system |
static long |
getPartitionCapacity(java.lang.String partition)
Gets the capacity of a given drive on Windows or a partition on Linux. |
static java.lang.String |
getPartitionFileSystemType(java.lang.String partition)
Gets the file system type of a given drive on Windows or a mount point on Linux. |
static java.lang.String |
getPartitionVolumeLabel(java.lang.String partition)
Gets the volume label of a given drive on Windows or mount point on linux. |
static java.lang.String |
getPasswordValue(java.lang.String passwordVariableName)
Retrieves a password value for the currently installing application from the ibmnsi.properties file. |
static java.lang.String |
getPasswordValueByKey(java.lang.String key)
Retrieves a password value from the ibmnsi.properties file. |
static java.lang.String |
getPreDeploymentCheckerResponseFilePath()
Retrieves the name of the response file specified for the pre-deploymentChecker program prepended with the logs directory path. |
static java.lang.String |
getPreDeploymentCheckerResponseFilePath(java.lang.String originalResponseFileName)
Retrieves the name of the response file specified for the PreDeploymentChecker program prepended with the logs directory path. |
static java.util.Properties |
getProductInstallingBundleProperties()
Retrieves the Properties object loaded from the default
properties bundle for the currently installing product. |
static java.lang.String |
getProductInstallingId()
Gets the application ID of the product currently installing on the target computer. |
static java.lang.String |
getProductInstallingVersion()
Retrieves the version of the currently installing application. |
static java.lang.String |
getPropertyLogFileName()
Gets the log file name stored in the ibmnsi.properties file. |
static java.lang.String |
getQualifiedHostName()
Retrieves the fully qualified local host name. |
static java.util.List<java.lang.String> |
getQualifiedTiedPasswordValue(java.lang.String task,
java.lang.String applicationId,
java.lang.String variableKeyword)
Returns a List of tied, password attribute values that
correspond to the specified task, application ID and variable keyword. |
static java.util.List<java.lang.String> |
getQualifiedTiedVariableValue(java.lang.String task,
java.lang.String applicationId,
java.lang.String variableKeyword)
Returns a List of tied, host attribute values that
correspond to the specified task, application ID and variable keyword. |
static java.lang.String |
getResourceString(java.lang.String resourceBundle,
java.lang.String key,
java.lang.String... substitutions)
Retrieves a translated message for the given key and substitution parameters in the given resource bundle. |
static java.lang.String |
getResponseFilePath(int stage)
Retrieves the name of the response file specified for the program prepended with the logs directory. |
static java.lang.String |
getResponseFilePath(int stage,
java.lang.String sourceName)
Gets the qualifed, updated response file path for the specified original response file source name. |
static java.util.Properties |
getResponseFileProperties(java.lang.String propertiesFilePath)
Gets a property object populated by a Java properties formatted response file. |
static java.lang.String |
getResponseFileProperty(java.lang.String propertiesFilePath,
java.lang.String key)
Gets a property value from a Java properties formatted response file. |
static java.lang.String |
getResponseFileValue(java.lang.String responseFileName,
java.lang.String key)
Scans a response file for a key and returns the string value found. |
static java.util.List<java.lang.String> |
getSelectedTaskList()
Retrieves a List of the task IDs that have been selected
for deployment in the deployment wizard. |
static boolean |
getSetupFileRemovalSetting()
Gets the setup file removal setting indicating whether or not the setup files will be removed at the completion of the installation. |
static java.lang.String |
getStringFromCommandArray(java.lang.String[] cmdArray)
Convenience method to assemble a command String
from a
String[] for logging purposes. |
static java.lang.String |
getSystemEnvVar(java.lang.String variableName)
Retrieves the value of a System environment variable. |
static java.util.List<java.lang.String> |
getTaskApplicationList(java.lang.String taskId)
Retrieves a List of the application IDs that were
specified for deployment in the deployment wizard for the given task. |
static java.util.List<java.lang.String> |
getTaskHostnameList(java.lang.String taskId)
Retrieves a List of the hostnames that were specified for
deployment in the deployment wizard for the given task. |
static java.lang.String |
getTempDir()
Determines and returns the temporary directory from the operating system environment. |
static java.util.List<java.lang.String> |
getTiedPasswordValue(java.lang.String variableKeyword)
Returns a List of tied, host password values that
correspond to the variable keyword for the currently installing
application. |
static java.util.List<java.lang.String> |
getTiedPasswordValueForKey(java.lang.String key)
Returns a List of tied, host password values that
correspond to the specified key. |
static java.util.List<java.lang.String> |
getTiedVariableValue(java.lang.String variableKeyword)
Returns a List of tied, host attribute values that
correspond to the variable keyword for the currently installing
application. |
static java.util.List<java.lang.String> |
getTiedVariableValueForKey(java.lang.String key)
Returns a List of tied, host attribute values that
correspond to the specified key. |
static java.lang.String |
getTranslatedMessage(java.lang.String resourceKey,
java.lang.String messageSubstitutionString,
java.lang.String messageResourcePath,
java.util.Locale locale)
Retrieves a translatable message from a Locale specific
ResourceBundle . |
static java.lang.String |
getUnpackedDir()
This method returns an absolute path to the unpacked directory with a slash appended to it. |
static java.lang.String |
getVariableValueForTaskApplication(java.lang.String taskId,
java.lang.String appId,
java.lang.String variableKeyword)
Retrieves the value of a variable. |
static java.lang.String[] |
getVpdInstallLocationArray(java.lang.String vpdUid)
Retrieves String |
static java.util.ArrayList<java.lang.String> |
getVpdPropertyList(java.lang.String vpdUid,
int vpdStartPipe,
int vpdEndPipe)
Retrieves a property from the ISMP vpd.properties file. |
static java.lang.String[] |
getVpdVersionArray(java.lang.String vpdUid)
Retrieves a String array of versions of an installed product with a given UID from the ISMP vpd.properties file. |
static boolean |
isAix()
Determines if the computer is running a AIX operating system. |
static boolean |
isAixOSType(java.lang.String os)
Determines if the operating system is a type of AIX operating system. |
static boolean |
isApplicationVersionEqual(java.lang.String applicationVersion)
Verifies that the specified version is equal to the version of the product currently installing. |
static boolean |
isEnoughTargetDirSpaceAvailable(java.lang.String path,
int sizeKBRequired)
Determines the validity and free space of a destination directory stored in the ibmnsi.properties file. |
static boolean |
isHPUX()
Determines if the computer is running a HP-UX operating system. |
static boolean |
isHPUXOSType(java.lang.String os)
Determines if the operating system is a type of HP-UX operating system. |
static boolean |
isIpv6Address(java.lang.String computerName)
Indicates whether or not the specified computer name is an IPv6 address. |
static boolean |
isLinux()
Determines if the computer is running a Linux operating system. |
static boolean |
isLinuxOSType(java.lang.String os)
Determines if the operating system is a type of Linux operating system. |
static boolean |
isLinuxX86_32()
Determines if the machine is running 32-bit Linux on x86 |
static boolean |
isLinuxX86_64()
Determines if the machine is running 64-bit Linux on x86 |
static boolean |
isOS400()
Determines if the computer is running a OS/400 or iSeries operating system. |
static boolean |
isOS400OSType(java.lang.String os)
Determines if the operating system is a type of OS/400 or iSeries operating system. |
static boolean |
isPortOpen(int portNumber)
Verifies that a TCP/IP port is not in use. |
static boolean |
isPortRegistered(int port)
Checks the operating system services file to see if the port is already registered. |
static boolean |
isPowerLinuxOSType(java.lang.String os)
Determines if the operating system is a type of Linux on POWER operating system |
static boolean |
isSameDirectoryName(java.lang.String location1,
java.lang.String location2)
Compares two directories to see if they are the same. |
static boolean |
isSunOS()
Determines if the computer is running a Solaris operating system. |
static boolean |
isSunOSType(java.lang.String os)
Determines if the operating system is a type of Solaris operating system. |
static boolean |
isVersionSupported(java.lang.String version,
java.lang.String lowestSupportedVersion,
java.lang.String highestSupportedVersion)
Determines if the version specified falls within the boundary of the lowest supported version and highest supported version. |
static boolean |
isWindows()
Determines if the computer is running a Windows operating system. |
static boolean |
isWindowsOSType(java.lang.String os)
Determines if the operating system is a type of Windows operating system. |
static boolean |
log(java.lang.String message)
Writes a message to a log file. |
static void |
log(java.lang.String message,
java.lang.String logFileName)
Writes the message, the timestamp and separator string to the log file specified in the logFileName |
static OperationStatus |
logAppendFile(java.lang.String fileToAppendPath)
This method provides a supported mechanism for adding the contents of a file to the log. |
static OperationStatus |
logAppendFile(java.lang.String[] fileNames)
Appends the content of each file listed in the array to the deployment wizard log file. |
static void |
logNewLine()
Writes a blank line to the log file. |
static void |
logStatus(boolean isInstallSuccessful)
Writes a success or failure message to a log file prepended with a timestamp and "****INSTALLATION STATUS = ". |
static boolean |
modifyResponseFile(java.lang.String key,
java.lang.String value,
java.lang.String responseFileName)
Changes a value in a response file. |
static void |
postCompletionMessageToDeployerUI(java.lang.String message)
Overrides the default completion message to the deployment wizard on the "Detailed Messages" panel. |
static void |
postErrorMessageToDeployerMainUI(java.lang.String message)
Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel. |
static void |
postErrorMessageToDeployerUI(java.lang.String message)
Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel. |
static void |
postInformationMessageToDeployerMainUI(java.lang.String message)
Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel. |
static void |
postInformationMessageToDeployerUI(java.lang.String message)
Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel. |
static void |
postSuccessMessageToDeployerMainUI(java.lang.String message)
Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel. |
static void |
postSuccessMessageToDeployerUI(java.lang.String message)
Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel. |
static void |
postWarningMessageToDeployerMainUI(java.lang.String message)
Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel. |
static void |
postWarningMessageToDeployerUI(java.lang.String message)
Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel. |
static java.lang.String |
readFile(java.lang.String filePathName)
Reads in a file. |
static java.lang.String |
removeAlphaCharsFromString(java.lang.String inputString)
Removes all characters that are not 0 -9 or '.' from the input string and returns the resulting value. |
static java.lang.String |
replaceSubstring(java.lang.String targetString,
java.lang.String oldSubstring,
java.lang.String newSubstring)
Modifies a String by replacing a substring with a new
substring. |
protected static int |
runAs(java.lang.String userId,
java.lang.String password,
java.lang.String command)
Runs the command on the local computer as the specified user. |
protected static int |
runAs(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. |
static OperationStatus |
setIbmNsiProperty(java.lang.String key,
java.lang.String value)
Sets a property into the currently cached ibmnsi Properties
object and saves the updated properties to disk. |
static boolean |
setKeyValue(java.lang.String key,
java.lang.String value,
java.lang.String responseFileName,
boolean createKeyIfDoesNotExist)
Scans a file for a key and sets the corresponding value. |
static void |
setLogFileName(java.lang.String name)
Set the log file name if it is not set by ibmnsi.properties |
void |
setMainResources(java.lang.String myResources)
Set the name of the main ResourceBundle . |
static boolean |
setResponseFileProperty(java.lang.String propertiesFilePath,
java.lang.String key,
java.lang.String value)
Sets a property value into a Java properties formatted response file. |
static boolean |
setResponseFileValue(java.lang.String responseFileName,
java.lang.String key,
java.lang.String keyValue,
boolean createKeyIfDoesNotExist)
Scans a response file for a key and sets the corresponding value. |
static void |
trace(java.lang.Object object)
Deprecated. |
static void |
trace(java.lang.Object[] objects)
Deprecated. |
static void |
trace(java.lang.String text)
Deprecated. |
static java.lang.String |
trimDoubleQuotes(java.lang.String inputString)
Removes quotation marks from a string. |
static boolean |
unPackJar(java.lang.String absolutePathName,
java.lang.String destinationDirPath)
Unpacks a JAR file. |
static boolean |
valueExists(java.lang.String stringToSearch,
java.lang.String[] values)
Determines if any of the given values exist in a given string. |
static boolean |
waitForFile(int timeOutInSec,
int timeIntervalInSec,
java.lang.String filePath,
java.lang.String[] successStrings,
java.lang.String[] failureStrings)
Polls the system for the existence of a file and, optionally, strings within the file. |
static OperationStatus |
writeFile(java.lang.String filePathName,
java.lang.String message,
boolean append)
Writes a String to a file, appends it to the file or
overwrites the file. |
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 |
Field Detail |
---|
public static final java.lang.String copyright
public static final int VPD_INSTALL_LOCATION_PIPE
public static final int VPD_VERSION_PIPE
public static final java.lang.String DEPLOYER_SPECIFICATION_VERSION_KEY
public static final java.lang.String SELECTED_TASK_NAMES_KEY
public static final java.lang.String resourceBundle
protected static final int VERSIONCHECKER_STAGE
protected static final int ENTRY_STAGE
protected static final int MAIN_STAGE
protected static final int EXIT_STAGE
public static final int SUCCESS
public static final int FAILURE
public static final int PDC_DO_NOT_INSTALL
public static final int PDC_CANCEL_INSTALL
public static final int PDC_EXISTS
public static final int PDC_DOES_NOT_EXIST
public static final java.lang.String sNEWLN
public static final java.lang.String ISMP_GLOBAL_PROPERTY
public static final java.lang.String ISMP_WIZARD_PROPERTY
public static final java.lang.String ISMP_PRODUCT_PROPERTY
Constructor Detail |
---|
public DeploymentHelper()
Method Detail |
---|
public static OperationStatus copyDirectory(java.lang.String source, java.lang.String target)
source
- -The absolute path to the source directory.target
- -The absolute path to the target directory.
OperationStatus
-The status of the operation. Check isOK()
method for success/failure.public static OperationStatus copyFile(java.lang.String source, java.lang.String target)
NOTE: If a file of the same name already exists in the target directory, it will be overwritten. If the target directory does not exist it will be created. The source file and target directory should not be encapsulated in quotation marks.
source
- -The absolute path and name of the source file.target
- -The absolute path to the target directory.
OperationStatus
-The status of the operation. Check isOK()
method for success or failurepublic static OperationStatus copyAndRenameFile(java.lang.String source, java.lang.String target, java.lang.String newName)
NOTE: If a file of the same name already exists in the target directory, it will be overwritten. If the target directory does not exist it will be created. The source file, target directory and target file name should not be encapsulated in quotation marks.
source
- - source file pathtarget
- - target file pathnewName
- - a new file name.
OperationStatus
-The status of the operation. Check isOK()
method for success or failure.public static OperationStatus deleteFile(java.lang.String pathname)
pathname
- -path to file. If pathname denotes a directory, then the directory must be empty.
OperationStatus
-the status of the operation. Check isOK()
for success or failure.public static boolean fileExists(java.lang.String pathname)
pathname
- - a file path name.
boolean
true
if the file exists.
false
otherwise.public static OperationStatus endOfFileScan(java.lang.String filePathName, java.lang.String searchString, int numOfCharsToSearch)
filePathName
- -the absolute path of the file to be searched.searchString
- -the string to search for in the file, starting from the end of the file.numOfCharsToSearch
- -designates the number of characters to search for, starting from
the end. For example, if 100 is specified, then only the last 100 characters of the file are scanned
for the search string. If the number specified is greater than the total character count in the file,
the entire file will be scanned.
OperationStatus
-the status of the operation. If isOK()
method returns true, then the string was found.public static OperationStatus fileScan(java.lang.String filePathName, java.lang.String searchString, int startIndex)
filePathName
- -the absolute file path to scansearchString
- -the string to search for in the filestartIndex
- - designates the starting index from which to begin searching in the file. Zero marks the beginning.
OperationStatus
the status of the operation. If isOK()
method returns true, the string was found.public static java.lang.String getKeyValue(java.lang.String key, java.lang.String responseFileName)
getLogsDir()
which is an absolute path to the logs
directory.
key
- -the response file key to search forresponseFileName
- -the response file absolute path with name
String
found for the keypublic static boolean setKeyValue(java.lang.String key, java.lang.String value, java.lang.String responseFileName, boolean createKeyIfDoesNotExist)
This function will set or replace a value in a file. The value
(right side) must be part of a "key = value" pair. The "key = value"
pair must be on the same line in the text based file. The line must
start with the var/key (In other word, no preceding asterisks or blank spaces and so on).
Note: If this is a response file, typically, you can prepend the file
name with the return value from getLogsDir()
which is an
absolute path to the logs directory (which also contains response files).
key
- -The key to search for.value
- -The value to set for the specified key in the response file.responseFileName
- -The absolute path to the response file, including the name.createKeyIfDoesNotExist
- -Set this to true if a key should be created if one does not exist.
boolean
value oftrue
if the operation was successful
false
if the operation failed
public static java.lang.String getLogsDir()
public static java.lang.String getAgentRelease()
For example, it would return 2.1.0.0, not 3.1.0.0 for IR 2.1.
It will return null
for releases prior
to IR 2.1 .
NOTE: This is not the same as the version number of the IBM Installation Agent.
String
public static java.lang.String getDeploymentPackageJarName()
The value is retrieved as a non-translatable property.
String
public static java.lang.String getIbmnsiPropertyKeyPrefix()
ibmnsi.properties
file.
For release IR 2.1 and later, the prefix is the application ID. Earlier releases used the deployment package JAR file name.
String
public static java.lang.String getPropertyLogFileName()
ibmnsi.properties
file.
ibmnsi.properties
filepublic static void setLogFileName(java.lang.String name)
ibmnsi.properties
name
- The log file name is set directly by DeploymentHelper instead get from ibmnsi.properties
file.public static java.lang.String getLogFileName()
public static java.lang.String determineLogFileName()
ibmnsi.properties
.
productInstallingId.log is used.
- Returns:
String
the log file name with ".log" appended
public static boolean modifyResponseFile(java.lang.String key, java.lang.String value, java.lang.String responseFileName)
This function will set or replace a value in a file. The value
(right side) must be part of a "key = value" pair. The "key = value"
pair must be on the same line in the text based file. The line must
start with the var/key (In other word, no preceding asterisks or blank spaces and so on).
Note: Typically, you can prepend the response file
name with the return value from getLogsDir()
which is an
absolute path to the logs directory (which also contains response files).
This method is the same as setKeyValue
with the exception that
it does not take a fourth parameter to determine whether or not to create the key
if it does not exist. The key will not be created if not found.
To create the key, use setKeyValue
with the option to create key set to true.
key
- -The key to search for.value
- -The value to set for the specified key in the response file.responseFileName
- -The absolute path to the response file, including the file name.
boolean
value oftrue
if the operation was successful
false
if the operation failed
public static java.lang.String readFile(java.lang.String filePathName) throws java.io.IOException
filePathName
- -The absolute file path, including the file name.
String
-The contents of the file
java.io.IOException
- the file cannot be readpublic static OperationStatus writeFile(java.lang.String filePathName, java.lang.String message, boolean append)
String
to a file, appends it to the file or
overwrites the file.
If append is set to true it will append the string. If it is set to
false, it will overwrite the old contents of the file with this new
string. If the file does not already exist, it will be created.
filePathName
- -The path (including the file name) to the file to be written.message
- -The string message to write to the file.append
- -Determines whether to append the string to the file, or overwrite it.
OperationStatus
-The status of the operation. If isOK()
returns true, the operation was successful.public static java.lang.String getUnpackedDir()
unpacked
directory contains all of the files exploded from the deployment
package for the product, including entry, exit, main, and pre-deployment programs, as
well as any other files specified in the application deployment accelerator.
unpacked
directory with a slash
appended to itpublic static boolean isPortOpen(int portNumber)
portNumber
- -The port number to check.
boolean
value oftrue
if the port is not in use or if usage cannot be determined
false
if the port is in use
public static long checkFreeSpaceAvailable(java.lang.String path)
WINDOWS: You must pass a path prepended with a drive letter and a colon (For example, c:).
LINUX: You must pass a fully qualified path to the mount point or directory (For example, /usr). If /usr is passed and is itself a mount point the return value will be the amount of free space available in /usr. If /usr is not actually a mount point, the return value will be the amount of free space in the filesystem on which the /usr resides. In this example, the amount of free space on "/" (root) would be returned. Therefore, you can check the available free space in the target directory without knowing beforehand whether or not the target is a mount point.
path
- -The absolute path to check for free space.
long
the amount of free space in KB
0 will be returned if the directory does not exist, or if the drive or mount point passed is not valid or not in the appropriate format
public static long checkTargetDirectory(java.lang.String path)
ibmnsi.properties
file. If the directory does not already
exist, it will be created. If the directory does not exist and cannot be
created, the drive is not valid and the method will return 0. If the
directory exists, the free space of the drive or mount point that
contains the directory will be returned. The function will return long
representing the kilobytes of free space available. A return of 0
indicates no space available or an invalid directory.
path
- -The absolute path to check
long
public static boolean isEnoughTargetDirSpaceAvailable(java.lang.String path, int sizeKBRequired)
path
- -the absolute path to checksizeKBRequired
- -an integer representing the kilobytes of space required
boolean
value of
true
if there is enough free space to install
to the target directory
false
if there is not enough free space
public static boolean waitForFile(int timeOutInSec, int timeIntervalInSec, java.lang.String filePath, java.lang.String[] successStrings, java.lang.String[] failureStrings)
NOTE: In most cases, a check for (old) previous versions of the file should be performed and the (old) file should be deleted before invoking this function.
TimeOutInSec specifies the total time to wait for the specified conditions. The function will return false if conditions are not met in the allotted time. A negative timeout value indicates an "infinite" timeout. Interval specifies the number of seconds between checks for file existence and strings.
timeOutInSec
- - Specifies the total time in seconds to wait for the specified conditions.
The function will return false
timeIntervalInSec
- - The number of seconds between checks for file existence and strings (if any specified).filePath
- - The absolute path and name of the file.successStrings
- - Can be null (optional). An array of String(s) which indicate success if found in the file.failureStrings
- - Can be null (optional). An array of String(s) which indicate failure if found in the file.
boolean
value of
true
if the file is found (created) and the successs and fail strings are null
or the success string is found.
false
if a timeout occurs or if the fail string is found.
public static ProgramOutput executeCommand(java.lang.String cmdLaunchDir, java.lang.String[] commandEnvironmentArray, boolean isLocalInteractive, boolean waitForOutput, java.lang.String commandToLog, java.lang.String command)
Runtime.exec()
with the specified environment and working
directory and waits for it to finish.
Return values can be obtained from the ProgramOutput
object returned by this method.
Note:
The string “cmd /C “
is added to the beginning of the command for Windows platforms.
The string "/bin/sh -c"
is added to Linux, HP, AIX and Solaris platforms.
The Wait For Completion property must be checked for the corresponding user program if the program being launched locally is an interactive program.
cmdLaunchDir
- -Can be null (optional). Specifies the working directory path. If null,
the current working directory of the current process is used.commandEnvironmentArray
- - The environment array can be null
. If the environment array is null, the current
environment of the calling process is used.isLocalInteractive
- -Set to true if the command being launched is an interactive local program.waitForOutput
- -Set to true to indicate execution should be paused to ensure that the
command output is captured in its entirety.commandToLog
- -If the command contains sensitive data, set the command to log here. If left null, the regular command will be logged.command
- -Command to launch
ProgramOutput
The program output. It contains information about the command's stderr, stdout,
return code, and exception thrown (if any).public static java.lang.String getSystemEnvVar(java.lang.String variableName)
variableName
- - The variable name in the system environment.
String
indicating the value of the environment variablepublic static java.util.Locale getGroupLocale()
ibmnsi.properties
file. It will return
the default locale of the current machine if a value cannot be obtained
from the ibmnsi.properties
file.
Locale
-The locale of the group directorypublic static java.lang.String replaceSubstring(java.lang.String targetString, java.lang.String oldSubstring, java.lang.String newSubstring)
String
by replacing a substring with a new
substring.
targetString
- -The string to be modified.oldSubstring
- -The substring to be replacednewSubstring
- -The replacement substring
String
resulting from replacing all occurrences of
the oldSubstring in the targetString with the newSubstringpublic static java.lang.String getProductInstallingId()
public static java.lang.String getHostName()
String
indicate the host namepublic static java.lang.String getDomain()
Example: raleigh.ibm.com
String
indicating the domain of the local hostpublic static int fileSearchAndReplace(java.lang.String filePathName, java.lang.String findString, java.lang.String replaceString, boolean ignoreCase, boolean createBackup)
filePathName
- -the absolute path to the file including the file name.findString
- -the substring to be replaced.replaceString
- -the substring to use for replacement.ignoreCase
- -set to true if case should be ignored when searching.createBackup
- -set to true if a backup of original file should be created.
integer
indicating the number of replacements made. -1 is return if errors occurred.public static int fileSearchAndReplaceLine(java.lang.String filePathName, java.lang.String findLine, java.lang.String replaceLine, boolean ignoreCase, boolean ignoreWhitespace, boolean createBackup)
filePathName
- -the absolute path to the file (including file name)findLine
- -the line to search forreplaceLine
- -the replacement lineignoreCase
- -set to true if case should be ignored when searching.ignoreWhitespace
- -set to true if whitespace should be ignored when searching.createBackup
- -set to true if a backup of original file should be created.
integer
indicating the number of replacements made. -1 is returned if errors occurredpublic static void postSuccessMessageToDeployerUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postSuccessMessageToDeployerMainUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postInformationMessageToDeployerUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postInformationMessageToDeployerMainUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postWarningMessageToDeployerUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postWarningMessageToDeployerMainUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postErrorMessageToDeployerUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postErrorMessageToDeployerMainUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static void postCompletionMessageToDeployerUI(java.lang.String message)
message
- -the translated, substituted message to postpublic static java.lang.String getTranslatedMessage(java.lang.String resourceKey, java.lang.String messageSubstitutionString, java.lang.String messageResourcePath, java.util.Locale locale)
Locale
specific
ResourceBundle
.
resourceKey
- -key to find the translated string in the given resource bundle.messageSubstitutionString
- -string with all of the parameter substitutions comma delimited.messageResourcePath
- -dotted classpath of a translated message's
ResourceBundle
. For example, "com.ibm.jsdt.main.MainManagerNLS".locale
- -message locale.
String
indicating the translated messagepublic static java.util.Locale getDeployerLocale()
Locale
of the deployment wizard so that a
translatable message can be created for display.
Locale
public static boolean isApplicationVersionEqual(java.lang.String applicationVersion)
applicationVersion
- -the version to check for
boolean
value oftrue
if the specified version is equal to the version of the product currently installing.
false
otherwise.public static java.lang.String getProductInstallingVersion()
String
indicating the version of the application.public static java.lang.String getStringFromCommandArray(java.lang.String[] cmdArray)
String
from a
String[]
for logging purposes.
cmdArray
- -Array to convert to string
String
public static java.util.Properties getIbmNsiProperties()
The Properties
object is not cached because
changes are frequently written to disk.
Properties
public static java.lang.String[] getIimInstallLocationArray(java.lang.String packageId)
String array of installation locations of an installed product
with a given package id from the IIM installed.xml
file.
The return will be null
if the package id is not found.
- Parameters:
String
- package id
- Returns:
String
array of installation locations or null
.
public static java.lang.String[] getIimVersionArray(java.lang.String packageId)
String array of versions of an installed product
with a given package id from the IIM installed.xml
file.
The return will be null
if the package id is not found.
- Parameters:
String
- package id
- Returns:
String
array of versions or null
.
public static java.util.ArrayList<java.lang.String> getVpdPropertyList(java.lang.String vpdUid, int vpdStartPipe, int vpdEndPipe)
vpd.properties
file.
vpdUid
- -the uid of the product for which the VPD
property value is sought.vpdStartPipe
- -the number of the first pipe character that delimits
the sought VPD property.vpdEndPipe
- -the number of the last pipe character that delimits
the sought VPD property.
String
indicating the property value.public static java.lang.String[] getVpdInstallLocationArray(java.lang.String vpdUid)
String array of installation locations of an installed product
with a given UID from the ISMP vpd.properties
file.
The return will be null
if the UID is not
found in the properties file.
It is assumed that the pipe number for the installation location information is 12.
- Parameters:
vpdUid
- -the Uid of the product
- Returns:
- A
String[]
indicating the install locations.
public static java.lang.String[] getVpdVersionArray(java.lang.String vpdUid)
vpd.properties
file.
The return will be null
if the UID is not found in the
properties file.
It is assumed that the pipe number for the version information is 5.
vpdUid
- -the UID for the product
String[]
indicating the version of the installed productpublic static int compareVersions(java.lang.String version, java.lang.String compareVersion)
The compared version strings must be comprised of only dots and numbers.
version
- -the application versioncompareVersion
- -the application version to compare
integer
with one of the following four possible return values:
Integer.MIN_VALUE
if version or
compareVersion contains characters other than dots and numbers.public static java.util.Properties getProductInstallingBundleProperties()
Properties
object loaded from the default
properties bundle for the currently installing product.
Properties
public static java.util.List<java.lang.String> getSelectedTaskList()
List
of the task IDs that have been selected
for deployment in the deployment wizard.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.
The ordering of the tasks in the solution XML is preserved in the List.
List
public static java.lang.String getVariableValueForTaskApplication(java.lang.String taskId, java.lang.String appId, java.lang.String variableKeyword)
The SupportBase
to be queried must invoke
setVariableKeyword
and setApplicationId
,
setTaskId
before calling this method.
taskId
- -the task IDappId
- -the application IDvariableKeyword
- -the keyword specified for the variable
String
indicating the value of the variable.public static java.util.List<java.lang.String> getTaskHostnameList(java.lang.String taskId)
List
of the hostnames that were specified for
deployment in the deployment wizard for the given task.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.
taskId
- - a task ID
List
of host names.public static java.util.List<java.lang.String> getTaskApplicationList(java.lang.String taskId)
List
of the application IDs that were
specified for deployment in the deployment wizard for the given task.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.
taskId
- - the task ID
List
of the application IDs specified for deploymentpublic static OperationStatus setIbmNsiProperty(java.lang.String key, java.lang.String value)
Properties
object and saves the updated properties to disk.
key
- -the key to add in the list of propertiesvalue
- -the corresponding value of the key
OperationStatus
-the status of the operation. If isOK()
returns true,
the operation was successful. Check getException()
for any exceptions that might have occurred.public static java.lang.String getPartitionFileSystemType(java.lang.String partition)
Note: This method is not supported on AIX or iSeries systems.
The path format on Windows must be C:\\, where C is the drive letter.
partition
- - drive in Windows (For example, C:\\) or a mount point in Linux
String
indicating the file system typepublic static java.lang.String getPartitionVolumeLabel(java.lang.String partition)
Note: This method is not supported on AIX or iSeries systems.
The path format on Windows must be C:\\, where C is the drive letter.
partition
- - drive in Windows (For example, C:\\) or a mount point in Linux
String
indicating the volume labelpublic static long getPartitionCapacity(java.lang.String partition)
Note: This method is not supported on AIX or iSeries systems.
partition
- -drive on Windows (For example: C:\\) or a partition on Linux
public static boolean isWindows()
Boolean
value oftrue
if operating system is Windows
false
if operating system is not Windowspublic static boolean isLinux()
Boolean
value oftrue
if operating system is Linux
false
if operating system is not Linuxpublic static boolean isLinuxX86_64()
Boolean
value oftrue
if operating system is 64-bit Linux
false
if operating system is not 64-bit Linuxpublic static boolean isLinuxX86_32()
Boolean
value oftrue
if operating system is 32-bit Linux
false
if operating system is not 32-bit Linuxpublic static boolean isSunOS()
Boolean
value oftrue
if operating system is Solaris
false
if operating system is not Solarispublic static boolean isHPUX()
Boolean
value oftrue
if operating system is HP-UX
false
if operating system is not HP-UXpublic static boolean isAix()
Boolean
value oftrue
if operating system is AIX
false
if operating system is not AIXpublic static boolean isOS400()
Boolean
value oftrue
if operating system is OS/400, i5/OS, or IBM i.
false
if operating system is not OS/400, i5/OS, or IBM ipublic static boolean isWindowsOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of Windows
false
if operating system is not a type of Windowspublic static boolean isLinuxOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of Linux
false
if operating system is not a type of Linuxpublic static boolean isAixOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of AIX
false
if operating system is not a type of AIXpublic static boolean isOS400OSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of OS/400, i5/OS, or IBM i
false
if operating system is not a type of OS/400, i5/OS, or IBM ipublic static boolean isHPUXOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of HP-UX
false
if operating system is not a type of HP-UXpublic static boolean isSunOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of Solaris
false
if operating system is not a type of Solarispublic static boolean isPowerLinuxOSType(java.lang.String os)
Boolean
value oftrue
if operating system is a type of Linux on POWER
false
if operating system is not a type of Linux on POWERpublic static java.lang.String getOSType(java.lang.String os)
String
indicating the operating system typepublic static java.lang.String getPasswordValue(java.lang.String passwordVariableName)
The password is encrypted and stored as a hex string in the properties file. This will "unmask" the value and return it as a plain text string.
passwordVariableName
- - a String
passwordVariableName
String
indicating the password valuepublic static java.lang.String getIbmNsiPropValue(java.lang.String variable)
ibmnsi.properties
file.
Uses the application ID of the product currently installing and the name
of the variable, concatenated together to form the key.
variable
- -the variable name to use to get the value from the properties file.
String
indicating the value in the properties filepublic static java.lang.String getIbmNsiPropValueByKey(java.lang.String key)
ibmnsi.properties
file.
key
- -a string key in the ibmnsi.properties file
String
indicating the value in the properties filepublic static java.lang.String getIbmNsiISMPPropValue(java.lang.String variable, java.lang.String propertyKeyType)
ibmnsi.properties
file.
Uses the application ID of the product currently installing, the property
key type and the name of the variable, concatenated together to form the
key.
variable
- - the string variable namepropertyKeyType
- - the string property key type. Valid key types are:
ISMP_GLOBAL_PROPERTY, ISMP_PRODUCT_PROPERTY, and ISMP_WIZARD_PROPERTY
String
indicating the value in the properties filepublic static boolean log(java.lang.String message)
The log file used is determined as follow: First, if the application deployment accelerator
specified a log file name, that file name is retrieved
from the ibmnsi.properties
file. Otherwise, it will check if the log file name
has been set in setLogFileName
. If not set, then a default name of
productInstallingId
.log is used.
message
- -the string message to log
Boolean
value oftrue
if the logging was successful
false
if an exception occurred.public static void log(java.lang.String message, java.lang.String logFileName)
message
- -Full text message string to write to the log.logFileName
- -Fully qualified file name to write the message to.public static void logNewLine()
The log file name is determined as follow:
First, if the application deployment accelerator specified a log file name, that file name is
retrieved from the ibmnsi.properties
. Otherwise, it will check if the log file name
has been set in DeploymentHelper. If this was not set, then a default name of
productInstallingId
.log is used.
public static void logStatus(boolean isInstallSuccessful)
The log file used is determined as follow:
First, if the application deployment accelerator specified a log file name, that file name is
retrieved from the ibmnsi.properties
. Otherwise, it will check if the log file name
has been set in setLogFileName
file. If not set, then a default name of
productInstallingId
.log is used.
isInstallSuccessful
- - if true, "SUCCESS" will be appended to the installation status string, if false,
"FAILURE" will be appended.public static OperationStatus logAppendFile(java.lang.String fileToAppendPath)
Note: The log file used is determined as follow:
First, if the application deployment accelerator specified a log file name, that file name is
retrieved from the ibmnsi.properties
file. Otherwise, it will check if the log file name
has been set in setLogFileName
. If not set, then a default name of
productInstallingId
.log is used.
fileToAppendPath
- the fully qualified path of the file to append to the log
OperationStatus
the status of the operation. Check isOK()
for success or failure.public static OperationStatus logAppendFile(java.lang.String[] fileNames)
Note: The log file used is determined as follow:
First, if the application deployment accelerator specified a log file name, that file name is
retrieved from the ibmnsi.properties
file. Otherwise, it will check if the log file name
has been set in setLogFileName
. If not set, then a default name of
productInstallingId
.log is used.
fileNames
- - Array of string. Each element is a fully qualified name of a file to append.
OperationStatus
the status of the operation. Check OperationStatus isOK()
for success or failure.public static java.lang.String removeAlphaCharsFromString(java.lang.String inputString)
inputString
- -
The original input string.
String
with just digits or "."public static java.lang.String getTempDir()
String
indicating the temporary directory for the operating system.public static boolean fileGrep(java.lang.String filePath, java.lang.String searchString, int startIndex)
filePath
- the full path to the file to search for the stringsearchString
- the string to search for in the filestartIndex
- the offset from the beginning of the file to start the search. This might be zero,
in which case the entire file text String is the "substring".
boolean
value of
true
if the string was found in the file
false
if the string was not found, or the file does not exist
public static long fileLength(java.lang.String fileName)
fileName
- -
Specify the file name using an absolute path.
long
- The length of the file is returned if it exists. If it does not
exist, it returns 0.public static java.lang.String[] directorySearch(java.lang.String directoryName, java.lang.String dotFileExtensionRegExpression)
dotFileExtensionRegExpression
is "*.exe", all file names ending in ".exe" are returned in the array.
Note: This is not a recursive search, and will not go into directories under the directoryName
directoryName
- -
The directory name should contain the absolute path.dotFileExtensionRegExpression
- -
The file extension expression to match, should be prepended with a dot.
String Array
of file names that match the regular expression. A zero length
array is returned if no matches are found or the directory is
empty. Null is returned if the directory does not exist.javadoc for regular expression details.
public static boolean arraySearch(java.lang.String[] messageArray, java.lang.String searchString)
true
is returned.
messageArray
- -
Array of strings to search.searchString
- -
Search string.
Boolean
value oftrue
if the search string is found in the array.
false
if the array is null or the search string is not in the array.public static boolean isSameDirectoryName(java.lang.String location1, java.lang.String location2)
Note: If short names are passed in for Windows, the path must exist.
location1
- the path to the first location to comparelocation2
- the path to the second location to compare
Boolean
value oftrue
true if the path to directories are equal.
false
otherwise.public static java.lang.String trimDoubleQuotes(java.lang.String inputString)
inputString
- - the string to remove quotation marks
String
without quotation marks.public static java.lang.String getResourceString(java.lang.String resourceBundle, java.lang.String key, java.lang.String... substitutions)
Note: The resource bundle name is a fully qualified package name without the file extension. For example, com.ibm.jsdt.main.MainManagerNLS
The template string in the NLS file should have the form:
{"ItemsFoundAndReturned", "{0} items found, {1} items returned"}
where substitutions[] is passed as substitutions[0]=10 substitutions[1]=7
This would return the string: "10 items found, 7 items returned"
resourceBundle
- fully qualified package name without file extensionkey
- the key to look forsubstitutions
- the replacement values in order. Can be null.
String
obtained from the resource bundlepublic static java.lang.String getPasswordValueByKey(java.lang.String key)
By specifying a fully qualified key, a password for applications other than the one currently installing can be obtained. The key can be in the form "taskId.appId.keyword".
Any password variable key that appears in the ibmnsi.properties file can be used.
The password is encrypted and stored as a hex string in the properties file. This will "unmask" the value and return it as a plain text string.
key
- -the key in the ibmnsi.properties file
String
indicating the password valuepublic static java.util.List<java.lang.String> getTiedVariableValue(java.lang.String variableKeyword)
List
of tied, host attribute values that
correspond to the variable keyword for the currently installing
application.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
The order of the values in the list corresponds to the natural ordering of the fully-qualified hostnames for the particular tied task. The list of ordered, fully-qualified hostnames is available through the property <>tiedTaskID>>.qualified.hostnames.
variableKeyword
- - the variable keyword.
List
of tied host attribute valuespublic static java.util.List<java.lang.String> getQualifiedTiedVariableValue(java.lang.String task, java.lang.String applicationId, java.lang.String variableKeyword)
List
of tied, host attribute values that
correspond to the specified task, application ID and variable keyword.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
The order of the values in the list corresponds to the natural ordering of the fully-qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <>tied task ID>>.qualified.hostnames.
task
- -this is the task that contains the
application whose variable has been tied. It is not the task that
supplies the attribute to which the variable has been tied.applicationId
- -the application which contains
the variable whose value is tied.variableKeyword
- -the variable keyword.
List
of values.public static java.util.List<java.lang.String> getTiedVariableValueForKey(java.lang.String key)
List
of tied, host attribute values that
correspond to the specified key.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
If the key is not task qualified, the current task is assumed.
The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <>tied task ID>>.qualified.hostnames.
key
- -composed of: <>task (if any)>>.<>applicationId>>.<>variableKeyword>>.
List
of values.public static java.util.List<java.lang.String> getTiedPasswordValue(java.lang.String variableKeyword)
List
of tied, host password values that
correspond to the variable keyword for the currently installing
application.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <>tied task id>>.qualified.hostnames.
variableKeyword
- - the variable keyword
List
of password values.public static java.util.List<java.lang.String> getQualifiedTiedPasswordValue(java.lang.String task, java.lang.String applicationId, java.lang.String variableKeyword)
List
of tied, password attribute values that
correspond to the specified task, application ID and variable keyword.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <>tied task ID>>.qualified.hostnames.
task
- - this is the task that contains the
application whose variable has been tied. It is not the task that
supplies attributes to which the variable has been tied.applicationId
- - the application which contains
the variable whose value is tied.variableKeyword
- - the variable keyword.
List
of password values.public static java.util.List<java.lang.String> getTiedPasswordValueForKey(java.lang.String key)
List
of tied, host password values that
correspond to the specified key.
There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.
If the key is not task qualified, the current task is assumed.
The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <>tied task ID>>.qualified.hostnames.
key
- -composed as following (using dots): <>task (if any)>>.<>applicationId>>.<>variableKeyword>>
List
of password values.public static boolean isVersionSupported(java.lang.String version, java.lang.String lowestSupportedVersion, java.lang.String highestSupportedVersion)
version
- - version of a product to verify if supportedlowestSupportedVersion
- - the lowest supported version of a producthighestSupportedVersion
- - the highest supported version of product
Boolean
value oftrue
if the version of product being checked is the same as,
or between the provided lower and upper supported limits.
false
otherwise.public static boolean valueExists(java.lang.String stringToSearch, java.lang.String[] values)
stringToSearch
- - the string to be searched for a particular valuevalues
- - an array of string values
Boolean
value oftrue>
if any of the values are found in the string.
false
otherwise.public static java.lang.String[] fileSearchAndReturnLinesWithSearch(java.lang.String filename, java.lang.String find, int startSearchPosition)
filename
- - The file name that contains the string.find
- - The string to find.startSearchPosition
- - The position of the file to start searching from.
public static java.lang.String getQualifiedHostName()
String
indicating the qualified host name.public static boolean getSetupFileRemovalSetting()
boolean
value of true
if setup files will be removed.
false
if setup files will not be removed.public static boolean setResponseFileProperty(java.lang.String propertiesFilePath, java.lang.String key, java.lang.String value)
propertiesFilePath
- -In order to obtain the correct response file path and name, one of
the following methods should be used: getPreDeploymentCheckerResponseFilePath
,
getEntryResponseFilePath
, getMainResponseFilePath
,
getExitResponseFilePath
, getResponseFilePath
.key
- - key for a variable in the property file.value
- - value of the key.
boolean
value oftrue
if the set was successful
false
otherwise.public static java.lang.String getResponseFileProperty(java.lang.String propertiesFilePath, java.lang.String key)
propertiesFilePath
- -In order to obtain the correct response file path and name, one of
the following methods should be used: getPreDeploymentCheckerResponseFilePath
,
getEntryResponseFilePath
, getMainResponseFilePath
,
getExitResponseFilePath
, getResponseFilePath
.key
- - key for a variable in the property file.
String
value.public static java.util.Properties getResponseFileProperties(java.lang.String propertiesFilePath)
propertiesFilePath
- -In order to obtain the correct response file path and name, one of
the following methods should be used: getPreDeploymentCheckerResponseFilePath
,
getEntryResponseFilePath
, getMainResponseFilePath
,
getExitResponseFilePath
, getResponseFilePath
.
Properties
public static java.lang.String getResponseFileValue(java.lang.String responseFileName, java.lang.String key)
responseFileName
- - file with key=value properties.key
- - key to find the value
String
value found at the keypublic static boolean setResponseFileValue(java.lang.String responseFileName, java.lang.String key, java.lang.String keyValue, boolean createKeyIfDoesNotExist)
getLogsDir()
which is an
absolute path to the logs directory.
responseFileName
- - file with key=value propertieskey
- - key to find paired value from response filekeyValue
- - new value to set for the keycreateKeyIfDoesNotExist
- - set this to true if a key should be created if one does not exist.
boolean
value of
true
if operation was successful
false
if operation failed
public static boolean unPackJar(java.lang.String absolutePathName, java.lang.String destinationDirPath)
absolutePathName
- -The absolute path to the JAR file including the name
of the JAR file.destinationDirPath
- -The absolute destination path where the jar file will be upacked to.
boolean
value oftrue
if the JAR file was successfully unpacked.
false
otherwise.public static boolean isPortRegistered(int port)
port
- the port to check
boolean
value oftrue
if the port is already registered.
false
otherwise.public static boolean isIpv6Address(java.lang.String computerName)
For example, "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210" would return true. The name "test.ibm.com" would return false.
computerName
- - a computer name.
boolean
indicating whether or not the computer name is in IPv6 format.public static java.lang.String getDeploymentWizardSpecificationVersion()
It will return null
for specification-versions
prior to 2.1.1.0
String
indicating the specification versionprotected static java.lang.String getBackLevelJsdtMessage(java.lang.String methodName)
methodName
- - a method name.
String
protected static java.lang.String getBackLevelDeployerMessage(java.lang.String methodName, java.lang.String sinceVersion)
methodName
- - a method name.
String
the earliest compatible version
the deployer.public static java.util.logging.Logger getLogger()
java.util.logging.Logger
that can be used to log trace
information to the support framework trace.
Logger
support framework loggerpublic static void trace(java.lang.String text)
text
- - The text to be loggedgetLogger
public static void trace(java.lang.Object object)
object
- - a oject method that need to be traced.getLogger
public static void trace(java.lang.Object[] objects)
objects
- - the object methods that need to be traced.getLogger
public void setMainResources(java.lang.String myResources)
ResourceBundle
.
Note that this is a fully qualified package name without the file extension.
setMainResources
in class com.ibm.jsdt.common.Base
myResources
- the ResourceBundle
to usepublic static java.lang.String getPreDeploymentCheckerResponseFilePath()
If no response file was specified for this program, null
will be returned.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
String
indicating the response file path for the pre-deployment checker programpublic static java.lang.String getPreDeploymentCheckerResponseFilePath(java.lang.String originalResponseFileName)
If no response file was specified for this program, null
will be returned.
If the Deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.
the
- name of the original (source) response file.
String
-the response file path for the pre-deployment checker programpublic static java.lang.String getEntryResponseFilePath()
If no response file was specified for this program, null
will be returned.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
String
indicating the path to the response file for the entry program.public static java.lang.String getEntryResponseFilePath(java.lang.String originalResponseFileName)
If no response file was specified for this program, null
will be returned.
If the Deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.
the
- name of the original (source) response file.
String
-the path to the entry program's response filepublic static java.lang.String getMainResponseFilePath()
If no response file was specified for this program, null
will be returned.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
String
indicating the path to the response file for the main programpublic static java.lang.String getMainResponseFilePath(java.lang.String originalResponseFilePath)
If no response file was specified for this program, null
will be returned.
If the Deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.
the
- name of the original (source) response file.
String
-the path to the main program's response filepublic static java.lang.String getExitResponseFilePath()
If no response file was specified for this program, null
will be returned.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
String
indicating the path to the response file for the exit programpublic static java.lang.String getExitResponseFilePath(java.lang.String originalResponseFilePath)
If no response file was specified for this program, null
will be returned.
If the Deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.
the
- name of the original (source) response file.
String
-the path to the exit program's response file.public static java.lang.String getResponseFilePath(int stage)
If no response file was specified for this program, null
will be returned.
If the deployment wizard has a specification version earlier than
2.1.1.0, then this method will return null
.
stage
- - the stage or program type
String
indicating the response file pathpublic static java.lang.String getResponseFilePath(int stage, java.lang.String sourceName)
If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.
stage
- sourceName
-
protected static int runAs(java.lang.String userId, java.lang.String password, java.lang.String command)
This will not run on i5 systems.
code
- String userIdcode
- String passwordcode
- String commandprotected static int runAs(java.lang.String userId, java.lang.String password, java.lang.String command, boolean shouldLogOutput)
This will not run on i5 systems.
code
- String userIdcode
- String passwordcode
- String command
int
the return code of the command.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |