new ArrayList<Pattern>(request.getPatterns().size());
for (String s : request.getPatterns()) {
patterns.add(verifyPattern(s));
}
FindNamespaceValuesResponse response =
OBJECT_FACTORY.createFindNamespaceValuesResponse();
for (Namespace ns : namespaces) {
ns = verifyNamespace(ns);
try {
// get namespace values
List<String> vals = new ArrayList<String>();
for (Pattern p : patterns) {
vals.addAll(
namespaceService.search(ns.getResourceLocation(), p));
}
// get equivalences
List<NamespaceValue> values = new ArrayList<NamespaceValue>();
for (String v : vals) {
NamespaceValue nv = new NamespaceValue();
nv.setNamespace(ns);
nv.setValue(v);
EquivalenceId eq = equivalencerService.getEquivalenceId(nv);
nv.setEquivalence(eq);
values.add(nv);
}
response.getNamespaceValues().addAll(values);
} catch (IndexingFailure ife) {
final String msg = "error searching namespaces";
throw new RequestException(msg, ife);
} catch (ResourceDownloadError rde) {
final String msg = "error searching namespaces";