this.authenticated = authenticateAccount(request,
AccountRole.USERADMINISTRATOR);
if (this.authenticated) {
GDataServerRegistry registry = GDataServerRegistry.getRegistry();
ServiceFactory factory = registry.lookup(ServiceFactory.class,
ComponentType.SERVICEFACTORY);
try {
GDataAccount account = getAccountFromRequest(request);
if (!account.requiredValuesSet()) {
setError(GDataResponse.SERVER_ERROR,
"Required server component not available");
throw new AccountHandlerException(
"Required values are not set -- account can not be saved -- "
+ account);
}
this.service = factory.getAdminService();
processServiceAction(account);
} catch (ServiceException e) {
LOG.error("Can't process account action -- " + e.getMessage(),
e);
setError(e.getErrorCode(), "");