IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.product
Class WASDirectory

java.lang.Object
  extended by com.ibm.websphere.product.WASDirectory

public class WASDirectory
extends java.lang.Object

WASDirectory provides an interface into the product version information. For example, Product Name, Edition, Build Number, Build Date etc. This class contains methods that replaced deprecated methods in WASProduct class.

Version:
8.0

Field Summary
static java.lang.String ID_BASE
          Deprecated. Since V8.0
static java.lang.String ID_CLIENT
          Deprecated. Since V8.0
static java.lang.String ID_EMBEDDED_EXPRESS
          Deprecated. Since V8.0
static java.lang.String ID_EXPRESS
          Deprecated. Since V8.0
static java.lang.String ID_IHS
          Deprecated. Since V8.0
static java.lang.String ID_JDK
          Deprecated. Since V8.0
static java.lang.String ID_ND
          Deprecated. Since V8.0
static java.lang.String ID_NDDMZ
          Deprecated. Since V8.0
static java.lang.String ID_PLUGIN
          Deprecated. Since V8.0
static java.lang.String ID_PME
          Deprecated. Since V8.0
static java.lang.String ID_WBI
          Deprecated. Since V8.0
static java.lang.String ID_WXD
          Deprecated. Since V8.0
static java.lang.String ID_XD
          Deprecated. Since V8.0
 
Constructor Summary
WASDirectory()
          Constructor for WASDirectory.
WASDirectory(java.lang.String wasLocation)
          Constructor for WASDirectory.
 
Method Summary
 java.lang.String getArch()
          IBM WEBSPHERE INTERNAL USE ONLY.
 java.lang.String getArchFromNativeFile()
          Deprecated. As of WAS v8.0. Replaced by getArch().
 java.lang.String getBuildDate(java.lang.String id)
          Get the build date of the WAS product with the specific id.
 java.lang.String getBuildLevel(java.lang.String id)
          Get the build level of the WAS product with the specific id.
 IMEvent[] getHistoryEventList()
          Return a list of history event objects.
 com.ibm.websphere.product.metadata.WASMaintenancePackage[] getHistoryMaintenancePackageList()
          Deprecated. As of WAS v8.0
 com.ibm.websphere.product.metadata.WASMaintenancePackage[] getHistoryMaintenancePackageListFromV7Metadata()
          Deprecated. As of WAS v8.0
 java.lang.String getIMLogLocation()
          Return the log directory path associated with this install location.
 com.ibm.websphere.product.metadata.WASComponent getInstalledComponentByName(java.lang.String componentName)
          Deprecated. Since WAS v8.0.
 com.ibm.websphere.product.metadata.WASComponent[] getInstalledComponentList()
          Deprecated. Since WAS v8.0.
 com.ibm.websphere.product.metadata.WASMaintenancePackage getInstalledMaintenancePackageByID(java.lang.String mpID)
          Deprecated. As of WAS v8.0
 com.ibm.websphere.product.metadata.WASMaintenancePackage[] getInstalledMaintenancePackageList()
          Deprecated. As of WAS v8.0.
 IMOffering getInstalledOfferingByID(java.lang.String productID)
          Return an installed IMOffering objects based on product ID.
 IMOffering[] getInstalledOfferingList()
          Return a list of installed IMOffering objects.
protected  java.lang.String getLibraryFilePathByPlatform(java.lang.String os, java.lang.String sInstallRootPath)
          IBM WEBSPHERE INTERNAL USE ONLY.
 java.lang.String getName(java.lang.String id)
          Get the name of the WASProductInfo with the specific id.
 java.lang.String getOfficialArchName()
          IBM WEBSPHERE INTERNAL USE ONLY.
 java.lang.String getOfficialArchNameFromNativeFile()
          Deprecated. As of WAS v8.0. Replaced by getOfficialArchName()
 com.ibm.websphere.product.WASRegistrarInfo getRegistrarById(java.lang.String id)
          Returns a WASRegistrarInfo for the registrar with the specified id, or null if no such registrar exists.
 java.util.List<java.lang.String> getRegistrarFileNames()
          Get the list of .registrar file names in the WASDirectory.
 java.util.List<com.ibm.websphere.product.WASRegistrarInfo> getRegistrarInstances()
          Get the WASRegistrarInfo instances in the WASDirectory.
 java.lang.String getVersion(java.lang.String id)
          Get the version of the WAS product with the specific id.
 java.lang.String getWasLocation()
          Get the installation location of the WAS product.
 WASProductInfo getWASProductInfo(java.lang.String id)
          Get the WASProductInfo with the specific id in the WASDirectory.
 WASProductInfo[] getWASProductInfoInstances()
          Get the WASProductInfo instances in the WASDirectory.
