Class AbstractVersion
- java.lang.Object
-
- org.ametys.core.migration.version.AbstractVersion
-
- All Implemented Interfaces:
Version
- Direct Known Subclasses:
JcrDataVersion
,SqlVersion
public abstract class AbstractVersion extends Object implements Version
Representation of a version Each upgrade create a new version
-
-
Field Summary
Fields Modifier and Type Field Description private String
_comment
private String
_componentId
private Instant
_executionInstant
private String
_versionHandlerId
private String
_versionNumber
-
Constructor Summary
Constructors Modifier Constructor Description protected
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getComment()
Get the comment about this versionString
getComponentId()
Get the component idInstant
getExecutionInstant()
Get the time when the version was createdString
getVersionHandlerId()
Get the version handler ID of this versionString
getVersionNumber()
Get the number of the versionvoid
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)String
toString()
Build a readable log for this Version-
Methods 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
-
-
-
-
Field Detail
-
_versionHandlerId
private String _versionHandlerId
-
_componentId
private String _componentId
-
_versionNumber
private String _versionNumber
-
_executionInstant
private Instant _executionInstant
-
-
Constructor Detail
-
AbstractVersion
protected AbstractVersion(String versionHandlerId, String componentId)
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
protected AbstractVersion(ActionData actionData)
Create a version from the data of anActionData
and its associated version.- Parameters:
actionData
- The action data
-
-
Method Detail
-
getVersionHandlerId
public String 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
public String getComponentId()
Description copied from interface:Version
Get the component id- Specified by:
getComponentId
in interfaceVersion
- Returns:
- The component id
-
getVersionNumber
public String getVersionNumber()
Description copied from interface:Version
Get the number of the version- Specified by:
getVersionNumber
in interfaceVersion
- Returns:
- The number of the version
-
getExecutionInstant
public Instant 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
public String getComment()
Description copied from interface:Version
Get the comment about this version- Specified by:
getComment
in interfaceVersion
- Returns:
- The comment about this version
-
setVersionNumber
public void setVersionNumber(String versionNumber)
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
public void setExecutionInstant(Instant executionInstant)
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
public void setComment(String comment)
Description copied from interface:Version
Change the comment of the version- Specified by:
setComment
in interfaceVersion
- Parameters:
comment
- comment to set
-
-