public class ExecutionContext extends java.lang.Object implements IExecutionContext
IExecutionContext.
| Constructor and Description |
|---|
ExecutionContext(ISystemImage pSys)
Constructor for a context without an action descriptor.
|
ExecutionContext(ISystemImage pSys,
ActionDescriptor pActionDescriptor)
Basic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParmForOutputDialog(RToolOutParameter pOutParm)
Parameters added to the ExecutionContext by this Method will be shown in
an output dialog at the end of an Action.
|
void |
addResource(IResource pRes,
java.lang.String pName)
Adds an
IResource with the given name. |
void |
addResourceToMemory(IResource pResource)
Adds a resource to the context memory.
|
void |
addToolExecStatus(ToolExecutionStatus pToolStatus)
Adds a tool execution status to the list of statuses.
|
IExecutionContext |
duplicate()
Duplicates this execution context, including the following information:
Context parameters
Memory (previous tool) parameters
Context Resource
TAURUS System
|
java.util.Map<Property,IPropertyValue> |
getActionContextMap()
Receives a map with all Properties which have been created based on a
resource and/or manually added Properties.
|
ActionDescriptor |
getActionDescriptor()
Gets the
ActionDescriptor of the context. |
java.util.List<IResource> |
getContextResources()
Returns a list of context resources.
|
FileDescriptor |
getFileFromContext(FileDescriptor pFileDescr)
Retrieves a FileDescriptor from the context map.
|
FileDescriptor |
getFileFromMemory(java.lang.String pFileDescrID)
Retrieves a FileDescriptor from the context memory Map.
|
java.util.Map<java.lang.String,FileDescriptor> |
getFileMemory()
Gets the file memory which contains file descriptors with resolved
physical names which were returned by previous tools of an action.
|
java.util.ArrayList<IExecutionContext> |
getMassProcessingContexts()
Returns a list of execution contexts for every resource that is being
processed by a mass processing action.
|
java.util.List<IResource> |
getMemoryResources()
Gets resources that have been added to the context by tools.
|
java.util.Map<Property,IPropertyValue> |
getParameterMemoryMap()
Receives a map with all Properties which have been saved in the context.
|
static IPropertyValue |
getParmeterFromContext(IExecutionContext pContext,
Property pProperty)
This method tries to execute an internal method to return the
IPropertyValue of a Property from the context. |
static IPropertyValue |
getParmeterFromMemory(IExecutionContext pContext,
Property pProperty)
This method tries to execute an internal method to return the
IPropertyValue of a Property from the memory. |
IPropertyValue |
getParmFromContext(Property pProperty)
Receives a Property from the ExecutionContext.
|
IPropertyValue |
getParmFromMemory(Property pKey)
Retrieves a parameter Property from a map where previous tools might have
stored their output parameter Properties.
|
java.util.List<RToolOutParameter> |
getParmsForOutputDialog()
Returns a List of
RToolOutParameters, which have the
attribute To_OutputDialog set to true. |
IResource |
getResource()
Receives the resource which is assigned to this context.
|
IResource |
getResource(java.lang.String pName)
Returns the
IResource with the given name, which has been added
to the context by a resource operation (tool defined resource
processing). |
IExecutionContext |
getResourceContext(java.lang.String pResourceName)
Returns the
IExecutionContext of a resource with a logical name. |
ISystemImage |
getSystemImage()
Gets the
ISystemImage the context is connected with. |
java.util.List<ToolExecutionStatus> |
getToolExecStatusList()
Gets a list of tool execution statuses.
|
IExecutionContext |
initContext(IResource pRes)
Initializes the IExecutionContext from the given resource.
|
IExecutionContext |
initContext(java.util.List<IResource> pResources)
Initializes the IExecutionContext from the list of resources.
|
void |
populateContext(IResource pRes)
Deprecated.
|
void |
putFileParmIntoMemory(FileDescriptor pFileDescriptor)
Puts a File Descriptor in the execution memory.
|
void |
putParmIntoContext(Property pProp,
IPropertyValue pPropValue)
Manually puts a Property into the context Map.
|
void |
putParmIntoMemory(Property pProp,
IPropertyValue pPropValue)
Puts a parameter Property into a map, providing them to following tools
during the execution.
|
void |
setActionContext(java.util.Map<Property,IPropertyValue> pActionContext)
Set the action context of the execution context.
|
void |
setContextResources(java.util.List<IResource> pContextResources)
Sets the context resources for mass processing.
|
void |
setFileMemory(java.util.Map<java.lang.String,FileDescriptor> pFileMemory)
Completely sets the file memory of this context.
|
void |
setParmMemory(java.util.Map<Property,IPropertyValue> pParmMemory)
Set the parameter memory of the execution context.
|
void |
setResource(IResource pResource)
Sets the resource of this context.
|
public ExecutionContext(ISystemImage pSys)
pSys - the system image (must not be null)public ExecutionContext(ISystemImage pSys, ActionDescriptor pActionDescriptor)
pSys - the system image (must not be null)pActionDescriptor - the action descriptorpublic static IPropertyValue getParmeterFromContext(IExecutionContext pContext, Property pProperty)
IPropertyValue of a Property from the context.
If the IExecutionContext is an instance of
ExecutionContext, the internal method is used, which has a better
performance (returns null if the IPropertyValue
could not be retrieved). Else
IExecutionContext.getParmFromContext(Property) is used to
retrieve the IPropertyValue (throws an
TaurusToolException if the IPropertyValue could not be
retrieved (Bad performance)).
pContext - the context for retrieving the IPropertyValue.pProperty - the desired PropertyIPropertyValue or null, if none is
found.public static IPropertyValue getParmeterFromMemory(IExecutionContext pContext, Property pProperty)
IPropertyValue of a Property from the memory.
If the IExecutionContext is an instance of
ExecutionContext, the internal method is used, which has a better
performance (returns null if the IPropertyValue
could not be retrieved). Else
IExecutionContext.getParmFromMemory(Property) is used to retrieve
the IPropertyValue (throws an TaurusToolException if the
IPropertyValue could not be retrieved (Bad performance)).
pContext - the context for retrieving the IPropertyValue.pProperty - the desired PropertyIPropertyValue or null, if none is
found.public void addParmForOutputDialog(RToolOutParameter pOutParm)
IExecutionContextaddParmForOutputDialog in interface IExecutionContextpOutParm - The RToolOutParameter or
RToolFileOutput to be shown in an output dialog.public java.util.Map<Property,IPropertyValue> getActionContextMap()
IExecutionContextgetActionContextMap in interface IExecutionContextpublic ActionDescriptor getActionDescriptor()
IExecutionContextActionDescriptor of the context. Note that a context can
be created without an action descriptor so this method can return
null.getActionDescriptor in interface IExecutionContextnull.public FileDescriptor getFileFromMemory(java.lang.String pFileDescrID) throws TaurusToolException
IExecutionContext
Usually this will be used when the NamePhysical or the
Type attributes of a FileDescriptor were changed by a
previous tool.
getFileFromMemory in interface IExecutionContextpFileDescrID - The ID of the desired FileDescriptorTaurusToolException - if the FileDescriptor does not exist within the parameter
memory.public java.util.Map<Property,IPropertyValue> getParameterMemoryMap()
IExecutionContextgetParameterMemoryMap in interface IExecutionContextpublic IPropertyValue getParmFromContext(Property pProperty) throws TaurusToolException
IExecutionContextIExecutionContext.initContext(IResource) method.
Properties could have also been added by the
IExecutionContext.putParmIntoContext(Property, IPropertyValue) method.
getParmFromContext in interface IExecutionContextpProperty - The desired PropertyTaurusToolException - if no value for the property was found in the context.public IPropertyValue getParmFromMemory(Property pKey) throws TaurusToolException
IExecutionContextgetParmFromMemory in interface IExecutionContextpKey - The Property which should be retrievedTaurusToolException - if no value for the property was found in the memory.public java.util.List<RToolOutParameter> getParmsForOutputDialog()
IExecutionContextRToolOutParameters, which have the
attribute To_OutputDialog set to true.getParmsForOutputDialog in interface IExecutionContextpublic IResource getResource()
IExecutionContextgetResource in interface IExecutionContextpublic IExecutionContext initContext(IResource pRes)
IExecutionContextinitContext in interface IExecutionContextpRes - The resource which shall be used to initialize the
ExecutionContextpublic void putFileParmIntoMemory(FileDescriptor pFileDescriptor)
IExecutionContextputFileParmIntoMemory in interface IExecutionContextpFileDescriptor - The FileDescriptor which shall be stored in the parameter
memorypublic void putParmIntoContext(Property pProp, IPropertyValue pPropValue)
IExecutionContextIExecutionContext.initContext(IResource) method should provide all necessary
Properties from the given resource.putParmIntoContext in interface IExecutionContextpProp - The Property which shall be stored in the contextpPropValue - The corresponding IPropertyValuepublic void putParmIntoMemory(Property pProp, IPropertyValue pPropValue)
IExecutionContextputParmIntoMemory in interface IExecutionContextpProp - The Property which an output parameter was pointing topPropValue - The corresponding IPropertyValuepublic void setActionContext(java.util.Map<Property,IPropertyValue> pActionContext)
IExecutionContextsetActionContext in interface IExecutionContextpActionContext - action context to be set in the execution contextpublic void setParmMemory(java.util.Map<Property,IPropertyValue> pParmMemory)
IExecutionContextsetParmMemory in interface IExecutionContextpParmMemory - parameter memory to be set in the execution contextpublic void setResource(IResource pResource)
IExecutionContextsetResource in interface IExecutionContextpResource - The IResource which shall be assigned to the contextpublic void setContextResources(java.util.List<IResource> pContextResources)
IExecutionContextsetContextResources in interface IExecutionContextpContextResources - a list of resources, typically all elements which are selected
for a multi selection action. Must not be null.ActionDescriptor.isMassProcessing()public java.util.List<IResource> getContextResources()
IExecutionContextnull unless
IExecutionContext.setContextResources(List) was called with null as
parameter.getContextResources in interface IExecutionContextpublic FileDescriptor getFileFromContext(FileDescriptor pFileDescr) throws TaurusToolException
IExecutionContextgetFileFromContext in interface IExecutionContextpFileDescr - The ID of the desired FileDescriptorTaurusToolException - if the FileDescriptor does not exist within the context.public java.util.List<ToolExecutionStatus> getToolExecStatusList()
IExecutionContextnull.getToolExecStatusList in interface IExecutionContextpublic void addToolExecStatus(ToolExecutionStatus pToolStatus)
IExecutionContextaddToolExecStatus in interface IExecutionContextpToolStatus - the new tool execution status to be added.public IResource getResource(java.lang.String pName)
IExecutionContextIResource with the given name, which has been added
to the context by a resource operation (tool defined resource
processing).getResource in interface IExecutionContextpName - The logical name of the desired resourceToolDescriptor.getResourceProcessing()public void addResource(IResource pRes, java.lang.String pName)
IExecutionContextIResource with the given name. This should be done if a
tool defined resource operation was executed.addResource in interface IExecutionContextpRes - The resource to be addedpName - The logical name of the resourcepublic IExecutionContext getResourceContext(java.lang.String pResourceName)
IExecutionContextIExecutionContext of a resource with a logical name.
The logical name comes from TOOL-DEFINED resource operations.getResourceContext in interface IExecutionContextpResourceName - the logical name of a resourceIExecutionContext of the resource or
null if no resource with that name was found@Deprecated public void populateContext(IResource pRes)
IExecutionContextpopulateContext in interface IExecutionContextpRes - the IResource which should be use to populate the
context.public ISystemImage getSystemImage()
IExecutionContextISystemImage the context is connected with. Note that
the context does not need to use the system image, but it is recommended
to always add an image for other callers to be used.getSystemImage in interface IExecutionContextISystemImage. Can be null.public java.util.Map<java.lang.String,FileDescriptor> getFileMemory()
IExecutionContextgetFileMemory in interface IExecutionContextpublic void setFileMemory(java.util.Map<java.lang.String,FileDescriptor> pFileMemory)
IExecutionContextsetFileMemory in interface IExecutionContextpFileMemory - the new file memory map.IExecutionContext.getFileMemory(),
IExecutionContext.getFileFromMemory(String)public IExecutionContext duplicate()
IExecutionContextduplicate in interface IExecutionContextpublic java.util.List<IResource> getMemoryResources()
IExecutionContextgetMemoryResources in interface IExecutionContextIExecutionContext.addResourceToMemory(IResource)public void addResourceToMemory(IResource pResource)
IExecutionContextaddResourceToMemory in interface IExecutionContextpResource - the resource to be added in the memoryIExecutionContext.getMemoryResources()public java.util.ArrayList<IExecutionContext> getMassProcessingContexts()
IExecutionContextIExecutionContext.getMassProcessingContexts() on any of the contained
contexts will always return an empty list.getMassProcessingContexts in interface IExecutionContextpublic IExecutionContext initContext(java.util.List<IResource> pResources)
IExecutionContextIExecutionContext.getMassProcessingContexts(). Internally calls
IExecutionContext.initContext(IResource) for every given resource.
initContext in interface IExecutionContextpResources - A list of IResources.Copyright © 2015 Micro Focus GmbH. All rights reserved.