Package com.exonum.binding.core.runtime
Class NodeProxy
java.lang.Object
com.exonum.binding.core.proxy.AbstractNativeProxy
com.exonum.binding.core.proxy.AbstractCloseableNativeProxy
com.exonum.binding.core.runtime.NodeProxy
- All Implemented Interfaces:
CloseableNativeProxy
,java.lang.AutoCloseable
public final class NodeProxy extends AbstractCloseableNativeProxy
An Exonum node context. Allows to add transactions to Exonum network
and get a snapshot of the database state.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NodeProxy(long nativeHandle)
Creates a proxy of a Node. -
Method Summary
Modifier and Type Method Description protected void
disposeInternal()
Releases any resources owned by this proxy (e.g., the corresponding native object).PublicKey
getPublicKey()
HashCode
submitTransaction(RawTransaction rawTransaction)
<ResultT> ResultT
withSnapshot(java.util.function.Function<Snapshot,ResultT> snapshotFunction)
Methods inherited from class com.exonum.binding.core.proxy.AbstractCloseableNativeProxy
close, getNativeHandle
-
Constructor Details
-
NodeProxy
public NodeProxy(long nativeHandle)Creates a proxy of a Node.- Parameters:
nativeHandle
- an implementation-specific reference to a native Node object
-
-
Method Details
-
submitTransaction
-
withSnapshot
public <ResultT> ResultT withSnapshot(java.util.function.Function<Snapshot,ResultT> snapshotFunction) -
getPublicKey
-
disposeInternal
protected void disposeInternal()Description copied from class:AbstractCloseableNativeProxy
Releases any resources owned by this proxy (e.g., the corresponding native object).This method is only called once from
AbstractCloseableNativeProxy.close()
for a valid proxy and shall not be called directly.- Specified by:
disposeInternal
in classAbstractCloseableNativeProxy
-