|
|||||||||||
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.OS400DeploymentHelper
public class OS400DeploymentHelper
OS400 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 | |
---|---|
OS400DeploymentHelper()
Sole constructor. |
Method Summary | |
---|---|
static boolean |
arePtfsApplied(java.util.Iterator ptfList)
Checks to see if each PTF in a specified list has been applied(PERM or TEMP) to the system. |
static void |
chmodDirPermissions(java.lang.String path,
java.lang.String chmodValue)
Changes the permissions on a directory. |
static void |
chmodFilePermissions(java.lang.String fileName,
java.lang.String chmodValue)
Changes the permissions on a file. |
static boolean |
createSecOfrUser(java.lang.String userName,
java.lang.String password)
Creates an administrative user on the i5/OS machine. |
static boolean |
createUser(java.lang.String userName,
java.lang.String password)
Creates a user on the i5/OS machine. |
static boolean |
deleteUser(java.lang.String userName)
Deletes a user on the i5/OS machine. |
static boolean |
doesHaveSecOfrAuthority(java.lang.String userName)
Determines whether or not the given user has "secofr" administrative authority. |
static boolean |
doesUserExist(java.lang.String userName)
Determines whether or not the specified user exists on the system. |
static ProgramOutput |
executeCommandAndConvertToASCII(java.lang.String command,
java.lang.String logCommand,
boolean convertFromEBCDIC,
java.lang.String workingDir)
Run a QSH command with convertFromEBCDIC option. |
static ProgramOutput |
executeCommandNoConvertToASCII(java.lang.String command,
java.lang.String commandToLog)
Run a QSH command. |
static com.ibm.as400.access.AS400Message[] |
getArePtfsAppliedMessageList()
Retrieves an array of messages that are associated with a failed program call in the arePtfsApplied method. |
static com.ibm.as400.access.AS400 |
getAS400()
Retrieves the AS400 system object. |
static java.lang.String |
getCLCommandOutput()
Retrieves the output of the last invoked CL command. |
static java.lang.String |
getOSLevel()
Returns the current level of the i5 operating system in the form of "version.release.modification". |
static int |
getOSRelease()
Obtains the current i5/OS release. |
static int |
getOSVersion()
Obtains the current i5/OS version. |
static boolean |
isCurrentReleaseEqualOrGreater(java.lang.String os400Release)
Indicates whether or not the version and release of the current OS/400 computer is greater than or equal to a specified expected value. |
static boolean |
isProductInstalled(java.lang.String os400ProductId,
java.lang.String os400ProductOption)
Checks the system to see if a product and option are installed on the machine. |
static boolean |
isProductInstalled(java.lang.String os400ProductId,
java.lang.String os400Release,
java.lang.String os400ProductOption)
Checks the system to see if a product, option, and release are installed on the machine for a specific OS version. |
static boolean |
isUserPasswordValid(java.lang.String userName,
java.lang.String password)
Determines the validity of the given user and password combination. |
static void |
reboot()
Reboots the i5/OS machine. |
static boolean |
runCLCommand(java.lang.String command)
Runs a CL command. |
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 OS400DeploymentHelper()
Method Detail |
---|
public static void chmodDirPermissions(java.lang.String path, java.lang.String chmodValue)
path
- - a directory on which to set access permissionchmodValue
- - a chmod value indicating the level of permission to setpublic static void chmodFilePermissions(java.lang.String fileName, java.lang.String chmodValue)
fileName
- - a file name on which to set access permissionchmodValue
- - a chmod value indicating the level of permission to setpublic static boolean createSecOfrUser(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a user password
boolean
value of true
if the administrative user is successfully created.
false
otherwise public static boolean createUser(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a user password
boolean
value of true
if the user is successfully created
false
otherwisepublic static boolean deleteUser(java.lang.String userName)
userName
- - user name to be deleted
boolean
value of true
if the user is successfully deleted
false
otherwisepublic static void reboot()
public static boolean doesHaveSecOfrAuthority(java.lang.String userName)
userName
- - a user name to be verified
boolean
value of true
if the user has administrative authority
false
otherwisepublic static boolean isUserPasswordValid(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a user password
boolean
value of true
if the password is valid for the user
false
otherwisepublic static boolean doesUserExist(java.lang.String userName)
userName
- - a user name
boolean
value of true
if user exists
false
otherwise public static boolean runCLCommand(java.lang.String command)
"QSYS/CRTLIB LIB(MYLIB) TEXT('Some text')"
command
- - CL command
boolean
value of true
if the command returns true
false
otherwisepublic static java.lang.String getCLCommandOutput()
public static java.lang.String getOSLevel()
public static int getOSVersion()
public static int getOSRelease()
public static boolean isProductInstalled(java.lang.String os400ProductId, java.lang.String os400ProductOption)
For example os400ProductId = 5722DG1. See Product Javadoc for constant values.
os400ProductId
- - OS400 product idos400ProductOption
- - OS400 product option
boolean
value of true
if the product
and option are correctly installed.
false
if the product is not installed, or if
it is on the system, but not in a fully installed state.public static boolean isProductInstalled(java.lang.String os400ProductId, java.lang.String os400Release, java.lang.String os400ProductOption)
For example os400ProductId = "5722DG1", os400ProductOption = "*BASE" or "0001" or "0002" etc, os400ProductRelease = "V6R1M0" See Product Javadoc for constant values.
os400ProductId
- - OS400 product idos400ProductOption
- - OS400 product optionos400ProductRelease
- - OS400 product release
boolean
value of true
if the product and option and release
are correctly installed.
false
if the product or option or release
are not installed, or if
it is on the system but not in a fully installed state.public static boolean arePtfsApplied(java.util.Iterator ptfList)
Applied is defined as temporarily applied, permanently applied, or superseded. If a PTF is loaded or has a SAVF it is not considered applied.
The ptfList must contain String[3] arrays
for each entry. Each entry(String[3]) must contain
{
ptfList
- - an iterator of ptfList
boolean
value of
true
if
every PTF in the list has been applied.
false
if one or more
PTFs in the list is not applied.
public static com.ibm.as400.access.AS400 getAS400()
AS400
system object.
AS400
public static com.ibm.as400.access.AS400Message[] getArePtfsAppliedMessageList()
arePtfsApplied
method.
The arePtfsApplied
method must be called prior
to calling this method.
AS400Message[]
public static boolean isCurrentReleaseEqualOrGreater(java.lang.String os400Release)
For example, if a release of V5R2M0 was passed, and the current target computer is V5R1M0, then the value of false would be returned. If the release of the current computer is V5R2M0 or later, a value of true is returned.
os400Release
- - OS400 release
boolean value of
true
if the current
release on the computer is the same or higher than the specified release,
false
otherwise.
public static ProgramOutput executeCommandAndConvertToASCII(java.lang.String command, java.lang.String logCommand, boolean convertFromEBCDIC, java.lang.String workingDir)
command
- - the command to run.logCommand
- - logCommand to write to the log file. Can be used if the original contains
secure information such as user ID and/or password.convertFromEBCDIC
- - a boolean if the output needs to be converted from EBCDIC to ASCII.workingDir
- - A String
indicate the working directory from which the command should be run from.
If null is specified, the current working directory is used.
ProgramOutput
The program output. It contains information about the command's stderr, stdout,
return code, and exception thrown (if any).public static ProgramOutput executeCommandNoConvertToASCII(java.lang.String command, java.lang.String commandToLog)
command
- - the command to run.commandToLog
- - the command to log. If null or empty string is specified, a command will be logged.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |