public abstract class WebsocketTransport
extends java.lang.Object
implements org.ic4j.agent.ReplicaTransport
| Modifier and Type | Class and Description |
|---|---|
static interface |
WebsocketTransport.MessageHandler
Message handler.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.net.URI |
endpointURI |
protected WebsocketTransport.MessageHandler |
messageHandler |
| Constructor and Description |
|---|
WebsocketTransport(java.net.URI endpointURI,
org.ic4j.agent.ReplicaTransport httpTransport) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addMessageHandler(WebsocketTransport.MessageHandler msgHandler) |
java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> |
call(org.ic4j.types.Principal canisterId,
byte[] payload,
org.ic4j.agent.requestid.RequestId requestId,
java.util.Map<java.lang.String,java.lang.String> headers) |
abstract void |
close(int code,
java.lang.String reason) |
abstract void |
open() |
java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> |
query(org.ic4j.types.Principal canisterId,
byte[] envelope,
java.util.Map<java.lang.String,java.lang.String> headers) |
java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> |
readState(org.ic4j.types.Principal canisterId,
byte[] envelope,
java.util.Map<java.lang.String,java.lang.String> headers) |
protected void |
send(byte[] payload)
Send a message.
|
void |
sendMessage(java.lang.Object message) |
abstract void |
setMaxIdleTimeout(int timeout) |
java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> |
status() |
protected WebsocketTransport.MessageHandler messageHandler
protected java.net.URI endpointURI
public WebsocketTransport(java.net.URI endpointURI,
org.ic4j.agent.ReplicaTransport httpTransport)
public abstract void open()
public abstract void addMessageHandler(WebsocketTransport.MessageHandler msgHandler)
public abstract void close(int code,
java.lang.String reason)
public abstract void setMaxIdleTimeout(int timeout)
protected void send(byte[] payload)
payload - Byte arraypublic void sendMessage(java.lang.Object message)
public java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> status()
status in interface org.ic4j.agent.ReplicaTransportpublic java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> query(org.ic4j.types.Principal canisterId,
byte[] envelope,
java.util.Map<java.lang.String,java.lang.String> headers)
query in interface org.ic4j.agent.ReplicaTransportpublic java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> call(org.ic4j.types.Principal canisterId,
byte[] payload,
org.ic4j.agent.requestid.RequestId requestId,
java.util.Map<java.lang.String,java.lang.String> headers)
call in interface org.ic4j.agent.ReplicaTransportpublic java.util.concurrent.CompletableFuture<org.ic4j.agent.ReplicaResponse> readState(org.ic4j.types.Principal canisterId,
byte[] envelope,
java.util.Map<java.lang.String,java.lang.String> headers)
readState in interface org.ic4j.agent.ReplicaTransport