}
// validate kam
final KamHandle handle = req.getHandle();
if (handle == null || handle.getHandle() == null) {
throw new RequestException("KamHandle is missing");
}
// Get the Dialect (may be null)
final Dialect dialect = getDialect(req.getDialect());
final org.openbel.framework.api.Kam kam = getKam(
handle, dialect);
final Namespace ns = req.getNamespace();
if (ns == null) {
throw new RequestException("Namespace is missing");
}
final List<String> values = req.getValues();
if (values.isEmpty()) {
throw new RequestException("Values are missing");
}
// read optional filter
final NodeFilter nf = req.getNodeFilter();
// convert namespace/values to NamespaceValue objects for delegation
List<NamespaceValue> nvs = new ArrayList<NamespaceValue>(values.size());
for (String s : values) {
NamespaceValue nv = OBJECT_FACTORY.createNamespaceValue();
nv.setNamespace(ns);
nv.setValue(s);
nvs.add(nv);
}
// delegate to findKamNodesByNamespaceValues
List<org.openbel.framework.api.Kam.KamNode> nodes;
try {
nodes =
KamEndPoint.findKamNodesByNamespacevalues(nvs, nf, kam,
kAMStore,
equivalencer);
} catch (EquivalencerException e) {
throw new RequestException("Error mapping data", e);
} catch (KAMStoreException e) {
throw new RequestException("Error mapping data", e);
}
KamInfo kamInfo = kam.getKamInfo();
final MapDataResponse res = OBJECT_FACTORY.createMapDataResponse();
for (org.openbel.framework.api.Kam.KamNode kn : nodes) {