public interface SPersistentEntity
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConfigId()
Returns the entity's config identifier.
|
java.io.File |
getConfigurationFile()
Returns the configuration file where this entity instance is persisted (or will be persisted to).
|
java.io.File |
getConfigurationFile(java.io.File projectsDir)
Returns the configuration file where this entity is persisted in custom projects directory
|
java.lang.String |
getExternalId()
Returns the external identifier.
|
java.lang.String |
getName()
Returns the name of the entity.
|
SPersistentEntity |
getParent()
The parent entity.
|
PersistentEntityVersion |
getVersion()
Returns version of this entity which can be used to check if the entity
was edited or persisted.
|
void |
markPersisted(long expectedEditId)
Marks entity as persisted
|
void |
persist()
Persists this entity instance onto disk.
|
void |
persist(ConfigAction cause)
Persists this entity on disk.
|
void |
remove()
Removes this entity.
|
PersistTask |
schedulePersisting(ConfigAction cause)
Schedules background persisting of this project settings.
|
PersistTask |
schedulePersisting(java.lang.String reason)
Schedules background persisting of this entity settings.
|
@NotNull java.lang.String getConfigId()
@NotNull java.lang.String getExternalId()
java.lang.String getName()
void persist() throws PersistFailedException
PersistFailedException
- if persisting failedvoid persist(@NotNull ConfigAction cause) throws PersistFailedException
cause
- an action which caused persistingPersistFailedException
- if persisting failed@NotNull PersistTask schedulePersisting(@NotNull ConfigAction cause) throws PersistFailedException
cause
- an action which caused persistingPersistFailedException
- if failed to schedule the operationschedulePersisting(String)
@NotNull PersistTask schedulePersisting(@NotNull java.lang.String reason) throws PersistFailedException
reason
- provides a reason why persist operation was calledPersistFailedException
- if failed to schedule the operationschedulePersisting(ConfigAction)
void remove()
This method also makes all changes (related to removing the entity) on the disk and in the database. There is no need to call the persist() after this method.
@NotNull java.io.File getConfigurationFile()
@NotNull java.io.File getConfigurationFile(@NotNull java.io.File projectsDir)
projectsDir
- path to teamcity projects directory@Nullable SPersistentEntity getParent()
@NotNull PersistentEntityVersion getVersion()
void markPersisted(long expectedEditId)
expectedEditId
- expected editId in the end of persist. The entity
will be marked as unedited if expected editId is the same as actual, ie.
the entity wasn't edited while persist was running