Class HttpObjectSocket

java.lang.Object
org.nustaq.kontraktor.remoting.websockets.WebObjectSocket
org.nustaq.kontraktor.remoting.http.HttpObjectSocket
All Implemented Interfaces:
org.nustaq.kontraktor.remoting.base.ObjectSink, org.nustaq.kontraktor.remoting.base.ObjectSocket

public class HttpObjectSocket extends WebObjectSocket implements org.nustaq.kontraktor.remoting.base.ObjectSink
Created by ruedi on 12.05.2015. bidirectional http longpoll based objectsocket backed by a binary queue.
  • Field Details

    • LP_TIMEOUT

      public static int LP_TIMEOUT
    • HISTORY_SIZE

      public static int HISTORY_SIZE
    • HTTP_BATCH_SIZE

      public static int HTTP_BATCH_SIZE
  • Constructor Details

    • HttpObjectSocket

      public HttpObjectSocket(String sessionId, Runnable closeAction)
  • Method Details

    • getSessionId

      public String getSessionId()
    • updateTimeStamp

      public void updateTimeStamp()
    • updateLastRemoteCallTimeStamp

      public void updateLastRemoteCallTimeStamp()
    • getLastRemoteCallMS

      public long getLastRemoteCallMS()
    • getLastUse

      public long getLastUse()
    • sendBinary

      public void sendBinary(byte[] message)
      Specified by:
      sendBinary in class WebObjectSocket
    • writeObject

      public void writeObject(Object toWrite) throws Exception
      Specified by:
      writeObject in interface org.nustaq.kontraktor.remoting.base.ObjectSocket
      Overrides:
      writeObject in class WebObjectSocket
      Throws:
      Exception
    • close

      public void close() throws IOException
      Specified by:
      close in interface org.nustaq.kontraktor.remoting.base.ObjectSocket
      Throws:
      IOException
    • getId

      public int getId()
      Specified by:
      getId in interface org.nustaq.kontraktor.remoting.base.ObjectSocket
    • getConnectionIdentifier

      public String getConnectionIdentifier()
      Specified by:
      getConnectionIdentifier in interface org.nustaq.kontraktor.remoting.base.ObjectSocket
    • setSink

      public void setSink(org.nustaq.kontraktor.remoting.base.ObjectSink sink)
    • getSink

      public org.nustaq.kontraktor.remoting.base.ObjectSink getSink()
    • getNextQueuedMessage

      public org.nustaq.kontraktor.util.Pair<byte[],Integer> getNextQueuedMessage()
    • checkThread

      protected void checkThread()
    • getLongPollTask

      public org.nustaq.kontraktor.util.Pair<Runnable,KHttpExchange> getLongPollTask()
    • cancelLongPoll

      public void cancelLongPoll()
    • triggerLongPoll

      public void triggerLongPoll()
    • setLongPollTask

      public void setLongPollTask(org.nustaq.kontraktor.util.Pair<Runnable,KHttpExchange> longPollTask)
    • getLongPollTaskTime

      public long getLongPollTaskTime()
    • receiveObject

      public void receiveObject(org.nustaq.kontraktor.remoting.base.ObjectSink asink, Object received, List<org.nustaq.kontraktor.IPromise> createdFutures, Object securityContext)
      Specified by:
      receiveObject in interface org.nustaq.kontraktor.remoting.base.ObjectSink
    • sinkClosed

      public void sinkClosed()
      Specified by:
      sinkClosed in interface org.nustaq.kontraktor.remoting.base.ObjectSink
    • takeStoredLPMessage

      public Object takeStoredLPMessage(int seq)
    • storeLPMessage

      public void storeLPMessage(int inSequence, Object msg)
    • flush

      public void flush() throws Exception
      Specified by:
      flush in interface org.nustaq.kontraktor.remoting.base.ObjectSocket
      Overrides:
      flush in class WebObjectSocket
      Throws:
      Exception