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

java.lang.Object
  extended by com.ibm.jsdt.support.deploymenthelper.installedproduct.InstalledProduct
      extended by com.ibm.jsdt.support.deploymenthelper.installedproduct.ConsoleAgentInstalledProduct

public class ConsoleAgentInstalledProduct
extends InstalledProduct

Handles pre-installation and post-installation activities for the Console agent.


Field Summary
 
Fields inherited from class com.ibm.jsdt.support.deploymenthelper.installedproduct.InstalledProduct
helper
 
Constructor Summary
protected ConsoleAgentInstalledProduct(java.lang.String version, java.lang.String location)
          Constructs a new ConsoleAgentInstalledProduct containing the version and the location of the installed product.
 
Method Summary
 void clearProductsDependentOn(java.lang.String entry)
          Clears an entry in the console agent properties file for the ProductsDependentOnConsoleAgent key.
 void clearPropertiesFileKey(java.lang.String key)
          Clears the entire value in the properties file for a particular key.
 int determineNumberOfEntriesForKey(java.lang.String key)
          The number of entries that exists in a key value.
 boolean doesMiddlewareEntryExist(java.lang.String key, java.lang.String location)
          Determines if a particular middleware is updated in the console agent properties file.
 boolean doesProductsDependentOnEntryExists(java.lang.String value)
          Determines if the console agent properties file contains the requested ProductsDependentOnConsoleAgent value
 java.lang.String getConsoleAgentLogLocation()
          Determines the Console agent log location.
 java.lang.String getConsoleAgentProcessIdFile()
          Gets the location of the Console Agent Process ID File
 java.lang.String getConsoleAgentPropertiesFile()
          Gets the console agent properties file.
static ConsoleAgentInstalledProduct getInstalledProduct(java.lang.String location)
          Gets the Console agent installed product if location is provided.
static ConsoleAgentInstalledProduct[] getInstalledProducts()
          Gets the Console Agent installed product from the target computer.
 java.lang.String getLastEntryFromPropFileValue(java.lang.String key)
          Using the key, returns the last entry from a list in property file.
 boolean isConsoleAgentRunning()
          Checks to see if console agent is running or not.
static void main(java.lang.String[] args)
          Main program
 boolean restartConsoleAgent()
          Restarts console agent.
 boolean restartConsoleAgentUsingServicesFile()
          Starts console agent service using a script file that will be generated on the machine.
 boolean startConsoleAgent()
          Starts console agent.
 boolean stopConsoleAgent()
          Stops the console agent.
 void updateMiddlewareLocationInfo(java.lang.String key, java.lang.String location)
          Updates the console agent properties file with the IBM middleware installation location information.
 void updateProductsDependentOn(java.lang.String entry)
          Updates the console agent properties file ProductsDependentOnConsoleAgent key.
 
Methods inherited from class com.ibm.jsdt.support.deploymenthelper.installedproduct.InstalledProduct
compareVersion, getDeploymentHelper, getInstalledLocation, getInstalledProduct, getInstalledProducts, getInstalledVersion, getOSDeploymentHelper, grepRPM, setDeploymentHelper, setInstalledLocation, setInstalledVersion, trimVersionToNVersionPlaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleAgentInstalledProduct

protected ConsoleAgentInstalledProduct(java.lang.String version,
                                       java.lang.String location)
Constructs a new ConsoleAgentInstalledProduct containing the version and the location of the installed product.

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

getInstalledProduct

public static ConsoleAgentInstalledProduct getInstalledProduct(java.lang.String location)
Gets the Console agent installed product if location is provided.

Parameters:
location - The location of the installed product.
Returns:
An instance of the console agent installed product.

getInstalledProducts

public static ConsoleAgentInstalledProduct[] getInstalledProducts()
Gets the Console Agent installed product from the target computer.

Returns:
An array of management extension installed products found. The array size is 1, because you cannot have multiple instances of the product.

getConsoleAgentLogLocation

public java.lang.String getConsoleAgentLogLocation()
Determines the Console agent log location.

Returns:
Location of the log file.

getConsoleAgentPropertiesFile

public java.lang.String getConsoleAgentPropertiesFile()
Gets the console agent properties file.

Returns:
The absolute installation location of the properties file.

getConsoleAgentProcessIdFile

public java.lang.String getConsoleAgentProcessIdFile()
Gets the location of the Console Agent Process ID File

Returns:
The location of the Console Agent Process ID File

isConsoleAgentRunning

public boolean isConsoleAgentRunning()
Checks to see if console agent is running or not.

Returns:
True if the console agent is running. False if the console agent is not running.

updateMiddlewareLocationInfo

public void updateMiddlewareLocationInfo(java.lang.String key,
                                         java.lang.String location)
Updates the console agent properties file with the IBM middleware installation location information.

Parameters:
key - The console agent properties file key.
location - The location to add.

clearPropertiesFileKey

public void clearPropertiesFileKey(java.lang.String key)
Clears the entire value in the properties file for a particular key.

Parameters:
key - The console agent properties file key.

doesProductsDependentOnEntryExists

public boolean doesProductsDependentOnEntryExists(java.lang.String value)
Determines if the console agent properties file contains the requested ProductsDependentOnConsoleAgent value

Parameters:
value - The requested value
Returns:
True if the value exists, false otherwise.

doesMiddlewareEntryExist

public boolean doesMiddlewareEntryExist(java.lang.String key,
                                        java.lang.String location)
Determines if a particular middleware is updated in the console agent properties file.

Parameters:
key - The key in the properties file to search for.
location - The request value.
Returns:
True if the value exists, false otherwise.

updateProductsDependentOn

public void updateProductsDependentOn(java.lang.String entry)
Updates the console agent properties file ProductsDependentOnConsoleAgent key.

Parameters:
entry - The middleware entry to update.

clearProductsDependentOn

public void clearProductsDependentOn(java.lang.String entry)
Clears an entry in the console agent properties file for the ProductsDependentOnConsoleAgent key.

Parameters:
entry - The entry to clear.

determineNumberOfEntriesForKey

public int determineNumberOfEntriesForKey(java.lang.String key)
The number of entries that exists in a key value.

Parameters:
key - - The key to determine the number of entries.
Returns:
The number of entries.

stopConsoleAgent

public boolean stopConsoleAgent()
Stops the console agent.

Returns:
true If console agent is successfully stopped false If console agent could not be successfully stopped

startConsoleAgent

public boolean startConsoleAgent()
Starts console agent.

Returns:
true If console agent is successfully started false If console agent could not be successfully started

restartConsoleAgentUsingServicesFile

public boolean restartConsoleAgentUsingServicesFile()
Starts console agent service using a script file that will be generated on the machine.

Returns:
true If console agent is successfully started false If console agent could not be successfully started

restartConsoleAgent

public boolean restartConsoleAgent()
Restarts console agent.

Returns:
true If console agent is successfully restarted false If console agent could not be successfully restarted

getLastEntryFromPropFileValue

public java.lang.String getLastEntryFromPropFileValue(java.lang.String key)
Using the key, returns the last entry from a list in property file.

Parameters:
key - The entry that you want to search for.
Returns:
The last entry for that given entry.

main

public static void main(java.lang.String[] args)
Main program

Parameters:
args -