Package jetbrains.buildServer.serverSide
Interface SettingsPersister
-
- All Known Subinterfaces:
SettingsPersister
- All Known Implementing Classes:
SettingsPersisterImpl
public interface SettingsPersister
This service can be obtained as a Spring bean and should be used when one wants to save a global (non project related) configuration file under the/config folder. It is important to avoid using direct file I/O otherwise in a multi-node setups other nodes may not see the configuration file changes in time. To modify a project configuration, use the
ProjectsPersister
andProjectPersistingHandler
.- Since:
- 2024.12
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortTask(long taskId)
Cancel task with specified task id.PersistTask
scheduleDeleteFile(String description, File file)
Schedules the task to remove the specified file.PersistTask
scheduleSaveDocument(String description, File file, org.jdom.Document document)
Schedules the task to save the document into the file.PersistTask
scheduleSaveDocument(String description, FileWatcher fileWatcher, org.jdom.Document document)
Schedules the task to save the document into the file monitored by the file watcher.PersistTask
scheduleSaveFile(String description, File file, byte[] content)
Schedules the task to save the byte content into the file monitored by the file watcher.PersistTask
scheduleSaveFile(String description, FileWatcher fileWatcher, byte[] content)
Schedules the task to save the byte content into the file monitored by the file watcher.
-
-
-
Method Detail
-
scheduleSaveDocument
PersistTask scheduleSaveDocument(@NotNull String description, @NotNull FileWatcher fileWatcher, @NotNull org.jdom.Document document) throws IOException
Schedules the task to save the document into the file monitored by the file watcher.- Parameters:
description
- desciprition of the taskfileWatcher
- file watcher for the settings file, if settings file has configured file watcher. TeamCity will obtain real settings file from the file watcher viaFileWatcher.getFile()
method. TeamCity will imediatelly notify this file watcher about changes in file after persisting changes on disk.document
- XML document to be saved- Throws:
IOException
-
scheduleSaveDocument
PersistTask scheduleSaveDocument(@NotNull String description, @NotNull File file, @NotNull org.jdom.Document document) throws IOException
Schedules the task to save the document into the file.- Parameters:
description
- desciprition of the taskfile
- settings file to be changed, If the file has configured file watcher usescheduleSaveDocument(String, FileWatcher, Document)
insteaddocument
- XML document to be saved- Throws:
IOException
-
scheduleSaveFile
PersistTask scheduleSaveFile(@NotNull String description, @NotNull FileWatcher fileWatcher, byte[] content) throws IOException
Schedules the task to save the byte content into the file monitored by the file watcher.- Parameters:
description
- desciprition of the taskfileWatcher
- file watcher for the settings file, if settings file has configured file watcher. TeamCity will obtain real settings file from the file watcher viaFileWatcher.getFile()
method. TeamCity will imediatelly notify this file watcher about changes in file after persisting changes on disk.content
- content of the file to be saved- Throws:
IOException
-
scheduleSaveFile
PersistTask scheduleSaveFile(@NotNull String description, @NotNull File file, byte[] content) throws IOException
Schedules the task to save the byte content into the file monitored by the file watcher.- Parameters:
description
- desciprition of the taskfile
- settings file to be changed, If the file has configured file watcher usescheduleSaveFile(String, FileWatcher, byte[])
insteadcontent
- content of the file to be saved- Throws:
IOException
-
scheduleDeleteFile
PersistTask scheduleDeleteFile(@NotNull String description, @NotNull File file) throws IOException
Schedules the task to remove the specified file.- Throws:
IOException
- Since:
- 2024.12
-
abortTask
void abortTask(long taskId)
Cancel task with specified task id.- Parameters:
taskId
- task id to be cancelled
-
-