public interface Session
Version
s of
various types of models. A session is assumed to be associated with a single thread of execution.Modifier and Type | Method and Description |
---|---|
Counted |
createCountedVersion()
Creates a new
Counted object for this session. |
Toggled |
createToggledVersion(Node node,
boolean include)
Creates a new
Toggled object for this session. |
Version |
createVersion(ModelType modelType)
Creates a new version instance.
|
Version |
findLastVersion(ModelType modelType,
AccessMode accessMode)
Returns the last version of the given model type and with the given access mode.
|
Version |
findOrCreateLastVersion(ModelType modelType,
AccessMode accessMode)
Returns the last version of the given model type and with the given access mode.
|
Version |
findVersion(long ordinal)
Returns the version that is associated with the given ordinal.
|
Version.Iterable |
findVersionsInRange(long minOrdinal,
long maxOrdinal,
ModelType modelType,
AccessMode accessMode)
Returns all versions of the given model type and with the given access mode.
|
void |
flush()
Flushes all cached data to persistent storage.
|
Histogram |
getHistogram(Version version,
Node node)
Retrieves a histogram from the cache.
|
InteractionContext |
getInteractionContext()
Returns the interaction context associated with this session.
|
Root |
getRoot()
Returns the root object associated with this session.
|
void |
logVersions(String label,
Version.Iterable versions)
Logs the given versions.
|
void |
putHistogram(Histogram histogram)
Stores the given histogram in the cache
|
Session |
refresh()
Returns a fresh copy of the session that is (re)attached to the ORM framework.
|
Root getRoot()
InteractionContext getInteractionContext()
Version createVersion(ModelType modelType)
modelType
- The model type for the new versionVersion findVersion(long ordinal)
null
if no such
version exists.ordinal
- The ordinal of the versionVersion findLastVersion(ModelType modelType, AccessMode accessMode)
null
if no such version exists.modelType
- The model type of the requested versionaccessMode
- The access model of the requested versionVersion findOrCreateLastVersion(ModelType modelType, AccessMode accessMode)
modelType
- The model type of the requested versionaccessMode
- The access model of the requested versionVersion.Iterable findVersionsInRange(long minOrdinal, long maxOrdinal, ModelType modelType, AccessMode accessMode)
minOrdinal
- The minimum for the ordinals of the returned versionsmaxOrdinal
- The maximum for the ordinals of the returned versionsmodelType
- The model type of the requested versionsaccessMode
- The access model of the requested versionsvoid logVersions(String label, Version.Iterable versions)
label
- A descriptive label for the block of log recordsversions
- The versions to logCounted createCountedVersion()
Counted
object for this session.Counted
objectToggled createToggledVersion(Node node, boolean include)
Toggled
object for this session.node
- The node that is toggledinclude
- Tha flag that indicates whether the given node is included in the new model of expected behaviorToggled
object for this sessionHistogram getHistogram(Version version, Node node)
version
- The version of the requested histogramnode
- The node of the requested histogramvoid putHistogram(Histogram histogram)
histogram
- The histogram to storeSession refresh()
void flush()
Copyright © 2013. All Rights Reserved.