public class DtlsManagedClusterConnector extends DtlsClusterConnector
DtlsClusterConnectorConfig.DtlsClusterConnector.ClusterNodesProviderDTLSConnector.Worker| Modifier and Type | Field and Description |
|---|---|
static String |
PROTOCOL_MANAGEMENT_DTLS
Protocol identifier for DTLS management communication.
|
static String |
PROTOCOL_MANAGEMENT_DTLS_MAC
Protocol identifier for DTLS management communication.
|
static String |
PROTOCOL_MANAGEMENT_UDP
Protocol identifier for plain UDP management communication.
|
CLUSTER_ADDRESS_LENGTH_OFFSET, CLUSTER_ADDRESS_OFFSET, CLUSTER_MAC_LENGTH, CLUSTER_PORT_OFFSET, CLUSTER_RECORD_TYPE_OFFSET, clusterHealth, clusterInternalSocket, MAX_ADDRESS_LENGTH, MAX_DATAGRAM_OFFSET, MIN_ADDRESS_LENGTH, RECORD_TYPE_INCOMING, RECORD_TYPE_OUTGOINGconfig, connectionIdGenerator, health, inboundDatagramBufferSize, KEY_TLS_SERVER_HOST_NAME, timerDEFAULT_ETH_MTU, DEFAULT_IPV4_MTU, DEFAULT_IPV6_MTU, IPV4_HEADER_LENGTH, IPV6_HEADER_LENGTH, MAX_MTU| Modifier | Constructor and Description |
|---|---|
|
DtlsManagedClusterConnector(DtlsConnectorConfig configuration,
DtlsClusterConnectorConfig clusterConfiguration)
Create dtls connector with cluster management communication.
|
protected |
DtlsManagedClusterConnector(DtlsConnectorConfig configuration,
DtlsClusterConnectorConfig clusterConfiguration,
ResumptionSupportingConnectionStore connectionStore)
Create dtls connector with dynamic cluster support.
|
|
DtlsManagedClusterConnector(DtlsConnectorConfig configuration,
DtlsClusterConnectorConfig clusterConfiguration,
SessionCache sessionCache)
Create dtls connector with dynamic cluster support.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
calculateClusterMac(Mac mac,
DatagramPacket clusterPacket)
Calculates MAC for forwarded and backwarded messages.
|
void |
destroy()
Destroys the connector.
|
protected int |
getClusterMacLength()
Get cluster MAC length.
|
org.eclipse.californium.elements.ExtendedConnector |
getClusterManagementConnector()
Get cluster management connector.
|
String |
getManagementProtocol()
Get protocol for management connector.
|
protected void |
init(InetSocketAddress bindAddress,
DatagramSocket socket,
Integer mtu)
Initialize socket ad start connector.
|
protected void |
processDatagramFromClusterNetwork(Byte type,
DatagramPacket clusterPacket)
Process received cluster internal message.
|
protected void |
processManagementDatagramFromClusterNetwork(DatagramPacket clusterPacket)
Process cluster internal management message.
|
protected void |
sendDatagramToClusterNetwork(DatagramPacket clusterPacket)
Send cluster internal message.
|
static void |
setClusterMac(Mac mac,
DatagramPacket clusterPacket)
Set cluster MAC in packet.
|
void |
stop()
Stop also socket and threads for cluster internal communication.
|
static boolean |
validateClusterMac(Mac mac,
DatagramPacket clusterPacket)
Validate cluster MAC in packet.
|
createDefaultHealthHandler, ensureLength, getClusterRecordType, getNodeID, processDatagram, sendRecord, setClusterNodesProvider, startReceiverclearConnectionState, close, createConnectionStore, dropReceivedRecord, forceResumeAllSessions, forceResumeSessionFor, getAddress, getMaxDatagramSize, getMaximumFragmentLength, getMaximumTransmissionUnit, getProtocol, getSessionByAddress, isRunning, onInitializeHandshaker, processDatagram, processRecord, receiveNextDatagramFromNetwork, send, sendFlight, sendNextDatagramOverNetwork, setAlertHandler, setEndpointContextMatcher, setExecutor, setRawDataReceiver, start, start, startDropConnectionsForPrincipal, startForEach, startTerminateConnectionsForPrincipal, startTerminateConnectionsForPrincipal, toStringpublic static final String PROTOCOL_MANAGEMENT_UDP
protocol,
getManagementProtocol(),
Constant Field Valuespublic static final String PROTOCOL_MANAGEMENT_DTLS
protocol,
getManagementProtocol(),
Constant Field Valuespublic static final String PROTOCOL_MANAGEMENT_DTLS_MAC
protocol,
getManagementProtocol(),
Constant Field Valuespublic DtlsManagedClusterConnector(DtlsConnectorConfig configuration, DtlsClusterConnectorConfig clusterConfiguration)
configuration - dtls configurationclusterConfiguration - cluster internal connector configurationIllegalArgumentException - if the configuration doesn't provide a
cid generator, or the cid generator only supports, but
doesn't use cids, or the cid generator is no
NodeConnectionIdGenerator.public DtlsManagedClusterConnector(DtlsConnectorConfig configuration, DtlsClusterConnectorConfig clusterConfiguration, SessionCache sessionCache)
configuration - dtls configurationclusterConfiguration - cluster internal connector configurationsessionCache - session cache. May be null.IllegalArgumentException - if the configuration doesn't provide a
cid generator, or the cid generator only supports, but
doesn't use cids, or the cid generator is no
NodeConnectionIdGenerator.protected DtlsManagedClusterConnector(DtlsConnectorConfig configuration, DtlsClusterConnectorConfig clusterConfiguration, ResumptionSupportingConnectionStore connectionStore)
configuration - dtls configurationclusterConfiguration - cluster internal connector configurationconnectionStore - connection storeIllegalArgumentException - if the configuration doesn't provide a
cid generator, or the cid generator only supports, but
doesn't use cids, or the cid generator is no
NodeConnectionIdGenerator.protected void init(InetSocketAddress bindAddress, DatagramSocket socket, Integer mtu) throws IOException
DtlsClusterConnector.startReceiver is true.
Creates socket and threads for cluster internal communication.init in class DtlsClusterConnectorbindAddress - address to bind socketsocket - socketmtu - mtu of socket, or null, if socket implementation
doesn't use a special mtu.IOException - I/O errorpublic void stop()
DtlsClusterConnectorstop in interface org.eclipse.californium.elements.Connectorstop in class DtlsClusterConnectorpublic void destroy()
DTLSConnector
This method invokes DTLSConnector.stop() and clears the ConnectionStore
used to manage connections to peers. Thus, contrary to the behavior specified
for Connector.destroy(), this connector can be re-started using the
DTLSConnector.start() method but subsequent invocations of the DTLSConnector.send(RawData)
method will trigger the establishment of a new connection to the corresponding peer.
destroy in interface org.eclipse.californium.elements.Connectordestroy in class DTLSConnectorprotected int getClusterMacLength()
DtlsClusterConnector.CLUSTER_MAC_LENGTH, if useClusterMac is
true, 0, otherwise.getClusterMacLength in class DtlsClusterConnector0, if cluster MAC is not used.public String getManagementProtocol()
PROTOCOL_MANAGEMENT_UDP,
PROTOCOL_MANAGEMENT_DTLS, or
PROTOCOL_MANAGEMENT_DTLS_MAC.protocolpublic org.eclipse.californium.elements.ExtendedConnector getClusterManagementConnector()
protected void processDatagramFromClusterNetwork(Byte type, DatagramPacket clusterPacket) throws IOException
useClusterMac is enabled.processDatagramFromClusterNetwork in class DtlsClusterConnectortype - cluster record type. DtlsClusterConnector.RECORD_TYPE_INCOMING or
DtlsClusterConnector.RECORD_TYPE_OUTGOING.clusterPacket - cluster internal messageIOException - if an io-error occurred.protected void sendDatagramToClusterNetwork(DatagramPacket clusterPacket) throws IOException
useClusterMac is enabled.sendDatagramToClusterNetwork in class DtlsClusterConnectorclusterPacket - cluster internal messageIOException - if an i/o-error occurred.public static boolean validateClusterMac(Mac mac, DatagramPacket clusterPacket)
mac - initialized MacclusterPacket - packettrue, if MAC is valid, false, otherwise.public static void setClusterMac(Mac mac, DatagramPacket clusterPacket)
mac - initialized MacclusterPacket - packetpublic static byte[] calculateClusterMac(Mac mac, DatagramPacket clusterPacket)
mac - initialized MAC.clusterPacket - forwarded and backwarded messagesIllegalArgumentException - if message is too smallprotected void processManagementDatagramFromClusterNetwork(DatagramPacket clusterPacket) throws IOException
DtlsClusterConnectorprocessManagementDatagramFromClusterNetwork in class DtlsClusterConnectorclusterPacket - cluster internal management message.IOException - if an i/o-error occurredCopyright © 2023 Eclipse Foundation. All rights reserved.