Class Snapshot
- java.lang.Object
-
- com.exonum.binding.core.proxy.AbstractNativeProxy
-
- com.exonum.binding.core.storage.database.AbstractAccess
-
- com.exonum.binding.core.storage.database.Snapshot
-
- All Implemented Interfaces:
Access
public final class Snapshot extends AbstractAccess
A snapshot is a read-only, immutable database access.A snapshot represents database state at the time it was created. Immutability implies that:
- Write operations are prohibited; an attempt to perform a modifying operation
will result in an
UnsupportedOperationException. - Database state represented by this snapshot does not change. Newly created snapshots, however, might correspond to a new database state.
The Snapshot does not modify the index name upon address resolution.
- See Also:
Fork
-
-
Field Summary
-
Fields inherited from class com.exonum.binding.core.proxy.AbstractNativeProxy
nativeHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CleanergetCleaner()Returns the cleaner of this access.static SnapshotnewInstance(long nativeHandle, boolean owningHandle, Cleaner cleaner)Creates a new Snapshot proxy.static SnapshotnewInstance(long nativeHandle, Cleaner cleaner)Creates a new owning Snapshot proxy.-
Methods inherited from class com.exonum.binding.core.storage.database.AbstractAccess
canModify, getAccessNativeHandle, getEntry, getKeySet, getList, getMap, getOpenIndexes, getProofEntry, getProofList, getProofMap, getRawProofMap, getValueSet, nativeCanModify, nativeFree
-
Methods inherited from class com.exonum.binding.core.proxy.AbstractNativeProxy
getNativeHandle, isValidHandle
-
-
-
-
Method Detail
-
newInstance
public static Snapshot newInstance(long nativeHandle, Cleaner cleaner)
Creates a new owning Snapshot proxy.- Parameters:
nativeHandle- a handle of the native Snapshot objectcleaner- a cleaner to destroy the native peer and any dependent objects
-
newInstance
public static Snapshot newInstance(long nativeHandle, boolean owningHandle, Cleaner cleaner)
Creates a new Snapshot proxy.- Parameters:
nativeHandle- a handle of the native Snapshot objectowningHandle- whether a proxy owns the corresponding native object and is responsible to clean it upcleaner- a cleaner to destroy the native peer and any dependent objects
-
getCleaner
public Cleaner getCleaner()
Description copied from class:AbstractAccessReturns the cleaner of this access. It is supposed to be used with collections and other objects depending on this access.- Specified by:
getCleanerin classAbstractAccess
-
-