|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.garret.perst.Persistent
org.garret.perst.PersistentResource
org.garret.perst.VersionHistory
Collection of version of versioned object. Versioned object should be access through version history object. Instead of storing direct reference to Verson in some component of some other persistent object, it is necessary to store reference to it's VersionHistory.
| Constructor Summary | |
VersionHistory(Version root)
Create new version history |
|
| Method Summary | |
Version |
checkout()
Checkout current version: create successor of the current version. |
Version[] |
getAllVersions()
Get all versions in version history |
Version |
getCurrent()
Get current version in version history. |
Version |
getEarliestAfter(java.util.Date timestamp)
Get earliest version adter specified date |
Version |
getLatestBefore(java.util.Date timestamp)
Get latest version before specified date |
Version |
getRoot()
Get root version |
Version |
getVersionById(java.lang.String id)
Get version with specified ID. |
Version |
getVersionByLabel(java.lang.String label)
Get version with specified label. |
java.util.Iterator |
iterator()
Get iterator through all version in version history Iteration is started from the root version and performed in direction of increaing version timestamp This iterator supports remove() method. |
void |
setCurrent(Version version)
Set new current version in version history |
| Methods inherited from class org.garret.perst.PersistentResource |
exclusiveLock, exclusiveLock, reset, sharedLock, sharedLock, unlock |
| Methods inherited from class org.garret.perst.Persistent |
assignOid, deallocate, equals, getOid, getStorage, hashCode, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, readExternal, recursiveLoading, store, writeExternal |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public VersionHistory(Version root)
root - root version| Method Detail |
public Version checkout()
public Version[] getAllVersions()
public Version getCurrent()
public Version getEarliestAfter(java.util.Date timestamp)
timestamp - deadline, if null then root version will be returned
timestamppublic Version getLatestBefore(java.util.Date timestamp)
timestamp - deadline, if null then the latest version in version history will be returned
timestamppublic Version getRoot()
public Version getVersionById(java.lang.String id)
id - version ID
public Version getVersionByLabel(java.lang.String label)
label - version label
public java.util.Iterator iterator()
public void setCurrent(Version version)
version - new current version in version history (it must belong to version history)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||