public class NameServerImpl extends Object implements NameServer
| Constructor and Description | 
|---|
NameServerImpl(int port,
                            IdentifierFactory factory)
Deprecated. 
 
inject the NameServer instead of new it up
 Constructs a name server 
 | 
NameServerImpl(int port,
                            IdentifierFactory factory,
                            ReefEventStateManager reefEventStateManager)
Constructs a name server 
 | 
| 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 
 | 
@Deprecated public NameServerImpl(int port, IdentifierFactory factory)
port - a listening port numberfactory - an identifier factory@Inject public NameServerImpl(int port, IdentifierFactory factory, ReefEventStateManager reefEventStateManager)
port - a listening port numberfactory - an identifier factoryreefEventStateManager - the event state manager used to register name server infopublic 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 © 2015 The Apache Software Foundation. All rights reserved.