protected  void init(java.lang.String wasLocation)
          IBM WEBSPHERE INTERNAL USE ONLY.
protected  void init(java.lang.String wasLocation, boolean initMetadatInstance)
          IBM WEBSPHERE INTERNAL USE ONLY.
protected  boolean initMetadataInstance()
          IBM WEBSPHERE INTERNAL USE ONLY.
 boolean isComponentInstalled(java.lang.String componentName)
          Deprecated. As of WAS v8.0.
 boolean isInstallMetadataExist()
          IBM WEBSPHERE INTERNAL USE ONLY.
 boolean isMaintenancePackageInstalled(java.lang.String ID)
          Deprecated. As of WAS v8.0.
 boolean isRegistrarPresent(java.lang.String id)
          Determines if a registrar with the specified id exists.
 boolean isThisProductInstalled(java.lang.String id)
          Checks if a specific product exists.
static boolean refreshCache()
          IBM WEBSPHERE INTERNAL USE ONLY.
static boolean refreshProductInfoCache()
          IBM WEBSPHERE INTERNAL USE ONLY.
protected  void setLogger(com.ibm.websphere.product.logger.WASDirectoryLogger logger)
          IBM WEBSPHERE INTERNAL USE ONLY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_BASE

public static final java.lang.String ID_BASE
Deprecated. Since V8.0
Product ID: BASE edition

See Also:
Constant Field Values

ID_EXPRESS

public static final java.lang.String ID_EXPRESS
Deprecated. Since V8.0
Product ID: EXPRESS edition

See Also:
Constant Field Values

ID_ND

public static final java.lang.String ID_ND
Deprecated. Since V8.0
Product ID: ND edition

See Also:
Constant Field Values

ID_NDDMZ

public static final java.lang.String ID_NDDMZ
Deprecated. Since V8.0
Product ID: NDDMZ edition

See Also:
Constant Field Values

ID_PME

public static final java.lang.String ID_PME
Deprecated. Since V8.0
Product ID: PME

See Also:
Constant Field Values

ID_WBI

public static final java.lang.String ID_WBI
Deprecated. Since V8.0
Product ID: WBI

See Also:
Constant Field Values

ID_JDK

public static final java.lang.String ID_JDK
Deprecated. Since V8.0
Product ID: JDK

See Also:
Constant Field Values

ID_EMBEDDED_EXPRESS

public static final java.lang.String ID_EMBEDDED_EXPRESS
Deprecated. Since V8.0
Product ID: embeddedEXPRESS edition

See Also:
Constant Field Values

ID_XD

public static final java.lang.String ID_XD
Deprecated. Since V8.0
Product ID: XD edition

See Also:
Constant Field Values

ID_CLIENT

public static final java.lang.String ID_CLIENT
Deprecated. Since V8.0
Product ID: CLIENT installer

See Also:
Constant Field Values

ID_PLUGIN

public static final java.lang.String ID_PLUGIN
Deprecated. Since V8.0
Product ID: PLUGIN installer

See Also:
Constant Field Values

ID_IHS

public static final java.lang.String ID_IHS
Deprecated. Since V8.0
Product ID: IHS installer

See Also:
Constant Field Values

ID_WXD

public static final java.lang.String ID_WXD
Deprecated. Since V8.0
Product ID: WXD edition

See Also:
Constant Field Values
Constructor Detail

WASDirectory

public WASDirectory()
             throws java.io.FileNotFoundException,
                    java.io.IOException,
                    javax.xml.parsers.ParserConfigurationException,
                    org.xml.sax.SAXException,
                    WASDirectoryException
Constructor for WASDirectory. The product instances retrieved are from cache.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
WASDirectoryException

