public class ChannelUri
extends java.lang.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 java.lang.String |
AERON_SCHEME
URI Scheme for Aeron channels.
|
static long |
INVALID_TAG |
static java.lang.String |
SPY_QUALIFIER
Qualifier for spy subscriptions which spy on outgoing network destined traffic efficiently.
|
Constructor and Description |
---|
ChannelUri(java.lang.String media,
java.util.Map<java.lang.String,java.lang.String> params)
Construct with the components provided to avoid parsing.
|
ChannelUri(java.lang.String prefix,
java.lang.String media,
java.util.Map<java.lang.String,java.lang.String> params)
Construct with the components provided to avoid parsing.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addSessionId(java.lang.String channel,
int sessionId)
Add a sessionId to a given channel.
|
java.lang.String |
channelTag()
Get the channel tag, if it exists, that refers to an another channel.
|
boolean |
containsKey(java.lang.String key)
Does the URI contain a value for the given key.
|
java.lang.String |
entityTag()
Get the entity tag, if it exists, that refers to an entity such as subscription or publication.
|
java.lang.String |
get(java.lang.String key)
Get a value for a given parameter key.
|
java.lang.String |
get(java.lang.String key,
java.lang.String defaultValue)
Get the value for a given parameter key or the default value provided if the key does not exist.
|
static long |
getTag(java.lang.String paramValue)
Get the value of the tag from a given parameter value.
|
void |
initialPosition(long position,
int initialTermId,
int termLength)
Initialise a channel for restarting a publication at a given position.
|
static boolean |
isTagged(java.lang.String paramValue)
Is the param value tagged? (starts with the "tag:" prefix)
|
java.lang.String |
media()
The media over which the channel operates.
|
ChannelUri |
media(java.lang.String media)
Set the media over which the channel operates.
|
static ChannelUri |
parse(java.lang.CharSequence cs)
Parse a
CharSequence which contains an Aeron URI. |
java.lang.String |
prefix()
The prefix for the channel.
|
ChannelUri |
prefix(java.lang.String prefix)
Change the prefix from what has been parsed.
|
java.lang.String |
put(java.lang.String key,
java.lang.String value)
Put a key and value pair in the map of params.
|
java.lang.String |
remove(java.lang.String key)
Remove a key pair in the map of params.
|
java.lang.String |
scheme()
The scheme for the URI.
|
java.lang.String |
toString()
Generate a String representation of the URI that is valid for an Aeron channel.
|
public static final java.lang.String AERON_SCHEME
public static final java.lang.String SPY_QUALIFIER
public static final long INVALID_TAG
public ChannelUri(java.lang.String prefix, java.lang.String media, java.util.Map<java.lang.String,java.lang.String> params)
prefix
- empty if no prefix is required otherwise expected to be 'aeron-spy'media
- for the channel which is typically "udp" or "ipc".params
- for the query string as key value pairs.public ChannelUri(java.lang.String media, java.util.Map<java.lang.String,java.lang.String> params)
media
- for the channel which is typically "udp" or "ipc".params
- for the query string as key value pairs.public java.lang.String prefix()
public ChannelUri prefix(java.lang.String prefix)
prefix
- to replace the existing prefix.public java.lang.String media()
public ChannelUri media(java.lang.String media)
media
- to replace the parsed value.public java.lang.String scheme()
public java.lang.String get(java.lang.String key)
key
- to lookup.public java.lang.String get(java.lang.String key, java.lang.String defaultValue)
key
- to lookup.defaultValue
- to be returned if no key match is found.public java.lang.String put(java.lang.String key, java.lang.String value)
key
- of the param to be put.value
- of the param to be put.public java.lang.String remove(java.lang.String key)
key
- of the param to be removed.public boolean containsKey(java.lang.String key)
key
- to be lookup.public java.lang.String channelTag()
CommonContext.TAGS_PARAM_NAME
,
CommonContext.TAG_PREFIX
public java.lang.String entityTag()
CommonContext.TAGS_PARAM_NAME
,
CommonContext.TAG_PREFIX
public java.lang.String toString()
toString
in class java.lang.Object
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(java.lang.CharSequence cs)
CharSequence
which contains an Aeron URI.cs
- to be parsed.ChannelUri
representing the URI string.public static java.lang.String addSessionId(java.lang.String channel, int sessionId)
channel
- to add sessionId to.sessionId
- to add to channel.public static boolean isTagged(java.lang.String paramValue)
paramValue
- to check if tagged.CommonContext.TAGS_PARAM_NAME
,
CommonContext.TAG_PREFIX
public static long getTag(java.lang.String paramValue)
paramValue
- to extract the tag value from.INVALID_TAG
if not tagged.CommonContext.TAGS_PARAM_NAME
,
CommonContext.TAG_PREFIX
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.