|
||||||||||
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.SingleFileNamingService
public class SingleFileNamingService
A naming service based on a single file using the "hosts.txt" format. Supports adds, removes, and listeners. All methods here are case-sensitive. Conversion to lower case is done in HostsTxtNamingService. This does NOT provide .b32.i2p or {b64} resolution. It also does not do any caching. Use from HostsTxtNamingService or chain with another NamingService via MetaNamingService if you need those features.
Field Summary |
---|
Fields inherited from class net.i2p.client.naming.NamingService |
---|
_context, _listeners, _log, _updaters, PROP_IMPL |
Constructor Summary | |
---|---|
SingleFileNamingService(I2PAppContext context,
String filename)
|
Method Summary | |
---|---|
Map<String,Destination> |
getEntries(Properties options)
Warning - This will bring the whole database into memory if options is null, empty, or unsupported, use with caution. |
String |
getName()
|
Set<String> |
getNames(Properties options)
|
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)
|
boolean |
putIfAbsent(String hostname,
Destination d,
Properties options)
Fails if entry previously exists |
boolean |
remove(String hostname,
Properties options)
|
String |
reverseLookup(Destination dest,
Properties options)
Same as reverseLookup(dest) but with options |
void |
shutdown()
Parent will call when removed. |
int |
size(Properties options)
|
Methods inherited from class net.i2p.client.naming.NamingService |
---|
addNamingService, addNamingService, createInstance, getBase64Entries, getConfiguration, getEntries, getNames, getNamingServices, getParent, lookup, lookup, lookupBase32, lookupBase64, put, putAll, putIfAbsent, registerListener, registerUpdater, remove, removeNamingService, requestUpdate, reverseLookup, reverseLookup, setConfiguration, size, start, toString, unregisterListener, unregisterUpdater, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SingleFileNamingService(I2PAppContext context, String filename)
Method Detail |
---|
public String getName()
getName
in class NamingService
public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
NamingService
lookup
in class NamingService
hostname
- case-sensitive; caller should convert to lower caselookupOptions
- ignoredstoredOptions
- ignored
public String reverseLookup(Destination dest, Properties options)
NamingService
reverseLookup
in class NamingService
options
- ignoreddest
- non-null
public boolean put(String hostname, Destination d, Properties options)
put
in class NamingService
hostname
- case-sensitive; caller should convert to lower caseoptions
- ignored
public boolean putIfAbsent(String hostname, Destination d, Properties options)
NamingService
putIfAbsent
in class NamingService
hostname
- case-sensitive; caller should convert to lower caseoptions
- ignored
public boolean remove(String hostname, Properties options)
remove
in class NamingService
hostname
- case-sensitive; caller should convert to lower caseoptions
- ignored
public Map<String,Destination> getEntries(Properties options)
NamingService
getEntries
in class NamingService
options
- As follows:
Key "search": return only those matching substring
Key "startsWith": return only those starting with
("[0-9]" allowed)
public Set<String> getNames(Properties options)
getNames
in class NamingService
options
- ignored
public int size(Properties options)
size
in class NamingService
options
- ignored
public void shutdown()
NamingService
shutdown
in class NamingService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |