Search in sources :

Example 71 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_55649 method upgradeZimbraGalLdapAttrMap.

private void upgradeZimbraGalLdapAttrMap() throws ServiceException {
    String valueToAdd = "binary zimbraPrefMailSMIMECertificate,userCertificate,userSMIMECertificate=SMIMECertificate";
    Config config = prov.getConfig();
    Set<String> curValues = config.getMultiAttrSet(Provisioning.A_zimbraGalLdapAttrMap);
    if (curValues.contains(valueToAdd)) {
        return;
    }
    Map<String, Object> attrs = new HashMap<String, Object>();
    StringUtil.addToMultiMap(attrs, "+" + Provisioning.A_zimbraGalLdapAttrMap, valueToAdd);
    modifyAttrs(config, attrs);
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Example 72 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class TestMaxMessageSize method setMaxMessageSize.

private void setMaxMessageSize(long numBytes) throws Exception {
    Provisioning prov = Provisioning.getInstance();
    Config config = prov.getConfig();
    Map<String, Object> attrs = new HashMap<String, Object>();
    attrs.put(Provisioning.A_zimbraMtaMaxMessageSize, Long.toString(numBytes));
    prov.modifyAttrs(config, attrs);
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config) Provisioning(com.zimbra.cs.account.Provisioning)

Example 73 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class ProvTestUtil method getSystemDefaultDomainName.

public String getSystemDefaultDomainName() throws Exception {
    Config config = prov.getConfig(Provisioning.A_zimbraDefaultDomainName);
    String domainName = config.getAttr(Provisioning.A_zimbraDefaultDomainName, null);
    assertFalse(Strings.isNullOrEmpty(domainName));
    return domainName;
}
Also used : Config(com.zimbra.cs.account.Config)

Aggregations

Config (com.zimbra.cs.account.Config)73 HashMap (java.util.HashMap)24 Provisioning (com.zimbra.cs.account.Provisioning)10 Test (org.junit.Test)8 ServiceException (com.zimbra.common.service.ServiceException)7 Account (com.zimbra.cs.account.Account)7 RetentionPolicy (com.zimbra.soap.mail.type.RetentionPolicy)7 Element (com.zimbra.common.soap.Element)6 Policy (com.zimbra.soap.mail.type.Policy)6 Cos (com.zimbra.cs.account.Cos)5 Server (com.zimbra.cs.account.Server)5 Domain (com.zimbra.cs.account.Domain)4 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)4 Pair (com.zimbra.common.util.Pair)3 HashSet (java.util.HashSet)3 SMTPMessage (com.sun.mail.smtp.SMTPMessage)2 ZFilterAction (com.zimbra.client.ZFilterAction)2 ZFileIntoAction (com.zimbra.client.ZFilterAction.ZFileIntoAction)2 ZFilterCondition (com.zimbra.client.ZFilterCondition)2 ZHeaderCondition (com.zimbra.client.ZFilterCondition.ZHeaderCondition)2