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 voidaddError(Exception error)booleanaffects(SPersistentEntity entity)booleanaffectsProject(SProject project)booleancanBeInterrupted()voidcancel()Marks task as canceled, canceled task will not be executed on configs directory.voiddelete(SPersistentEntity entity)Marks config files of the specified entity for deletion.voiddelete(SProject project, String path)Marks a config file of the specified project for deletion.Collection<SPersistentEntity>getAffectedEntities()Set<String>getAffectedProjectExtIds()Set<SProject>getAffectedProjects()ConfigActiongetCause()StringgetDescription()Returns task description.ThrowablegetError()Returns an error thrown by fs operation ornullif there was no errors.List<Throwable>getErrors()Returns errors thrown during background task execution.StringgetOriginNodeId()Set<String>getSavedPaths()UsergetUser()booleanisCanceled()booleanisComplete()voidlogChangesToAudit()voidmarkAsFinished()voidonRemoveFromQueue()voidrun()voidsetComplete()Marks task as complete meaning that all desired changes were provided to the task.voidsetContent(SPersistentEntity entity, byte[] content)Sets file content to be persisted.voidsetContent(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 IOExceptionDescription copied from interface:BackgroundPersistTaskSets file content to be persisted.- Specified by:
setContentin 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 IOExceptionDescription copied from interface:BackgroundPersistTaskSets file content to be persisted. Should be used for paths which don't depend on external ids.- Specified by:
setContentin 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:
markAsFinishedin interfacePersistTaskEx
-
delete
public void delete(@NotNull SPersistentEntity entity) throws UncheckedIOExceptionDescription copied from interface:BackgroundPersistTaskMarks config files of the specified entity for deletion.- Specified by:
deletein interfaceBackgroundPersistTask- Parameters:
entity- entity of interest- Throws:
UncheckedIOException
-
delete
public void delete(@NotNull SProject project, @NotNull String path) throws UncheckedIOException, IOExceptionDescription copied from interface:BackgroundPersistTaskMarks a config file of the specified project for deletion.- Specified by:
deletein interfaceBackgroundPersistTask- Parameters:
project- whose file should be removedpath- path to the file- Throws:
UncheckedIOExceptionIOException
-
getUser
public User getUser()
- Specified by:
getUserin interfacePersistTaskEx
-
setComplete
public void setComplete()
Description copied from interface:BackgroundPersistTaskMarks task as complete meaning that all desired changes were provided to the task. Changes made after setComplete() call will lead to exception.- Specified by:
setCompletein interfaceBackgroundPersistTask
-
isComplete
public boolean isComplete()
-
cancel
public void cancel()
Description copied from interface:BackgroundPersistTaskMarks task as canceled, canceled task will not be executed on configs directory.- Specified by:
cancelin interfaceBackgroundPersistTask
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceledin interfacePersistTaskEx
-
addError
public void addError(@NotNull Exception error)- Specified by:
addErrorin interfacePersistTaskEx
-
run
public void run()
- Specified by:
runin interfacePersistTaskEx
-
onRemoveFromQueue
public void onRemoveFromQueue()
- Specified by:
onRemoveFromQueuein interfacePersistTaskEx
-
canBeInterrupted
public boolean canBeInterrupted()
- Specified by:
canBeInterruptedin interfacePersistTaskEx
-
getDescription
@NotNull public String getDescription()
Description copied from interface:PersistTaskReturns task description.- Specified by:
getDescriptionin interfacePersistTask- Returns:
- task description
-
getError
@Nullable public Throwable getError()
Description copied from interface:PersistTaskReturns an error thrown by fs operation ornullif there was no errors.- Specified by:
getErrorin interfacePersistTask- Returns:
- an error thrown by fs operation or
nullif there was no errors
-
getErrors
@NotNull public List<Throwable> getErrors()
Description copied from interface:BackgroundPersistTaskReturns errors thrown during background task execution.- Specified by:
getErrorsin interfaceBackgroundPersistTask- Returns:
- errors thrown during background task execution
-
getCause
@NotNull public ConfigAction getCause()
- Specified by:
getCausein interfaceBackgroundPersistTask
-
getAffectedEntities
@NotNull public Collection<SPersistentEntity> getAffectedEntities()
- Specified by:
getAffectedEntitiesin interfaceBackgroundPersistTask
-
getAffectedProjects
@NotNull public Set<SProject> getAffectedProjects()
- Specified by:
getAffectedProjectsin interfaceBackgroundPersistTask
-
getAffectedProjectExtIds
@NotNull public Set<String> getAffectedProjectExtIds()
- Specified by:
getAffectedProjectExtIdsin interfaceBackgroundPersistTask
-
affects
public boolean affects(@NotNull SPersistentEntity entity)- Specified by:
affectsin interfaceBackgroundPersistTask
-
affectsProject
public boolean affectsProject(@NotNull SProject project)- Specified by:
affectsProjectin interfaceBackgroundPersistTask
-
getOriginNodeId
@NotNull public String getOriginNodeId()
- Specified by:
getOriginNodeIdin interfaceBackgroundPersistTask
-
getSavedPaths
@NotNull public Set<String> getSavedPaths()
- Specified by:
getSavedPathsin interfaceBackgroundPersistTask
-
logChangesToAudit
public void logChangesToAudit()
-
-