Class NetworkConnection

java.lang.Object
org.teamapps.cluster.core.NetworkConnection
All Implemented Interfaces:
Connection, org.teamapps.protocol.file.FileProvider, org.teamapps.protocol.file.FileSink

public class NetworkConnection
extends java.lang.Object
implements Connection
  • Field Details

  • Constructor Details

    • NetworkConnection

      public NetworkConnection​(java.net.Socket socket, MessageQueue messageQueue, ConnectionHandler connectionHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret)
    • NetworkConnection

      public NetworkConnection​(HostAddress hostAddress, MessageQueue messageQueue, ConnectionHandler connectionHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret)
  • Method Details

    • handleSocket

      protected void handleSocket​(java.net.Socket socket)
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface Connection
    • close

      public void close()
      Specified by:
      close in interface Connection
    • getLastMessageTimestamp

      public long getLastMessageTimestamp()
      Specified by:
      getLastMessageTimestamp in interface Connection
    • getSentBytes

      public long getSentBytes()
      Specified by:
      getSentBytes in interface Connection
    • getReceivedBytes

      public long getReceivedBytes()
      Specified by:
      getReceivedBytes in interface Connection
    • getSentMessages

      public long getSentMessages()
      Specified by:
      getSentMessages in interface Connection
    • getReceivedMessages

      public long getReceivedMessages()
      Specified by:
      getReceivedMessages in interface Connection
    • sendKeepAlive

      public void sendKeepAlive()
      Specified by:
      sendKeepAlive in interface Connection
    • getFile

      public java.io.File getFile​(java.lang.String fileId)
      Specified by:
      getFile in interface org.teamapps.protocol.file.FileProvider
    • handleFile

      public java.lang.String handleFile​(java.io.File file) throws java.io.IOException
      Specified by:
      handleFile in interface org.teamapps.protocol.file.FileSink
      Throws:
      java.io.IOException