@Immutable public class Uri extends Object
This class provides a value-semantic type, representing a URI for a BlazingMQ queue. A Uri
can be built by parsing from a string representation provided to the class constructor.
bmq://ts.trades.myapp/my.queue bmq://ts.trades.myapp.~bt/my.queue bmq://ts.trades.myapp/my.queue?id=foowhere:
[-a-zA-Z0-9\\._]+'
. The domain may be followed by an optional tier, introduced by the ".~"
sequence and consisting of alphanumeric characters and dashes. The ".~" sequence is not
part of the tier.
[-a-zA-Z0-9_~\\.]+
).
my.queue
above) may contain alphanumeric characters and
dots.
id
, and corresponding value represents a name that will be used by BlazingMQ broker to
uniquely identify the client.
Uri
object with a string representation of the URI:
Uri uri = new Uri("bmq://my.domain/queue"); assert uri.scheme() == "bmq"; assert uri.domain() == "my.domain"; assert uri.queue() == "queue";
Uri
object is immutable and thread safe.Constructor and Description |
---|
Uri(String uriStr)
Constructs this object from the specified
uri string. |
Modifier and Type | Method and Description |
---|---|
String |
authority()
Returns
authority part of the URI in terms of the URI RFC terminology. |
String |
canonical()
Returns the canonical form of the URI.
|
String |
domain()
Returns
domain part of the URI in terms of the BlazingMQ terminology. |
boolean |
equals(Object obj)
Returns true if this
Uri is equal to the specified obj , false otherwise. |
int |
hashCode()
Returns a hash code value for this
Uri object. |
String |
id()
Returns
id part of the URI in terms of the BlazingMQ terminology. |
String |
path()
Returns
path part of the URI in terms of the URI RFC terminology. |
String |
qualifiedDomain()
Returns
qualifiedDomain part of the URI in terms of the BlazingMQ terminology. |
String |
queue()
Returns
queue part of the URI in terms of the BlazingMQ terminology. |
String |
scheme()
Returns
scheme part of the URI in terms of the URI RFC terminology. |
String |
tier()
Returns
tier part of the URI in terms of the BlazingMQ terminology. |
String |
toString()
Returns a string representation of the URI.
|
public Uri(String uriStr)
uri
string. If the uri
input string
doesn't represent a valid URI, this object won't be created.uriStr
- string representation of the URIRuntimeException
- if the specified string is not a valid URIpublic String scheme()
scheme
part of the URI in terms of the URI RFC terminology.scheme
part of the URIpublic String authority()
authority
part of the URI in terms of the URI RFC terminology.authority
part of the URIpublic String path()
path
part of the URI in terms of the URI RFC terminology.path
part of the URIpublic String qualifiedDomain()
qualifiedDomain
part of the URI in terms of the BlazingMQ terminology.qualifiedDomain
part of the URIpublic String domain()
domain
part of the URI in terms of the BlazingMQ terminology.domain
part of the URIpublic String tier()
tier
part of the URI in terms of the BlazingMQ terminology.tier
part of the URIpublic String queue()
queue
part of the URI in terms of the BlazingMQ terminology.queue
part of the URIpublic String id()
id
part of the URI in terms of the BlazingMQ terminology.id
part of the URIpublic String canonical()
Note that canonical form includes everything except the query part of the URI.
public String toString()
public boolean equals(Object obj)
Uri
is equal to the specified obj
, false otherwise.Copyright © 2023 Bloomberg L.P.. All rights reserved.