public class HttpConnector extends Object implements Connection
X_IOTA_API_VERSION_HEADER_NAME, X_IOTA_API_VERSION_HEADER_VALUE| Constructor and Description |
|---|
HttpConnector(okhttp3.OkHttpClient client,
String protocol,
String host)
Creates an HTTP connector using the provided HTTP client, with the default port
|
HttpConnector(okhttp3.OkHttpClient client,
String protocol,
String host,
int port)
Creates an HTTP connector using the provided HTTP client
|
HttpConnector(okhttp3.OkHttpClient client,
URL url)
Creates an HTTP connector using the provided HTTP client
|
HttpConnector(String protocol,
String host)
Creates an HTTP connector using the default port by creating an
OkHttpClient |
HttpConnector(String protocol,
String host,
int port)
Creates an HTTP connector using the default timeout by creating an
OkHttpClient |
HttpConnector(String protocol,
String host,
int port,
int timeout)
Creates an HTTP connector by creating an
OkHttpClient |
HttpConnector(URL url)
Creates an HTTP connector using the default timeout by creating an
OkHttpClient |
HttpConnector(URL url,
int timeout)
Creates an HTTP connector by creating an
OkHttpClient |
| Modifier and Type | Method and Description |
|---|---|
AddNeighborsResponse |
addNeighbors(IotaNeighborsRequest request)
Add a list of neighbors to the node.
|
GetAttachToTangleResponse |
attachToTangle(IotaAttachToTangleRequest request)
Attaches the specified transactions (trytes) to the Tangle by doing Proof of Work.
|
BroadcastTransactionsResponse |
broadcastTransactions(IotaBroadcastTransactionRequest request)
Broadcast a list of transactions to all neighbors.
|
CheckConsistencyResponse |
checkConsistency(IotaCheckConsistencyRequest request)
Checks the consistency of the subtangle described by the provided tails.
|
IotaCustomResponse |
customRequest(IotaCustomRequest customRequest)
Custom API call used to call IXI modules.
|
boolean |
equals(Object obj) |
FindTransactionResponse |
findTransactions(IotaFindTransactionsRequest request)
Find the transactions which match the specified input and return.
|
GetBalancesResponse |
getBalances(IotaGetBalancesRequest request)
It returns the confirmed balance which a list of addresses have at the latest confirmed milestone.
|
GetInclusionStateResponse |
getInclusionStates(IotaGetInclusionStateRequest request)
Get the inclusion states of a set of transactions.
|
GetNeighborsResponse |
getNeighbors(IotaCommandRequest request)
Get the list of neighbors from the node.
|
GetNodeInfoResponse |
getNodeInfo(IotaCommandRequest request)
Returns information about the node.
|
GetTipsResponse |
getTips(IotaCommandRequest request)
Get the list of latest tips (unconfirmed transactions).
|
GetTransactionsToApproveResponse |
getTransactionsToApprove(IotaGetTransactionsToApproveRequest request)
Tip selection which returns trunkTransaction and branchTransaction.
|
GetTrytesResponse |
getTrytes(IotaGetTrytesRequest request)
Returns the raw trytes data of a transaction.
|
int |
hashCode() |
InterruptAttachingToTangleResponse |
interruptAttachingToTangle(IotaCommandRequest request)
Interrupts and completely aborts the attachToTangle process.
|
boolean |
isConnectedToSameNode(Connection other)
A check if we are connected to the same node.
|
RemoveNeighborsResponse |
removeNeighbors(IotaNeighborsRequest request)
Removes a list of neighbors from the node.
|
boolean |
start()
Attempts to start the node connection
|
void |
stop()
Stops this connection
|
StoreTransactionsResponse |
storeTransactions(IotaStoreTransactionsRequest request)
Store transactions into the nodes local storage.
|
String |
toString() |
URL |
url() |
WereAddressesSpentFromResponse |
wereAddressesSpentFrom(IotaWereAddressesSpentFromRequest request)
Check if a list of addresses was ever spent from, in the current epoch, or in previous epochs.
|
protected static <T> retrofit2.Response<T> |
wrapCheckedException(retrofit2.Call<T> call) |
public HttpConnector(URL url)
OkHttpClienturl - The URL we connect topublic HttpConnector(String protocol, String host) throws MalformedURLException
OkHttpClientprotocol - The protocol we usehost - The host we use (Domain and optional subdomain)MalformedURLException - if this is an invalid URLpublic HttpConnector(String protocol, String host, int port) throws MalformedURLException
OkHttpClientprotocol - The protocol we usehost - The host we use (Domain and optional subdomain)port - The port we useMalformedURLException - if this is an invalid URLpublic HttpConnector(String protocol, String host, int port, int timeout) throws MalformedURLException
OkHttpClientprotocol - The protocol we usehost - The host we use (Domain and optional subdomain)port - The port we usetimeout - the connection timeout after a request is sentMalformedURLException - if this is an invalid URLpublic HttpConnector(URL url, int timeout)
OkHttpClienturl - The URL we connect totimeout - the connection timeout after a request is sentpublic HttpConnector(okhttp3.OkHttpClient client,
String protocol,
String host)
throws MalformedURLException
client - The client we use to send/receive/interceptprotocol - The protocol we usehost - The host we use (Domain and optional subdomain)MalformedURLException - if this is an invalid URLpublic HttpConnector(okhttp3.OkHttpClient client,
String protocol,
String host,
int port)
throws MalformedURLException
client - The client we use to send/receive/interceptprotocol - The protocol we usehost - The host we use (Domain and optional subdomain)port - The port we useMalformedURLException - if this is an invalid URLpublic HttpConnector(okhttp3.OkHttpClient client,
URL url)
client - The client we use to send/receive/intercepturl - The URL we connect topublic URL url()
url in interface Connectionpublic boolean start()
Connectionstart in interface Connectiontrue if start was successful, otherwise falsepublic void stop()
Connectionstop in interface Connectionpublic boolean isConnectedToSameNode(Connection other)
ConnectionisConnectedToSameNode in interface Connectionother - The other connectiontrue if it connects to the same node, otherwise falseprotected static <T> retrofit2.Response<T> wrapCheckedException(retrofit2.Call<T> call)
throws ArgumentException,
IllegalStateException,
IllegalAccessError
public GetNodeInfoResponse getNodeInfo(IotaCommandRequest request) throws ArgumentException
IotaNodeApigetNodeInfo in interface IotaNodeApiArgumentExceptionpublic GetNeighborsResponse getNeighbors(IotaCommandRequest request) throws ArgumentException
IotaNodeApigetNeighbors in interface IotaNodeApiArgumentExceptionpublic AddNeighborsResponse addNeighbors(IotaNeighborsRequest request) throws ArgumentException
IotaNodeApiaddNeighbors in interface IotaNodeApiArgumentExceptionpublic RemoveNeighborsResponse removeNeighbors(IotaNeighborsRequest request) throws ArgumentException
IotaNodeApiremoveNeighbors in interface IotaNodeApiArgumentExceptionpublic GetTipsResponse getTips(IotaCommandRequest request) throws ArgumentException
IotaNodeApigetTips in interface IotaNodeApiArgumentExceptionpublic FindTransactionResponse findTransactions(IotaFindTransactionsRequest request) throws ArgumentException
IotaNodeApifindTransactions in interface IotaNodeApiArgumentExceptionpublic GetInclusionStateResponse getInclusionStates(IotaGetInclusionStateRequest request) throws ArgumentException
IotaNodeApigetInclusionStates in interface IotaNodeApiArgumentExceptionpublic GetTrytesResponse getTrytes(IotaGetTrytesRequest request) throws ArgumentException
IotaNodeApigetTrytes in interface IotaNodeApiArgumentExceptionpublic GetTransactionsToApproveResponse getTransactionsToApprove(IotaGetTransactionsToApproveRequest request) throws ArgumentException
IotaNodeApigetTransactionsToApprove in interface IotaNodeApiArgumentExceptionpublic GetBalancesResponse getBalances(IotaGetBalancesRequest request) throws ArgumentException
IotaNodeApigetBalances in interface IotaNodeApiArgumentExceptionpublic GetAttachToTangleResponse attachToTangle(IotaAttachToTangleRequest request) throws ArgumentException
IotaNodeApiattachToTangle in interface IotaNodeApiArgumentExceptionpublic InterruptAttachingToTangleResponse interruptAttachingToTangle(IotaCommandRequest request) throws ArgumentException
IotaNodeApiinterruptAttachingToTangle in interface IotaNodeApiArgumentExceptionpublic BroadcastTransactionsResponse broadcastTransactions(IotaBroadcastTransactionRequest request) throws ArgumentException
IotaNodeApibroadcastTransactions in interface IotaNodeApiArgumentExceptionpublic StoreTransactionsResponse storeTransactions(IotaStoreTransactionsRequest request) throws ArgumentException
IotaNodeApistoreTransactions in interface IotaNodeApiArgumentExceptionpublic CheckConsistencyResponse checkConsistency(IotaCheckConsistencyRequest request) throws ArgumentException
IotaNodeApicheckConsistency in interface IotaNodeApiArgumentExceptionpublic WereAddressesSpentFromResponse wereAddressesSpentFrom(IotaWereAddressesSpentFromRequest request) throws ArgumentException
IotaNodeApiwereAddressesSpentFrom in interface IotaNodeApiArgumentExceptionpublic IotaCustomResponse customRequest(IotaCustomRequest customRequest)
IotaNodeApicustomRequest in interface IotaNodeApiCopyright © 2019. All rights reserved.