public class ExecNamingService
- extends NamingService
An interface to an external naming service program, with in-memory caching.
This can be used as a simple and flexible way to experiment with
alternative naming systems.
The external command takes a hostname argument and must return (only) the
516-byte Base64 destination, or hostname=dest, on stdout.
A trailing \n or \r\n is acceptable.
The command must exit 0 on success. Nonzero on failure is optional.
The external command can do local and/or remote (via i2p or not) lookups.
No timeouts are implemented here - the author of the external program
must ensure that the program returns in a reasonable amount of time -
(15 sec max suggested)
Can be used from MetaNamingService, (e.g. after HostsTxtNamingService),
or as the sole naming service.
Sample chained config to put in configadvanced.jsp (restart required):
Sample unchained config to put in configadvanced.jsp (restart required):
The naming service should only be constructed and accessed through the
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ExecNamingService(I2PAppContext context)
- The naming service should only be constructed and accessed through the
application context. This constructor should only be used by the
appropriate application context itself.
public Destination lookup(java.lang.String hostname)
- Description copied from class:
- Look up a host name.
- Specified by:
lookup in class
- the Destination for this host name, or
null if name is unknown.