public class ResolutionEntryFlyweight extends HeaderFlyweight
Protocol Specification wiki page.
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_FIELD_OFFSET
Offset in the frame at which the IP address field begins.
|
static int |
ADDRESS_LENGTH_IP4
Length of an IPv4 address in bytes.
|
static int |
ADDRESS_LENGTH_IP6
Length of an IPv6 address in bytes.
|
static int |
AGE_IN_MS_FIELD_OFFSET
Offset in the frame at which the age field begins.
|
static int |
MAX_NAME_LENGTH
Maximum length allowed for a name.
|
static int |
RES_FLAGS_FIELD_OFFSET
Offset in the frame at which the res-flags field begins.
|
static int |
RES_TYPE_FIELD_OFFSET
Offset in the frame at which the res-type (resolution type) field begins.
|
static byte |
RES_TYPE_NAME_TO_IP4_MD
Resolution type field flag for IPv4.
|
static byte |
RES_TYPE_NAME_TO_IP6_MD
Resolution type field flag for IPv6.
|
static short |
SELF_FLAG
(S) - Self flag
|
static int |
UDP_PORT_FIELD_OFFSET
Offset in the frame at which the UDP port field begins.
|
CURRENT_VERSION, FLAGS_FIELD_OFFSET, FRAME_LENGTH_FIELD_OFFSET, HDR_TYPE_DATA, HDR_TYPE_ERR, HDR_TYPE_EXT, HDR_TYPE_NAK, HDR_TYPE_PAD, HDR_TYPE_RES, HDR_TYPE_RTTM, HDR_TYPE_SETUP, HDR_TYPE_SM, MIN_HEADER_LENGTH, TYPE_FIELD_OFFSET, VERSION_FIELD_OFFSETALIGNMENT, DISABLE_BOUNDS_CHECKS_PROP_NAME, SHOULD_BOUNDS_CHECKDISABLE_ARRAY_CONTENT_PRINTOUT_PROP_NAME, STR_HEADER_LEN| Constructor and Description |
|---|
ResolutionEntryFlyweight()
Default constructor which can later be use to wrap a frame.
|
ResolutionEntryFlyweight(ByteBuffer buffer)
Construct the flyweight over a frame.
|
ResolutionEntryFlyweight(UnsafeBuffer buffer)
Construct the flyweight over a frame.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
addressLength(byte resType)
Get the length of the address given a resolution type.
|
int |
ageInMs()
Get the age of the entry based on last observed activity.
|
ResolutionEntryFlyweight |
ageInMs(int ageInMs)
Set the age of the entry based on last observed activity.
|
void |
appendAddress(Appendable appendable)
Append the address to the provided
Appendable in ASCII format. |
void |
appendName(StringBuilder appendable)
Append the name to the provided
Appendable in ASCII format. |
int |
entryLength()
Total length of the entry in bytes.
|
static int |
entryLengthRequired(byte resType,
int nameLength)
Calculate the length required for the entry when encoded.
|
short |
flags()
Get the flags for the resolution entry.
|
ResolutionEntryFlyweight |
flags(short flags)
Set the flags for the resolution entry.
|
int |
getAddress(byte[] dstBuffer)
Get the address for the entry by copying it into the destination buffer.
|
int |
getName(byte[] dstBuffer)
Get the name for the entry by copying it into the destination buffer.
|
static boolean |
isAnyLocalAddress(byte[] address,
int addressLength)
Is the local address a match for binding a socket to ANY IP.
|
static int |
nameOffset(byte resType)
Offset in the entry at which the name begins depending on resolution type.
|
ResolutionEntryFlyweight |
putAddress(byte[] address)
Put the address into the resolution entry.
|
ResolutionEntryFlyweight |
putName(byte[] name)
Put the name for the resolution entry into the frame.
|
byte |
resType()
Get the protocol type of the resolution entry.
|
ResolutionEntryFlyweight |
resType(byte type)
Set the protocol type of the resolution.
|
int |
udpPort()
Get the UDP port of the resolver with a given name.
|
ResolutionEntryFlyweight |
udpPort(int udpPort)
Set the UDP port of the resolver with a given name.
|
appendFlagsAsChars, flagsToChars, frameLength, frameLength, headerType, headerType, version, versionaddIntOrdered, addLongOrdered, addressOffset, boundsCheck, byteArray, byteBuffer, capacity, checkLimit, compareAndSetInt, compareAndSetLong, compareTo, equals, getAndAddInt, getAndAddLong, getAndSetInt, getAndSetLong, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getByteVolatile, getChar, getChar, getCharVolatile, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getIntVolatile, getLong, getLong, getLongVolatile, getShort, getShort, getShortVolatile, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, hashCode, isExpandable, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAscii, putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putByteVolatile, putChar, putChar, putCharVolatile, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putIntOrdered, putIntVolatile, putLong, putLong, putLongAscii, putLongOrdered, putLongVolatile, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putShortVolatile, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemory, toString, verifyAlignment, wrap, wrap, wrap, wrap, wrap, wrap, wrap, wrapAdjustmentpublic static final byte RES_TYPE_NAME_TO_IP4_MD
public static final byte RES_TYPE_NAME_TO_IP6_MD
public static final int ADDRESS_LENGTH_IP4
public static final int ADDRESS_LENGTH_IP6
public static final short SELF_FLAG
public static final int RES_TYPE_FIELD_OFFSET
public static final int RES_FLAGS_FIELD_OFFSET
public static final int UDP_PORT_FIELD_OFFSET
public static final int AGE_IN_MS_FIELD_OFFSET
public static final int ADDRESS_FIELD_OFFSET
public static final int MAX_NAME_LENGTH
public ResolutionEntryFlyweight()
public ResolutionEntryFlyweight(UnsafeBuffer buffer)
buffer - containing the frame.public ResolutionEntryFlyweight(ByteBuffer buffer)
buffer - containing the frame.public ResolutionEntryFlyweight resType(byte type)
type - of the resolution entry protocol.RES_TYPE_NAME_TO_IP4_MD,
RES_TYPE_NAME_TO_IP4_MDpublic byte resType()
RES_TYPE_NAME_TO_IP4_MD,
RES_TYPE_NAME_TO_IP4_MDpublic ResolutionEntryFlyweight flags(short flags)
flags in class HeaderFlyweightflags - field value.SELF_FLAGpublic short flags()
flags in class HeaderFlyweightpublic ResolutionEntryFlyweight udpPort(int udpPort)
udpPort - of the resolver with a given name.public int udpPort()
public ResolutionEntryFlyweight ageInMs(int ageInMs)
ageInMs - of the entry based on last observed activity.public int ageInMs()
public ResolutionEntryFlyweight putAddress(byte[] address)
resType(byte).address - to be written for the resolution entry.public int getAddress(byte[] dstBuffer)
dstBuffer - into which the address will be copied.public void appendAddress(Appendable appendable)
Appendable in ASCII format.appendable - to which the address will be appended.public ResolutionEntryFlyweight putName(byte[] name)
name - for the resolution entry.public int getName(byte[] dstBuffer)
dstBuffer - into which the name will be copied.public void appendName(StringBuilder appendable)
Appendable in ASCII format.appendable - to which the name will be appended.public int entryLength()
public static int nameOffset(byte resType)
resType - for the protocol family.public static int entryLengthRequired(byte resType,
int nameLength)
resType - of the entry.nameLength - of the name in the entry.public static int addressLength(byte resType)
resType - to lookup address length for.public static boolean isAnyLocalAddress(byte[] address,
int addressLength)
address - to check which can be IPv4 or IPv6.addressLength - of the address in bytes.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.