Class NetEndPoint

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

public final class NetEndPoint extends AbstractEndPoint
A NetEndPoint is a AbstractEndPoint that can send messages to an other NetEndPoint.
Author:
Silvan Wyss
  • Method Details

    • toGivenHostAndGivenPortAndDefaultSlot

      public static NetEndPoint toGivenHostAndGivenPortAndDefaultSlot(String host, int port)
      Parameters:
      host -
      port -
      Returns:
      a new NetEndPoint 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 NetEndPoint toGivenHostAndGivenPortAndGivenSlot(String host, int port, String slot)
      Parameters:
      host -
      port -
      slot -
      Returns:
      a new NetEndPoint 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 NetEndPoint toGivenHostAndHttpPortAndDefaultSlot(String host)
      Parameters:
      host -
      Returns:
      a new NetEndPoint that will connect to the default slot on the HTTP port on the given host.
    • toLocalMachineAndGivenPortAndDefaultSlot

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

      public static NetEndPoint toLocalMachineAndGivenPortAndGivenSlot(int port, String slot)
      Parameters:
      port -
      slot -
      Returns:
      a new NetEndPoint 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 slot is null or blank.
    • getConnectionType

      public ConnectionType getConnectionType()
    • getCustomTargetSlot

      public String getCustomTargetSlot()
      Returns:
      the target of the current NetEndPoint.
      Throws:
      ArgumentDoesNotHaveAttributeException - if this net end point does not have a target.
    • getPeerType

      public PeerType getPeerType()
    • getSecurityMode

      public SecurityMode getSecurityMode()
    • getReplyForRequest

      public String getReplyForRequest(String message)
      Sends the given message and returns the reply.
      Parameters:
      message -
      Returns:
      the reply to the given message if the current NetEndPoint stays connected, null otherwise.
    • hasCustomTargetSlot

      public boolean hasCustomTargetSlot()