loginActionsSent++;
if (sendResponse)
{
ManagerResponse loginResponse;
// let testReconnectWithKeepAliveAfterAuthenticationFailure
// succeed after
// 3 unsuccessful attempts
if (key.equals(expectedKey) || loginActionsSent > 2)
{
loginResponse = new ManagerResponse();
loginResponse.setResponse("Success");
}
else
{
loginResponse = new ManagerError();
loginResponse.setResponse("Error");
loginResponse.setMessage("Authentication failed");
}
loginResponse.setActionId(ManagerUtil.addInternalActionId(action.getActionId(), internalActionId));
dispatchLater(loginResponse);
}
}
else if (action instanceof LogoffAction)
{
logoffActionsSent++;
if (sendResponse)
{
ManagerResponse response;
response = new ManagerResponse();
response.setActionId(ManagerUtil.addInternalActionId(action.getActionId(), internalActionId));
response.setResponse("Success");
dispatchLater(response);
}
}
else
{
otherActionsSent++;
if (sendResponse)
{
ManagerResponse response;
response = new ManagerResponse();
response.setActionId(ManagerUtil.addInternalActionId(action.getActionId(), internalActionId));
response.setResponse("Success");
dispatchLater(response);
}
}
}