"Either dcs.source or a non-empty document list in dcs.c2stream must be provided");
return;
}
// Perform processing
ProcessingResult result = null;
try
{
long start = System.currentTimeMillis();
final String logMsg;
if (requestModel.source != null)
{
logMsg = "Processed results from " + requestModel.source + " with " + requestModel.algorithm;
result = controller.process(processingAttributes, requestModel.source,
requestModel.algorithm);
}
else
{
logMsg = "Processed direct results feed with " + requestModel.algorithm;
result = controller.process(processingAttributes, requestModel.algorithm);
}
if (config.logger.isInfoEnabled()) {
config.logger.info(
String.format(Locale.ENGLISH,
"%s [%.2fs.]",
logMsg,
(System.currentTimeMillis() - start) / 1000.0));
}
}
catch (ProcessingException e)
{
sendInternalServerError("Could not perform processing", response, e);
return;
}
// Serialize the result
try
{
if (OutputFormat.XML.equals(requestModel.outputFormat))
{
transformAndSerializeOutputXml(response, result,
!requestModel.clustersOnly, true);
}
else if (OutputFormat.JSON.equals(requestModel.outputFormat))
{
response.setContentType(MIME_JSON_UTF8);
result.serializeJson(response.getWriter(), requestModel.jsonCallback,
!requestModel.clustersOnly, true);
}
else
{
response.sendError(HttpServletResponse.SC_BAD_REQUEST,