try {
message = protocolManager.receiveJsonRequest(asyncCtx);
if (message == null) {
throw new KurentoMediaFrameworkException(
"Null json message received", 10020);
}
AbstractContentSession contentSession = null;
String sessionId = message.getParams() != null ? message
.getParams().getSessionId() : null;
if (sessionId == null && message.getMethod().equals(METHOD_START)) {
// Session is created by a start request, we need to fill
// asyncCtx associated to start requests.
contentSession = createContentSession(asyncCtx, contentId);
contentSessionManager.put(contentSession);
} else if (sessionId == null
&& message.getMethod().equals(METHOD_EXECUTE)) {
// Session is created by an execute request, the asyncCtx for
// start requests must be set to null
contentSession = createContentSession(null, contentId);
contentSessionManager.put(contentSession);
} else if (sessionId != null) {
contentSession = contentSessionManager.get(sessionId);
if (contentSession == null) {
throw new KurentoMediaFrameworkException(
"Could not find contentSession object associated to sessionId "
+ sessionId, 10021);
}
} else {
throw new KurentoMediaFrameworkException(
"Could not find required sessionId field in request",
10022);
}
Future<?> future = executor.getExecutor().submit(