use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapUCService method reload.
public void reload(SoapProvisioning prov) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.GET_UC_SERVICE_REQUEST);
Element a = req.addElement(AdminConstants.E_UC_SERVICE);
a.setText(getId());
a.addAttribute(AdminConstants.A_BY, Key.UCServiceBy.id.name());
setAttrs(SoapProvisioning.getAttrs(prov.invoke(req).getElement(AdminConstants.E_UC_SERVICE)));
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method delegateAuth.
public DelegateAuthResponse delegateAuth(AccountBy keyType, String key, int durationSeconds) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.DELEGATE_AUTH_REQUEST);
req.addAttribute(AdminConstants.A_DURATION, durationSeconds);
Element acct = req.addElement(AdminConstants.E_ACCOUNT);
acct.addAttribute(AccountConstants.A_BY, keyType.name());
acct.setText(key);
return new DelegateAuthResponse(invoke(req));
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method deleteXMPPComponent.
@Override
public void deleteXMPPComponent(XMPPComponent comp) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.DELETE_XMPPCOMPONENT_REQUEST);
Element c = req.addElement(AccountConstants.E_XMPP_COMPONENT);
c.addAttribute(AdminConstants.A_BY, "id");
c.setText(comp.getId());
invoke(req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method searchGal.
public SearchGalResult searchGal(Domain d, String query, GalSearchType type, String token, int limit, int offset, String sortBy) throws ServiceException {
String typeStr = type == null ? GalSearchType.all.name() : type.name();
XMLElement req = new XMLElement(AdminConstants.SEARCH_GAL_REQUEST);
req.addElement(AdminConstants.E_NAME).setText(query);
req.addAttribute(AdminConstants.A_DOMAIN, d.getName());
req.addAttribute(AdminConstants.A_TYPE, typeStr);
if (limit > 0)
req.addAttribute(AdminConstants.A_LIMIT, limit);
if (offset > 0)
req.addAttribute(AdminConstants.A_OFFSET, limit);
if (sortBy != null)
req.addAttribute(AdminConstants.A_SORT_BY, sortBy);
if (token != null)
req.addAttribute(AdminConstants.A_TOKEN, token);
Element resp = invoke(req);
SearchGalResult result = SearchGalResult.newSearchGalResult(null);
result.setToken(resp.getAttribute(AdminConstants.A_TOKEN, null));
result.setHadMore(resp.getAttributeBool(AdminConstants.A_MORE, false));
result.setTokenizeKey(resp.getAttribute(AccountConstants.A_TOKENIZE_KEY, null));
for (Element e : resp.listElements(AdminConstants.E_CN)) {
result.addMatch(new GalContact(e.getAttribute(AdminConstants.A_ID), getAttrs(e)));
}
return result;
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class FbCli method getFreeBusyQueueInfo.
public Collection<FbQueue> getFreeBusyQueueInfo(String provider) throws ServiceException, IOException {
ArrayList<FbQueue> queues = new ArrayList<FbQueue>();
try {
auth();
XMLElement req = new XMLElement(AdminConstants.GET_FREE_BUSY_QUEUE_INFO_REQUEST);
if (provider != null)
req.addElement(AdminConstants.E_PROVIDER).addAttribute(AdminConstants.A_NAME, provider);
Element resp = mTransport.invoke(req);
for (Element provElem : resp.listElements(AdminConstants.E_PROVIDER)) {
FbQueue queue = new FbQueue();
queue.name = provElem.getAttribute(AdminConstants.A_NAME, null);
for (Element acctElem : provElem.listElements(AdminConstants.E_ACCOUNT)) {
queue.accounts.add(acctElem.getAttribute(AdminConstants.A_ID, null));
}
queues.add(queue);
}
} finally {
mTransport.shutdown();
}
return queues;
}
Aggregations