WASDirectory

public WASDirectory(java.lang.String wasLocation)
Constructor for WASDirectory. The product instances retrieved are from cache.

Parameters:
wasLocation - the installation location of the WAS product.
Method Detail

getRegistrarInstances

public java.util.List<com.ibm.websphere.product.WASRegistrarInfo> getRegistrarInstances()
Get the WASRegistrarInfo instances in the WASDirectory. The WASRegistrarInfo instances retrieved are from a cache.

Returns:
List of registrar instances.

getRegistrarFileNames

public java.util.List<java.lang.String> getRegistrarFileNames()
Get the list of .registrar file names in the WASDirectory. The List of file names is returned from a cache.

Returns:
List of .registrar file names.

getRegistrarById

public com.ibm.websphere.product.WASRegistrarInfo getRegistrarById(java.lang.String id)
Returns a WASRegistrarInfo for the registrar with the specified id, or null if no such registrar exists.

Parameters:
id - The registrar ID to return a WASRegistrarInfo for.
Returns:
A WASRegistrarInfo object that represents the registrar specified by the id, or null if no such registrar exists.

isRegistrarPresent

public boolean isRegistrarPresent(java.lang.String id)
Determines if a registrar with the specified id exists.

Parameters:
id - The registrar id to look for.
Returns:
true if the registrar exists, or false otherwise.

getWASProductInfoInstances

public WASProductInfo[] getWASProductInfoInstances()
Get the WASProductInfo instances in the WASDirectory. The product info instances retrieved are from cache.

Returns:
Array of WASProductInfo instances

getWASProductInfo

public WASProductInfo getWASProductInfo(java.lang.String id)
Get the WASProductInfo with the specific id in the WASDirectory. The product info retrieved is from cache.

Parameters:
id - the id of the WAS product.
Returns:
The WASProductInfo instance.

isThisProductInstalled

public boolean isThisProductInstalled(java.lang.String id)
Checks if a specific product exists. The product info retrieved is from cache.

Parameters:
id - The product ID to be checked.
Returns:
true if the specific product is found to be exists; otherwise, return false.

getName

public java.lang.String getName(java.lang.String id)
Get the name of the WASProductInfo with the specific id. The name retrieved is from cache.

Parameters:
id - the id of the WAS product.
Returns:
The name of the WAS product with the specific id.

getVersion

public java.lang.String getVersion(java.lang.String id)
Get the version of the WAS product with the specific id. The version retrieved is from cache.

Parameters:
id - the id of the WAS product.
Returns:
The version of the WAS product with the specific id.

getBuildDate

public java.lang.String getBuildDate(java.lang.String id)
Get the build date of the WAS product with the specific id. The build date retrieved is from cache.

Parameters:
id - the id of the WAS product.
Returns:
The date of the WAS product with the specific id.

getBuildLevel

public java.lang.String getBuildLevel(java.lang.String id)
Get the build level of the WAS product with the specific id. The build level retrieved is from cache.

Parameters:
id - the id of the WAS product.
Returns:
The build level of the WAS product with the specific id.

getWasLocation

public java.lang.String getWasLocation()
Get the installation location of the WAS product.

Returns:
The installation location of the WAS product.

getIMLogLocation

public java.lang.String getIMLogLocation()
Return the log directory path associated with this install location.

Returns:
The log directory path associated with this install location. If there is problem in getting IMMetadata, empty string is returned.

refreshProductInfoCache

public static boolean refreshProductInfoCache()
IBM WEBSPHERE INTERNAL USE ONLY. Refresh ProductInfo cache.

Returns:
true or false

refreshCache

public static boolean refreshCache()
IBM WEBSPHERE INTERNAL USE ONLY. Refresh WASMetadata and IMMetadata cache. Existing WASDirectory instances in the current JVM are not usable.

Returns:
true or false

getOfficialArchNameFromNativeFile

public java.lang.String getOfficialArchNameFromNativeFile()
Deprecated. As of WAS v8.0. Replaced by getOfficialArchName()

IBM WEBSPHERE INTERNAL USE ONLY. Return the official architecture name from OS name and architecture keyword.

Parameters:
installLocation - Product install location.

