public final class ChannelUri extends Object
aeron-uri = "aeron:" media [ "?" param *( "|" param ) ] media = *( "[^?:]" ) param = key "=" value key = *( "[^=]" ) value = *( "[^|]" )
Multiple params with the same key are allowed, the last value specified takes precedence.
ChannelUriStringBuilder| Modifier and Type | Field and Description |
|---|---|
static String |
AERON_SCHEME
URI Scheme for Aeron channels and destinations.
|
static long |
INVALID_TAG
Invalid tag value returned when calling
getTag(String) and the channel is not tagged. |
static String |
SPY_QUALIFIER
Qualifier for spy subscriptions which spy on outgoing network destined traffic efficiently.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
addSessionId(String channel,
int sessionId)
Add a sessionId to a given channel.
|
String |
channelTag()
Get the channel tag, if it exists, that refers to another channel.
|
boolean |
containsKey(String key)
Does the URI contain a value for the given key.
|
static String |
createDestinationUri(String channel,
String endpoint)
Create a channel URI for a destination, i.e.
|
String |
entityTag()
Get the entity tag, if it exists, that refers to an entity such as subscription or publication.
|
boolean |
equals(Object o) |
String |
get(String key)
Get a value for a given parameter key.
|
String |
get(String key,
String defaultValue)
Get the value for a given parameter key or the default value provided if the key does not exist.
|
static long |
getTag(String paramValue)
Get the value of the tag from a given parameter value.
|
int |
hashCode() |
void |
initialPosition(long position,
int initialTermId,
int termLength)
Initialise a channel for restarting a publication at a given position.
|
boolean |
isIpc()
Is the channel
media() equal to CommonContext.IPC_MEDIA. |
static boolean |
isTagged(String paramValue)
Is the param value tagged? (starts with the "tag:" prefix).
|
boolean |
isUdp()
Is the channel
media() equal to CommonContext.UDP_MEDIA. |
String |
media()
The media over which the channel operates.
|
ChannelUri |
media(String media)
Set the media over which the channel operates.
|
static ChannelUri |
parse(CharSequence cs)
Parse a
CharSequence which contains an Aeron URI. |
String |
prefix()
The prefix for the channel.
|
ChannelUri |
prefix(String prefix)
Change the prefix from what has been parsed.
|
String |
put(String key,
String value)
Put a key and value pair in the map of params.
|
String |
remove(String key)
Remove a key pair in the map of params.
|
void |
replaceEndpointWildcardPort(String resolvedEndpoint)
Uses the supplied endpoint to resolve any wildcard ports.
|
String |
scheme()
The scheme for the URI.
|
String |
toString()
Generate a String representation of the URI that is valid for an Aeron channel.
|
public static final String AERON_SCHEME
public static final String SPY_QUALIFIER
public static final long INVALID_TAG
getTag(String) and the channel is not tagged.public String prefix()
public ChannelUri prefix(String prefix)
prefix - to replace the existing prefix.public String media()
public ChannelUri media(String media)
media - to replace the parsed value.public boolean isUdp()
media() equal to CommonContext.UDP_MEDIA.media() equals CommonContext.UDP_MEDIA.public boolean isIpc()
media() equal to CommonContext.IPC_MEDIA.media() equals CommonContext.IPC_MEDIA.public String scheme()
public String get(String key)
key - to lookup.public String get(String key, String defaultValue)
key - to lookup.defaultValue - to be returned if no key match is found.public String put(String key, String value)
key - of the param to be put.value - of the param to be put.public String remove(String key)
key - of the param to be removed.public boolean containsKey(String key)
key - to be lookup.public String channelTag()
CommonContext.TAGS_PARAM_NAME,
CommonContext.TAG_PREFIXpublic String entityTag()
CommonContext.TAGS_PARAM_NAME,
CommonContext.TAG_PREFIXpublic String toString()
public void initialPosition(long position,
int initialTermId,
int termLength)
position - at which the publication should be started.initialTermId - what which the stream would start.termLength - for the stream.public static ChannelUri parse(CharSequence cs)
CharSequence which contains an Aeron URI.cs - to be parsed.ChannelUri representing the URI string.public static String addSessionId(String channel, int sessionId)
channel - to add sessionId to.sessionId - to add to channel.public static boolean isTagged(String paramValue)
paramValue - to check if tagged.CommonContext.TAGS_PARAM_NAME,
CommonContext.TAG_PREFIXpublic static long getTag(String paramValue)
paramValue - to extract the tag value from.INVALID_TAG if not tagged.CommonContext.TAGS_PARAM_NAME,
CommonContext.TAG_PREFIXpublic static String createDestinationUri(String channel, String endpoint)
media and interface parameters
of the original channel and adds specified endpoint to it. For example given the input channel is
aeron:udp?mtu=1440|ttl=0|endpoint=localhost:8090|term-length=128k|interface=eth0 and the endpoint is
192.168.0.14 the output of this method will be aeron:udp?endpoint=192.168.0.14|interface=eth0.channel - for which the destination is being added.endpoint - for the target destination.public void replaceEndpointWildcardPort(String resolvedEndpoint)
resolvedEndpoint - The endpoint to supply a resolved endpoint port.IllegalArgumentException - if the supplied resolvedEndpoint does not have a port or the port is zero.NullPointerException - if the supplied resolvedEndpoint is nullCopyright © 2014-2023 Real Logic Limited. All Rights Reserved.