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() |
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.
|
(package private) 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, update
public SingleFileNamingService(I2PAppContext context, String filename)
public String getName()
getName
in class NamingService
public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
lookup
in class NamingService
hostname
- case-sensitive; caller should convert to lower caselookupOptions
- ignoredstoredOptions
- ignoredpublic String reverseLookup(Destination dest, Properties options)
NamingService
reverseLookup
in class NamingService
options
- ignoreddest
- non-nullpublic boolean put(String hostname, Destination d, Properties options)
NamingService
put
in class NamingService
hostname
- 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)
NamingService
putIfAbsent
in class NamingService
hostname
- case-sensitive; caller should convert to lower caseoptions
- if non-null, any prefixed with '=' will be appended
in subscription formatstatic void writeOptions(Properties options, Writer out) throws IOException
options
- non-nullIOException
public boolean remove(String hostname, Properties options)
NamingService
remove
in class NamingService
hostname
- case-sensitive; caller should convert to lower caseoptions
- ignoredpublic 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 Map<String,String> getBase64Entries(Properties options)
getBase64Entries
in class NamingService
options
- 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 NamingService
options
- ignoredIOException
public Set<String> getNames(Properties options)
getNames
in class NamingService
options
- ignoredpublic int size(Properties options)
NamingService
size
in class NamingService
options
- ignoredpublic void shutdown()
NamingService
shutdown
in class NamingService