Class HttpClientConnector

java.lang.Object
org.nustaq.kontraktor.remoting.http.HttpClientConnector
All Implemented Interfaces:
org.nustaq.kontraktor.remoting.base.ActorClientConnector

public class HttpClientConnector
extends java.lang.Object
implements org.nustaq.kontraktor.remoting.base.ActorClientConnector
Created by ruedi on 13/05/15. Long Poll, http 1.1 based connectivity with on top sequencing + reordering. Designed to handle network outages and crappy connectivity. This implies once it successfully connected, it won't go to "closed" except a session timeout/close happened (=>404) (even if server has been stopped after connection) TODO: proxy options TODO: provide 1.7 compliant Android client impl
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  HttpClientConnector.HttpClientActor  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncHttpClient  
    java.lang.Object[] authData  
    static boolean DumpProtocol  
    static int MAX_CONN_PER_ROUTE  
    static int MAX_CONN_TOTAL  

    Fields inherited from interface org.nustaq.kontraktor.remoting.base.ActorClientConnector

    OBJECT_MAX_BATCH_SIZE
  • Constructor Summary

    Constructors 
    Constructor Description
    HttpClientConnector​(HttpConnectable httpConnectable)  
  • Method Summary

    Modifier and Type Method Description
    org.nustaq.kontraktor.IPromise closeClient()  
    org.nustaq.kontraktor.IPromise connect​(java.util.function.Function<org.nustaq.kontraktor.remoting.base.ObjectSocket,​org.nustaq.kontraktor.remoting.base.ObjectSink> factory)  
    static org.apache.http.impl.nio.client.CloseableHttpAsyncClient getClient()  
    static HttpClientConnector.HttpClientActor getReceiveActor()  
    static HttpClientConnector.HttpClientActor getRefPollActor()  
    protected void startLongPoll​(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getClient

      public static org.apache.http.impl.nio.client.CloseableHttpAsyncClient getClient()
    • connect

      public org.nustaq.kontraktor.IPromise connect​(java.util.function.Function<org.nustaq.kontraktor.remoting.base.ObjectSocket,​org.nustaq.kontraktor.remoting.base.ObjectSink> factory) throws java.lang.Exception
      Specified by:
      connect in interface org.nustaq.kontraktor.remoting.base.ActorClientConnector
      Throws:
      java.lang.Exception
    • startLongPoll

      protected void startLongPoll​(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS)
    • closeClient

      public org.nustaq.kontraktor.IPromise closeClient()
      Specified by:
      closeClient in interface org.nustaq.kontraktor.remoting.base.ActorClientConnector
    • getReceiveActor

      public static HttpClientConnector.HttpClientActor getReceiveActor()
    • getRefPollActor

      public static HttpClientConnector.HttpClientActor getRefPollActor()