com.ibm.mmconsole.extension
Interface IExecuteTask

All Superinterfaces:
IBaseExtensionPoint
All Known Implementing Classes:
ExecuteTaskImpl

public interface IExecuteTask
extends IBaseExtensionPoint

This extension point can be used to execute certain console tasks. You can start or stop a resource, execute your custom ANT task, or execute Websphere Application Server wsadmin command.


Field Summary
static java.lang.String copyright0
           
static java.lang.String copyright1
           
static java.lang.String copyright2
           
static java.lang.String copyright3
           
static int STARTED
           
static int STOPPED
           
static int UNAVAILABLE
           
static int UNKNOWN
           
 
Method Summary
 void addDirectoryToSend(java.io.File directory, java.lang.String directoryToPerverse)
          This method allows you to specify a directory to send to the console agent.
 void addFileToSend(java.io.File file, java.lang.String directoryToPerverse)
          This method allows you to specify an individual file to send to the console agent.
 java.lang.String getAntTaskResult()
          Returns the result of the Ant task.
 java.lang.String getErrorMessage()
          Returns the error message that occurred during execution.
 int getResourceStatus(javax.portlet.PortletRequest request, Resource resource, IConsoleConfiguration consoleConfiguration)
          This method will retrieve the status of the specified resource.
 boolean isThereAFileNotFoundError()
          This method indicates whether there was a file not found error when executing a task in which an ANT or a Jython file was specified.
 boolean isThereAuthenticationError()
          This method indicates whether there was an authentication error during a task execution.
 boolean launchAntTask(java.lang.String filename, java.lang.String targetName, java.util.Properties properties, Resource resource, javax.portlet.PortletRequest request, IConsoleConfiguration consoleConfiguration, boolean encodeResourceProperties)
          This methods allows you to run an Ant task.
 boolean runWsAdminJythonScript(javax.portlet.PortletRequest request, ApplicationServerResource resource, java.lang.String wasJythonFile, IConsoleConfiguration consoleConfiguration)
          This method enables you to run a Jython script against a specified application server object.
 boolean sendFilesToAgent(Resource resource, javax.portlet.PortletRequest request, IConsoleConfiguration consoleConfiguration)
          This method allows you to send files to the Console Agent.
 boolean startResource(javax.portlet.PortletRequest request, Resource resource, IConsoleConfiguration consoleConfiguration)
          This method will attempt to start the specified resource.
 boolean stopResource(javax.portlet.PortletRequest request, Resource resource, IConsoleConfiguration consoleConfiguration)
          This method will attempt to stop the specified resource.
 
Methods inherited from interface com.ibm.mmconsole.extension.IBaseExtensionPoint
destroy, getUserLocale, setUserLocale
 

Field Detail

copyright0

static final java.lang.String copyright0
See Also:
Constant Field Values

copyright1

static final java.lang.String copyright1
See Also:
Constant Field Values

copyright2

static final java.lang.String copyright2
See Also:
Constant Field Values

copyright3

static final java.lang.String copyright3
See Also:
Constant Field Values

UNKNOWN

static final int UNKNOWN
See Also:
Constant Field Values

UNAVAILABLE

static final int UNAVAILABLE
See Also:
Constant Field Values

STARTED

static final int STARTED
See Also:
Constant Field Values

STOPPED

static final int STOPPED
See Also:
Constant Field Values
Method Detail

getAntTaskResult

java.lang.String getAntTaskResult()
Returns the result of the Ant task. The result may contain details to truly determine whether the task was successfully completed. Generally, Ant fails if there is an error. However, that might not be true when executing an external script (such as wsadmin). It is not recommended that the result be displayed to the user.

Returns:
String

getErrorMessage

java.lang.String getErrorMessage()
Returns the error message that occurred during execution.

Returns:
String

getResourceStatus

int getResourceStatus(javax.portlet.PortletRequest request,
                      Resource resource,
                      IConsoleConfiguration consoleConfiguration)
This method will retrieve the status of the specified resource.

Parameters:
request - - An instance of PortletRequest.
resource - - An instance of Resource.
consoleConfiguration - - An instance of the IConsoleConfiguration
Returns:
STARTED, STOPPED, UNAVAILABLE, UNKNOWN

startResource

boolean startResource(javax.portlet.PortletRequest request,
                      Resource resource,
                      IConsoleConfiguration consoleConfiguration)
This method will attempt to start the specified resource.

Parameters:
request - - An instance of PortletRequest.
resource - - An instance of Resource.
consoleConfiguration - - An instance of the IConsoleConfiguration
Returns:
Returns true or false. True means that the task was successfully completed. False means that there was an error.

stopResource

boolean stopResource(javax.portlet.PortletRequest request,
                     Resource resource,
                     IConsoleConfiguration consoleConfiguration)
This method will attempt to stop the specified resource.

