final DFSMessage dfsMsg = (DFSMessage)message.specification;
switch(dfsMsg) {
case ERROR: {
final IdlCommon.Error errorPayload = (Error)message.payload;
final CompletionToken token = errorPayload.getToken();
this.transcript.traceDebugging ("processing the failure (error) response for pending request with token `%s` with message `%s`...", token.getMessageId (), errorPayload.getErrorMessage ());
this.pendingRequests.fail(token.getMessageId(), new Exception (errorPayload.getErrorMessage ()));
}
break;
case SUCCESS: {
final SuccessResponse successPayload = (SuccessResponse)message.payload;
final CompletionToken token = successPayload.getToken();
this.transcript.traceDebugging ("processing the success response for pending request with token `%s`...", token.getMessageId ());
if(successPayload.getSuccessful()){
this.pendingRequests.succeed(token.getMessageId(), null);
}else {
this.pendingRequests.fail(token.getMessageId(), new Exception ("I/O exception")); //TODO err message?
}
}
break;
case LISTING: {
final ListResult listResultPayload = (ListResult)message.payload;
final CompletionToken token = listResultPayload.getToken();
this.transcript.traceDebugging ("processing the list response for pending request with token `%s`...", token.getMessageId ());
List<LsElement> list = getLsResult(listResultPayload);
this.pendingRequests.succeed(token.getMessageId(), list);
}
break;
case HANDLER: {
receivedHandlerRequest(message);
}