public final class NodeProxy extends AbstractCloseableNativeProxy implements Node
nativeHandle| Constructor and Description |
|---|
NodeProxy(long nativeHandle,
ViewFactory viewFactory)
Creates a proxy of a node.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
disposeInternal()
Releases any resources owned by this proxy (e.g., the corresponding native object).
|
byte[] |
getPublicKey()
Returns the public key of this node.
|
void |
submitTransaction(Transaction transaction)
Submits a transaction into Exonum network.
|
<ResultT> ResultT |
withSnapshot(java.util.function.Function<Snapshot,ResultT> snapshotFunction)
Performs a given function with a snapshot of the current database state.
|
close, getNativeHandleisValidHandlepublic NodeProxy(long nativeHandle,
ViewFactory viewFactory)
nativeHandle - an implementation-specific reference to a native nodeviewFactory - a factory to instantiate native database viewspublic void submitTransaction(Transaction transaction) throws InvalidTransactionException, InternalServerError
submitTransaction in interface Nodetransaction - a transaction to sendjava.lang.IllegalStateException - if the node proxy is closedInvalidTransactionException - if the transaction is not validInternalServerError - if this node failed to process the transactionpublic <ResultT> ResultT withSnapshot(java.util.function.Function<Snapshot,ResultT> snapshotFunction)
withSnapshot in interface NodeResultT - a type the function returnssnapshotFunction - a function to executejava.lang.IllegalStateException - if the node proxy is closedpublic byte[] getPublicKey()
getPublicKey in interface Nodejava.lang.IllegalStateException - if the node proxy is closedprotected void disposeInternal()
AbstractCloseableNativeProxyThis method is only called once from AbstractCloseableNativeProxy.close() for a valid
proxy and shall not be called directly.
disposeInternal in class AbstractCloseableNativeProxyCopyright © 2018 Exonum. All rights reserved.