Parameters:
request - - An instance of PortletRequest.
resource - - An instance of Resource.
consoleConfiguration - - An instance of the IConsoleConfiguration
Returns:
Returns true or false. True means that the task was successfully completed. False means that there was an error.

runWsAdminJythonScript

boolean runWsAdminJythonScript(javax.portlet.PortletRequest request,
                               ApplicationServerResource resource,
                               java.lang.String wasJythonFile,
                               IConsoleConfiguration consoleConfiguration)
This method enables you to run a Jython script against a specified application server object. The Jython file must be located on the remote computer relative to the console agent's scripts directory.

Parameters:
request - - An instance of PortletRequest.
resource - - An instance of ApplicationServerResource.
wasJythonFile - - The name of the Jython script to execute. The name specified must be relative to console agent's scripts directory. For example: If you have ConsoleAgentInstall/scripts/MyBusApp/jyhton1.py then the name is MyBusApp/jyhton1.py.
consoleConfiguration - - An instance of the IConsoleConfiguration
Returns:
Returns true or false. True means that the task was successfully executed. False means that there was an error. There is a chance that the Ant result may contain an error message. For example, the wsadmin command returns success even though the Ant output indicates an error. In this situation, you have to check the Ant result.

launchAntTask

boolean launchAntTask(java.lang.String filename,
                      java.lang.String targetName,
                      java.util.Properties properties,
                      Resource resource,
                      javax.portlet.PortletRequest request,
                      IConsoleConfiguration consoleConfiguration,
                      boolean encodeResourceProperties)
This methods allows you to run an Ant task. The Ant file must be located relative to the console agent's scripts directory on the remote computer. Currently, there is a limitation in the SSL verification process. The APIs are unable to reuse the current keystore used by Express Runtime. This is a known issue. The console can use a SSL connection to communicate with the agent. For now, SSL certificates will be accepted automatically for the user. The user still might be prompted through the Express Runtime authentication page.

Parameters:
filename - - The name of the Ant file to run. The name specified must be relative to console agent's scripts directory. For example: If the file location is ConsoleAgentInstall/scripts/MyBusApp/ant1.xml then the name is MyBusApp/znt1.xml.
targetName - - The name of the target within the Ant file to run.
properties - - A Properties object representing any properties to pass on to the Ant script. This can be null if there are no properties to pass on.
resource - - An instance of Resource.
request - - An instance of PortletRequest.
consoleConfiguration - - An instance of the IConsoleConfiguration
encodeResourceProperties - - A boolean indicating that you want to add the Express Runtime Ant properties for the given resource. This is useful in case your Ant scripts are referencing the existing Express Runtime Ant scripts.
Returns:
Returns true or false. True means that the task was successfully executed. False means that there was an error. There is a chance that the Ant result may contain an error message. For example, the wsadmin command returns success even though the Ant output indicates an error. In this situation, you have to check the Ant result.

sendFilesToAgent

boolean sendFilesToAgent(Resource resource,
                         javax.portlet.PortletRequest request,
                         IConsoleConfiguration consoleConfiguration)
This method allows you to send files to the Console Agent. This would be used when your task does not execute due to a isThereAFileNotFoundError(). The files should be located somewhere on the console machine. To specify which files to use addDirectoryToSend(File, String) or addFileToSend(File, String). The files be will copied over into the console agent's scripts folder.

Parameters:
resource - - An instance of Resource.
request - - An instance of PortletRequest.
consoleConfiguration - - An instance of the IConsoleConfiguration
Returns:
Returns true or false. True means that the task was successfully completed. False means that there was an error.

addDirectoryToSend

void addDirectoryToSend(java.io.File directory,
                        java.lang.String directoryToPerverse)
This method allows you to specify a directory to send to the console agent.

Parameters:
directory - - A File that represents the directory to send. It sends everything in the directory.
directoryToPerverse - - This would be the directory in which you would like to preserve the path data. For example: You would specify "MyBusApp" if you specifed the directory c:\temp\MyBusApp and wanted to retain "MyBusApp" in path on the console agent machine.

addFileToSend

void addFileToSend(java.io.File file,
                   java.lang.String directoryToPerverse)
This method allows you to specify an individual file to send to the console agent.

Parameters:
directory - - A File that represents the file to send.
directoryToPerverse - - This would be the directory in which you would like to preserve the path data. For example: You would specify "MyBusApp" if you specifed the file c:\temp\MyBusApp\ant1.xml and wanted to retain "MyBusApp" in path on the console agent machine.

isThereAuthenticationError

boolean isThereAuthenticationError()
This method indicates whether there was an authentication error during a task execution. An authentication error could mean there is a problem with the credentials used or with certificate between the console and the console agent.

Returns:
True or false.

isThereAFileNotFoundError

boolean isThereAFileNotFoundError()
This method indicates whether there was a file not found error when executing a task in which an ANT or a Jython file was specified.

Returns:
True or false.