IIP installation API
An integrated installation package (IIP) contains an application programming interface (API) which allows an application to launch the IIP installer and retrieve information pertaining to the running install. The API provides a standardized way to retrieve installation status and progress. The API requires that the appserver installer be contained within an IIP and is unavailable for the standalone appserver installer.
The following Java™ classes are available to interface with the IIP controller.
IIPInstallerCLIInterface( String iipHome ) Constructor that takes in the location of the IIP (IIP_HOME).class="topictitle2">IIPInstallerCLIInterface
The IIPInstallerCLIInterface is the main interface into the IIP controller. From the IIPInstallerCLIInterface all objects that are used by the IIP are initialized where the IIP is launched.
-  
- Parameter: iipHome - The path to the directory that contains the IIP installer, which is equivalent to .
 boolean initialize( String[] options ) This method initializes the IIP controller by loading all required metadata files and then parsing and validating any and all options passed in. Because of the current implementation of the IIP controller if options are passed in for a specific contribution, then only those options are set for the contribution during run time. The method validates that the IIP_HOME location exists. This is an existing method in the IIP controller.
- Parameter: options - A string array that contains options for the contributions inside the IIP. Each position in the array contains an option. For example, options[1] = “-OPT installLocation=C:\IBM”
Returns true if the IIP was successfully initialized, otherwise false.
 int runIIP() This method invokes the IIP install. Upon successful validation the method the IIP is invoked. After the IIP has finished running, the overall IIP install status is returned. This method is the main method for this line item.
Returns one of the install status constants from the IIPResults class that represents the install status for the IIP.
 InstallationProgressListener getInstallationProgressListener() This method returns the installation progress listener object used in the IIP. The installation progress listener class is explained later in this topic.
 IIPResults getIIPResults() This method is used to get the install status constants and returns the IIPResults object that is used in the IIP.
int IIP_RETCODE_SUCCESS
class="topictitle2">IIPResults
The IIPResults object contains the result information for the IIP that was run. Installation status constants:
-  
 int IIP_RETCODE_PARTIAL_SUCCESS  int IIP_RETCODE_FAILED int getInstallationProgress()
class="topictitle2">InstallationProgressListener
The InstallationProgressListener object contains the installation progress information for both the IIP as a whole as well as for each individual invocation.
-  
This method returns the current progress of the currently running contribution installation.
Returns an integer value representing the current progress out of 100.
 int getOverallProgress() This method returns the current progress of the entire IIP installation. The overall progress represents the total number of contributions that have been run against the total number of contributions to be run plus the progress of the currently installing contribution. If only one contribution exists, then this returns the same value as getInstallationProgress().
Returns an integer value representing the current progress out of 100.
String IIP_NOGUI_ARG
class="topictitle2">IIPArguments
The IIPArguments object contains all the arguments that are passed into an IIP for all contributions.
-  
This constant contains the -iipNoGui argument which is used to suppress the IIP GUI. However, this constant does not suppress the contribution install GUI.
class="topictitle2">Example
Use the following example to create and initialize an API interface object, launch the IIP, and retrieve the installation status.
import com.ibm.ws.install.factory.iip.engine.impl.IIPInstallerCLIInterfaceImpl; import com.ibm.ws.install.factory.iip.engine.IIPArguments; import com.ibm.ws.install.factory.iip.engine.IIPResults; import com.ibm.ws.install.factory.iip.engine.IIPInstallerCLIInterface; IIPInstallerCLIInterface wasIIP = new IIPInstallerCLIInterfaceImpl(“/IIPHome”); String[] options = {IIPArguments.IIP_NOGUI_ARG, “-OPT installLocation=/opt/IBM/WebSphere/AppServer”}; wasIIP.initialize(options); int wasInstallStatus = wasIIP.runIIP();Read the "install command" topic for more information on installation codes.
Requirements You must fulfill the following requirements to run the example.
- The IIPArguments.IIP_NOGUI_ARG must be specified as the first option in the array when specifying options for the IIP such as the installation location. The reason that IIPArguments.IIP_NOGUI_ARG must be specified is that the IIP API does not include the IIP GUI and therefore the IIP GUI must be suppressed.
- To build a Java class that uses the API, the iipengine.jar file located in the IIP’s lib directory is required to be on the classpath. The IIP lib directory can be found in /iip/lib.
- To run the IIP API, the classpath needs to include all JAR files located in the /iip/lib directory and all subdirectories below it, as well as all JAR files in the /iip/contrib/<contribution_name>/assets/lib/ directory.
Related concepts
Last updated Nov 11, 2010 1:01:09 PM CST