tx.sendResponse(HTTP_NOT_FOUND, "text/plain", "404 Not Found.");
}
else
{ // If we get this far we can create the Object and invoke the method.
// We can create a QmfConsoleData with nothing but an ObjectId and the agent.
QmfConsoleData object = new QmfConsoleData(Collections.EMPTY_MAP, agent);
object.setObjectId(oid);
String request = tx.getRequestString();
_log.info("QpidServer.doPost path: {} body: {}", tx.getRequestURI(), request);
//System.out.println(request);
String method = "";
try
{
Map<String, Object> reqMap = JSON.toMap(request);
method = (String)reqMap.get("_method_name");
Object arguments = reqMap.get("_arguments");
Map args = (arguments instanceof Map) ? (Map)arguments : null;
//System.out.println("method: " + method + ", args: " + args);
// Parse the args if present into a QmfData (needed by invokeMethod).
QmfData inArgs = (args == null) ? new QmfData() : new QmfData(args);
// Invoke the specified method on the QmfConsoleData we've created.
MethodResult results = null;
_log.info("invokeMethod: {}", request);
results = object.invokeMethod(method, inArgs);
tx.sendResponse(HTTP_OK, "application/json", JSON.fromObject(results));
}
catch (QmfException qmfe)
{
_log.info("QpidServer.doPost() caught Exception {}", qmfe.getMessage());