public class OSCommandExecutor extends AbstractTaurusToolExecutor
OS Command AWM tools by running commands on the
operating system. The commands to run are defined by tool input parameters.
Copyright (C) Micro Focus. All rights reserved.
| Constructor and Description |
|---|
OSCommandExecutor() |
| Modifier and Type | Method and Description |
|---|---|
ToolExecutionStatus |
execTool(IExecutionContext pContext,
ToolDescriptor pTool,
java.lang.String pAffectedResName,
org.eclipse.core.runtime.IProgressMonitor pMon)
Called by AWM as soon as the tool is executed within an action.
|
IToolOutputReader |
getOutputReader()
Returns the implementation of the IToolOutputReader which is used for
reading the tool output of the implemented IToolExecutor.
|
java.util.List<java.lang.String> |
readParmFile(ISystemImage pImg,
java.lang.String pParmFilePath,
org.eclipse.core.runtime.IProgressMonitor pMon)
Converts the contents of a parameter file into a list of strings (lines).
|
createMassOutputParameters, createSingleOutputParameterspublic ToolExecutionStatus execTool(IExecutionContext pContext, ToolDescriptor pTool, java.lang.String pAffectedResName, org.eclipse.core.runtime.IProgressMonitor pMon) throws TaurusToolException
IToolExecutorIProgressMonitor.setCanceled(boolean) to cancel the
execution of an action. This is common for tools opening a dialog with a
Cancel button.
TaurusToolException will cancel the action and
display the error message in an error dialog.
ToolExecutionStatus with a return code higher
than the modeled Max RC (application option) will also cause
the action to abort with an error dialog.
Max RC and a message will display the message at the end of
the action.
ResourceOperations by adding them to the
returned ToolExecutionStatus.
ToolExecutionStatus need by AWM to process the modeled
ResourceOperations.
TaurusModelUtilities and TaurusUtility useful
helper methods.
TaurusUtility.readFile(FileDescriptor, IExecutionContext).
ToolDescriptor.getInputParm().
TaurusModelUtilities.getParameterValue(com.microfocus.awm.meta.interfaces.RToolInParameter, IExecutionContext)
to resolve a parameter value.
TaurusModelUtilities.getFileDescriptorByInputParam(com.microfocus.awm.meta.interfaces.RToolInParameter, IExecutionContext)
to resolve file input parameters.
TaurusToolExceptions if the tool has not been configured
properly.
ToolDescriptor.getOutputParm().
IExecutionContext.putParmIntoMemory(com.microfocus.awm.meta.interfaces.Property, IPropertyValue)
to add an output parameter into the memory.
IExecutionContext.putFileParmIntoMemory(com.microfocus.awm.meta.interfaces.FileDescriptor)
to add a file output parameter into the memory.
FileDescriptor.clone() to create a copy of a modeled file
descriptor, before e.g. setting a file descriptor path (physical name) or
input stream. Otherwise the loaded model would be altered.
IExecutionContext.addParmForOutputDialog(com.microfocus.awm.meta.interfaces.RToolOutParameter)
when RToolOutParameter.isToOutputDialog() has been set, to
support the AWM modeled output dialog.
DynamicObject.getDynamicAttributes() or
DynamicObject.getDynamicAttributes(). Complex attributes can be
read by DynamicObject.getComplexAttributes().
EFileTypes.INPUT_STREAM_VALUE is recommended. The stream can be
set by using FileDescriptor.setInputStream(java.io.InputStream).
Please see Processing Output Parameters on how to add the output
file to the memory, since this is required for AWM to find the file
reference. AWM only picks up the last file output parameter of a tool to
create an element list.
IExecutionContext.getMassProcessingContexts(). To
find out whether the tool was modeled to process several elements at
once, use
ActionExecutor.isMassProcessing(IExecutionContext, ToolDescriptor)
.
execTool in interface IToolExecutorexecTool in class AbstractTaurusToolExecutorpContext - The IExecutionContext. Can be handed over by a previous Tool
or created manually.pTool - The descriptor of the Tool to be executed.pAffectedResName - a logical resource name (or null if there is
none, see IExecutionContext.getResource(String))pMon - An IProgressMonitor. Setting the progress monitor cancelled
using IProgressMonitor.setCanceled(boolean) will cause
the action to be canceled after the tool.ToolExecutionStatusTaurusToolException - if the tool encounters an exceptionpublic IToolOutputReader getOutputReader()
IToolExecutorOnly required for tools which are able to execute batch jobs.
getOutputReader in interface IToolExecutorgetOutputReader in class AbstractTaurusToolExecutorpublic java.util.List<java.lang.String> readParmFile(ISystemImage pImg, java.lang.String pParmFilePath, org.eclipse.core.runtime.IProgressMonitor pMon) throws java.io.IOException
IToolExecutorOnly required for tools which are able to execute batch jobs.
readParmFile in interface IToolExecutorreadParmFile in class AbstractTaurusToolExecutorpImg - the system imagepParmFilePath - the parameter file pathpMon - progress monitorjava.io.IOException - if reading or interpreting the parameter file failsCopyright © 2015 Micro Focus GmbH. All rights reserved.