Class StandardSnapshot
java.lang.Object
dev.getelements.elements.rt.transact.StandardSnapshot
- All Implemented Interfaces:
Snapshot
,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.rt.transact.Snapshot
Snapshot.Builder
-
Constructor Summary
ConstructorsConstructorDescriptionStandardSnapshot
(Monitor monitor, DataStore dataStore, SortedSet<ResourceId> resourceIds, SortedSet<Path> paths) -
Method Summary
Modifier and TypeMethodDescriptionadd
(ResourceId resourceId) Adds a newResourceEntry
with the suppliedResourceId
, returning the result.void
close()
Closes this snapshot, releasing any underlying system resources associated with this snapshot.findResourceEntry
(ResourceId resourceId) Finds theResourceEntry
at the supplied ResourceId.findResourceEntry
(Path path) Finds theResourceEntry
at the supplied path.findTaskEntry
(ResourceId resourceId) Finds theTaskEntry
associated with the suppliedResourceId
.getOrCreateTaskEntry
(ResourceId resourceId) Gets theTaskEntry
or throws an instance ofSnapshotMissException
.Gets allResourceEntry
instances in thisSnapshot
.Collection
<TaskEntry<?>> List allResourceEntry
instances matching thePath
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.rt.transact.Snapshot
getResourceEntry, getResourceEntry
-
Constructor Details
-
StandardSnapshot
-
-
Method Details
-
list
Description copied from interface:Snapshot
List allResourceEntry
instances matching thePath
. As aSnapshot
may be backed by aStream
from theDataStore
, it is required that the Stream reach a terminal state or be explicitly closed. Closing thisSnapshot
will close the stream associatd with it.- Specified by:
list
in interfaceSnapshot
- Parameters:
path
- the path- Returns:
- the
Stream<ResourceEntry>
-
findTaskEntry
Description copied from interface:Snapshot
Finds theTaskEntry
associated with the suppliedResourceId
.- Specified by:
findTaskEntry
in interfaceSnapshot
- Parameters:
resourceId
- theResourceId
- Returns:
- the
Optional
containing theTaskEntry<ResourceId>
-
getOrCreateTaskEntry
Description copied from interface:Snapshot
Gets theTaskEntry
or throws an instance ofSnapshotMissException
.- Specified by:
getOrCreateTaskEntry
in interfaceSnapshot
- Parameters:
resourceId
- the path- Returns:
- the
Optional
containing aTaskEntry
never null
-
findResourceEntry
Description copied from interface:Snapshot
Finds theResourceEntry
at the supplied path.- Specified by:
findResourceEntry
in interfaceSnapshot
- Parameters:
path
- the path- Returns:
- an
Optional
containing the Entry.
-
findResourceEntry
Description copied from interface:Snapshot
Finds theResourceEntry
at the supplied ResourceId.- Specified by:
findResourceEntry
in interfaceSnapshot
- Parameters:
resourceId
- the path- Returns:
- an
Optional
containing the Entry.
-
getTaskEntries
Description copied from interface:Snapshot
- Specified by:
getTaskEntries
in interfaceSnapshot
- Returns:
- gets all
TaskEntry
instances associated with thisSnapshot
-
getResourceEntries
Description copied from interface:Snapshot
Gets allResourceEntry
instances in thisSnapshot
.- Specified by:
getResourceEntries
in interfaceSnapshot
- Returns:
- gets all
ResourceEntry
instances associated with thisSnapshot
-
add
Description copied from interface:Snapshot
Adds a newResourceEntry
with the suppliedResourceId
, returning the result. Any previously accessedResourceEntry
instances.- Specified by:
add
in interfaceSnapshot
- Parameters:
resourceId
- theResourceId
- Returns:
- the
ResourceEntry
which was added.
-
close
public void close()Description copied from interface:Snapshot
Closes this snapshot, releasing any underlying system resources associated with this snapshot.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSnapshot
-
getDataStore
-