Class ProjectPersistTask
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.persisting.BasePersistTask
-
- jetbrains.buildServer.serverSide.impl.persisting.projects.ProjectPersistTask
-
- All Implemented Interfaces:
PersistTaskEx
,BackgroundPersistTask
,PersistTask
public class ProjectPersistTask extends BasePersistTask implements BackgroundPersistTask
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(Exception error)
boolean
affects(SPersistentEntity entity)
boolean
affectsProject(SProject project)
boolean
canBeInterrupted()
void
cancel()
Marks task as canceled, canceled task will not be executed on configs directory.void
delete(SPersistentEntity entity)
Marks config files of the specified entity for deletion.void
delete(SProject project, String path)
Marks a config file of the specified project for deletion.Collection<SPersistentEntity>
getAffectedEntities()
Set<String>
getAffectedProjectExtIds()
Set<SProject>
getAffectedProjects()
ConfigAction
getCause()
String
getDescription()
Returns task description.Throwable
getError()
Returns an error thrown by fs operation ornull
if there was no errors.List<Throwable>
getErrors()
Returns errors thrown during background task execution.String
getOriginNodeId()
Set<String>
getSavedPaths()
User
getUser()
boolean
isCanceled()
boolean
isComplete()
void
logChangesToAudit()
void
markAsFinished()
void
onRemoveFromQueue()
void
run()
void
setComplete()
Marks task as complete meaning that all desired changes were provided to the task.void
setContent(SPersistentEntity entity, byte[] content)
Sets file content to be persisted.void
setContent(SProject project, String path, byte[] content)
Sets file content to be persisted.-
Methods inherited from class jetbrains.buildServer.serverSide.impl.persisting.BasePersistTask
await, await, awaitForStage, compareAndSetStage, equals, getCreationTime, getId, getStage, hashCode, isAddedToQueueInsideAnotherTask, markAsUpdated, rethrowError, setAddedToQueueInsideAnotherTask, setStage, toString, updateStage
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.PersistTask
await, await, awaitUninterruptibly, getId, getStage
-
Methods inherited from interface jetbrains.buildServer.serverSide.impl.persisting.PersistTaskEx
getFileWatcher, notifyFileWatcher
-
-
-
-
Method Detail
-
setContent
public void setContent(@NotNull SPersistentEntity entity, @NotNull byte[] content) throws IOException
Description copied from interface:BackgroundPersistTask
Sets file content to be persisted.- Specified by:
setContent
in interfaceBackgroundPersistTask
- Parameters:
entity
- entity which content is persistedcontent
- content to persist- Throws:
IOException
- when task failed to save the content in task dir
-
setContent
public void setContent(@NotNull SProject project, @NotNull String path, @NotNull byte[] content) throws IOException
Description copied from interface:BackgroundPersistTask
Sets file content to be persisted. Should be used for paths which don't depend on external ids.- Specified by:
setContent
in interfaceBackgroundPersistTask
- Parameters:
project
- project within which content should be persistedpath
- path relative to project root directorycontent
- content to persist- Throws:
IOException
- when task failed to save the content in task dir
-
markAsFinished
public void markAsFinished()
- Specified by:
markAsFinished
in interfacePersistTaskEx
-
delete
public void delete(@NotNull SPersistentEntity entity) throws UncheckedIOException
Description copied from interface:BackgroundPersistTask
Marks config files of the specified entity for deletion.- Specified by:
delete
in interfaceBackgroundPersistTask
- Parameters:
entity
- entity of interest- Throws:
UncheckedIOException
-
delete
public void delete(@NotNull SProject project, @NotNull String path) throws UncheckedIOException, IOException
Description copied from interface:BackgroundPersistTask
Marks a config file of the specified project for deletion.- Specified by:
delete
in interfaceBackgroundPersistTask
- Parameters:
project
- whose file should be removedpath
- path to the file- Throws:
UncheckedIOException
IOException
-
getUser
public User getUser()
- Specified by:
getUser
in interfacePersistTaskEx
-
setComplete
public void setComplete()
Description copied from interface:BackgroundPersistTask
Marks task as complete meaning that all desired changes were provided to the task. Changes made after setComplete() call will lead to exception.- Specified by:
setComplete
in interfaceBackgroundPersistTask
-
isComplete
public boolean isComplete()
-
cancel
public void cancel()
Description copied from interface:BackgroundPersistTask
Marks task as canceled, canceled task will not be executed on configs directory.- Specified by:
cancel
in interfaceBackgroundPersistTask
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceled
in interfacePersistTaskEx
-
addError
public void addError(@NotNull Exception error)
- Specified by:
addError
in interfacePersistTaskEx
-
run
public void run()
- Specified by:
run
in interfacePersistTaskEx
-
onRemoveFromQueue
public void onRemoveFromQueue()
- Specified by:
onRemoveFromQueue
in interfacePersistTaskEx
-
canBeInterrupted
public boolean canBeInterrupted()
- Specified by:
canBeInterrupted
in interfacePersistTaskEx
-
getDescription
@NotNull public String getDescription()
Description copied from interface:PersistTask
Returns task description.- Specified by:
getDescription
in interfacePersistTask
- Returns:
- task description
-
getError
@Nullable public Throwable getError()
Description copied from interface:PersistTask
Returns an error thrown by fs operation ornull
if there was no errors.- Specified by:
getError
in interfacePersistTask
- Returns:
- an error thrown by fs operation or
null
if there was no errors
-
getErrors
@NotNull public List<Throwable> getErrors()
Description copied from interface:BackgroundPersistTask
Returns errors thrown during background task execution.- Specified by:
getErrors
in interfaceBackgroundPersistTask
- Returns:
- errors thrown during background task execution
-
getCause
@NotNull public ConfigAction getCause()
- Specified by:
getCause
in interfaceBackgroundPersistTask
-
getAffectedEntities
@NotNull public Collection<SPersistentEntity> getAffectedEntities()
- Specified by:
getAffectedEntities
in interfaceBackgroundPersistTask
-
getAffectedProjects
@NotNull public Set<SProject> getAffectedProjects()
- Specified by:
getAffectedProjects
in interfaceBackgroundPersistTask
-
getAffectedProjectExtIds
@NotNull public Set<String> getAffectedProjectExtIds()
- Specified by:
getAffectedProjectExtIds
in interfaceBackgroundPersistTask
-
affects
public boolean affects(@NotNull SPersistentEntity entity)
- Specified by:
affects
in interfaceBackgroundPersistTask
-
affectsProject
public boolean affectsProject(@NotNull SProject project)
- Specified by:
affectsProject
in interfaceBackgroundPersistTask
-
getOriginNodeId
@NotNull public String getOriginNodeId()
- Specified by:
getOriginNodeId
in interfaceBackgroundPersistTask
-
getSavedPaths
@NotNull public Set<String> getSavedPaths()
- Specified by:
getSavedPaths
in interfaceBackgroundPersistTask
-
logChangesToAudit
public void logChangesToAudit()
-
-