Class MCRAbstractMetadataVersion<T>

java.lang.Object
org.mycore.datamodel.common.MCRAbstractMetadataVersion<T>
Direct Known Subclasses:
MCRMetadataVersion, MCROCFLMetadataVersion

public abstract class MCRAbstractMetadataVersion<T> extends Object
Provides information about a stored version of metadata and allows to retrieve that version from SVN
Author:
Frank Lützenkirchen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
    A version that was created in store
    protected Date
    The date this version was created
    static final char
    A version that was deleted in store
    protected String
    The revision number of this version
    Was this version result of a create, update or delete?
    static final char
    A version that was updated in store
    protected String
    The user that created this version
    protected T
    The metadata document this version belongs to
  • Constructor Summary

    Constructors
    Constructor
    Description
    MCRAbstractMetadataVersion(T vm, String revision, String user, Date date, char type)
    Creates a new metadata version info object
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the date and time this version was created
    Returns the metadata object this version belongs to
    Returns the SVN revision number of this version
    char
    Returns the type of operation this version comes from
    Returns the user that created this version
    abstract void
    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
    Retrieves this version of the metadata

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • vm

      protected T vm
      The metadata document this version belongs to
    • revision

      protected String revision
      The revision number of this version
    • user

      protected String user
      The user that created this version
    • date

      protected Date date
      The date this version was created
    • type

      Was this version result of a create, update or delete?
    • CREATED

      public static final char CREATED
      A version that was created in store
      See Also:
    • UPDATED

      public static final char UPDATED
      A version that was updated in store
      See Also:
    • DELETED

      public static final char DELETED
      A version that was deleted in store
      See Also:
  • Constructor Details

    • MCRAbstractMetadataVersion

      public MCRAbstractMetadataVersion(T vm, String revision, String user, Date date, char type)
      Creates a new metadata version info object
      Parameters:
      vm - the metadata document this version belongs to
      revision - the revision of this object, serialised as a string
      user - the user that created this revision
      date - the date on which this revision was created
      type - the type of commit
  • Method Details

    • getMetadataObject

      public T 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
      See Also:
    • getRevision

      public String getRevision()
      Returns the SVN revision number of this version
      Returns:
      the SVN revision number of this version
    • getUser

      public String getUser()
      Returns the user that created this version
      Returns:
      the user that created this version
    • getDate

      public Date getDate()
      Returns the date and time this version was created
      Returns:
      the date and time this version was created
    • retrieve

      public abstract MCRContent retrieve() throws IOException
      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 retrieved
      IOException
    • restore

      public abstract void restore() throws IOException, JDOMException
      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