protected String myhostname;
protected int myport;
protected final String aaf_locator_host;
+ protected final URI aaf_locator_uri;
private long earliest;
private final long refreshWait;
public AbsAAFLocator(Access access, String name, final long refreshMin) throws LocatorException {
aaf_locator_host = access.getProperty(Config.AAF_LOCATE_URL, null);
+ if(aaf_locator_host==null) {
+ aaf_locator_uri = null;
+ } else {
+ try {
+ aaf_locator_uri = new URI(aaf_locator_host);
+ } catch (URISyntaxException e) {
+ throw new LocatorException(e);
+ }
+ }
- epList = new LinkedList<EP>();
+ epList = new LinkedList<>();
refreshWait = refreshMin;
this.access = access;
version = split[1];
name = split[0];
break;
+ default:
+ break;
}
}
}
}
private boolean noEntries() {
- return epList.size()<=0;
+ return epList.isEmpty();
}
@Override
if(!hasItems()) {
throw new LocatorException("No Entries found" + (pathInfo==null?"":(" for " + pathInfo)));
}
- List<EP> lep = new ArrayList<EP>();
+ List<EP> lep = new ArrayList<>();
EP first = null;
// Note: Deque is sorted on the way by closest distance
Iterator<EP> iter = getIterator();
}
protected static class EP implements Comparable<EP> {
- public URI uri;
- public final double distance;
+ private URI uri;
+ private final double distance;
private boolean valid;
public EP(final Endpoint ep, double latitude, double longitude) throws URISyntaxException {
try {
return new URI(rv.getScheme(),rv.getUserInfo(),rv.getHost(),rv.getPort(),pathInfo,query,fragment);
} catch (URISyntaxException e) {
- throw new LocatorException("Error copying URL");
+ throw new LocatorException("Error copying URL", e);
}
}
return rv;