Class InputReader

  • All Implemented Interfaces:
    java.lang.Runnable

    public class InputReader
    extends java.lang.Thread
    Reads incoming data from the SSL socket and parses them into distinct strings
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_MESSAGE_TIMOUT  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      InputReader​(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback)
      Instantiate the reader with the default timeout
      InputReader​(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback, int timeout)
      Instantiate the reader with a defined timeout
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Start the thread
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • InputReader

        public InputReader​(java.io.InputStream incomingData,
                           Callback messageCallback,
                           Callback errorCallback)
        Instantiate the reader with the default timeout
        Parameters:
        incomingData - stream of incoming data from the socket
        messageCallback - method to call on a completed message
        errorCallback - method to call if an incoming message is malformed
      • InputReader

        public InputReader​(java.io.InputStream incomingData,
                           Callback messageCallback,
                           Callback errorCallback,
                           int timeout)
        Instantiate the reader with a defined timeout
        Parameters:
        incomingData - stream of incoming data from the socket
        messageCallback - method to call on a completed message
        errorCallback - method to call if an incoming message is malformed
        timeout - timeout from receiving the start of a message before the message is deemed malformed
    • Method Detail

      • run

        public void run()
        Start the thread
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread