Package org.mycore.datamodel.common
Class MCRAbstractMetadataVersion<T>
java.lang.Object
org.mycore.datamodel.common.MCRAbstractMetadataVersion<T>
- Direct Known Subclasses:
MCRMetadataVersion
,MCROCFLMetadataVersion
Provides information about a stored version of metadata and allows to
retrieve that version from SVN
- Author:
- Frank Lützenkirchen
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
A version that was created in storeprotected Date
The date this version was createdstatic final char
A version that was deleted in storeprotected String
The revision number of this versionprotected MCRAbstractMetadataVersion.Type
Was this version result of a create, update or delete?static final char
A version that was updated in storeprotected String
The user that created this versionprotected T
The metadata document this version belongs to -
Constructor Summary
ConstructorDescriptionMCRAbstractMetadataVersion
(T vm, String revision, String user, Date date, char type) Creates a new metadata version info object -
Method Summary
Modifier and TypeMethodDescriptiongetDate()
Returns the date and time this version was createdReturns the metadata object this version belongs toReturns the SVN revision number of this versionchar
getType()
Returns the type of operation this version comes fromgetUser()
Returns the user that created this versionabstract void
restore()
Replaces the current version of the metadata object with this version, which means that a new version is created that is identical to this old version.abstract MCRContent
retrieve()
Retrieves this version of the metadata
-
Field Details
-
vm
The metadata document this version belongs to -
revision
The revision number of this version -
user
The user that created this version -
date
The date this version was created -
type
Was this version result of a create, update or delete? -
CREATED
public static final char CREATEDA version that was created in store- See Also:
-
UPDATED
public static final char UPDATEDA version that was updated in store- See Also:
-
DELETED
public static final char DELETEDA version that was deleted in store- See Also:
-
-
Constructor Details
-
MCRAbstractMetadataVersion
Creates a new metadata version info object- Parameters:
vm
- the metadata document this version belongs torevision
- the revision of this object, serialised as a stringuser
- the user that created this revisiondate
- the date on which this revision was createdtype
- the type of commit
-
-
Method Details
-
getMetadataObject
Returns the metadata object this version belongs to- Returns:
- the metadata object this version belongs to
-
getType
public char getType()Returns the type of operation this version comes from -
getRevision
Returns the SVN revision number of this version- Returns:
- the SVN revision number of this version
-
getUser
Returns the user that created this version- Returns:
- the user that created this version
-
getDate
Returns the date and time this version was created- Returns:
- the date and time this version was created
-
retrieve
Retrieves this version of the metadata- Returns:
- the metadata document as it was in this version
- Throws:
MCRUsageException
- if this is a deleted version, which can not be retrievedIOException
-
restore
Replaces the current version of the metadata object with this version, which means that a new version is created that is identical to this old version. The stored metadata document is updated to this old version of the metadata.- Throws:
IOException
JDOMException
-