@Override
public LogoutResponseDMO logout(LogoutRequestDMO logoutRequest) {
// All requests are immediately wrapped for use on the server. This includes
// associating the request with the originating HttpServletRequest.
LogoutRequest request = new LogoutRequest(logoutRequest, getThreadLocalRequest());
LogoutResponse response = null;
if (request.isTrackingEnabled())
logger.trace("Received by DMP servlet:\n" + request.toOIF());
try {
// Ensure that the session is valid - if it isn't, an error reponse
// will be returned.
response = (LogoutResponse) securityManager.validateSession(request);
if (response == null){
// All activity takes place against the session
// SessionRI session = securityManager.getSession(request);
response = securityManager.logout(request);
}
} catch (DmcValueException e) {
response = (LogoutResponse) request.getErrorResponse();
response.setResponseText(e.toString());
logger.error(e.toString());
} catch (Exception ex){
logger.error(DebugInfo.extractTheStack(ex));
response = (LogoutResponse) request.getErrorResponse();
response.setResponseText(DebugInfo.extractTheStack(ex));
}
return(response.getDMO());
}