Class ExecutionContextImpl
- java.lang.Object
-
- com.dtolabs.rundeck.core.execution.ExecutionContextImpl
-
- All Implemented Interfaces:
ExecutionContext,StepExecutionContext,NodeExecutionContext
public class ExecutionContextImpl extends java.lang.Object implements ExecutionContext, StepExecutionContext, NodeExecutionContext
ExecutionContextImpl is ...
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExecutionContextImpl.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExecutionContextImpl.Builderbuilder()static ExecutionContextImpl.Builderbuilder(ExecutionContext context)static ExecutionContextImpl.Builderbuilder(StepExecutionContext context)<T> java.util.Optional<T>componentForType(java.lang.Class<T> type)<T> java.util.Collection<T>componentsForType(java.lang.Class<T> type)INodeSetfilteredNodes()com.dtolabs.rundeck.core.authorization.AuthContextgetAuthContext()java.lang.StringgetCharsetEncoding()java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>getDataContext()Return data context setDataContextgetDataContextObject()ExecutionReferencegetExecution()Gets a reference to the execution being processed.ExecutionListenergetExecutionListener()ExecutionLoggergetExecutionLogger()FlowControlgetFlowControl()FrameworkgetFramework()java.lang.StringgetFrameworkProject()Get the framework project nameIFrameworkgetIFramework()JobServicegetJobService()LoggingManagergetLoggingManager()intgetLoglevel()Return the loglevel value, using the Ant equivalents: DEBUG=1,java.lang.StringgetNodeRankAttribute()INodeSetgetNodes()Return the node selectorNodesSelectorgetNodeSelector()Return the node selectorProjectNodeServicegetNodeService()OrchestratorConfiggetOrchestrator()SharedOutputContextgetOutputContext()PluginControlServicegetPluginControlService()java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>getPrivateDataContext()DataContextgetPrivateDataContextObject()MultiDataContext<ContextView,DataContext>getSharedDataContext()INodeEntrygetSingleNodeContext()java.util.List<java.lang.Integer>getStepContext()intgetStepNumber()StorageTreegetStorageTree()intgetThreadCount()java.lang.StringgetUser()com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContextgetUserAndRolesAuthContext()WorkflowExecutionListenergetWorkflowExecutionListener()booleanisKeepgoing()booleanisNodeRankOrderAscending()voidsetAuthContext(com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)voidsetCharsetEncoding(java.lang.String charsetEncoding)<T> intuseAllComponentsOfType(java.lang.Class<T> type, java.util.function.Consumer<T> consumer)apply the consumer to components of the given type, and remove "useOnce" components after use<T> java.util.Optional<T>useSingleComponentOfType(java.lang.Class<T> type)apply the consumer to a single component of the given type, and remove the component if it is "useOnce"<T> booleanuseSingleComponentOfType(java.lang.Class<T> type, java.util.function.Consumer<java.util.Optional<T>> consumer)apply the consumer to a single component of the given type, and remove the component if it is "useOnce"-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.dtolabs.rundeck.core.execution.ExecutionContext
getComponentList
-
-
-
-
Method Detail
-
builder
public static ExecutionContextImpl.Builder builder()
-
builder
public static ExecutionContextImpl.Builder builder(ExecutionContext context)
-
builder
public static ExecutionContextImpl.Builder builder(StepExecutionContext context)
-
componentsForType
public <T> java.util.Collection<T> componentsForType(java.lang.Class<T> type)
- Specified by:
componentsForTypein interfaceExecutionContext- Returns:
- collection of components of specified type
-
useAllComponentsOfType
public <T> int useAllComponentsOfType(java.lang.Class<T> type, java.util.function.Consumer<T> consumer)Description copied from interface:ExecutionContextapply the consumer to components of the given type, and remove "useOnce" components after use- Specified by:
useAllComponentsOfTypein interfaceExecutionContext
-
useSingleComponentOfType
public <T> boolean useSingleComponentOfType(java.lang.Class<T> type, java.util.function.Consumer<java.util.Optional<T>> consumer)Description copied from interface:ExecutionContextapply the consumer to a single component of the given type, and remove the component if it is "useOnce"- Specified by:
useSingleComponentOfTypein interfaceExecutionContext- Returns:
- a single component for the given type
-
useSingleComponentOfType
public <T> java.util.Optional<T> useSingleComponentOfType(java.lang.Class<T> type)
Description copied from interface:ExecutionContextapply the consumer to a single component of the given type, and remove the component if it is "useOnce"- Specified by:
useSingleComponentOfTypein interfaceExecutionContext- Returns:
- optional component object
-
componentForType
public <T> java.util.Optional<T> componentForType(java.lang.Class<T> type)
- Specified by:
componentForTypein interfaceExecutionContext- Returns:
- a single component for the given type
-
getSharedDataContext
public MultiDataContext<ContextView,DataContext> getSharedDataContext()
- Specified by:
getSharedDataContextin interfaceExecutionContext- Returns:
- the node specific context data keyed by node name
-
getAuthContext
public com.dtolabs.rundeck.core.authorization.AuthContext getAuthContext()
- Specified by:
getAuthContextin interfaceExecutionContext- Returns:
- the authorization context
-
getUserAndRolesAuthContext
public com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext getUserAndRolesAuthContext()
- Specified by:
getUserAndRolesAuthContextin interfaceExecutionContext
-
setAuthContext
public void setAuthContext(com.dtolabs.rundeck.core.authorization.UserAndRolesAuthContext authContext)
-
getStorageTree
public StorageTree getStorageTree()
- Specified by:
getStorageTreein interfaceExecutionContext- Returns:
- the storage service
-
getFlowControl
public FlowControl getFlowControl()
- Specified by:
getFlowControlin interfaceStepExecutionContext- Returns:
- object to control workflow
-
getCharsetEncoding
public java.lang.String getCharsetEncoding()
- Specified by:
getCharsetEncodingin interfaceExecutionContext- Returns:
- the charset encoding to use for handling output, or null for default
-
setCharsetEncoding
public void setCharsetEncoding(java.lang.String charsetEncoding)
-
getOutputContext
public SharedOutputContext getOutputContext()
- Specified by:
getOutputContextin interfaceExecutionContext- Returns:
- context for emitting new data
-
getSingleNodeContext
public INodeEntry getSingleNodeContext()
- Specified by:
getSingleNodeContextin interfaceNodeExecutionContext- Returns:
- current node if in single node context
-
getLoggingManager
public LoggingManager getLoggingManager()
- Specified by:
getLoggingManagerin interfaceExecutionContext- Returns:
- manager for capturing logs
-
getFrameworkProject
public java.lang.String getFrameworkProject()
Description copied from interface:ExecutionContextGet the framework project name- Specified by:
getFrameworkProjectin interfaceExecutionContext- Returns:
- project name
-
getUser
public java.lang.String getUser()
- Specified by:
getUserin interfaceExecutionContext- Returns:
- username
-
getNodeSelector
public NodesSelector getNodeSelector()
Description copied from interface:ExecutionContextReturn the node selector- Specified by:
getNodeSelectorin interfaceExecutionContext- Returns:
- nodeset
-
getNodes
public INodeSet getNodes()
Description copied from interface:ExecutionContextReturn the node selector- Specified by:
getNodesin interfaceExecutionContext- Returns:
- nodeset
-
filteredNodes
public INodeSet filteredNodes()
- Specified by:
filteredNodesin interfaceStepExecutionContext- Returns:
- filtered node set
-
getLoglevel
public int getLoglevel()
Description copied from interface:ExecutionContextReturn the loglevel value, using the Ant equivalents: DEBUG=1,- Specified by:
getLoglevelin interfaceExecutionContext- Returns:
- log level from 0-4: ERR,WARN,INFO,VERBOSE,DEBUG
-
getDataContext
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getDataContext()
Description copied from interface:ExecutionContextReturn data context set- Specified by:
getDataContextin interfaceExecutionContext- Returns:
- map of data contexts keyed by name
-
getDataContextObject
public DataContext getDataContextObject()
- Specified by:
getDataContextObjectin interfaceExecutionContext
-
getPrivateDataContextObject
public DataContext getPrivateDataContextObject()
- Specified by:
getPrivateDataContextObjectin interfaceExecutionContext
-
getExecutionListener
public ExecutionListener getExecutionListener()
- Specified by:
getExecutionListenerin interfaceExecutionContext
-
getWorkflowExecutionListener
public WorkflowExecutionListener getWorkflowExecutionListener()
- Specified by:
getWorkflowExecutionListenerin interfaceExecutionContext
-
getExecutionLogger
public ExecutionLogger getExecutionLogger()
- Specified by:
getExecutionLoggerin interfaceExecutionContext
-
getFramework
public Framework getFramework()
- Specified by:
getFrameworkin interfaceExecutionContext- Returns:
- the framework
-
getIFramework
public IFramework getIFramework()
- Specified by:
getIFrameworkin interfaceExecutionContext- Returns:
- the framework
-
getThreadCount
public int getThreadCount()
- Specified by:
getThreadCountin interfaceExecutionContext- Returns:
- node dispatch threadcount
-
isKeepgoing
public boolean isKeepgoing()
- Specified by:
isKeepgoingin interfaceExecutionContext- Returns:
- node dispatch keepgoing
-
getPrivateDataContext
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getPrivateDataContext()
- Specified by:
getPrivateDataContextin interfaceExecutionContext- Returns:
- the data context in the private scope
-
getNodeRankAttribute
public java.lang.String getNodeRankAttribute()
- Specified by:
getNodeRankAttributein interfaceExecutionContext- Returns:
- the node rank attribute to use for ranking
-
isNodeRankOrderAscending
public boolean isNodeRankOrderAscending()
- Specified by:
isNodeRankOrderAscendingin interfaceExecutionContext- Returns:
- true if the node rank order is ascending
-
getStepNumber
public int getStepNumber()
- Specified by:
getStepNumberin interfaceStepExecutionContext- Returns:
- the step being executed.
-
getStepContext
public java.util.List<java.lang.Integer> getStepContext()
- Specified by:
getStepContextin interfaceStepExecutionContext- Returns:
- the stack of step numbers within the larger workflow context.
-
getJobService
public JobService getJobService()
- Specified by:
getJobServicein interfaceExecutionContext- Returns:
- the job service
-
getNodeService
public ProjectNodeService getNodeService()
- Specified by:
getNodeServicein interfaceExecutionContext- Returns:
- the node service
-
getOrchestrator
public OrchestratorConfig getOrchestrator()
- Specified by:
getOrchestratorin interfaceExecutionContext
-
getPluginControlService
public PluginControlService getPluginControlService()
- Specified by:
getPluginControlServicein interfaceExecutionContext
-
getExecution
public ExecutionReference getExecution()
Description copied from interface:ExecutionContextGets a reference to the execution being processed.- Specified by:
getExecutionin interfaceExecutionContext- Returns:
- An
ExecutionReferenceto the execution, or null if doesn't apply.
-
-