Returns:
The official architecture name from OS name and architecture keyword. If the official architecture name is not found, then the architecture keyword is returned. Null is returned if exceptions are caught.

getArchFromNativeFile

public java.lang.String getArchFromNativeFile()
                                       throws java.io.IOException
Deprecated. As of WAS v8.0. Replaced by getArch().

IBM WEBSPHERE INTERNAL USE ONLY. Get the architecture of product from native file. This method is not applicable to UPDI because UPDI does not carry any native library file.

Parameters:
installLocation - Product install location.

Returns:
The architecture of product from native file. Return null if unsupported platform or architecture is detected.

Throws:
java.io.IOException

getOfficialArchName

public java.lang.String getOfficialArchName()
IBM WEBSPHERE INTERNAL USE ONLY. Return the official architecture name from OS name and architecture keyword.

Parameters:
installLocation - Product install location.

Returns:
The official architecture name from OS name and architecture keyword. If the official architecture name is not found, then the architecture keyword is returned. Null is returned if exceptions are caught.

getArch

public java.lang.String getArch()
                         throws java.io.IOException
IBM WEBSPHERE INTERNAL USE ONLY. Get the architecture of product based on JRE architecture.

Returns:
The architecture of installed product. Return null if unsupported platform or architecture is detected.

Throws:
java.io.IOException

getInstalledOfferingList

public IMOffering[] getInstalledOfferingList()
                                      throws java.io.FileNotFoundException,
                                             java.io.IOException,
                                             javax.xml.parsers.ParserConfigurationException,
                                             org.xml.sax.SAXException
Return a list of installed IMOffering objects.

Returns:
A a list of installed IMOffering objects.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

isInstallMetadataExist

public boolean isInstallMetadataExist()
IBM WEBSPHERE INTERNAL USE ONLY.


getInstalledOfferingByID

public IMOffering getInstalledOfferingByID(java.lang.String productID)
                                    throws java.io.FileNotFoundException,
                                           java.io.IOException,
                                           javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException
Return an installed IMOffering objects based on product ID.

Parameters:
productID - The product ID of interest.

Returns:
An installed IMOffering objects based on product ID.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getHistoryEventList

public IMEvent[] getHistoryEventList()
                              throws java.io.FileNotFoundException,
                                     java.io.IOException,
                                     javax.xml.parsers.ParserConfigurationException,
                                     org.xml.sax.SAXException
Return a list of history event objects.

Returns:
A a list of history event objects.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getInstalledComponentByName

public com.ibm.websphere.product.metadata.WASComponent getInstalledComponentByName(java.lang.String componentName)
                                                                            throws java.io.FileNotFoundException,
                                                                                   java.io.IOException,
                                                                                   javax.xml.parsers.ParserConfigurationException,
                                                                                   org.xml.sax.SAXException
Deprecated. Since WAS v8.0.

Return installed component by component name.

Parameters:
componentName - The name of the component to be retrieved.

Returns:
Installed component by component name. Return null if error occurs or install root location is not valid.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getInstalledComponentList

public com.ibm.websphere.product.metadata.WASComponent[] getInstalledComponentList()
                                                                            throws java.io.FileNotFoundException,
                                                                                   java.io.IOException,
                                                                                   javax.xml.parsers.ParserConfigurationException,
                                                                                   org.xml.sax.SAXException
Deprecated. Since WAS v8.0.

Return installed component objects list.

Returns:
Installed component objects list. Return empty array if error occurs or install root location is not valid.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getHistoryMaintenancePackageList

public com.ibm.websphere.product.metadata.WASMaintenancePackage[] getHistoryMaintenancePackageList()
                                                                                            throws java.io.FileNotFoundException,
                                                                                                   java.io.IOException,
                                                                                                   javax.xml.parsers.ParserConfigurationException,
                                                                                                   org.xml.sax.SAXException
Deprecated. As of WAS v8.0

Return the maintenace packages objects list in the history xml file.

Returns:
The maintenace packages objects list in the history xml file. Return empty array if error occurs or install root location is not valid.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getInstalledMaintenancePackageByID

