Package io.nem.sdk.infrastructure.okhttp
Class ListenerOkHttp
- java.lang.Object
-
- io.nem.sdk.infrastructure.ListenerBase
-
- io.nem.sdk.infrastructure.okhttp.ListenerOkHttp
-
- All Implemented Interfaces:
io.nem.sdk.api.Listener,java.io.Closeable,java.lang.AutoCloseable
public class ListenerOkHttp extends io.nem.sdk.infrastructure.ListenerBase implements io.nem.sdk.api.ListenerOkHttp implementations of theListener.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description ListenerOkHttp(okhttp3.OkHttpClient httpClient, java.lang.String url, io.nem.sdk.openapi.okhttp_gson.invoker.JSON json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close webSocket connectionjava.util.concurrent.CompletableFuture<java.lang.Void>open()protected voidsubscribeTo(java.lang.String channel)protected io.nem.sdk.model.blockchain.BlockInfotoBlockInfo(java.lang.Object blockInfoDTO)protected io.nem.sdk.model.transaction.TransactiontoTransaction(java.lang.Object transactionInfo)-
Methods inherited from class io.nem.sdk.infrastructure.ListenerBase
aggregateBondedAdded, aggregateBondedAdded, aggregateBondedRemoved, confirmed, confirmed, cosignatureAdded, getJsonHelper, getMessageSubject, getUid, handle, newBlock, setUid, status, transactionFromAddress, unconfirmedAdded, unconfirmedRemoved
-
-
-
-
Method Detail
-
open
public java.util.concurrent.CompletableFuture<java.lang.Void> open()
- Specified by:
openin interfaceio.nem.sdk.api.Listener- Returns:
- a
CompletableFuturethat resolves when the websocket connection is opened
-
toBlockInfo
protected io.nem.sdk.model.blockchain.BlockInfo toBlockInfo(java.lang.Object blockInfoDTO)
- Specified by:
toBlockInfoin classio.nem.sdk.infrastructure.ListenerBase
-
toTransaction
protected io.nem.sdk.model.transaction.Transaction toTransaction(java.lang.Object transactionInfo)
- Specified by:
toTransactionin classio.nem.sdk.infrastructure.ListenerBase
-
close
public void close()
Close webSocket connection- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceio.nem.sdk.api.Listener
-
subscribeTo
protected void subscribeTo(java.lang.String channel)
- Specified by:
subscribeToin classio.nem.sdk.infrastructure.ListenerBase
-
-