public class NameLookupClient extends Object implements Stage, NamingLookup
| Modifier and Type | Class and Description |
|---|---|
static class |
NameLookupClient.RetryCount |
static class |
NameLookupClient.RetryTimeout |
| Constructor and Description |
|---|
NameLookupClient(String serverAddr,
int serverPort,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache)
Constructs a naming lookup client
|
NameLookupClient(String serverAddr,
int serverPort,
long timeout,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache)
Constructs a naming lookup client
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes resources
|
InetSocketAddress |
lookup(Identifier id)
Finds an address for an identifier
|
InetSocketAddress |
remoteLookup(Identifier id)
Retrieves an address for an identifier remotely
|
public NameLookupClient(String serverAddr, int serverPort, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache)
serverAddr - a server addressserverPort - a server port numberfactory - an identifier factorycache - an cachepublic NameLookupClient(String serverAddr, int serverPort, long timeout, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache)
serverAddr - a server addressserverPort - a server port numbertimeout - request timeout in msfactory - an identifier factorycache - an cachepublic InetSocketAddress lookup(Identifier id) throws Exception
lookup in interface NamingLookupid - an identifierIOExceptionExceptionpublic InetSocketAddress remoteLookup(Identifier id) throws Exception
id - an identifierExceptionpublic void close() throws Exception
close in interface AutoCloseableExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.