Top Description Inners Fields Constructors Methods
org.newsclub.net.unix

public final Class AFTIPCSocketAddress

extends AFSocketAddress
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, .Serializable, java.net.InetAddress, .InetSocketAddress, .SocketAddress, .SocketException, .URI, java.nio.ByteBuffer, java.util.Arrays, .HashSet, .Locale, .Objects, .Set, java.util.regex.Matcher, .Pattern, org.eclipse.jdt.annotation.NonNull, .NonNullByDefault, org.newsclub.net.unix.pool.ObjectPool.Lease

An AFSocketAddress for TIPC sockets. The TIPC socket API provides three different address types:

When binding a socket to a service address or address range, the visibility scope of the binding must be indicated. There are two options, Scope#SCOPE_NODE if the user only wants node local visibility, and Scope#SCOPE_CLUSTER if he wants cluster global visibility. There are almost no limitations to how sockets can be bound to service addresses: one socket can be bound to many addresses or ranges, and many sockets can be bound to the same address or range.

The service types 0 through 63 are however reserved for system internal use, and are not available for user space applications.

When sending a message by service address the sender may indicate a lookup domain, also called lookup scope. This is a node hash number, limiting the set of eligible destination sockets to the indicated node. If this value is zero, all matching sockets in the whole cluster, as visible from the source node, are eligible.

Author
Christian Kohlschütter (documentation credits to Jon Maloy and the TIPC team).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AFTIPCSocketAddress.AddressType

The TIPC address type.

public static class
AFTIPCSocketAddress.Scope

The TIPC visibility scope.

Field Summary

Modifier and TypeField and Description
private static AFAddressFamily<AFTIPCSocketAddress>
private static final Pattern
private static final long
public static final int
TIPC_RESERVED_TYPES

The lowest user-publishable name type.

public static final int
TIPC_TOP_SRV

The "topology" service name type.

Inherited from org.newsclub.net.unix.AFSocketAddress:
INTERNAL_DUMMY_BINDINTERNAL_DUMMY_CONNECTINTERNAL_DUMMY_DONT_CONNECTSOCKETADDRESS_BUFFER_TL

Constructor Summary

AccessConstructor and Description
private
AFTIPCSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress)

Method Summary

Modifier and TypeMethod and Description
public static synchronized AFAddressFamily<AFTIPCSocketAddress>

Returns:

The address family instance.
addressFamily
()

Returns the corresponding AFAddressFamily.

public File
getFile()

Implements abstract org.newsclub.net.unix.AFSocketAddress.getFile.

Returns the File corresponding with this address, if possible.

public AFTIPCSocketAddress.Scope

Returns:

The scope.
getScope
()

Returns the scope of this address.

public int

Returns:

The domain identifier.
getTIPCDomain
()

Returns the TIPC domain part of this address.

public int

Returns:

The instance identifier.
getTIPCInstance
()

Returns the TIPC instance part of this address.

public int

Returns:

The lower instance identifier.
getTIPCLower
()

Returns the TIPC lower instance of this address.

public int

Returns:

The node hash.
getTIPCNodeHash
()

Returns the TIPC node hash of this address.

public int

Returns:

The ref identifier.
getTIPCRef
()

Returns the TIPC ref of this address.

public int

Returns:

The type identifier
getTIPCType
()

Returns the TIPC type part of this address.

public int

Returns:

The lower instance identifier.
getTIPCUpper
()

Returns the TIPC upper instance of this address.

public boolean
hasFilename()

Implements abstract org.newsclub.net.unix.AFSocketAddress.hasFilename.

Checks if the address can be resolved to a File.

public static boolean

Returns:

true if so.
isSupportedAddress
(InetAddress
The instance to check.
addr
)

Checks if an InetAddress can be unwrapped to an AFTIPCSocketAddress.

public static boolean

Returns:

true if so.
isSupportedAddress
(SocketAddress
The instance to check.
addr
)

Checks if a SocketAddress can be unwrapped to an AFTIPCSocketAddress.

private static AFTIPCSocketAddress
newAFSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress)

public static AFTIPCSocketAddress

Returns:

The address.
of
(URI
The URI.
uri
)

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFTIPCSocketAddress for the given URI, if possible.

public static AFTIPCSocketAddress

Returns:

The address.
of
(URI
The URI.
uri
,
int
The port to forcibly use, or -1 for "don't override".
overridePort
)

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFTIPCSocketAddress for the given URI, if possible.

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofService
(AFTIPCSocketAddress.Scope
The address scope.
scope
,
int
The service type (0-63 are reserved).
type
,
int
The service instance ID.
instance
)

Returns an AFTIPCSocketAddress that refers to a given service type and instance, using the given scope.

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofService
(int
The service type (0-63 are reserved).
type
,
int
The service instance ID.
instance
)

