s_logger.debug("apiKey does not map to a valid user -- ignoring request, apiKey: " + apiKey);
returnfalse;
}
user = userAcctPair.first();
Accountaccount = userAcctPair.second();
if (user.getState() != Account.State.enabled || !account.getState().equals(Account.State.enabled)) {
s_logger.info("disabled or locked user accessing the api, userid = " + user.getId() + "; name = " + user.getUsername() + "; state: " + user.getState() + "; accountState: "
+ account.getState());
returnfalse;
}
try{
checkCommandAvailable(user, commandName);
}
catch (PermissionDeniedExceptionex){
s_logger.debug("The given command:" + commandName + " does not exist or it is not available for user");
thrownewServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + " does not exist or it is not available for user with id:" + userId);
}
// verify secret key exists
secretKey = user.getSecretKey();
if (secretKey == null) {
s_logger.info("User does not have a secret key associated with the account -- ignoring request, username: " + user.getUsername());