public com.ibm.websphere.product.metadata.WASMaintenancePackage getInstalledMaintenancePackageByID(java.lang.String mpID)
                                                                                            throws java.io.FileNotFoundException,
                                                                                                   java.io.IOException,
                                                                                                   javax.xml.parsers.ParserConfigurationException,
                                                                                                   org.xml.sax.SAXException
Deprecated. As of WAS v8.0

Return installed maintenance package by maintenance package ID.

Parameters:
mpID - The maintenance package ID of the maintenance package to be retrieved.

Returns:
Installed maintenance package by maintenance package ID. Return null if error occurs or install root location is not valid.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getInstalledMaintenancePackageList

public com.ibm.websphere.product.metadata.WASMaintenancePackage[] getInstalledMaintenancePackageList()
                                                                                              throws java.io.FileNotFoundException,
                                                                                                     java.io.IOException,
                                                                                                     javax.xml.parsers.ParserConfigurationException,
                                                                                                     org.xml.sax.SAXException
Deprecated. As of WAS v8.0.

Return installed maintenance package objects list.

Returns:
Installed maintenance package objects list. Return null if error occurs or install root location is not valid.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

isComponentInstalled

public boolean isComponentInstalled(java.lang.String componentName)
                             throws java.io.FileNotFoundException,
                                    java.io.IOException,
                                    javax.xml.parsers.ParserConfigurationException,
                                    org.xml.sax.SAXException
Deprecated. As of WAS v8.0.

Return true if the named component is installed. Else return false.

Parameters:
componentName - The component name.

Returns:
true if the named component is installed. Else return false.
Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

isMaintenancePackageInstalled

public boolean isMaintenancePackageInstalled(java.lang.String ID)
                                      throws java.io.FileNotFoundException,
                                             java.io.IOException,
                                             javax.xml.parsers.ParserConfigurationException,
                                             org.xml.sax.SAXException
Deprecated. As of WAS v8.0.

Return true if the named maintenance package is installed. Else return false.

Parameters:
ID - The maintenance package ID.

Returns:
true if the named maintenance package is installed. Else return false.
Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getHistoryMaintenancePackageListFromV7Metadata

public com.ibm.websphere.product.metadata.WASMaintenancePackage[] getHistoryMaintenancePackageListFromV7Metadata()
                                                                                                          throws java.io.FileNotFoundException,
                                                                                                                 java.io.IOException,
                                                                                                                 javax.xml.parsers.ParserConfigurationException,
                                                                                                                 org.xml.sax.SAXException
Deprecated. As of WAS v8.0

IBM WEBSPHERE INTERNAL USE ONLY.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getLibraryFilePathByPlatform

protected java.lang.String getLibraryFilePathByPlatform(java.lang.String os,
                                                        java.lang.String sInstallRootPath)
IBM WEBSPHERE INTERNAL USE ONLY. Return the library path used for checking architecture.

Parameters:
os - The OS/platform keyword.
sLibDirPath - The path of the directory where the libraries are placed under.

Returns:
The library path used for checking architecture.

init

protected void init(java.lang.String wasLocation)
IBM WEBSPHERE INTERNAL USE ONLY. Initialized the WASDirectory instance and init the logger object.

Parameters:
wasLocation - The install location.

init

protected void init(java.lang.String wasLocation,
                    boolean initMetadatInstance)
IBM WEBSPHERE INTERNAL USE ONLY. Initialized the WASDirectory instance and init the logger object.

Parameters:
wasLocation - The install location.

initMetadataInstance

protected boolean initMetadataInstance()
                                throws java.io.FileNotFoundException,
                                       java.io.IOException,
                                       javax.xml.parsers.ParserConfigurationException,
                                       org.xml.sax.SAXException
IBM WEBSPHERE INTERNAL USE ONLY. Init the WASMetadata instance if it's not initialized yet. Return true if the instance is initialized properly. Else return false.

Throws:
java.io.FileNotFoundException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

setLogger

protected void setLogger(com.ibm.websphere.product.logger.WASDirectoryLogger logger)
IBM WEBSPHERE INTERNAL USE ONLY. Set the logger object for this WASMetadata instance.

Parameters:
logger - The logger object for this WASMetadata instance.

IBM WebSphere Application ServerTM
Release 8