Class SocketEndPoint
java.lang.Object
ch.nolix.base.net.baseendpoint.AbstractBaseEndPoint
ch.nolix.base.net.senderandreceiverserver.AbstractEndPoint
ch.nolix.base.net.senderandreceiverserver.AbstractNetEndPoint
ch.nolix.base.net.senderandreceiverserver.SocketEndPoint
- All Implemented Interfaces:
BaseEndPoint, ConnectionTypeHolder, SecurityModeHolder, EndPoint, Closeable, GroupCloseable, OpennessRequestable, AutoCloseable
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidLets the currentGroupCloseablenote a close.static SocketEndPointstatic SocketEndPointtoHostAndPortAndDefaultSlot(String host, int port) static SocketEndPointtoHostAndPortAndSlot(String host, int port, String slot) static SocketEndPointtoLocalHostAndPortAndDefaultSlot(int port) static SocketEndPointtoLocalHostAndPortAndSlot(int port, String slot) static SocketEndPointwithSocketAndSocketInputStreamAndSocketOutputStream(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream) static SocketEndPointwithSocketAndSocketInputStreamAndSocketOutputStreamAndSlot(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream, String slot) Methods inherited from class AbstractNetEndPoint
sendMessageMethods inherited from class AbstractEndPoint
getCustomTargetSlot, hasCustomTargetSlot, hasReceiver, setReceiverMethods inherited from class AbstractBaseEndPoint
getStoredCloseController, getTargetSlotDefinitionType, hasDefaultTargetSlot, isBackendEndPoint, isFrontendEndPoint, isLocalEndPoint, isSocketEndPoint, isWebSocketEndPointMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseEndPoint
getTargetSlotDefinitionType, hasDefaultTargetSlot, isBackendEndPoint, isFrontendEndPoint, isLocalEndPoint, isSocketEndPoint, isWebSocketEndPointMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, getStoredCloseController, isClosedMethods inherited from interface OpennessRequestable
isOpen
-
Method Details
-
toHostAndHttpPortAndDefaultSlot
- Parameters:
host-- Returns:
- a new
SocketEndPointthat will connect to the default slot on the HTTP port on the given host.
-
toHostAndPortAndDefaultSlot
- Parameters:
host-port-- Returns:
- a new
SocketEndPointthat 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]
-
toHostAndPortAndSlot
- Parameters:
host-port-slot-- Returns:
- a new
SocketEndPointthat 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 nullRuntimeException- if the given slot is blank
-
toLocalHostAndPortAndDefaultSlot
- Parameters:
port-- Returns:
- a new
SocketEndPointthat 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]
-
toLocalHostAndPortAndSlot
- Parameters:
port-slot-- Returns:
- a new
SocketEndPointthat 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 slot null or blank
-
withSocketAndSocketInputStreamAndSocketOutputStream
public static SocketEndPoint withSocketAndSocketInputStreamAndSocketOutputStream(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream) - Parameters:
socket-socketInputStream-socketOutputStream-- Returns:
- a new
AbstractNetEndPointwith the given socket. The given socketInputStream and the given socketOutputStream belong to the given socket - Throws:
RuntimeException- if the given socket is nullRuntimeException- if the given socketInputStream is nullRuntimeException- if the given socketOutputStream is null
-
withSocketAndSocketInputStreamAndSocketOutputStreamAndSlot
public static SocketEndPoint withSocketAndSocketInputStreamAndSocketOutputStreamAndSlot(Socket socket, InputStream socketInputStream, OutputStream socketOutputStream, String slot) - Parameters:
socket-socketInputStream-socketOutputStream-slot-- Returns:
- a new
AbstractNetEndPointwith the given socket and slot. The given socketInputStream and the given socketOutputStream belong to the given socket - Throws:
RuntimeException- if the given socket is nullRuntimeException- if the given socketInputStream is nullRuntimeException- if the given socketOutputStream is nullRuntimeException- if the given slot is null or blank
-
getPeerType
-
getConnectionType
- Returns:
- the
ConnectionTypeof the currentConnectionTypeHolder
-
getSecurityMode
- Returns:
- the
SecurityModeof the currentSecurityModeHolder
-
noteClose
public void noteClose()Lets the currentGroupCloseablenote a close.
-