SearchGalResult result = prov.getDomain(acct).searchGal(n, type, null);
Domain d = prov.getDomain(acct); SearchGalResult result = prov.searchGal(d, n, type, null);
    public Element handle(Element request, Map<String, Object> context) throws ServiceException {        String n = request.getAttribute(AccountService.E_NAME);        ZimbraSoapContext lc = getZimbraSoapContext(context);        Element response = lc.createElement(AccountService.SEARCH_GAL_RESPONSE);        Account acct = getRequestedAccount(getZimbraSoapContext(context));        while (n.endsWith("*"))            n = n.substring(0, n.length() - 1);        String typeStr = request.getAttribute(AccountService.A_TYPE, "all");        Provisioning.GAL_SEARCH_TYPE type;        if (typeStr.equals("all"))            type = Provisioning.GAL_SEARCH_TYPE.ALL;        else if (typeStr.equals("account"))            type = Provisioning.GAL_SEARCH_TYPE.USER_ACCOUNT;        else if (typeStr.equals("resource"))            type = Provisioning.GAL_SEARCH_TYPE.CALENDAR_RESOURCE;        else            throw ServiceException.INVALID_REQUEST("Invalid search type: " + typeStr, null);        Provisioning prov = Provisioning.getInstance();        SearchGalResult result = prov.getDomain(acct).searchGal(n, type, null);        response.addAttribute(AccountService.A_MORE, result.hadMore);                for (GalContact contact : result.matches)            addContact(response, contact);        return response;    }