Class View
- java.lang.Object
-
- com.exonum.binding.proxy.AbstractNativeProxy
-
- com.exonum.binding.storage.database.View
-
public abstract class View extends AbstractNativeProxy
Represents a view of a database.There are two sub-types:
- A snapshot, which is a read-only view.
- A fork, which is a read-write view.
As in some cases the clients need to detect any changes made to a database, a view also holds a modification counter, which any clients changing the database state must notify.
-
-
Field Summary
-
Fields inherited from class com.exonum.binding.proxy.AbstractNativeProxy
nativeHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canModify()
Returns true if this view allows modifications to the database state; false if it is immutable.Cleaner
getCleaner()
Returns the cleaner of this view.ModificationCounter
getModificationCounter()
Returns a modification counter, corresponding to this view.long
getViewNativeHandle()
Returns a native handle of this view.-
Methods inherited from class com.exonum.binding.proxy.AbstractNativeProxy
getNativeHandle, isValidHandle
-
-
-
-
Method Detail
-
canModify
public boolean canModify()
Returns true if this view allows modifications to the database state; false if it is immutable.
-
getViewNativeHandle
public long getViewNativeHandle()
Returns a native handle of this view.- Throws:
java.lang.IllegalStateException
- if the view is invalid (closed or nullptr)
-
getCleaner
public Cleaner getCleaner()
Returns the cleaner of this view.
-
getModificationCounter
public ModificationCounter getModificationCounter()
Returns a modification counter, corresponding to this view. The clients, trying to modify a collection using this view, must notify the counter first.
-
-