public final class UdpChannel extends Object
ChannelUri
.ChannelUri
,
ChannelUriStringBuilder
Modifier and Type | Method and Description |
---|---|
String |
canonicalForm()
The canonical form for the channel
|
static String |
canonicalise(String localParamValue,
InetSocketAddress localData,
String remoteParamValue,
InetSocketAddress remoteData)
Return a string which is a canonical form of the channel suitable for use as a file or directory
name and also as a method of hashing, etc.
|
ChannelUri |
channelUri()
Get the
ChannelUri for this channel. |
String |
description()
Used for debugging to get a human readable description of the channel.
|
static InetSocketAddress |
destinationAddress(ChannelUri uri,
NameResolver nameResolver)
Get the endpoint destination address from the URI.
|
boolean |
equals(Object o)
Channels are considered equal if the
canonicalForm() is equal. |
boolean |
hasExplicitControl()
Does the channel have an explicit control address as used with multi-destination-cast or not?
|
boolean |
hasExplicitEndpoint()
Does the channel have an explicit endpoint address?
|
int |
hashCode()
The hash code for the
canonicalForm() . |
boolean |
hasMulticastTtl()
Has this channel got a multicast TTL value set so that
multicastTtl() is valid. |
boolean |
hasTag()
Has the URI a tag to indicate entity relationships and if
tag() is valid. |
boolean |
isDynamicControlMode()
Does the channel have dynamic control mode specified.
|
boolean |
isManualControlMode()
Does the channel have manual control mode specified.
|
boolean |
isMulticast()
Is the channel UDP multicast.
|
boolean |
isMultiDestination()
Is the channel configured as multi-destination.
|
InetSocketAddress |
localControl()
Local control address and port.
|
InetSocketAddress |
localData()
Local data address and port.
|
NetworkInterface |
localInterface()
Local interface to be used by the channel.
|
boolean |
matchesTag(UdpChannel udpChannel)
Does this channel have a tag match to another channel having INADDR_ANY endpoints.
|
int |
multicastTtl()
Multicast TTL value.
|
String |
originalUriString()
Original URI of the channel URI.
|
static UdpChannel |
parse(String channelUriString)
Parse channel URI and create a
UdpChannel using the default name resolver.. |
static UdpChannel |
parse(String channelUriString,
NameResolver nameResolver)
Parse channel URI and create a
UdpChannel . |
static UdpChannel |
parse(String channelUriString,
NameResolver nameResolver,
boolean isDestination)
Parse channel URI and create a
UdpChannel . |
static int |
parseBufferLength(ChannelUri channelUri,
String paramName)
Parse a buffer length for a given URI paramName with a format specified by
SystemUtil.parseSize(String, String) , clamping the range to 0 <= x <= Integer.MAX_VALUE. |
ProtocolFamily |
protocolFamily()
Get the
ProtocolFamily for this channel. |
int |
receiverWindowLength()
Get the receiver window length used as the initial window length for congestion control.
|
int |
receiverWindowLengthOrDefault(int defaultValue)
Get the receiver window length used as the initial window length for congestion control.
|
InetSocketAddress |
remoteControl()
Remote control address information
|
InetSocketAddress |
remoteData()
Remote data address and port.
|
static InetSocketAddress |
resolve(String endpoint,
String uriParamName,
boolean isReResolution,
NameResolver nameResolver)
Resolve and endpoint into a
InetSocketAddress . |
int |
socketRcvbufLength()
Get the socket receive buffer length.
|
int |
socketRcvbufLengthOrDefault(int defaultValue)
Get the socket receive buffer length.
|
int |
socketSndbufLength()
Get the socket send buffer length.
|
int |
socketSndbufLengthOrDefault(int defaultValue)
Get the socket send buffer length.
|
long |
tag()
Get the tag value on the channel which is only valid if
hasTag() is true. |
String |
toString()
The
canonicalForm() for the channel. |
public static UdpChannel parse(String channelUriString)
UdpChannel
using the default name resolver..channelUriString
- to parse.UdpChannel
as the result of parsing.InvalidChannelException
- if an error occurs.public static UdpChannel parse(String channelUriString, NameResolver nameResolver)
UdpChannel
.channelUriString
- to parse.nameResolver
- to use for resolving names.UdpChannel
as the result of parsing.InvalidChannelException
- if an error occurs.public static UdpChannel parse(String channelUriString, NameResolver nameResolver, boolean isDestination)
UdpChannel
.channelUriString
- to parse.nameResolver
- to use for resolving names.isDestination
- to identify if it is a destination within a channel.UdpChannel
as the result of parsing.InvalidChannelException
- if an error occurs.public static int parseBufferLength(ChannelUri channelUri, String paramName)
SystemUtil.parseSize(String, String)
, clamping the range to 0 <= x <= Integer.MAX_VALUE.channelUri
- to get the value fromparamName
- key for the parameterSystemUtil.parseSize(String, String)
public static String canonicalise(String localParamValue, InetSocketAddress localData, String remoteParamValue, InetSocketAddress remoteData)
The general format is: UDP-interface:localPort-remoteAddress:remotePort
localParamValue
- interface or MDC control param value or null for not set.localData
- address/interface for the channel.remoteParamValue
- endpoint param value or null if not set.remoteData
- address for the channel.public InetSocketAddress remoteData()
public InetSocketAddress localData()
public InetSocketAddress remoteControl()
public InetSocketAddress localControl()
public ChannelUri channelUri()
ChannelUri
for this channel.ChannelUri
for this channel.public boolean hasMulticastTtl()
multicastTtl()
is valid.public int multicastTtl()
public String canonicalForm()
public String toString()
canonicalForm()
for the channel.toString
in class Object
canonicalForm()
for the channel.public boolean isMulticast()
public NetworkInterface localInterface()
NetworkInterface
for the local interface used by the channel.public String originalUriString()
public ProtocolFamily protocolFamily()
ProtocolFamily
for this channel.ProtocolFamily
for this channel.public long tag()
hasTag()
is true.public boolean isManualControlMode()
public boolean isDynamicControlMode()
public boolean hasExplicitEndpoint()
public boolean hasExplicitControl()
public boolean hasTag()
tag()
is valid.public boolean isMultiDestination()
public int socketRcvbufLength()
public int socketRcvbufLengthOrDefault(int defaultValue)
defaultValue
- to be used if the UdpChannel's value is 0 (unspecified).public int socketSndbufLength()
public int socketSndbufLengthOrDefault(int defaultValue)
defaultValue
- to be used if the UdpChannel's value is 0 (unspecified).public int receiverWindowLength()
public int receiverWindowLengthOrDefault(int defaultValue)
defaultValue
- to be used if the UdpChannel's value is 0 (unspecified).public boolean matchesTag(UdpChannel udpChannel)
udpChannel
- to match against.public String description()
public boolean equals(Object o)
canonicalForm()
is equal.equals
in class Object
o
- object to be compared with.canonicalForm()
is equal, otherwise false.public int hashCode()
canonicalForm()
.hashCode
in class Object
canonicalForm()
.public static InetSocketAddress destinationAddress(ChannelUri uri, NameResolver nameResolver)
uri
- to check.nameResolver
- to use for resolutionpublic static InetSocketAddress resolve(String endpoint, String uriParamName, boolean isReResolution, NameResolver nameResolver) throws UnknownHostException
InetSocketAddress
.endpoint
- to resolveuriParamName
- for the resolutionisReResolution
- for the resolutionnameResolver
- to be used for hostname.UnknownHostException
- if the endpoint can not be resolved.Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.