Returns an AFTIPCSocketAddress that refers to a given service type and instance, implicitly using cluster scope (Scope#SCOPE_CLUSTER).

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofService
(AFTIPCSocketAddress.Scope
The address scope.
scope
,
int
The service type (0-63 are reserved).
type
,
int
The service instance ID.
instance
,
int
The lookup domain. 0 indicates cluster global lookup, otherwise a node hash, indicating that lookup should be performed only on that node
domain
)

Returns an AFTIPCSocketAddress that refers to a given service type and instance, using the given scope and the given lookup domain.

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofService
(int
The emulated "port" number (not part of TIPC).
javaPort
,
AFTIPCSocketAddress.Scope
The address scope.
scope
,
int
The service type (0-63 are reserved).
type
,
int
The service instance ID.
instance
,
int
The lookup domain. 0 indicates cluster global lookup, otherwise a node hash, indicating that lookup should be performed only on that node
domain
)

Returns an AFTIPCSocketAddress that refers to a given service type and instance, using the given scope and the given lookup domain.

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofServiceRange
(AFTIPCSocketAddress.Scope
The address scope.
scope
,
int
The service type (0-63 are reserved).
type
,
int
Lower end of service instance ID range.
lower
,
int
Upper end of service instance ID range.
upper
)

Returns an AFTIPCSocketAddress that refers to a given service range type and instance boundaries (lower/upper values), using the given scope.

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofServiceRange
(int
The service type (0-63 are reserved).
type
,
int
Lower end of service instance ID range.
lower
,
int
Upper end of service instance ID range.
upper
)

Returns an AFTIPCSocketAddress that refers to a given service range type and instance boundaries (lower/upper values), implicitly using cluster scope (Scope#SCOPE_CLUSTER).

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofServiceRange
(int
The emulated "port" number (not part of TIPC).
javaPort
,
AFTIPCSocketAddress.Scope
The address scope.
scope
,
int
The service type (0-63 are reserved).
type
,
int
Lower end of service instance ID range.
lower
,
int
Upper end of service instance ID range.
upper
)

Returns an AFTIPCSocketAddress that refers to a given service range type and instance boundaries (lower/upper values), implicitly using cluster scope (Scope#SCOPE_CLUSTER).

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofSocket
(int
32-bit port reference ID (not to be confused with the InetSocketAddress#getPort() port).
ref
,
int
Node hash number (can be used as lookup domain with ofService(Scope, int, int, int)).
node
)

Returns an AFTIPCSocketAddress that refers to a given TIPC socket address (i.e., referring to a particular socket instance instead of a service address).

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofSocket
(int
The emulated "port" number (not part of TIPC).
javaPort
,
int
32-bit port reference ID (not to be confused with the InetSocketAddress#getPort() port).
ref
,
int
Node hash number (can be used as lookup domain with ofService(Scope, int, int, int)).
node
)

Returns an AFTIPCSocketAddress that refers to a given TIPC socket address (i.e., referring to a particular socket instance instead of a service address).

public static AFTIPCSocketAddress

Returns:

A corresponding AFTIPCSocketAddress instance.
ofTopologyService
()

Returns an AFTIPCSocketAddress that refers to the topology service.

private static int
private static byte[]
toBytes(AFTIPCSocketAddress.AddressType addrType, AFTIPCSocketAddress.Scope scope, int a, int b, int c)

public String
toString()

Overrides java.net.InetSocketAddress.toString.

Constructs a string representation of this InetSocketAddress.

private String
toTipcInt(int v)

public URI
toURI(String
The target scheme.
scheme
,
URI
An optional template to reuse certain parameters (e.g., the "path" component for an http request), or null.
template
)

Overrides org.newsclub.net.unix.AFSocketAddress.toURI.

Tries to create a URI based on this AFSocketAddress.

public static AFTIPCSocketAddress

Returns:

The AFTIPCSocketAddress instance.
unwrap
(InetAddress
The "special" InetAddress.
address
,
int
The port (use 0 for "none").
port
)

Returns an AFTIPCSocketAddress given a special InetAddress that encodes the byte sequence of an AF_TIPC socket address, like those returned by wrapAddress().

public static AFTIPCSocketAddress

Returns:

The AFTIPCSocketAddress instance.
unwrap
(String
The "special" hostname, as provided by InetAddress#getHostName().
hostname
,
int
The port (use 0 for "none").
port
)

Returns an AFTIPCSocketAddress given a special InetAddress hostname that encodes the byte sequence of an AF_TIPC socket address, like those returned by wrapAddress().

public static AFTIPCSocketAddress

Returns:

The AFTIPCSocketAddress instance.
unwrap
(SocketAddress
The address to unwrap.
address
)

Returns an AFTIPCSocketAddress given a generic SocketAddress.

Inherited from org.newsclub.net.unix.AFSocketAddress:
canMapcanMapcoversgetAddressFamilygetBytesgetInetAddressgetInetAddressgetInetAddressgetNativeAddressDirectBuffergetNativeAddressDirectBuffergetSocketAddressisSupportedAddressisUseDeserializationForInitmapOrFailmapOrFailnewBoundServerSocketnewConnectedSocketnewDeserializedAFSocketAddressnewForceBoundServerSocketnewSockAddrDirectBuffernewSockAddrKeyBufferofInternalparseUnsignedIntpreprocessSocketAddressresolveAddresstoSocatAddressStringtoUnsignedStringtoUnsignedStringunwrapunwrapunwrapAddressDirectBufferInternalwrapAddresswriteNativeAddressTo