Class AbstractConnection

    • Constructor Detail

      • AbstractConnection

        public AbstractConnection()
    • Method Detail

      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Default implementation returns null.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • checkRequest

        protected String checkRequest​(RemoteCommand cmd)
        Hook method that checks the request command and setup for sending it.
        Parameters:
        cmd - the command to check
        Returns:
        null if successful, otherwise error message
      • doSendRequest

        protected abstract String doSendRequest​(RemoteCommand cmd,
                                                RemoteCommandProcessor processor)
        Sends the request command.
        Parameters:
        cmd - the command to send
        processor - the processor for formatting/parsing
        Returns:
        null if successful, otherwise error message
      • sendRequest

        public String sendRequest​(RemoteCommand cmd,
                                  RemoteCommandProcessor processor)
        Sends the request command.
        Specified by:
        sendRequest in interface Connection
        Parameters:
        cmd - the command to send
        processor - the processor for formatting/parsing
        Returns:
        null if successful, otherwise error message
      • checkResponse

        protected String checkResponse​(RemoteCommand cmd)
        Hook method that checks the response command and setup for sending it.
        Parameters:
        cmd - the command to check
        Returns:
        null if successful, otherwise error message
      • doSendResponse

        protected abstract String doSendResponse​(RemoteCommand cmd,
                                                 RemoteCommandProcessor processor)
        Sends the response command.
        Parameters:
        cmd - the command to send
        processor - the processor for formatting/parsing
        Returns:
        null if successful, otherwise error message
      • sendResponse

        public String sendResponse​(RemoteCommand cmd,
                                   RemoteCommandProcessor processor)
        Sends the response command.
        Specified by:
        sendResponse in interface Connection
        Parameters:
        cmd - the command to send
        processor - the processor for formatting/parsing
        Returns:
        null if successful, otherwise error message
      • compareTo

        public int compareTo​(Connection o)
        Compares this connection with the other one using the commandline string.
        Specified by:
        compareTo in interface Comparable<Connection>
        Parameters:
        o - the other connection
        Returns:
        less than zero, equal to zero or greater than zero if the commandline string is less, equal or greater than this one
      • equals

        public boolean equals​(Object o)
        Checks whether the object is the same as this one.
        Overrides:
        equals in class Object
        Parameters:
        o - the other object
        Returns:
        true if also a connection object and the same commandline
        See Also:
        compareTo(Connection)
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Default implementation does nothing.
        Specified by:
        cleanUp in interface CleanUpHandler