public class MetaNamingService extends DummyNamingService
| Modifier and Type | Field and Description |
|---|---|
protected List<NamingService> | _services_services. |
BASE32_HASH_LENGTH, CACHE_MAX_SIZE, DEST_SIZE, PROP_B32_context, _listeners, _log, _updaters, PROP_IMPL| Constructor and Description |
|---|
MetaNamingService(I2PAppContext context)Construct a new meta naming service. |
MetaNamingService(I2PAppContext context,
List<NamingService> services)Create a new meta naming service with the specified services. |
| Modifier and Type | Method and Description |
|---|---|
boolean | addNamingService(NamingService ns,
boolean head)Only for chaining-capable NamingServices. |
void | export(Writer out,
Properties options)All services aggregated. |
Map<String,String> | getBase64Entries(Properties options)All services aggregated |
Map<String,Destination> | getEntries(Properties options)All services aggregated |
Set<String> | getNames(Properties options)All services aggregated |
List<NamingService> | getNamingServices()This implementation returns null. |
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 |
void | registerListener(NamingServiceListener nsl)Register a listener for naming service changes. |
boolean | remove(String hostname,
Properties options)Removes from all services |
boolean | removeNamingService(NamingService ns)Only for chaining-capable NamingServices. |
String | reverseLookup(Destination dest,
Properties options)Same as reverseLookup(dest) but with options
This implementation returns null. |
void | shutdown()Parent will call when removed. |
int | size(Properties options)All services aggregated |
void | unregisterListener(NamingServiceListener nsl)Unregister a listener for naming service changes. |
clearCache, getCache, putCache, removeCacheaddDestination, addDestination, addNamingService, createInstance, export, getConfiguration, getEntries, getName, getNames, getParent, isB32Host, isBlindedHost, isI2PHost, lookup, lookup, lookupAll, lookupAll, lookupBase32, lookupBase64, put, putAll, putIfAbsent, registerUpdater, remove, remove, remove, requestUpdate, reverseLookup, reverseLookup, reverseLookupAll, reverseLookupAll, reverseLookupAll, setConfiguration, size, start, toString, unregisterUpdater, updateprotected final List<NamingService> _services
public MetaNamingService(I2PAppContext context)
context - contextpublic MetaNamingService(I2PAppContext context, List<NamingService> services)
context - contextservices - if non-null, services to be added. If null, this will only handle b32 and b64,
until addNamingService() is called later.public final boolean addNamingService(NamingService ns, boolean head)
NamingServiceaddNamingService in class NamingServicens - the naming service to addhead - or tailpublic void export(Writer out, Properties options) throws IOException
export in class NamingServiceout - the writer to export tooptions - NamingService-specific, can be nullIOException - if an I/O error occurspublic Map<String,String> getBase64Entries(Properties options)
getBase64Entries in class NamingServiceoptions - NamingService-specific, can be nullpublic Map<String,Destination> getEntries(Properties options)
getEntries in class NamingServiceoptions - NamingService-specific, can be nullpublic Set<String> getNames(Properties options)
getNames in class NamingServiceoptions - NamingService-specific, can be nullpublic List<NamingService> getNamingServices()
NamingServicegetNamingServices in class NamingServicepublic Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
NamingServicelookup in class DummyNamingServicehostname - 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)
put in class NamingServicehostname - the hostnamed - the destination for the hostnameoptions - NamingService-specific, can be nullpublic boolean putIfAbsent(String hostname, Destination d, Properties options)
putIfAbsent in class NamingServicehostname - the hostnamed - the destination for the hostnameoptions - NamingService-specific, can be nullpublic void registerListener(NamingServiceListener nsl)
NamingServiceregisterListener in class NamingServicensl - the listener to registerpublic boolean remove(String hostname, Properties options)
remove in class NamingServicehostname - the hostnameoptions - NamingService-specific, can be nullpublic boolean removeNamingService(NamingService ns)
NamingServiceremoveNamingService in class NamingServicens - the naming service to removepublic String reverseLookup(Destination dest, Properties options)
NamingServicereverseLookup in class NamingServicedest - non-null destination to look upoptions - NamingService-specific, can be nullpublic void shutdown()
NamingServiceshutdown in class NamingServicepublic int size(Properties options)
size in class NamingServiceoptions - NamingService-specific, can be nullpublic void unregisterListener(NamingServiceListener nsl)
NamingServiceunregisterListener in class NamingServicensl - the listener to unregister