Class Snapshot
- java.lang.Object
-
- com.exonum.binding.proxy.AbstractNativeProxy
-
- com.exonum.binding.storage.database.View
-
- com.exonum.binding.storage.database.Snapshot
-
public final class Snapshot extends View
A snapshot is a read-only, immutable database view.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 will not change whilst a snapshot is alive.
- See Also:
Fork
- Write operations are prohibited; an attempt to perform a modifying operation
will result in an
-
-
Field Summary
-
Fields inherited from class com.exonum.binding.proxy.AbstractNativeProxy
nativeHandle
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Snapshot
newInstance(long nativeHandle, boolean owningHandle, Cleaner cleaner)
Creates a new Snapshot proxy.static Snapshot
newInstance(long nativeHandle, Cleaner cleaner)
Creates a new owning Snapshot proxy.-
Methods inherited from class com.exonum.binding.storage.database.View
canModify, getCleaner, getModificationCounter, getViewNativeHandle
-
Methods inherited from class com.exonum.binding.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 object
-
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 object
-
-