Class ListenerVertx

  • All Implemented Interfaces:
    io.nem.symbol.sdk.api.Listener, java.io.Closeable, java.lang.AutoCloseable

    public class ListenerVertx
    extends io.nem.symbol.sdk.infrastructure.ListenerBase
    implements io.nem.symbol.sdk.api.Listener
    Vertx implementations of the Listener.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ListenerVertx​(io.vertx.core.http.HttpClient httpClient, java.lang.String url, io.nem.symbol.sdk.api.NamespaceRepository namespaceRepository, io.nem.symbol.sdk.api.MultisigRepository multisigRepository, io.reactivex.Observable<io.nem.symbol.sdk.model.network.NetworkType> networkTypeObservable)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close webSocket connection
      java.util.concurrent.CompletableFuture<java.lang.Void> open()  
      protected void subscribeTo​(java.lang.String channel)  
      protected io.nem.symbol.sdk.model.blockchain.BlockInfo toBlockInfo​(java.lang.Object blockInfoDTO)  
      protected io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction toCosignatureSignedTransaction​(java.lang.Object cosignatureJson, io.nem.symbol.sdk.model.network.NetworkType networkType)  
      protected io.nem.symbol.sdk.model.blockchain.FinalizedBlock toFinalizedBlock​(java.lang.Object blockInfoDTO)  
      protected io.nem.symbol.sdk.model.transaction.Transaction toTransaction​(io.nem.symbol.sdk.model.transaction.TransactionGroup group, java.lang.Object transactionInfo)  
      • Methods inherited from class io.nem.symbol.sdk.infrastructure.ListenerBase

        aggregateBondedAdded, aggregateBondedAddedOrError, aggregateBondedRemoved, basicSubscribe, confirmed, confirmedOrError, cosignatureAdded, finalizedBlock, getAllAddressesAndAliases, getAllMultisigAddressesAndAliases, getJsonHelper, getMessageSubject, getUid, handle, newBlock, setUid, status, subscribe, subscribeMultipleAddresses, unconfirmedAdded, unconfirmedRemoved
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.nem.symbol.sdk.api.Listener

        aggregateBondedAdded, aggregateBondedAdded, aggregateBondedAddedOrError, aggregateBondedRemoved, aggregateBondedRemoved, confirmed, confirmed, confirmedOrError, cosignatureAdded, cosignatureAdded, finalizedBlock, getAllAddressesAndAliases, getAllMultisigAddressesAndAliases, getUid, newBlock, status, status, subscribe, subscribeMultipleAddresses, unconfirmedAdded, unconfirmedAdded, unconfirmedRemoved, unconfirmedRemoved
    • Constructor Detail

      • ListenerVertx

        public ListenerVertx​(io.vertx.core.http.HttpClient httpClient,
                             java.lang.String url,
                             io.nem.symbol.sdk.api.NamespaceRepository namespaceRepository,
                             io.nem.symbol.sdk.api.MultisigRepository multisigRepository,
                             io.reactivex.Observable<io.nem.symbol.sdk.model.network.NetworkType> networkTypeObservable)
        Parameters:
        httpClient - the http client instance.
        url - of the host
        namespaceRepository - the namespace repository used to resolve alias.
        multisigRepository - the namespace repository used to resolve cosigners.
        networkTypeObservable - the network type
    • Method Detail

      • open

        public java.util.concurrent.CompletableFuture<java.lang.Void> open()
        Specified by:
        open in interface io.nem.symbol.sdk.api.Listener
        Returns:
        a CompletableFuture that resolves when the websocket connection is opened
      • toBlockInfo

        protected io.nem.symbol.sdk.model.blockchain.BlockInfo toBlockInfo​(java.lang.Object blockInfoDTO)
        Specified by:
        toBlockInfo in class io.nem.symbol.sdk.infrastructure.ListenerBase
      • toFinalizedBlock

        protected io.nem.symbol.sdk.model.blockchain.FinalizedBlock toFinalizedBlock​(java.lang.Object blockInfoDTO)
        Specified by:
        toFinalizedBlock in class io.nem.symbol.sdk.infrastructure.ListenerBase
      • toTransaction

        protected io.nem.symbol.sdk.model.transaction.Transaction toTransaction​(io.nem.symbol.sdk.model.transaction.TransactionGroup group,
                                                                                java.lang.Object transactionInfo)
        Specified by:
        toTransaction in class io.nem.symbol.sdk.infrastructure.ListenerBase
      • toCosignatureSignedTransaction

        protected io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction toCosignatureSignedTransaction​(java.lang.Object cosignatureJson,
                                                                                                                  io.nem.symbol.sdk.model.network.NetworkType networkType)
        Specified by:
        toCosignatureSignedTransaction in class io.nem.symbol.sdk.infrastructure.ListenerBase
      • close

        public void close()
        Close webSocket connection
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface io.nem.symbol.sdk.api.Listener
      • subscribeTo

        protected void subscribeTo​(java.lang.String channel)
        Specified by:
        subscribeTo in class io.nem.symbol.sdk.infrastructure.ListenerBase