com.ibm.jsdt.support.deploymenthelper.installedproduct
Class InstalledProduct

java.lang.Object
  extended by com.ibm.jsdt.support.deploymenthelper.installedproduct.InstalledProduct
Direct Known Subclasses:
ConsoleAgentInstalledProduct, ConsoleMgmtExtInstalledProduct, DB2InstalledProduct, ERConsoleInstalledProduct, IDSInstalledProduct, IHSInstalledProduct, WASExpressInstalledProduct, WebserverPluginForWASInstalledProduct

public abstract class InstalledProduct
extends java.lang.Object

Enables products to have classes that will perform post-installation activities. It requires that the product be already installed on the computer.


Field Summary
protected static DeploymentHelper helper
           
 
Constructor Summary
protected InstalledProduct(java.lang.String version, java.lang.String location)
          Constructor sets version and location of the particular installed product which invokes it.
 
Method Summary
 int compareVersion(java.lang.String versionToInstall)
          Compares provided version string with the version of installed middleware.
 DeploymentHelper getDeploymentHelper()
          Gets the Deployment helper.
 java.lang.String getInstalledLocation()
          Gets the installed product directory
static InstalledProduct getInstalledProduct(com.ibm.jsdt.support.deploymenthelper.installedproduct.ProductDetector productDetector, java.lang.String location)
          Gets the installed product at the given location by calling the appropriate middleware policy class implementors.
static InstalledProduct[] getInstalledProducts(com.ibm.jsdt.support.deploymenthelper.installedproduct.ProductDetector productDetector)
          Gets all the installed products on the target computer by calling the appropriate middleware policy class implementors.
 java.lang.String getInstalledVersion()
          Gets the installed product version
protected static DeploymentHelper getOSDeploymentHelper()
          Gets the OS deployment helper.
protected static java.lang.String grepRPM(java.lang.String rpmToGrep, DeploymentHelper helper)
          The run command to grep for provided RPM
protected  void setDeploymentHelper(DeploymentHelper theHelper)
          Sets the DeploymentHelper object with the installed product deployment helper.
protected  void setInstalledLocation(java.lang.String location)
          Sets the installed location with the location being passed.
protected  void setInstalledVersion(java.lang.String version)
          Sets the installed version with the version string being passed.
 java.lang.String trimVersionToNVersionPlaces(int versionPlaces, java.lang.String fullVersion)
          Concatenates the installed version to the number of decimals specified using the '.' as a separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helper

protected static DeploymentHelper helper
Constructor Detail

InstalledProduct

protected InstalledProduct(java.lang.String version,
                           java.lang.String location)
Constructor sets version and location of the particular installed product which invokes it.

Parameters:
version - The version of the installed product.
location - The location of the installed product.
Method Detail

getInstalledLocation

public java.lang.String getInstalledLocation()
Gets the installed product directory

Returns:
The installation location.

getInstalledVersion

public java.lang.String getInstalledVersion()
Gets the installed product version

Returns:
The version of the installed product.

compareVersion

public int compareVersion(java.lang.String versionToInstall)
Compares provided version string with the version of installed middleware. If provided version or installed version contains any character besides number and dot, these characters will be removed before making comparison.

Parameters:
versionToInstall - String to be queried
Returns:
int there are four possible return values: 0 indicates versions are equal; -1 indicates versionToInstall is an upgrade to the version already installed (an earlier version is installed); 1 indicates versionToInstall is a downgrade to the version already installed (a later version is installed). Integer.MIN_VALUE if versionToInstall or already installed version contains characters other than dots and numbers.

trimVersionToNVersionPlaces

public java.lang.String trimVersionToNVersionPlaces(int versionPlaces,
                                                    java.lang.String fullVersion)
Concatenates the installed version to the number of decimals specified using the '.' as a separator. For example, if the installed version is 6.0.2.1 and the versionPlaces = 2, then 6.0 would be returned.

Returns:
The installed version number trimmed to the number of places specified.

setInstalledLocation

protected void setInstalledLocation(java.lang.String location)
Sets the installed location with the location being passed.

Parameters:
location - The installation location.

setInstalledVersion

protected void setInstalledVersion(java.lang.String version)
Sets the installed version with the version string being passed.

Parameters:
version - The version of the product.

setDeploymentHelper

protected void setDeploymentHelper(DeploymentHelper theHelper)
Sets the DeploymentHelper object with the installed product deployment helper.

Parameters:
theHelper - The instance of the DeploymentHelper object used.

getInstalledProduct

public static InstalledProduct getInstalledProduct(com.ibm.jsdt.support.deploymenthelper.installedproduct.ProductDetector productDetector,
                                                   java.lang.String location)
Gets the installed product at the given location by calling the appropriate middleware policy class implementors. The OS deployment helper is appropriately created, and is passed to the product detector class.

Parameters:
productDetector - The ProductDetector object for the specific InstalledProduct.
location - The location of the installed product.
Returns:
An instance of the installed product.

getInstalledProducts

public static InstalledProduct[] getInstalledProducts(com.ibm.jsdt.support.deploymenthelper.installedproduct.ProductDetector productDetector)
Gets all the installed products on the target computer by calling the appropriate middleware policy class implementors. The OS deployment helper is appropriately created and is passed to the product detector class.

Parameters:
productDetector - The ProductDetector object for the specific InstalledProduct.
Returns:
An instance of the installed product.

getDeploymentHelper

public DeploymentHelper getDeploymentHelper()
Gets the Deployment helper.

Returns:
The instance of DeploymentHelper used.

grepRPM

protected static java.lang.String grepRPM(java.lang.String rpmToGrep,
                                          DeploymentHelper helper)
The run command to grep for provided RPM

Parameters:
rpmToGrep - The rpm package to grep for.
helper - The instance of DeploymentHelper used.
Returns:
String output of the command

getOSDeploymentHelper

protected static DeploymentHelper getOSDeploymentHelper()
Gets the OS deployment helper.

Returns:
The instance of OS DeploymentHelper used.