public class BasicHttpClient
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
class |
BasicHttpClient.Answer |
|
class |
BasicHttpClient.AnswerRaw |
|
static class |
BasicHttpClient.ConnectionFailedException |
|
static class |
BasicHttpClient.EndpointException |
Modifier and Type | Field | Description |
---|---|---|
protected BasicHttpClientSession |
session |
Constructor | Description |
---|---|
BasicHttpClient(java.lang.String rootUrlString) |
Modifier and Type | Method | Description |
---|---|---|
net.sergeych.tools.Binder |
command(java.lang.String name,
java.lang.Object... keysValues) |
Execute command over the authenticated and encrypted connection.
|
net.sergeych.tools.Binder |
command(java.lang.String name,
net.sergeych.tools.Binder params) |
Execute a command over the authenticated and encrypted connection.
|
BasicHttpClient.Answer |
commonRequest(java.lang.String path,
com.eclipsesource.json.JsonObject params) |
|
BasicHttpClient.Answer |
commonRequest(java.lang.String path,
java.lang.Object... keysValues) |
|
java.lang.String |
getConnectMessage() |
|
int |
getNodeNumber() |
|
BasicHttpClientSession |
getSession() |
|
java.lang.String |
getUrl() |
|
static java.lang.Object |
ofJson(com.eclipsesource.json.JsonValue json) |
|
boolean |
ping() |
Ping remote side to ensure it is connected
|
BasicHttpClient.Answer |
proxyRequest(java.lang.String path,
java.lang.Object... keysValues) |
|
BasicHttpClient.Answer |
proxyRequest(java.lang.String path,
net.sergeych.tools.Binder params) |
|
BasicHttpClient.Answer |
request(java.lang.String path,
java.lang.Object... keysValues) |
|
BasicHttpClient.Answer |
request(java.lang.String path,
net.sergeych.tools.Binder params) |
|
BasicHttpClient.AnswerRaw |
requestRaw(java.lang.String path,
net.sergeych.tools.Binder params) |
|
void |
restart() |
|
BasicHttpClientSession |
start(com.icodici.crypto.PrivateKey privateKey,
com.icodici.crypto.PublicKey nodePublicKey,
BasicHttpClientSession session) |
Authenticate self to the remote party.
|
void |
startProxyToNode(Client.NodeRecord targetNode,
BasicHttpClientSession targetSession) |
|
BasicHttpClientSession |
startWithProxy(com.icodici.crypto.PrivateKey privateKey,
com.icodici.crypto.PublicKey nodePublicKey,
BasicHttpClientSession session) |
|
java.lang.String |
toString() |
protected BasicHttpClientSession session
public java.lang.String getConnectMessage()
public BasicHttpClientSession getSession()
public void startProxyToNode(Client.NodeRecord targetNode, BasicHttpClientSession targetSession) throws java.io.IOException
java.io.IOException
public BasicHttpClientSession start(com.icodici.crypto.PrivateKey privateKey, com.icodici.crypto.PublicKey nodePublicKey, BasicHttpClientSession session) throws java.io.IOException
privateKey
- is client's PrivateKey
nodePublicKey
- is Node's PublicKey
session
- is BasicHttpClientSession
object, can be nullBasicHttpClientSession
java.io.IOException
- is something went wrongpublic BasicHttpClientSession startWithProxy(com.icodici.crypto.PrivateKey privateKey, com.icodici.crypto.PublicKey nodePublicKey, BasicHttpClientSession session) throws java.io.IOException
java.io.IOException
public void restart() throws java.io.IOException
java.io.IOException
public boolean ping()
public net.sergeych.tools.Binder command(java.lang.String name, net.sergeych.tools.Binder params) throws java.io.IOException
name
- command nameparams
- command paramsjava.io.IOException
- if the commadn can't be executed after several retries or the remote side reports error.public net.sergeych.tools.Binder command(java.lang.String name, java.lang.Object... keysValues) throws java.io.IOException
command(String, Binder)
for more.name
- command namekeysValues
- keys (strings) and values of the command arguments. Values can be anything Boss
protocol
and registered adapters supportjava.io.IOException
- if the command can't be executed (also if remote returns an error)public java.lang.String getUrl()
public BasicHttpClient.Answer request(java.lang.String path, java.lang.Object... keysValues) throws java.io.IOException
java.io.IOException
public BasicHttpClient.Answer proxyRequest(java.lang.String path, java.lang.Object... keysValues) throws java.io.IOException
java.io.IOException
public BasicHttpClient.Answer commonRequest(java.lang.String path, java.lang.Object... keysValues) throws java.io.IOException
java.io.IOException
public BasicHttpClient.Answer request(java.lang.String path, net.sergeych.tools.Binder params) throws java.io.IOException
java.io.IOException
public BasicHttpClient.AnswerRaw requestRaw(java.lang.String path, net.sergeych.tools.Binder params) throws java.io.IOException
java.io.IOException
public BasicHttpClient.Answer proxyRequest(java.lang.String path, net.sergeych.tools.Binder params) throws java.io.IOException
java.io.IOException
public static java.lang.Object ofJson(com.eclipsesource.json.JsonValue json)
public BasicHttpClient.Answer commonRequest(java.lang.String path, com.eclipsesource.json.JsonObject params) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int getNodeNumber()