String msg = "Failed to execute query at path: " + queryResource.getPath() +
". Query resources should have a media type to map to a query processor.";
throw new RegistryException(msg);
}
QueryProcessor queryProcessor =
queryProcessors.get(queryResource.getMediaType());
if (queryProcessor == null) {
String msg = "Failed to execute query at path: " + queryResource.getPath() +
". No query processor is associated with the query type: " +
queryResource.getMediaType();
throw new RegistryException(msg);
}
return queryProcessor.executeQuery(registry, queryResource, parameters);
}