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 NameServer
public void close() throws Exception
close
in interface AutoCloseable
Exception
public void register(Identifier id, InetSocketAddress addr)
register
in interface NameServer
id
- an identifieraddr
- an Internet socket addresspublic void unregister(Identifier id)
unregister
in interface NameServer
id
- an identifierpublic InetSocketAddress lookup(Identifier id)
lookup
in interface NameServer
id
- an identifierpublic List<NameAssignment> lookup(Iterable<Identifier> identifiers)
lookup
in interface NameServer
identifiers
- an iterable of identifiersCopyright © 2017 The Apache Software Foundation. All rights reserved.