public class ProjectTaskContext extends UserDataHolderBase
Constructor and Description |
---|
ProjectTaskContext() |
ProjectTaskContext(boolean autoRun) |
ProjectTaskContext(java.lang.Object sessionId) |
ProjectTaskContext(java.lang.Object sessionId,
RunConfiguration runConfiguration) |
ProjectTaskContext(java.lang.Object sessionId,
RunConfiguration runConfiguration,
boolean autoRun) |
Modifier and Type | Method and Description |
---|---|
void |
addDirtyOutputPathsProvider(java.util.function.Supplier<? extends java.util.Collection<java.lang.String>> outputPathsProvider)
This method isn't supposed to be used directly.
|
void |
enableCollectionOfGeneratedFiles() |
void |
fileGenerated(java.lang.String root,
java.lang.String relativePath)
This method isn't supposed to be used directly.
|
java.util.Optional<java.util.stream.Stream<java.lang.String>> |
getDirtyOutputPaths()
Provides output paths that can be used for generated files by some tasks.
|
java.util.Collection<java.lang.String> |
getGeneratedFilesRelativePaths(java.lang.String root)
Returns files generated during the task session in the specified root.
|
java.util.Collection<java.lang.String> |
getGeneratedFilesRoots()
Returns roots of the files generated during the task session.
|
RunConfiguration |
getRunConfiguration() |
java.lang.Object |
getSessionId() |
boolean |
isAutoRun() |
boolean |
isCollectionOfGeneratedFilesEnabled() |
<T> ProjectTaskContext |
withUserData(Key<T> key,
T value) |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
public ProjectTaskContext()
public ProjectTaskContext(boolean autoRun)
public ProjectTaskContext(java.lang.Object sessionId)
public ProjectTaskContext(java.lang.Object sessionId, RunConfiguration runConfiguration)
public ProjectTaskContext(java.lang.Object sessionId, RunConfiguration runConfiguration, boolean autoRun)
public java.lang.Object getSessionId()
public RunConfiguration getRunConfiguration()
public boolean isAutoRun()
public void enableCollectionOfGeneratedFiles()
public boolean isCollectionOfGeneratedFilesEnabled()
public java.util.Collection<java.lang.String> getGeneratedFilesRoots()
enableCollectionOfGeneratedFiles()
method by the task initiator, see ProjectTaskManager.run(ProjectTaskContext, ProjectTask)
.
Or using the ProjectTaskListener.started(ProjectTaskContext)
event.public java.util.Collection<java.lang.String> getGeneratedFilesRelativePaths(java.lang.String root)
enableCollectionOfGeneratedFiles()
method by the task initiator, see ProjectTaskManager.run(ProjectTaskContext, ProjectTask)
.
Or using the ProjectTaskListener.started(ProjectTaskContext)
event.public void fileGenerated(java.lang.String root, java.lang.String relativePath)
ProjectTaskRunner
s can use it to report information about generated files during some task execution.root
- the root directory of the generated filerelativePath
- the generated file relative path with regard to the rootpublic void addDirtyOutputPathsProvider(java.util.function.Supplier<? extends java.util.Collection<java.lang.String>> outputPathsProvider)
ProjectTaskRunner
s can use it to report output paths of generated files produced during some task execution.
Note, generated files collecting is disabled by default.
It can be requested using the enableCollectionOfGeneratedFiles()
method by the task initiator, see ProjectTaskManager.run(ProjectTaskContext, ProjectTask)
.
Or using the ProjectTaskListener.started(ProjectTaskContext)
event.
The method should be used ONLY if the ProjectTaskRunner
doesn't support fileGenerated(java.lang.String, java.lang.String)
events.
public java.util.Optional<java.util.stream.Stream<java.lang.String>> getDirtyOutputPaths()
Can be useful for ProjectTaskRunner
s which doesn't support fileGenerated(java.lang.String, java.lang.String)
events.
public <T> ProjectTaskContext withUserData(Key<T> key, T value)