public class SingleFileNamingService extends NamingService
_context, _listeners, _log, _updaters, PROP_IMPL| Constructor and Description |
|---|
SingleFileNamingService(I2PAppContext context,
String filename) |
| Modifier and Type | Method and 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()
Get the name of this naming service.
|
Set<String> |
getNames(Properties options)
Get all known hostnames matching the specified 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, isB32Host, isBlindedHost, isI2PHost, 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 void export(Writer out, Properties options) throws IOException
export in class NamingServiceoptions - ignoredout - the writer to export toIOException - if an I/O error occurspublic Map<String,String> getBase64Entries(Properties options)
getBase64Entries in class NamingServiceoptions - null OK, or as follows:
Key "search": return only those matching substring
Key "startsWith": return only those starting with
("[0-9]" allowed)public Map<String,Destination> getEntries(Properties options)
NamingServicegetEntries in class NamingServiceoptions - null OK, or as follows:
Key "search": return only those matching substring
Key "startsWith": return only those starting with
("[0-9]" allowed)public String getName()
NamingServicegetName in class NamingServicepublic Set<String> getNames(Properties options)
NamingServicegetNames in class NamingServiceoptions - ignoredpublic Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
lookup in class NamingServicehostname - case-sensitive; caller should convert to lower caselookupOptions - ignoredstoredOptions - ignoredpublic 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 formatd - the destination for the hostnamepublic 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 formatd - the destination for the hostnamepublic boolean remove(String hostname, Properties options)
NamingServiceremove in class NamingServicehostname - case-sensitive; caller should convert to lower caseoptions - ignoredpublic String reverseLookup(Destination dest, Properties options)
NamingServicereverseLookup in class NamingServiceoptions - ignoreddest - non-null destination to look uppublic void shutdown()
NamingServiceshutdown in class NamingServicepublic int size(Properties options)
NamingServicesize in class NamingServiceoptions - ignoredpublic static void writeOptions(Properties options, Writer out) throws IOException
options - non-nullIOException