Class Version
java.lang.Object
org.ametys.core.migration.version.Version
Representation of a version
Each upgrade create a new version
-
Constructor Summary
ConstructorDescriptionVersion
(MigrationEngine.MigrationComponent component, String componentId, VersionStorage storage, VersionConfiguration configuration, String versionNumber, Instant executionInstant, String comment) Create a version to be stored -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalValue
(String key, Object value) Add a parameter that will be used by upgrade actionsboolean
Get the values that will be used by upgrade actionsGet the comment about this versionGet the context componentGet the component idGet the time when the version was createdGet the storage for this versionGet the configuration for the associated storageGet the number of the version (null means that initialization is needed)int
hashCode()
void
setComment
(String comment) Change the comment of the versionvoid
setExecutionInstant
(Instant executionInstant) Set the execution date of this version (only to be used when creating a new version after cloning an old version)void
setVersionNumber
(String versionNumber) Set the number of the version Should only be used in initialization actions, so the version contains the version to reach, not the version to start (which should be null in the case of initialization)toString()
Build a readable log for this Version
-
Constructor Details
-
Version
public Version(MigrationEngine.MigrationComponent component, String componentId, VersionStorage storage, VersionConfiguration configuration, String versionNumber, Instant executionInstant, String comment) Create a version to be stored- Parameters:
component
- the context componentcomponentId
- id of the componentstorage
- theVersionStorage
associated with this Versionconfiguration
- the storage configurationversionNumber
- version number of the upgrade that created this versionexecutionInstant
- time of the application of this versioncomment
- comment stored about this version
-
-
Method Details
-
toString
Build a readable log for this Version -
equals
-
hashCode
-
getComponent
Get the context component- Returns:
- The context component
-
getComponentId
Get the component id- Returns:
- The component id
-
getStorage
Get the storage for this version- Returns:
- the associated storage
-
getStorageConfiguration
Get the configuration for the associated storage- Returns:
- the configuration
-
getVersionNumber
Get the number of the version (null means that initialization is needed)- Returns:
- The number of the version
-
getExecutionInstant
Get the time when the version was created- Returns:
- The time when the version was created
-
getComment
Get the comment about this version- Returns:
- The comment about this version
-
setVersionNumber
Set the number of the version Should only be used in initialization actions, so the version contains the version to reach, not the version to start (which should be null in the case of initialization)- Parameters:
versionNumber
- number to set for this version
-
setExecutionInstant
Set the execution date of this version (only to be used when creating a new version after cloning an old version)- Parameters:
executionInstant
- instant to set
-
setComment
Change the comment of the version- Parameters:
comment
- comment to set
-
addAdditionalValue
Add a parameter that will be used by upgrade actions- Parameters:
key
- key to replacevalue
- value that will be inserted- Returns:
- the previous value associated with key, or null if there was no mapping for key.
-
getAdditionalValues
Get the values that will be used by upgrade actions- Returns:
- the values
-