public class SingleFileNamingService extends NamingService
_context, _listeners, _log, _updaters, PROP_IMPL| Constructor | Description |
|---|---|
SingleFileNamingService(I2PAppContext context,
String filename) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
export(Writer out,
Properties options) |
Overridden for efficiency.
|
Map<String,String> |
getBase64Entries(Properties options) |
Overridden since we store base64 natively.
|
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) |
Will strip a "www." prefix and retry if lookup fails
|
boolean |
put(String hostname,
Destination d,
Properties options) |
Add a hostname and Destination to the addressbook.
|
boolean |
putIfAbsent(String hostname,
Destination d,
Properties options) |
Add a hostname and Destination to the addressbook.
|
boolean |
remove(String hostname,
Properties options) |
Delete the entry.
|
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) |
This implementation returns -1.
|
static void |
writeOptions(Properties options,
Writer out) |
Write the subscription options part of the line (including the #!).
|
addDestination, addDestination, addNamingService, addNamingService, createInstance, export, getConfiguration, getEntries, getNames, getNamingServices, getParent, lookup, lookup, lookupAll, lookupAll, lookupBase32, lookupBase64, put, putAll, putIfAbsent, registerListener, registerUpdater, remove, remove, remove, removeNamingService, requestUpdate, reverseLookup, reverseLookup, reverseLookupAll, reverseLookupAll, reverseLookupAll, setConfiguration, size, start, toString, unregisterListener, unregisterUpdater, updatepublic SingleFileNamingService(I2PAppContext context, String filename)
public String getName()
getName in class NamingServicepublic Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
lookup in class NamingServicehostname - case-sensitive; caller should convert to lower caselookupOptions - ignoredstoredOptions - ignoredpublic String reverseLookup(Destination dest, Properties options)
NamingServicereverseLookup in class NamingServiceoptions - ignoreddest - non-nullpublic boolean put(String hostname, Destination d, Properties options)
NamingServiceput in class NamingServicehostname - case-sensitive; caller should convert to lower caseoptions - if non-null, any prefixed with '=' will be appended
in subscription formatpublic boolean putIfAbsent(String hostname, Destination d, Properties options)
NamingServiceputIfAbsent in class NamingServicehostname - case-sensitive; caller should convert to lower caseoptions - if non-null, any prefixed with '=' will be appended
in subscription formatpublic static void writeOptions(Properties options, Writer out) throws IOException
options - non-nullIOExceptionpublic boolean remove(String hostname, Properties options)
NamingServiceremove in class NamingServicehostname - case-sensitive; caller should convert to lower caseoptions - ignoredpublic Map<String,Destination> getEntries(Properties options)
NamingServicegetEntries in class NamingServiceoptions - As follows:
Key "search": return only those matching substring
Key "startsWith": return only those starting with
("[0-9]" allowed)public Map<String,String> getBase64Entries(Properties options)
getBase64Entries in class NamingServiceoptions - As follows:
Key "search": return only those matching substring
Key "startsWith": return only those starting with
("[0-9]" allowed)public void export(Writer out, Properties options) throws IOException
export in class NamingServiceoptions - ignoredIOExceptionpublic Set<String> getNames(Properties options)
getNames in class NamingServiceoptions - ignoredpublic int size(Properties options)
NamingServicesize in class NamingServiceoptions - ignoredpublic void shutdown()
NamingServiceshutdown in class NamingService