Package org.mycore.datamodel.ifs2
Class MCRVersionedMetadata
java.lang.Object
org.mycore.datamodel.ifs2.MCRStoredMetadata
org.mycore.datamodel.ifs2.MCRVersionedMetadata
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final Logger
The loggerThe revision number of the metadata version that is currently in the local filesystem store.Fields inherited from class org.mycore.datamodel.ifs2.MCRStoredMetadata
deleted, id, path, store
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Deletes this metadata object in the SVN repository, and in the local store.long
long
Returns the revision number of the version currently stored in the local filesystem store.getRevision
(long revision) getStore()
Returns the store this metadata document is stored inboolean
boolean
Checks if the version in the local store is up to date with the latest version in SVN repositoryLists all versions of this metadata object available in the subversion repositoryvoid
update()
Updates the version stored in the local filesystem to the latest version from Subversion repository HEAD.void
update
(MCRContent xml) Updates this metadata object, first in the SVN repository and then in the local storeMethods inherited from class org.mycore.datamodel.ifs2.MCRStoredMetadata
getID, getLastModified, getMetadata, isDeleted, setLastModified
-
Field Details
-
LOGGER
The logger -
revision
The revision number of the metadata version that is currently in the local filesystem store.
-
-
Method Details
-
getStore
Description copied from class:MCRStoredMetadata
Returns the store this metadata document is stored in- Overrides:
getStore
in classMCRStoredMetadata
- Returns:
- the store this metadata document is stored in
-
update
Updates this metadata object, first in the SVN repository and then in the local store- Overrides:
update
in classMCRStoredMetadata
- Parameters:
xml
- the new version of the document metadata- Throws:
JDOMException
- thrown byMCRStoredMetadata.create(MCRContent)
IOException
-
delete
Deletes this metadata object in the SVN repository, and in the local store.- Overrides:
delete
in classMCRStoredMetadata
- Throws:
IOException
-
isDeletedInRepository
- Throws:
IOException
-
update
Updates the version stored in the local filesystem to the latest version from Subversion repository HEAD.- Throws:
Exception
-
listVersions
Lists all versions of this metadata object available in the subversion repository- Returns:
- all stored versions of this metadata object
- Throws:
IOException
-
getRevision
- 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
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
-