* NamingServices
- Move default reverseLookup to base class - Deprecate unused services
This commit is contained in:
@ -432,12 +432,14 @@ public class I2PAppContext {
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
public PetNameDB petnameDb() {
|
||||
if (!_petnameDbInitialized)
|
||||
initializePetnameDb();
|
||||
return _petnameDb;
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
private void initializePetnameDb() {
|
||||
synchronized (this) {
|
||||
if (_petnameDb == null) {
|
||||
|
@ -7,6 +7,9 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Address;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
public abstract class AddressDB {
|
||||
|
||||
private final static Log _log = new Log(NamingService.class);
|
||||
|
@ -6,6 +6,9 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Address;
|
||||
import net.i2p.data.Destination;
|
||||
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
public class AddressDBNamingService extends NamingService {
|
||||
|
||||
private AddressDB _addressdb;
|
||||
|
@ -5,6 +5,9 @@ import java.util.Collection;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Address;
|
||||
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
public class DummyAddressDB extends AddressDB {
|
||||
|
||||
public DummyAddressDB(I2PAppContext context) {
|
||||
|
@ -27,9 +27,4 @@ class DummyNamingService extends NamingService {
|
||||
public Destination lookup(String hostname) {
|
||||
return lookupBase64(hostname);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String reverseLookup(Destination dest) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,9 +136,4 @@ public class EepGetNamingService extends NamingService {
|
||||
_log.error("Caught from: " + url + hostname);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String reverseLookup(Destination dest) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -126,9 +126,4 @@ public class ExecNamingService extends NamingService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String reverseLookup(Destination dest) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
public class FilesystemAddressDB extends AddressDB {
|
||||
|
||||
public final static String PROP_ADDRESS_DIR = "i2p.addressdir";
|
||||
|
@ -138,6 +138,7 @@ public class HostsTxtNamingService extends NamingService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @deprecated unused */
|
||||
@Override
|
||||
public String reverseLookup(Hash h) {
|
||||
List filenames = getFilenames();
|
||||
|
@ -61,7 +61,9 @@ public abstract class NamingService {
|
||||
* if none is known. It is safe for subclasses to always return
|
||||
* <code>null</code> if no reverse lookup is possible.
|
||||
*/
|
||||
public abstract String reverseLookup(Destination dest);
|
||||
public String reverseLookup(Destination dest) { return null; };
|
||||
|
||||
/** @deprecated unused */
|
||||
public String reverseLookup(Hash h) { return null; };
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import java.util.StringTokenizer;
|
||||
import net.i2p.data.DataHelper;
|
||||
|
||||
/**
|
||||
*
|
||||
* deprecated unused but can be instantiated through I2PAppContext
|
||||
*/
|
||||
public class PetName {
|
||||
private String _name;
|
||||
|
@ -19,7 +19,7 @@ import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* deprecated unused but can be instantiated through I2PAppContext
|
||||
*/
|
||||
public class PetNameDB {
|
||||
/** name (String) to PetName mapping */
|
||||
|
@ -5,6 +5,9 @@ import java.io.IOException;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Destination;
|
||||
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
public class PetNameNamingService extends NamingService {
|
||||
|
||||
private PetNameDB _petnameDb;
|
||||
|
Reference in New Issue
Block a user