VersionTransaction#

public abstract class VersionTransaction extends CacheableBackendTransaction<EntityID, HashMap<String, VersionHistoryItem>>#

Abstract base class which retrieves and caches the full, but flat version history. The implementations then use the flat version history to construct either single version information items (see RetrieveVersionInfo) or the complete history as a tree (see RetrieveVersionHistory)

Author:

Timm Fitschen (t.fitschen@indiscale.com)

Constructors#

VersionTransaction#

public VersionTransaction(EntityInterface e)#

Methods#

executeNoCache#

public HashMap<String, VersionHistoryItem> executeNoCache()#

getEntity#

public EntityInterface getEntity()#

getHistoryItems#

public HashMap<String, VersionHistoryItem> getHistoryItems()#

getKey#

protected EntityID getKey()#

getPredecessors#

protected List<Version> getPredecessors(String versionId, boolean transitive)#

Return a list of direct predecessors. The predecessors are constructed by getVersion(String).

If transitive is true, this function is called recursively on the predecessors as well, resulting in a list of trees of predecessors, with the direct predecessors at the root(s).

Parameters:
  • versionId

  • transitive

Returns:

A list of predecessors.

getSuccessors#

protected List<Version> getSuccessors(String versionId, boolean transitive)#

Return a list of direct successors. The successors are constructed by getVersion(String).

If transitive is true, this function is called recursively on the successors as well, resulting in a list of trees of successors, with the direct successors at the root(s).

Parameters:
  • versionId

  • transitive

Returns:

A list of successors.

getVersion#

protected abstract Version getVersion(String versionId)#

To be implemented by the base class. The idea is, that the base class decides which information is being included into the Version instance.

Parameters:
  • versionId

    • the id of the version

process#

protected void process(HashMap<String, VersionHistoryItem> historyItems)#

After this method call, the version map is available to the object.

removeCached#

public static void removeCached(EntityID entityId)#

Invalidate a cache item. This should be called upon update of entities.

Parameters:
  • entityId