This commit is contained in:
zzz
2011-05-23 19:16:33 +00:00
parent 4ea5622842
commit 7ab95d0144
21 changed files with 79 additions and 74 deletions

View File

@ -156,7 +156,7 @@ class AddressBook {
/**
* Return an iterator over the addresses in the AddressBook.
* @since 0.8.6
* @since 0.8.7
*/
public Iterator<Map.Entry<String, String>> iterator() {
if (this.subFile != null)
@ -166,7 +166,7 @@ class AddressBook {
/**
* Delete the temp file or clear the map.
* @since 0.8.6
* @since 0.8.7
*/
public void delete() {
if (this.subFile != null) {

View File

@ -38,7 +38,7 @@ import java.util.NoSuchElementException;
* Callers should iterate all the way through or call close()
* to ensure the underlying stream is closed.
*
* @since 0.8.6
* @since 0.8.7
*/
class ConfigIterator implements Iterator<Map.Entry<String, String>> {

View File

@ -109,7 +109,7 @@ public class Daemon {
* @param log
* The log to write changes and conflicts to.
* May be null.
* @since 0.8.6
* @since 0.8.7
*/
public static void update(NamingService router, File published, SubscriptionList subscriptions, Log log) {
// If the NamingService is a database, we look up as we go.

View File

@ -67,7 +67,7 @@ class DaemonThread extends Thread implements NamingServiceUpdater {
/**
* The NamingServiceUpdater interface
* @param options ignored
* @since 0.8.6
* @since 0.8.7
*/
public void update(Properties options) {
interrupt();

View File

@ -207,12 +207,12 @@ class SummaryListener implements RateSummaryListener {
long now() { return _context.clock().now(); }
/** @since 0.8.6 */
/** @since 0.8.7 */
String getBackendName() {
return _isPersistent ? RrdNioBackendFactory.NAME : RrdMemoryBackendFactory.NAME;
}
/** @since 0.8.6 */
/** @since 0.8.7 */
int getRows() {
return _rows;
}

View File

@ -73,7 +73,7 @@ public class AddressBean
/**
* The Unicode name, translated from Punycode
* @return the original string on error
* @since 0.8.6
* @since 0.8.7
*/
public String getDisplayName()
{
@ -83,7 +83,7 @@ public class AddressBean
/**
* The Unicode name, translated from Punycode
* @return the original string on error
* @since 0.8.6
* @since 0.8.7
*/
public static String toUnicode(String host) {
if (haveIDN)
@ -93,7 +93,7 @@ public class AddressBean
/**
* Is the ASCII name Punycode-encoded?
* @since 0.8.6
* @since 0.8.7
*/
public boolean isIDN()
{
@ -110,7 +110,7 @@ public class AddressBean
* @param name will be converted to lower case
* @return name converted to lower case and punycoded if necessary
* @throws IAE on various errors or if IDN is needed but not available
* @since 0.8.6
* @since 0.8.7
*/
static String toASCII(String host) throws IllegalArgumentException {
host = host.toLowerCase();
@ -159,7 +159,7 @@ public class AddressBean
return host;
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public String getB32()
{
byte[] dest = Base64.decode(destination);
@ -169,12 +169,12 @@ public class AddressBean
return Base32.encode(hash) + ".b32.i2p";
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public void setProperties(Properties p) {
props = p;
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public String getSource() {
String rv = getProp("s");
if (rv.startsWith("http://"))
@ -182,25 +182,25 @@ public class AddressBean
return rv;
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public String getAdded() {
return getDate("a");
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public String getModded() {
return getDate("m");
}
/** @since 0.8.6 */
/** @since 0.8.7 */
public String getNotes() {
return getProp("notes");
}
/**
* Do this the easy way
* @since 0.8.6
* @since 0.8.7
*/
public String getCert() {
// (4 / 3) * (pubkey length + signing key length)
@ -224,7 +224,7 @@ public class AddressBean
}
}
/** @since 0.8.6 */
/** @since 0.8.7 */
private String getProp(String p) {
if (props == null)
return "";
@ -232,7 +232,7 @@ public class AddressBean
return rv != null ? rv : "";
}
/** @since 0.8.6 */
/** @since 0.8.7 */
private String getDate(String key) {
String d = getProp(key);
if (d.length() > 0) {

View File

@ -443,7 +443,7 @@ public class AddressbookBean
/**
* @return beginning index into results
* @since 0.8.6
* @since 0.8.7
*/
public String getResultBegin() {
return isPrefiltered() ? "0" : Integer.toString(getBeginInt());
@ -465,7 +465,7 @@ public class AddressbookBean
/**
* @return ending index into results
* @since 0.8.6
* @since 0.8.7
*/
public String getResultEnd() {
return Integer.toString(isPrefiltered() ? resultSize() - 1 : getEndInt());
@ -480,7 +480,7 @@ public class AddressbookBean
/**
* Does the entries map contain only the lookup result,
* or must we index into it?
* @since 0.8.6
* @since 0.8.7
*/
protected boolean isPrefiltered() {
return false;
@ -488,7 +488,7 @@ public class AddressbookBean
/**
* @return the size of the lookup result
* @since 0.8.6
* @since 0.8.7
*/
protected int resultSize() {
return entries.length;
@ -496,7 +496,7 @@ public class AddressbookBean
/**
* @return the total size of the address book
* @since 0.8.6
* @since 0.8.7
*/
protected int totalSize() {
return entries.length;
@ -517,7 +517,7 @@ public class AddressbookBean
return Messages.getString(s, o, o2);
}
/** translate (ngettext) @since 0.8.6 */
/** translate (ngettext) @since 0.8.7 */
protected static String ngettext(String s, String p, int n) {
return Messages.getString(n, s, p);
}

View File

@ -8,7 +8,7 @@ import net.i2p.I2PAppContext;
/**
* Format a date in local time zone
* @since 0.8.6
* @since 0.8.7
*/
public abstract class FormatDate
{

View File

@ -32,7 +32,7 @@ public class Messages {
return Translate.getString(s, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
}
/** translate (ngettext) @since 0.8.6 */
/** translate (ngettext) @since 0.8.7 */
public static String getString(int n, String s, String p) {
return Translate.getString(n, s, p, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
}

View File

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @since 0.8.6
* @since 0.8.7
*/
package i2p.susi.dns;
@ -41,7 +41,7 @@ import net.i2p.data.Destination;
* Talk to the NamingService API instead of modifying the hosts.txt files directly,
* except for the 'published' addressbook.
*
* @since 0.8.6
* @since 0.8.7
*/
public class NamingServiceBean extends AddressbookBean
{

View File

@ -70,6 +70,8 @@ import net.metanotion.util.skiplist.SkipList;
* </pre>
*
* All host names are converted to lower case.
*
* @since 0.8.7
*/
public class BlockfileNamingService extends DummyNamingService {

View File

@ -86,7 +86,7 @@ class DummyNamingService extends NamingService {
}
}
/** @since 0.8.5 */
/** @since 0.8.7 */
protected static void removeCache(String s) {
synchronized (_cache) {
_cache.remove(s);

View File

@ -49,7 +49,7 @@ public class MetaNamingService extends DummyNamingService {
/**
* @param services if non-null, services to be added. If null, this will only handle b32 and b64,
* until addNamingService() is called later.
* @since 0.8.5
* @since 0.8.7
*/
public MetaNamingService(I2PAppContext context, List<NamingService> services) {
super(context);

View File

@ -97,7 +97,7 @@ public abstract class NamingService {
/**
* @return Class simple name by default
* @since 0.8.5
* @since 0.8.7
*/
public String getName() {
return getClass().getSimpleName();
@ -105,7 +105,7 @@ public abstract class NamingService {
/**
* @return NamingService-specific options or null
* @since 0.8.5
* @since 0.8.7
*/
public Properties getConfiguration() {
return null;
@ -113,7 +113,7 @@ public abstract class NamingService {
/**
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean setConfiguration(Properties p) {
return true;
@ -123,7 +123,7 @@ public abstract class NamingService {
/**
* @return chained naming services or null
* @since 0.8.5
* @since 0.8.7
*/
public List<NamingService> getNamingServices() {
return null;
@ -131,7 +131,7 @@ public abstract class NamingService {
/**
* @return parent naming service or null if this is the root
* @since 0.8.5
* @since 0.8.7
*/
public NamingService getParent() {
return null;
@ -158,7 +158,7 @@ public abstract class NamingService {
/**
* Only for chaining-capable NamingServices
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean removeNamingService(NamingService ns) {
return false;
@ -170,7 +170,7 @@ public abstract class NamingService {
/**
* @return number of entries or -1 if unknown
* @since 0.8.5
* @since 0.8.7
*/
public int size() {
return size(null);
@ -179,7 +179,7 @@ public abstract class NamingService {
/**
* @param options NamingService-specific, can be null
* @return number of entries (matching the options if non-null) or -1 if unknown
* @since 0.8.5
* @since 0.8.7
*/
public int size(Properties options) {
return -1;
@ -189,7 +189,7 @@ public abstract class NamingService {
* @return all mappings
* or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5
* @since 0.8.7
*/
public Map<String, Destination> getEntries() {
return getEntries(null);
@ -200,7 +200,7 @@ public abstract class NamingService {
* @return all mappings (matching the options if non-null)
* or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5
* @since 0.8.7
*/
public Map<String, Destination> getEntries(Properties options) {
return Collections.EMPTY_MAP;
@ -212,7 +212,7 @@ public abstract class NamingService {
* @return all mappings (matching the options if non-null)
* or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5
* @since 0.8.7
*/
public Map<String, String> getBase64Entries(Properties options) {
return Collections.EMPTY_MAP;
@ -222,7 +222,7 @@ public abstract class NamingService {
* @return all known host names
* or empty Set if none;
* Returned Set is not necessarily sorted, implementation dependent
* @since 0.8.5
* @since 0.8.7
*/
public Set<String> getNames() {
return getNames(null);
@ -233,7 +233,7 @@ public abstract class NamingService {
* @return all known host names (matching the options if non-null)
* or empty Set if none;
* Returned Set is not necessarily sorted, implementation dependent
* @since 0.8.5
* @since 0.8.7
*/
public Set<String> getNames(Properties options) {
return Collections.EMPTY_SET;
@ -241,7 +241,7 @@ public abstract class NamingService {
/**
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean put(String hostname, Destination d) {
return put(hostname, d, null);
@ -250,7 +250,7 @@ public abstract class NamingService {
/**
* @param options NamingService-specific, can be null
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean put(String hostname, Destination d, Properties options) {
return false;
@ -259,7 +259,7 @@ public abstract class NamingService {
/**
* Fails if entry previously exists
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean putIfAbsent(String hostname, Destination d) {
return putIfAbsent(hostname, d, null);
@ -269,7 +269,7 @@ public abstract class NamingService {
* Fails if entry previously exists
* @param options NamingService-specific, can be null
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean putIfAbsent(String hostname, Destination d, Properties options) {
return false;
@ -278,7 +278,7 @@ public abstract class NamingService {
/**
* @param options NamingService-specific, can be null
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean putAll(Map<String, Destination> entries, Properties options) {
boolean rv = true;
@ -294,7 +294,7 @@ public abstract class NamingService {
* @param d may be null if only options are changing
* @param options NamingService-specific, can be null
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean update(String hostname, Destination d, Properties options) {
return false;
@ -302,7 +302,7 @@ public abstract class NamingService {
/**
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean remove(String hostname) {
return remove(hostname, null);
@ -311,7 +311,7 @@ public abstract class NamingService {
/**
* @param options NamingService-specific, can be null
* @return success
* @since 0.8.5
* @since 0.8.7
*/
public boolean remove(String hostname, Properties options) {
return false;
@ -320,7 +320,7 @@ public abstract class NamingService {
/**
* Ask any registered updaters to update now
* @param options NamingService- or updater-specific, may be null
* @since 0.8.5
* @since 0.8.7
*/
public void requestUpdate(Properties options) {
for (NamingServiceUpdater nsu : _updaters) {
@ -329,28 +329,28 @@ public abstract class NamingService {
}
/**
* @since 0.8.5
* @since 0.8.7
*/
public void registerListener(NamingServiceListener nsl) {
_listeners.add(nsl);
}
/**
* @since 0.8.5
* @since 0.8.7
*/
public void unregisterListener(NamingServiceListener nsl) {
_listeners.remove(nsl);
}
/**
* @since 0.8.6
* @since 0.8.7
*/
public void registerUpdater(NamingServiceUpdater nsu) {
_updaters.add(nsu);
}
/**
* @since 0.8.6
* @since 0.8.7
*/
public void unregisterUpdater(NamingServiceUpdater nsu) {
_updaters.remove(nsu);
@ -363,7 +363,7 @@ public abstract class NamingService {
* @param lookupOptions input parameter, NamingService-specific, can be null
* @param storedOptions output parameter, NamingService-specific, any stored properties will be added if non-null
* @return dest or null
* @since 0.8.5
* @since 0.8.7
*/
public abstract Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions);
@ -371,7 +371,7 @@ public abstract class NamingService {
* Same as reverseLookup(dest) but with options
* @param options NamingService-specific, can be null
* @return host name or null
* @since 0.8.5
* @since 0.8.7
*/
public String reverseLookup(Destination d, Properties options) {
return null;
@ -383,7 +383,7 @@ public abstract class NamingService {
* @param hostname must be {52 chars}.b32.i2p
* @param timeout in seconds; <= 0 means use router default
* @return dest or null
* @since 0.8.5
* @since 0.8.7
*/
public Destination lookupBase32(String hostname, int timeout) {
return null;
@ -393,7 +393,7 @@ public abstract class NamingService {
* Same as lookupB32 but with the SHA256 Hash precalculated
* @param timeout in seconds; <= 0 means use router default
* @return dest or null
* @since 0.8.5
* @since 0.8.7
*/
public Destination lookup(Hash hash, int timeout) {
return null;
@ -403,7 +403,7 @@ public abstract class NamingService {
* Parent will call when added.
* If this is the root naming service, the core will start it.
* Should not be called by others.
* @since 0.8.5
* @since 0.8.7
*/
public void start() {}
@ -411,7 +411,7 @@ public abstract class NamingService {
* Parent will call when removed.
* If this is the root naming service, the core will stop it.
* Should not be called by others.
* @since 0.8.5
* @since 0.8.7
*/
public void shutdown() {}

View File

@ -5,7 +5,7 @@ import java.util.Properties;
import net.i2p.data.Destination;
/**
* @since 0.8.6
* @since 0.8.7
*/
public interface NamingServiceListener {

View File

@ -3,7 +3,7 @@ package net.i2p.client.naming;
import java.util.Properties;
/**
* @since 0.8.6
* @since 0.8.7
*/
public interface NamingServiceUpdater {

View File

@ -47,7 +47,7 @@ import net.i2p.util.SecureFileOutputStream;
* Use from HostsTxtNamingService or chain with another NamingService
* via MetaNamingService if you need those features.
*
* @since 0.8.5
* @since 0.8.7
*/
public class SingleFileNamingService extends NamingService {

View File

@ -165,7 +165,7 @@ public class DataHelper {
* Use utf8 = true for SessionConfig (slow, UTF-8)
* @param props source may be null
* @param sort should we sort the properties? (set to false if already sorted, e.g. OrderedProperties)
* @since 0.8.6
* @since 0.8.7
*/
public static void writeProperties(OutputStream rawStream, Properties props, boolean utf8, boolean sort)
throws DataFormatException, IOException {

View File

@ -89,7 +89,7 @@ public class StatManager {
* @param description simple description of the statistic
* @param group used to group statistics together
* @param periods array of period lengths (in milliseconds)
* @since 0.8.6
* @since 0.8.7
*/
public void createRequiredFrequencyStat(String name, String description, String group, long periods[]) {
if (_frequencyStats.containsKey(name)) return;
@ -118,7 +118,7 @@ public class StatManager {
* @param description simple description of the statistic
* @param group used to group statistics together
* @param periods array of period lengths (in milliseconds)
* @since 0.8.6
* @since 0.8.7
*/
public void createRequiredRateStat(String name, String description, String group, long periods[]) {
if (_rateStats.containsKey(name)) return;

View File

@ -17,6 +17,7 @@ import net.i2p.I2PAppContext;
/**
* Simple helper for uploading files and such via HTTP POST (rfc 1867)
*
* @deprecated unused
*/
public class EepPost {
private I2PAppContext _context;
@ -209,10 +210,10 @@ public class EepPost {
}
private String getSeparator() {
if (false)
return "ABCDEFG";
if (false)
return "------------------------" + new java.util.Random().nextLong();
//if (false)
// return "ABCDEFG";
//if (false)
// return "------------------------" + new java.util.Random().nextLong();
byte separator[] = new byte[32]; // 2^-128 chance of this being a problem
I2PAppContext.getGlobalContext().random().nextBytes(separator);
StringBuilder sep = new StringBuilder(48);

View File

@ -75,6 +75,7 @@ public class HTTPSendData {
}
}
/****
public static void main(String args[]) {
byte data[] = new byte[4096];
for (int i = 0; i < data.length; i++)
@ -88,4 +89,5 @@ public class HTTPSendData {
} catch (InterruptedException ie) { // nop
}
}
****/
}