|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.client.naming.NamingService
net.i2p.client.naming.DummyNamingService
net.i2p.client.naming.MetaNamingService
public class MetaNamingService
A naming service of multiple naming services. Supports .b32.i2p and {b64} lookups. Supports caching.
Field Summary | |
---|---|
protected List<NamingService> |
_services
|
Fields inherited from class net.i2p.client.naming.DummyNamingService |
---|
BASE32_HASH_LENGTH, CACHE_MAX_SIZE, DEST_SIZE, PROP_B32 |
Fields inherited from class net.i2p.client.naming.NamingService |
---|
_context, _listeners, _log, _updaters, PROP_IMPL |
Constructor Summary | |
---|---|
MetaNamingService(I2PAppContext context)
Adds the services from the i2p.nameservicelist property, in order, as chained services. |
|
MetaNamingService(I2PAppContext context,
List<NamingService> services)
|
Method Summary | |
---|---|
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()
|
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 B32 addresses 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)
|
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 |
void |
shutdown()
Parent will call when removed. |
int |
size(Properties options)
All services aggregated |
void |
unregisterListener(NamingServiceListener nsl)
|
Methods inherited from class net.i2p.client.naming.DummyNamingService |
---|
clearCache, getCache, putCache, removeCache |
Methods inherited from class net.i2p.client.naming.NamingService |
---|
addNamingService, createInstance, export, getConfiguration, getEntries, getName, getNames, getParent, lookup, lookup, lookupBase32, lookupBase64, put, putAll, putIfAbsent, registerUpdater, remove, requestUpdate, reverseLookup, reverseLookup, setConfiguration, size, start, toString, unregisterUpdater, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final List<NamingService> _services
Constructor Detail |
---|
public MetaNamingService(I2PAppContext context)
public MetaNamingService(I2PAppContext context, List<NamingService> services)
services
- if non-null, services to be added. If null, this will only handle b32 and b64,
until addNamingService() is called later.Method Detail |
---|
public boolean addNamingService(NamingService ns, boolean head)
NamingService
addNamingService
in class NamingService
head
- or tail
public List<NamingService> getNamingServices()
getNamingServices
in class NamingService
public boolean removeNamingService(NamingService ns)
NamingService
removeNamingService
in class NamingService
public void registerListener(NamingServiceListener nsl)
registerListener
in class NamingService
public void unregisterListener(NamingServiceListener nsl)
unregisterListener
in class NamingService
public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
NamingService
lookup
in class DummyNamingService
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-null
public String reverseLookup(Destination dest, Properties options)
NamingService
reverseLookup
in class NamingService
dest
- non-nulloptions
- NamingService-specific, can be null
public boolean put(String hostname, Destination d, Properties options)
put
in class NamingService
options
- NamingService-specific, can be null
public boolean putIfAbsent(String hostname, Destination d, Properties options)
putIfAbsent
in class NamingService
options
- NamingService-specific, can be null
public boolean remove(String hostname, Properties options)
remove
in class NamingService
options
- NamingService-specific, can be null
public Map<String,Destination> getEntries(Properties options)
getEntries
in class NamingService
options
- NamingService-specific, can be null
public Map<String,String> getBase64Entries(Properties options)
getBase64Entries
in class NamingService
options
- NamingService-specific, can be null
public Set<String> getNames(Properties options)
getNames
in class NamingService
options
- NamingService-specific, can be null
public void export(Writer out, Properties options) throws IOException
export
in class NamingService
options
- NamingService-specific, can be null
IOException
public int size(Properties options)
size
in class NamingService
options
- NamingService-specific, can be null
public void shutdown()
NamingService
shutdown
in class NamingService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |