soLog.warn("Cannot find subsegment: " + subSegmentName);
return(null);
}
Authority authority = moStore.getSubSegmentAuthority(subSegment);
// look up Refs and Services from the store, as well as LocalIDs if the store supports it
Ref[] refs = moStore.getAuthorityRefs(authority);
Service[] services = moStore.getAuthorityServices(authority);
LocalID[] localIds;
if (moStore instanceof StoreBetterLookup) {
localIds = ((StoreBetterLookup) moStore).getSubSegmentLocalIds(subSegment);
} else {
localIds = new LocalID[0];
}
// fill it with information we got from the store
for (int ii=0; ii<refs.length; ii++) xrd.addRef(refs[ii]);
for (int ii=0; ii<services.length; ii++) xrd.addService(services[ii]);
for (int ii=0; ii<localIds.length; ii++) xrd.addLocalID(localIds[ii]);
// do we want a local authority resolution service for this authority?
// this piece of information comes from the store, but we actually create
// the service, since this requires knowledge of the server configuration
if (authority.getLocalAuthService().equals(Boolean.TRUE)) {
URI[] uris;
try {
uris = new URI[2];
uris[0] = fillURI(authority.getAuthorityId(), "http");
uris[1] = fillURI(authority.getAuthorityId(), "https");
} catch(URISyntaxException ex) {
throw new ServerException("Invalid URI for authority resolution service.", ex);
}
xrd.addService(new AuthorityResolutionService(uris, authority.getAuthorityId()));
}
// let our subclasses finish the XRD before we append it to the XRDS
this.finishXRD(