Constructs and deconstructs Id values.
An Id is composed of two parts: a scheme and an id. There exists only a finite set of ''schemes'' recognized by ZooKeeper, which are noted below. The acceptable form of ''id'' depends on the chosen scheme.
'''Schemes'''
world
-- ''id'' must be "anyone"
.
auth
-- ''id'' must be ""
(empty string).
digest
-- ''id'' must be of the form "''username'':''password''"
.
host
-- ''id'' should be an Internet domain name.
ip
-- ''id'' must be a valid IPv4 or IPv6 address with an optional network prefix, variations of which follow:
"''addr''"
where prefix is assumed to be32
and128
for IPv4 and IPv6, respectively."''addr''/''prefix''"
where prefix is in the range[0,32]
and[0,128]
for IPv4 and IPv6, respectively.
- See also:
- Companion:
- class
Value members
Concrete methods
Constructs a new identity.
Constructs a new identity.
- Value parameters:
- id
a string representing the id
- scheme
a string representing the scheme
- Returns:
an identity with the given
scheme
andid
- Throws:
- IllegalArgumentException
if a valid identity cannot be constructed from
scheme
andid
- See also:
Constructs a new identity from the input string s
.
Constructs a new identity from the input string s
.
- Value parameters:
- s
a string representing the identity
- Returns:
the identity in
s
if it conforms to the proper syntax- Throws:
- IllegalArgumentException
if
s
does not conform to the proper syntax
- See also:
Parses the identity in the input string s
.
Parses the identity in the input string s
.
The syntax of s
is "''scheme'':''id''"
, where the :
delimiter may be omitted if ''id'' is not required for the
given ''scheme''.
- Value parameters:
- s
a string representing the identity
- Returns:
a
Success
containing the identity ins
if it conforms to the proper syntax, otherwise aFailure
containing the offending exception
Concrete fields
An identity whose scheme is "world
" and id is "anyone
".
An identity whose scheme is "world
" and id is "anyone
".
Equivalent to WorldId.