LOG.info("Participant id invalid", e);
resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
AccountData account;
try {
account = accountStore.getAccount(participant);
} catch (PersistenceException e) {
LOG.severe("Failed to retrieve account data for " + participant, e);
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"An unexpected error occured while trying to retrieve account data for "
+ participant.getAddress());
return;
}
if (account == null || !account.isRobot()) {
LOG.info("The account for robot named " + participant + " does not exist");
resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
OAuthConsumer consumer =
new OAuthConsumer(null, participant.getAddress(), account.asRobot().getConsumerSecret(),
oauthServiceProvider);
OAuthAccessor accessor = new OAuthAccessor(consumer);
processOpsRequest(req, resp, message, accessor, participant);
}