| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | import org.opends.server.api.CertificateMapper; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | |
| | | Backend b = DirectoryServer.getBackend(baseDN); |
| | | if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY))) |
| | | { |
| | | throw new ConfigException(ERR_FCM_ATTR_UNINDEXED.get( |
| | | configuration.dn().toString(), |
| | | t.getNameOrOID(), b.getBackendID())); |
| | | Message message = WARN_SATUACM_ATTR_UNINDEXED.get( |
| | | configuration.dn().toString(), |
| | | t.getNameOrOID(), b.getBackendID()); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | boolean configAcceptable = true; |
| | | |
| | | // Make sure that the fingerprint attribute is configured for equality in |
| | | // all appropriate backends. |
| | | Set<DN> cfgBaseDNs = configuration.getUserBaseDN(); |
| | | if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty()) |
| | | { |
| | | cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet(); |
| | | } |
| | | |
| | | AttributeType t = configuration.getFingerprintAttribute(); |
| | | for (DN baseDN : cfgBaseDNs) |
| | | { |
| | | Backend b = DirectoryServer.getBackend(baseDN); |
| | | if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY))) |
| | | { |
| | | configAcceptable = false; |
| | | unacceptableReasons.add(ERR_FCM_ATTR_UNINDEXED.get( |
| | | configuration.dn().toString(), |
| | | t.getNameOrOID(), b.getBackendID())); |
| | | } |
| | | } |
| | | |
| | | return configAcceptable; |
| | | } |
| | | |
| | |
| | | currentConfig = configuration; |
| | | } |
| | | |
| | | // Make sure that the fingerprint attribute is configured for equality in |
| | | // all appropriate backends. |
| | | Set<DN> cfgBaseDNs = configuration.getUserBaseDN(); |
| | | if ((cfgBaseDNs == null) || cfgBaseDNs.isEmpty()) |
| | | { |
| | | cfgBaseDNs = DirectoryServer.getPublicNamingContexts().keySet(); |
| | | } |
| | | |
| | | AttributeType t = configuration.getFingerprintAttribute(); |
| | | for (DN baseDN : cfgBaseDNs) |
| | | { |
| | | Backend b = DirectoryServer.getBackend(baseDN); |
| | | if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY))) |
| | | { |
| | | Message message = WARN_SATUACM_ATTR_UNINDEXED.get( |
| | | configuration.dn().toString(), |
| | | t.getNameOrOID(), b.getBackendID()); |
| | | messages.add(message); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |