Class SocketEndPoint

All Implemented Interfaces:
IBaseEndPoint, IEndPoint, Closeable, CloseStateRequestable, GroupCloseable, AutoCloseable

public final class SocketEndPoint extends AbstractNetEndPoint
Author:
Silvan Wyss
  • Method Details

    • toGivenHostAndGivenPortAndDefaultSlot

      public static SocketEndPoint toGivenHostAndGivenPortAndDefaultSlot(String host, int port)
      Parameters:
      host -
      port -
      Returns:
      a new SocketEndPoint that will connect to the default slot on the given port on the given host.
      Throws:
      RuntimeException - if the given port is not in [0, 65535].
    • toGivenHostAndGivenPortAndGivenSlot

      public static SocketEndPoint toGivenHostAndGivenPortAndGivenSlot(String host, int port, String slot)
      Parameters:
      host -
      port -
      slot -
      Returns:
      a new SocketEndPoint that will connect to the given slot on the given port on the given host.
      Throws:
      RuntimeException - if the given port is not in [0, 65535].
      RuntimeException - if the given slot is null.
      RuntimeException - if the given slot is blank.
    • toGivenHostAndHttpPortAndDefaultSlot

      public static SocketEndPoint toGivenHostAndHttpPortAndDefaultSlot(String host)
      Parameters:
      host -
      Returns:
      a new SocketEndPoint that will connect to the default slot on the HTTP port on the given host.
    • toLocaleMachineAndGivenPortAndDefaultSlot

      public static SocketEndPoint toLocaleMachineAndGivenPortAndDefaultSlot(int port)
      Parameters:
      port -
      Returns:
      a new SocketEndPoint that will connect to the default slot on the given port on the locale machine.
      Throws:
      RuntimeException - if the given port is not in [0, 65535].
    • toLocalMachineAndGivenPortAndGivenSlot

      public static SocketEndPoint toLocalMachineAndGivenPortAndGivenSlot(int port, String slot)
      Parameters:
      port -
      slot -
      Returns:
      a new SocketEndPoint that will connect to the given slot on the given port on the local machine.
      Throws:
      RuntimeException - if the given port is not in [0, 65535].
      RuntimeException - if the given target slot null.
      RuntimeException - if the given target slot blank.
    • withSocketAndSocketInputStreamAndSocketOutputStream

      public static SocketEndPoint withSocketAndSocketInputStreamAndSocketOutputStream(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream)
      Parameters:
      socket -
      socketInputStream -
      socketOutputStream -
      Returns:
      a new AbstractNetEndPoint with the given socket. The given socketInputStream and the given socketOutputStream belong to the given socket.
      Throws:
      RuntimeException - if the given socket is null.
      RuntimeException - if the given socketInputStream is null.
      RuntimeException - if the given socketOutputStream is null.
    • withSocketAndSocketInputStreamAndSocketOutputStreamAndTarget

      public static SocketEndPoint withSocketAndSocketInputStreamAndSocketOutputStreamAndTarget(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream, String target)
      Parameters:
      socket -
      socketInputStream -
      socketOutputStream -
      target -
      Returns:
      a new AbstractNetEndPoint with the given socket and target. The given socketInputStream and the given socketOutputStream belong to the given socket.
      Throws:
      RuntimeException - if the given socket is null.
      RuntimeException - if the given socketInputStream is null.
      RuntimeException - if the given socketOutputStream is null.
      RuntimeException - if the given target is null.
      RuntimeException - if the given target is blank.
    • getPeerType

      public PeerType getPeerType()
    • getConnectionType

      public ConnectionType getConnectionType()
    • getSecurityMode

      public SecurityMode getSecurityMode()
    • noteClose

      public void noteClose()
      Lets the current GroupCloseable note a close.