org.mycore.datamodel.ifs2
Class MCRMetadataVersion

java.lang.Object
  extended by org.mycore.datamodel.ifs2.MCRMetadataVersion

public class MCRMetadataVersion
extends Object

Provides information about a stored version of metadata and allows to retrieve that version from SVN

Author:
Frank Lützenkirchen

Field Summary
static char CREATED
          A version that was created in store
static char DELETED
          A version that was deleted in store
static char UPDATED
          A version that was updated in store
 
Constructor Summary
MCRMetadataVersion(MCRVersionedMetadata vm, org.tmatesoft.svn.core.SVNLogEntry logEntry, char type)
          Creates a new metadata version info object
 
Method Summary
 Date getDate()
          Returns the date and time this version was created
 MCRVersionedMetadata getMetadataObject()
          Returns the metadata object this version belongs to
 long getRevision()
          Returns the SVN revision number of this version
 char getType()
          Returns the type of operation this version comes from
 String getUser()
          Returns the user that created this version
 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.
 MCRContent retrieve()
          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 Detail

CREATED

public static final char CREATED
A version that was created in store

See Also:
Constant Field Values

UPDATED

public static final char UPDATED
A version that was updated in store

See Also:
Constant Field Values

DELETED

public static final char DELETED
A version that was deleted in store

See Also:
Constant Field Values
Constructor Detail

MCRMetadataVersion

MCRMetadataVersion(MCRVersionedMetadata vm,
                   org.tmatesoft.svn.core.SVNLogEntry logEntry,
                   char type)
Creates a new metadata version info object

Parameters:
vm - the metadata document this version belongs to
logEntry - the log entry from SVN holding data on this version
type - the type of commit
Method Detail

getMetadataObject

public MCRVersionedMetadata 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:
CREATED, UPDATED, DELETED

getRevision

public long 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 MCRContent retrieve()
                    throws Exception
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
Exception

restore

public void restore()
             throws Exception
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:
Exception