* getName, getLocation -> getByName, getByLocation
This commit is contained in:
@ -16,7 +16,7 @@ public class PetNameDB {
|
||||
_names = Collections.synchronizedMap(new HashMap());
|
||||
}
|
||||
|
||||
public PetName getName(String name) { return (PetName)_names.get(name); }
|
||||
public PetName getByName(String name) { return (PetName)_names.get(name); }
|
||||
public void add(PetName pn) { _names.put(pn.getName(), pn); }
|
||||
public void clear() { _names.clear(); }
|
||||
public boolean contains(PetName pn) { return _names.containsValue(pn); }
|
||||
@ -38,7 +38,7 @@ public class PetNameDB {
|
||||
return rv;
|
||||
}
|
||||
|
||||
public PetName getLocation(String location) {
|
||||
public PetName getByLocation(String location) {
|
||||
if (location == null) return null;
|
||||
synchronized (_names) {
|
||||
for (Iterator iter = iterator(); iter.hasNext(); ) {
|
||||
|
@ -51,7 +51,7 @@ public class PetNameNamingService extends NamingService {
|
||||
}
|
||||
|
||||
public Destination lookup(String hostname) {
|
||||
PetName name = _petnameDb.getName(hostname);
|
||||
PetName name = _petnameDb.getByName(hostname);
|
||||
if (name != null && name.getNetwork().equalsIgnoreCase("i2p")) {
|
||||
return lookupBase64(name.getLocation());
|
||||
} else {
|
||||
@ -60,6 +60,6 @@ public class PetNameNamingService extends NamingService {
|
||||
}
|
||||
|
||||
public String reverseLookup(Destination dest) {
|
||||
return _petnameDb.getLocation(dest.toBase64()).getName();
|
||||
return _petnameDb.getByLocation(dest.toBase64()).getName();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user