public class HostsTxtNamingService extends MetaNamingService
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOSTS_FILE
default hosts.txt filenames
|
static String |
PROP_HOSTS_FILE
If this system property is specified, the tunnel will read the
given file for hostname=destKey values when resolving names
|
_services
BASE32_HASH_LENGTH, CACHE_MAX_SIZE, DEST_SIZE, PROP_B32
_context, _listeners, _log, _updaters, PROP_IMPL
Constructor and Description |
---|
HostsTxtNamingService(I2PAppContext context)
The naming service should only be constructed and accessed through the
application context.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getNames(Properties options)
All services aggregated, unless options contains
the property "file", in which case only for that file
|
Destination |
lookup(String hostname,
Properties lookupOptions,
Properties storedOptions)
Same as lookup(hostname) but with in and out options
Note that whether this (and lookup(hostname)) resolve Base 32 addresses
in the form {52 chars}.b32.i2p is NamingService-specific.
|
boolean |
put(String hostname,
Destination d,
Properties options)
Stores in the last service
|
boolean |
putIfAbsent(String hostname,
Destination d,
Properties options)
Stores in the last service
|
boolean |
remove(String hostname,
Properties options)
Removes from all services
|
addNamingService, export, getBase64Entries, getEntries, getNamingServices, registerListener, removeNamingService, reverseLookup, shutdown, size, unregisterListener
clearCache, getCache, putCache, removeCache
addDestination, addDestination, addNamingService, createInstance, export, getConfiguration, getEntries, getName, getNames, getParent, lookup, lookup, lookupAll, lookupAll, lookupBase32, lookupBase64, put, putAll, putIfAbsent, registerUpdater, remove, remove, remove, requestUpdate, reverseLookup, reverseLookup, reverseLookupAll, reverseLookupAll, reverseLookupAll, setConfiguration, size, start, toString, unregisterUpdater, update
public static final String PROP_HOSTS_FILE
public static final String DEFAULT_HOSTS_FILE
public HostsTxtNamingService(I2PAppContext context)
public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
NamingService
lookup
in class MetaNamingService
hostname
- mixed case as it could be a keylookupOptions
- input parameter, NamingService-specific, can be nullstoredOptions
- output parameter, NamingService-specific, any stored properties will be added if non-nullpublic boolean put(String hostname, Destination d, Properties options)
MetaNamingService
put
in class MetaNamingService
options
- NamingService-specific, can be nullpublic boolean putIfAbsent(String hostname, Destination d, Properties options)
MetaNamingService
putIfAbsent
in class MetaNamingService
options
- NamingService-specific, can be nullpublic boolean remove(String hostname, Properties options)
MetaNamingService
remove
in class MetaNamingService
options
- NamingService-specific, can be nullpublic Set<String> getNames(Properties options)
getNames
in class MetaNamingService
options
- NamingService-specific, can be null