{
if(LOGGER.isDebugEnabled())
{
LOGGER.debug("Creating SaslServer for mechanism: " + mechanism);
}
SaslServer saslServer = subjectCreator.createSaslServer(mechanism, request.getServerName(), null/*TODO*/);
evaluateSaslResponse(request, response, session, saslResponse, saslServer, subjectCreator);
}
else
{
response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED);
session.removeAttribute(ATTR_ID);
session.removeAttribute(ATTR_SASL_SERVER);
session.removeAttribute(ATTR_EXPIRY);
}
}
else
{
if(id != null)
{
if(id.equals(session.getAttribute(ATTR_ID)) && System.currentTimeMillis() < (Long) session.getAttribute(ATTR_EXPIRY))
{
SaslServer saslServer = (SaslServer) session.getAttribute(ATTR_SASL_SERVER);
evaluateSaslResponse(request, response, session, saslResponse, saslServer, subjectCreator);
}
else
{
response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED);