Search in sources :

Example 1 with Config

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

the class EphemeralBackendCheck method postModify.

@Override
public void postModify(CallbackContext context, String attrName, Entry entry) {
    String prevUrl = context.getData(DataKey.PREV_EPHEMERAL_BACKEND_URL);
    Config config = (Config) entry;
    try {
        config.setPreviousEphemeralBackendURL(prevUrl);
    } catch (ServiceException e) {
        ZimbraLog.ephemeral.error("unable to set zimbraPreviousEphemeralBackendURL to %s", prevUrl, e);
    }
    try {
        resetMigrationInfo(config.getEphemeralBackendURL());
    } catch (ServiceException e) {
        ZimbraLog.ephemeral.error("unable to reset attribute migration info", e);
    }
    AttributeMigration.clearConfigCacheOnAllServers(false, true);
}
Also used : ServiceException(com.zimbra.common.service.ServiceException) Config(com.zimbra.cs.account.Config)

Example 2 with Config

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

the class ImapLoadBalancingMechanism method newInstance.

public static ImapLoadBalancingMechanism newInstance() throws ServiceException {
    Provisioning prov = Provisioning.getInstance();
    Config config = prov.getConfig();
    String lbMechStr = config.getAttr(Provisioning.A_zimbraImapLoadBalancingAlgorithm, ImapLBMech.AccountIdHash.name());
    return newInstance(lbMechStr);
}
Also used : Config(com.zimbra.cs.account.Config) Provisioning(com.zimbra.cs.account.Provisioning)

Example 3 with Config

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

the class BUG_47934 method upgradeZimbraGalLdapFilterDef.

void upgradeZimbraGalLdapFilterDef() throws ServiceException {
    Config config = prov.getConfig();
    Pair[] values = { new Pair<String, String>("zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair<String, String>("zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair<String, String>("zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair<String, String>("zimbraAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))", "zimbraAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))"), new Pair<String, String>("zimbraSearch:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))", "zimbraSearch:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))") };
    Set<String> curValues = config.getMultiAttrSet(Provisioning.A_zimbraGalLdapFilterDef);
    Map<String, Object> attrs = new HashMap<String, Object>();
    for (Pair<String, String> change : values) {
        String oldValue = change.getFirst();
        String newValue = change.getSecond();
        if (curValues.contains(oldValue)) {
            StringUtil.addToMultiMap(attrs, "-" + Provisioning.A_zimbraGalLdapFilterDef, oldValue);
            StringUtil.addToMultiMap(attrs, "+" + Provisioning.A_zimbraGalLdapFilterDef, newValue);
        }
    }
    modifyAttrs(config, attrs);
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config) Pair(com.zimbra.common.util.Pair)

Example 4 with Config

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

the class BUG_50258 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config, "global config");
}
Also used : Config(com.zimbra.cs.account.Config)

Example 5 with Config

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

the class BUG_57205 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config);
}
Also used : Config(com.zimbra.cs.account.Config)

Aggregations

Config (com.zimbra.cs.account.Config)78 HashMap (java.util.HashMap)24 Test (org.junit.Test)11 Provisioning (com.zimbra.cs.account.Provisioning)10 ServiceException (com.zimbra.common.service.ServiceException)9 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