Class AbstractVersion
java.lang.Object
org.ametys.core.migration.version.AbstractVersion
- All Implemented Interfaces:
Version
- Direct Known Subclasses:
JcrDataVersion
,SqlVersion
Representation of a version
Each upgrade create a new version
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractVersion
(String versionHandlerId, String componentId) Create a version to be storedprotected
AbstractVersion
(String versionHandlerId, String componentId, String versionNumber, Instant executionInstant, String comment) Create a version to be storedprotected
AbstractVersion
(ActionData actionData) Create a version from the data of anActionData
and its associated version. -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalValue
(String key, Object value) Add a parameter that will be replaced in the script with the valueGet the map of values to replace in the scriptGet the comment about this versionGet the component idGet the time when the version was createdGet the version handler ID of this versionGet the number of the version (null means that initialization is needed)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 VersionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.core.migration.version.Version
copyFromActionData
-
Constructor Details
-
AbstractVersion
Create a version to be stored- Parameters:
versionHandlerId
- id of theVersionHandler
componentId
- id of the component
-
AbstractVersion
protected AbstractVersion(String versionHandlerId, String componentId, String versionNumber, Instant executionInstant, String comment) Create a version to be stored- Parameters:
versionHandlerId
- id of theVersionHandler
componentId
- id of the componentversionNumber
- version number of the upgrade that created this versionexecutionInstant
- time of the application of this versioncomment
- comment stored about this version
-
AbstractVersion
Create a version from the data of anActionData
and its associated version.- Parameters:
actionData
- The action data
-
-
Method Details
-
toString
Build a readable log for this Version -
getVersionHandlerId
Description copied from interface:Version
Get the version handler ID of this version- Specified by:
getVersionHandlerId
in interfaceVersion
- Returns:
- The version handler ID of this version
-
getComponentId
Description copied from interface:Version
Get the component id- Specified by:
getComponentId
in interfaceVersion
- Returns:
- The component id
-
getVersionNumber
Description copied from interface:Version
Get the number of the version (null means that initialization is needed)- Specified by:
getVersionNumber
in interfaceVersion
- Returns:
- The number of the version
-
getExecutionInstant
Description copied from interface:Version
Get the time when the version was created- Specified by:
getExecutionInstant
in interfaceVersion
- Returns:
- The time when the version was created
-
getComment
Description copied from interface:Version
Get the comment about this version- Specified by:
getComment
in interfaceVersion
- Returns:
- The comment about this version
-
setVersionNumber
Description copied from interface:Version
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)- Specified by:
setVersionNumber
in interfaceVersion
- Parameters:
versionNumber
- number to set for this version
-
setExecutionInstant
Description copied from interface:Version
Set the execution date of this version (only to be used when creating a new version after cloning an old version)- Specified by:
setExecutionInstant
in interfaceVersion
- Parameters:
executionInstant
- instant to set
-
setComment
Description copied from interface:Version
Change the comment of the version- Specified by:
setComment
in interfaceVersion
- Parameters:
comment
- comment to set
-
addAdditionalValue
Description copied from interface:Version
Add a parameter that will be replaced in the script with the value- Specified by:
addAdditionalValue
in interfaceVersion
- 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
Description copied from interface:Version
Get the map of values to replace in the script- Specified by:
getAdditionalValues
in interfaceVersion
- Returns:
- the map of keys to replace in the script
-