logger.trace("Issuing request again with Authorization header"); //$NON-NLS-1$
response = context.doChain(request);
if (response.getStatusCode() == UNAUTHORIZED) {
logger
.trace("After sending request with Authorization header, still got " + UNAUTHORIZED + " response"); //$NON-NLS-1$
throw new ClientAuthenticationException(Messages
.getMessage("serviceFailedToAuthenticateUser", handlerUsername)); //$NON-NLS-1$
} else {
logger.trace("Got a non-" + UNAUTHORIZED + " response, so returning response"); //$NON-NLS-1$
return response;
}
} else {
logger.trace("user and/or password were not set so throwing exception"); //$NON-NLS-1$
// no user credential available
throw new ClientAuthenticationException(Messages
.getMessage("missingClientAuthenticationCredentialForUser", handlerUsername)); //$NON-NLS-1$
}
} else {
logger
.trace("Status code was not " + UNAUTHORIZED + " so no need to re-issue request."); //$NON-NLS-1$