public final class NameServerImpl extends Object implements NameServer
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes resources.
|
int |
getPort()
Gets port.
|
InetSocketAddress |
lookup(Identifier id)
Finds an address for an identifier locally.
|
List<NameAssignment> |
lookup(Iterable<Identifier> identifiers)
Finds addresses for identifiers locally.
|
void |
register(Identifier id,
InetSocketAddress addr)
Registers an (identifier, address) mapping locally.
|
void |
unregister(Identifier id)
Unregisters an identifier locally.
|
public int getPort()
getPort in interface NameServerpublic void close() throws Exception
close in interface AutoCloseableExceptionpublic void register(Identifier id, InetSocketAddress addr)
register in interface NameServerid - an identifieraddr - an Internet socket addresspublic void unregister(Identifier id)
unregister in interface NameServerid - an identifierpublic InetSocketAddress lookup(Identifier id)
lookup in interface NameServerid - an identifierpublic List<NameAssignment> lookup(Iterable<Identifier> identifiers)
lookup in interface NameServeridentifiers - an iterable of identifiersCopyright © 2017 The Apache Software Foundation. All rights reserved.