Class MCRVersionedMetadata

java.lang.Object
org.mycore.datamodel.ifs2.MCRStoredMetadata
org.mycore.datamodel.ifs2.MCRVersionedMetadata

public class MCRVersionedMetadata extends MCRStoredMetadata
Represents an XML metadata document that is stored in a local filesystem store and in parallel in a Subversion repository to track and restore changes.
Author:
Frank Lützenkirchen
  • Field Details

    • LOGGER

      protected static final Logger LOGGER
      The logger
    • revision

      protected Supplier<Optional<Long>> revision
      The revision number of the metadata version that is currently in the local filesystem store.
  • Method Details

    • getStore

      public MCRVersioningMetadataStore getStore()
      Description copied from class: MCRStoredMetadata
      Returns the store this metadata document is stored in
      Overrides:
      getStore in class MCRStoredMetadata
      Returns:
      the store this metadata document is stored in
    • update

      public void update(MCRContent xml) throws IOException, JDOMException
      Updates this metadata object, first in the SVN repository and then in the local store
      Overrides:
      update in class MCRStoredMetadata
      Parameters:
      xml - the new version of the document metadata
      Throws:
      JDOMException - thrown by MCRStoredMetadata.create(MCRContent)
      IOException
    • delete

      public void delete() throws IOException
      Deletes this metadata object in the SVN repository, and in the local store.
      Overrides:
      delete in class MCRStoredMetadata
      Throws:
      IOException
    • isDeletedInRepository

      public boolean isDeletedInRepository() throws IOException
      Throws:
      IOException
    • update

      public void update() throws Exception
      Updates the version stored in the local filesystem to the latest version from Subversion repository HEAD.
      Throws:
      Exception
    • listVersions

      public List<MCRMetadataVersion> listVersions() throws IOException
      Lists all versions of this metadata object available in the subversion repository
      Returns:
      all stored versions of this metadata object
      Throws:
      IOException
    • getRevision

      public MCRMetadataVersion getRevision(long revision) throws IOException
      Throws:
      IOException
    • getLastPresentRevision

      public long getLastPresentRevision() throws org.tmatesoft.svn.core.SVNException
      Throws:
      org.tmatesoft.svn.core.SVNException
    • getRevision

      public long getRevision()
      Returns the revision number of the version currently stored in the local filesystem store.
      Returns:
      the revision number of the local version
    • isUpToDate

      public boolean isUpToDate() throws IOException
      Checks if the version in the local store is up to date with the latest version in SVN repository
      Returns:
      true, if the local version in store is the latest version
      Throws:
      IOException