Search in sources :

Example 1 with GetAccountInfoRequest

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;
}
Also used : Account(com.zimbra.cs.account.Account) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) GetAccountInfoRequest(com.zimbra.soap.admin.message.GetAccountInfoRequest) Element(com.zimbra.common.soap.Element) Provisioning(com.zimbra.cs.account.Provisioning) AccountBy(com.zimbra.common.account.Key.AccountBy)

Aggregations

AccountBy (com.zimbra.common.account.Key.AccountBy)1 Element (com.zimbra.common.soap.Element)1 Account (com.zimbra.cs.account.Account)1 Provisioning (com.zimbra.cs.account.Provisioning)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 GetAccountInfoRequest (com.zimbra.soap.admin.message.GetAccountInfoRequest)1