Search in sources :

Example 41 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method getMemcachedClientConfig.

public MemcachedClientConfig getMemcachedClientConfig() throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.GET_MEMCACHED_CLIENT_CONFIG_REQUEST);
    Element resp = invoke(req);
    MemcachedClientConfig config = new MemcachedClientConfig();
    config.serverList = resp.getAttribute(AdminConstants.A_MEMCACHED_CLIENT_CONFIG_SERVER_LIST, null);
    config.hashAlgorithm = resp.getAttribute(AdminConstants.A_MEMCACHED_CLIENT_CONFIG_HASH_ALGORITHM, null);
    config.binaryProtocol = resp.getAttributeBool(AdminConstants.A_MEMCACHED_CLIENT_CONFIG_BINARY_PROTOCOL, false);
    config.defaultExpirySeconds = (int) resp.getAttributeLong(AdminConstants.A_MEMCACHED_CLIENT_CONFIG_DEFAULT_EXPIRY_SECONDS, 0);
    config.defaultTimeoutMillis = resp.getAttributeLong(AdminConstants.A_MEMCACHED_CLIENT_CONFIG_DEFAULT_TIMEOUT_MILLIS, 0);
    return config;
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 42 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method modifyDataSource.

@Override
public void modifyDataSource(Account account, String dataSourceId, Map<String, Object> attrs) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.MODIFY_DATA_SOURCE_REQUEST);
    req.addElement(AdminConstants.E_ID).setText(account.getId());
    Element ds = req.addElement(AccountConstants.E_DATA_SOURCE);
    ds.addAttribute(AccountConstants.A_ID, dataSourceId);
    addAttrElements(ds, attrs);
    invoke(req);
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 43 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method getHab.

/**
 * @param rootHabGroupId the group for which HAB is required
 * @return GetHabResponse object
 * @throws ServiceException if an error occurs while fetching hierarchy from ldap
 */
public Element getHab(String rootHabGroupId) throws ServiceException {
    XMLElement req = new XMLElement(AccountConstants.GET_HAB_REQUEST);
    req.addAttribute(AccountConstants.A_HAB_ROOT_GROUP_ID, rootHabGroupId);
    Element resp = invoke(req);
    return resp;
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 44 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class SoapProvisioning method deleteDataSource.

@Override
public void deleteDataSource(Account account, String dataSourceId) throws ServiceException {
    XMLElement req = new XMLElement(AdminConstants.DELETE_DATA_SOURCE_REQUEST);
    req.addElement(AdminConstants.E_ID).setText(account.getId());
    Element ds = req.addElement(AccountConstants.E_DATA_SOURCE);
    ds.addAttribute(AccountConstants.A_ID, dataSourceId);
    invoke(req);
}
Also used : Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) XMLElement(com.zimbra.common.soap.Element.XMLElement)

Example 45 with XMLElement

use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.

the class TestAccess method ModifyDataSource.

public void ModifyDataSource(Role role, Perm perm) throws Exception {
    String dateSourceName = "datasource-modify-" + random();
    DataSource ds = mProvAdmin.setup_createDataSource(this, role, perm, ACCT_1_EMAIL, dateSourceName);
    XMLElement req = new XMLElement(MailConstants.MODIFY_DATA_SOURCE_REQUEST);
    Element dataSource = req.addElement(MailConstants.E_DS_POP3);
    dataSource.addAttribute(MailConstants.A_ID, ds.getId());
    dataSource.addAttribute(MailConstants.A_DS_IS_ENABLED, "false");
    accessTest(role, perm, req);
}
Also used : XMLElement(com.zimbra.common.soap.Element.XMLElement) Element(com.zimbra.common.soap.Element) XMLElement(com.zimbra.common.soap.Element.XMLElement) DataSource(com.zimbra.cs.account.DataSource)

Aggregations

XMLElement (com.zimbra.common.soap.Element.XMLElement)146 Element (com.zimbra.common.soap.Element)116 JSONElement (com.zimbra.common.soap.Element.JSONElement)33 Test (org.junit.Test)32 XmlAnyElement (javax.xml.bind.annotation.XmlAnyElement)28 XmlElement (javax.xml.bind.annotation.XmlElement)28 FilterTest (com.zimbra.soap.mail.type.FilterTest)26 SoapHttpTransport (com.zimbra.common.soap.SoapHttpTransport)9 HashMap (java.util.HashMap)8 KeyValuePair (com.zimbra.soap.type.KeyValuePair)7 ArrayList (java.util.ArrayList)7 Account (com.zimbra.cs.account.Account)6 ZAuthToken (com.zimbra.common.auth.ZAuthToken)5 ByteBuilder (com.zimbra.common.mime.HeaderUtils.ByteBuilder)4 ServiceException (com.zimbra.common.service.ServiceException)4 DataSource (com.zimbra.cs.account.DataSource)4 Auth (com.zimbra.cs.service.account.Auth)4 URL (java.net.URL)4 Cookie (javax.servlet.http.Cookie)4 HttpException (org.apache.http.HttpException)4