|
|||||||
| 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(V root)
Create new version history |
|
| Method Summary | |
|---|---|
V |
checkout()
Checkout current version: create successor of the current version. |
Version[] |
getAllVersions()
Get all versions in version history |
V |
getCurrent()
Get current version in version history. |
V |
getEarliestAfter(java.util.Date timestamp)
Get earliest version adter specified date |
V |
getLatestBefore(java.util.Date timestamp)
Get latest version before specified date |
V |
getRoot()
Get root version |
V |
getVersionById(java.lang.String id)
Get version with specified ID. |
V |
getVersionByLabel(java.lang.String label)
Get version with specified label. |
java.util.Iterator<V> |
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(V 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(V root)
root - root version| Method Detail |
|---|
public V checkout()
public Version[] getAllVersions()
public V getCurrent()
public V getEarliestAfter(java.util.Date timestamp)
timestamp - deadline, if null then root version will be returned
timestamppublic V getLatestBefore(java.util.Date timestamp)
timestamp - deadline, if null then the latest version in version history will be returned
timestamppublic V getRoot()
public V getVersionById(java.lang.String id)
id - version ID
public V getVersionByLabel(java.lang.String label)
label - version label
public java.util.Iterator<V> iterator()
public void setCurrent(V 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 | ||||||