XRD xrd = new XRD();
xrd.setQuery("!nonexistent");
xrd.setStatus(new Status(Status.AUTH_RES_NOT_FOUND));
XRDS xrds = new XRDS();
xrds.add(xrd);
return new ResolvedHttpResponse(new ByteArrayInputStream(xrds.toString().getBytes()));
}
XRDS oDescs = new XRDS();
// just the same response always
XRD oFoo = new XRD();
oFoo.setQuery("!foo");
oFoo.setStatus(new Status(Status.SUCCESS));
oDescs.add(oFoo);
XRD oBar = new XRD();
oBar.setQuery("!bar");
oBar.setStatus(new Status(Status.SUCCESS));
oDescs.add(oBar);
if (uri.getPath().indexOf("!baz") > 0) {
XRD baz = new XRD();
baz.setQuery("!baz");
baz.setStatus(new Status(Status.AUTH_RES_NOT_FOUND, "Not found"));
oDescs.add(baz);
}
return new ResolvedHttpResponse(new ByteArrayInputStream(oDescs.toString().getBytes()));
} // getDataFromURI()