use of com.zimbra.soap.admin.message.GetAccountInfoRequest in project zm-mailbox by Zimbra.
the class GetAccountInfo method handle.
/* (non-Javadoc)
* @see com.zimbra.soap.DocumentHandler#handle(org.dom4j.Element, java.util.Map)
*/
@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
GetAccountInfoRequest req = JaxbUtil.elementToJaxb(request);
AccountBy accountBy = req.getAccount().getBy().toKeyAccountBy();
String accountSelectorKey = req.getAccount().getKey();
Provisioning prov = Provisioning.getInstance();
Account account = prov.get(accountBy, accountSelectorKey, zsc.getAuthToken());
defendAgainstAccountOrCalendarResourceHarvesting(account, accountBy, accountSelectorKey, zsc, Admin.R_getAccountInfo, Admin.R_getCalendarResourceInfo);
Element response = zsc.createElement(AdminConstants.GET_ACCOUNT_INFO_RESPONSE);
response.addNonUniqueElement(AdminConstants.E_NAME).setText(account.getName());
addAttr(response, Provisioning.A_zimbraId, account.getId());
addAttr(response, Provisioning.A_zimbraMailHost, account.getAttr(Provisioning.A_zimbraMailHost));
doCos(account, response);
addUrls(response, account);
return response;
}
Aggregations