Class AbstractAccess

    • Method Detail

      • getProofList

        public <E> ProofListIndexProxy<E> getProofList​(IndexAddress address,
                                                       com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new ProofListIndex.
        Specified by:
        getProofList in interface Access
        Type Parameters:
        E - the type of elements in this list
        Parameters:
        address - an index address in the MerkleDB
        serializer - a serializer of list elements
        See Also:
        StandardSerializers
      • getList

        public <E> ListIndexProxy<E> getList​(IndexAddress address,
                                             com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new ListIndex.
        Specified by:
        getList in interface Access
        Type Parameters:
        E - the type of elements in this list
        Parameters:
        address - an index address in the MerkleDB
        serializer - a serializer of list elements
        See Also:
        Access.getProofList(IndexAddress, Serializer), StandardSerializers
      • getProofMap

        public <K,​V> ProofMapIndexProxy<K,​V> getProofMap​(IndexAddress address,
                                                                     com.exonum.binding.common.serialization.Serializer<K> keySerializer,
                                                                     com.exonum.binding.common.serialization.Serializer<V> valueSerializer)
        Description copied from interface: Access
        Creates a new ProofMapIndex.
        Specified by:
        getProofMap in interface Access
        Type Parameters:
        K - the type of keys in the map
        V - the type of values in the map
        Parameters:
        address - an index address in the MerkleDB
        keySerializer - a serializer of keys
        valueSerializer - a serializer of values
        See Also:
        StandardSerializers
      • getRawProofMap

        public <K,​V> ProofMapIndexProxy<K,​V> getRawProofMap​(IndexAddress address,
                                                                        com.exonum.binding.common.serialization.Serializer<K> keySerializer,
                                                                        com.exonum.binding.common.serialization.Serializer<V> valueSerializer)
        Description copied from interface: Access
        Creates a new "raw" ProofMapIndex. A raw ProofMapIndex does not hash keys, hence imposes some requirements on them.
        Specified by:
        getRawProofMap in interface Access
        Type Parameters:
        K - the type of keys in the map
        V - the type of values in the map
        Parameters:
        address - an index address in the MerkleDB
        keySerializer - a serializer of keys, must always produce 32-byte long values that suit the requirements
        valueSerializer - a serializer of values
        See Also:
        Access.getProofMap(IndexAddress, Serializer, Serializer), StandardSerializers
      • getMap

        public <K,​V> MapIndexProxy<K,​V> getMap​(IndexAddress address,
                                                           com.exonum.binding.common.serialization.Serializer<K> keySerializer,
                                                           com.exonum.binding.common.serialization.Serializer<V> valueSerializer)
        Description copied from interface: Access
        Creates a new MapIndex.
        Specified by:
        getMap in interface Access
        Type Parameters:
        K - the type of keys in the map
        V - the type of values in the map
        Parameters:
        address - an index address in the MerkleDB
        keySerializer - a serializer of keys
        valueSerializer - a serializer of values
        See Also:
        Access.getProofMap(IndexAddress, Serializer, Serializer), StandardSerializers
      • getKeySet

        public <E> KeySetIndexProxy<E> getKeySet​(IndexAddress address,
                                                 com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new KeySet.
        Specified by:
        getKeySet in interface Access
        Type Parameters:
        E - the type of keys in this set
        Parameters:
        address - an index address in the MerkleDB
        serializer - a serializer of set keys
        See Also:
        Access.getValueSet(IndexAddress, Serializer), StandardSerializers
      • getValueSet

        public <E> ValueSetIndexProxy<E> getValueSet​(IndexAddress address,
                                                     com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new ValueSet.
        Specified by:
        getValueSet in interface Access
        Type Parameters:
        E - the type of values in this set
        Parameters:
        address - an index address in the MerkleDB
        serializer - a serializer of set values
        See Also:
        Access.getKeySet(IndexAddress, Serializer), StandardSerializers
      • getProofEntry

        public <E> ProofEntryIndex<E> getProofEntry​(IndexAddress address,
                                                    com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new ProofEntry.
        Specified by:
        getProofEntry in interface Access
        Type Parameters:
        E - the type of the entry
        Parameters:
        address - an index address in the MerkleDB
        serializer - an entry serializer
        See Also:
        StandardSerializers
      • getEntry

        public <E> EntryIndex<E> getEntry​(IndexAddress address,
                                          com.exonum.binding.common.serialization.Serializer<E> serializer)
        Description copied from interface: Access
        Creates a new Entry.
        Specified by:
        getEntry in interface Access
        Type Parameters:
        E - the type of the entry
        Parameters:
        address - an index address in the MerkleDB
        serializer - an entry serializer
        See Also:
        StandardSerializers
      • canModify

        public boolean canModify()
        Description copied from interface: Access
        Returns true if this access allows modifications to the database state; false if it is immutable.
        Specified by:
        canModify in interface Access
      • getAccessNativeHandle

        public long getAccessNativeHandle()
        Description copied from interface: Access
        Returns a native handle of this access.
        Specified by:
        getAccessNativeHandle in interface Access
      • getOpenIndexes

        protected com.exonum.binding.core.storage.database.OpenIndexRegistry getOpenIndexes()
        Returns the registry of open indexes for this Access.
      • getCleaner

        public abstract Cleaner getCleaner()
        Returns the cleaner of this access. It is supposed to be used with collections and other objects depending on this access.
      • nativeCanModify

        protected static boolean nativeCanModify​(long nativeHandle)
        Returns true if the native Access allows modifications to the storage. Note that it may differ from the Java Access canModify() property (may be more permissive, but never — stricter).
      • nativeFree

        protected static void nativeFree​(long accessNativeHandle)
        Destroys the native `ErasedAccess` object. May be used with Snapshots, Forks, and any other ErasedAccesses.