Search in sources :

Example 1 with GetDomainInfoResponse

use of com.zimbra.soap.admin.message.GetDomainInfoResponse in project zm-mailbox by Zimbra.

the class ZSoapProvisioning method getDomainInfo.

public ZDomain getDomainInfo(DomainBy keyType, String key) throws ServiceException {
    DomainSelector domSel = new DomainSelector(toJaxb(keyType), key);
    try {
        GetDomainInfoResponse resp = invokeJaxb(new GetDomainInfoRequest(domSel, null));
        DomainInfo domainInfo = resp.getDomain();
        return domainInfo == null ? null : new ZDomain(domainInfo);
    } catch (ServiceException e) {
        if (e.getCode().equals(Constants.ERROR_CODE_NO_SUCH_DOMAIN))
            return null;
        else
            throw e;
    }
}
Also used : ServiceException(com.zimbra.common.service.ServiceException) DomainSelector(com.zimbra.soap.admin.type.DomainSelector) GetDomainInfoRequest(com.zimbra.soap.admin.message.GetDomainInfoRequest) DomainInfo(com.zimbra.soap.admin.type.DomainInfo) GetDomainInfoResponse(com.zimbra.soap.admin.message.GetDomainInfoResponse)

Example 2 with GetDomainInfoResponse

use of com.zimbra.soap.admin.message.GetDomainInfoResponse in project zm-mailbox by Zimbra.

the class SoapProvisioning method getDomainInfo.

public Domain getDomainInfo(DomainBy keyType, String key) throws ServiceException {
    DomainSelector domSel = new DomainSelector(toJaxb(keyType), key);
    try {
        GetDomainInfoResponse resp = invokeJaxb(new GetDomainInfoRequest(domSel, null));
        DomainInfo domainInfo = resp.getDomain();
        return domainInfo == null ? null : new SoapDomain(domainInfo, this);
    } catch (ServiceException e) {
        if (e.getCode().equals(Constants.ERROR_CODE_NO_SUCH_DOMAIN))
            return null;
        else
            throw e;
    }
}
Also used : AccountServiceException(com.zimbra.cs.account.AccountServiceException) ServiceException(com.zimbra.common.service.ServiceException) DomainSelector(com.zimbra.soap.admin.type.DomainSelector) GetDomainInfoRequest(com.zimbra.soap.admin.message.GetDomainInfoRequest) DomainInfo(com.zimbra.soap.admin.type.DomainInfo) GetDomainInfoResponse(com.zimbra.soap.admin.message.GetDomainInfoResponse)

Aggregations

ServiceException (com.zimbra.common.service.ServiceException)2 GetDomainInfoRequest (com.zimbra.soap.admin.message.GetDomainInfoRequest)2 GetDomainInfoResponse (com.zimbra.soap.admin.message.GetDomainInfoResponse)2 DomainInfo (com.zimbra.soap.admin.type.DomainInfo)2 DomainSelector (com.zimbra.soap.admin.type.DomainSelector)2 AccountServiceException (com.zimbra.cs.account.AccountServiceException)1