Make a few generic fixes to various configuration classes, including:
- Fix copy and paste errors in javadoc documentation.
- Prevent hiding instance variables with local variables of the same name
- Eliminate a few unused methods left over from the use of
ConfigurableComponent
| | |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * notification handler. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * @param initialize Indicates whether the account status notification |
| | | * handler instance should be initialized. |
| | | * |
| | | * @return The possibly initialized notification handler. |
| | | * |
| | |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the attribute |
| | | * syntax. It should not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * @param initialize Indicates whether the attribute syntax instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized attribute syntax. |
| | |
| | | |
| | | |
| | | /** |
| | | * Loads the specified class, instantiates it as an entry cache, |
| | | * and optionally initializes that instance. |
| | | * Loads the specified class, instantiates it as an entry cache, and |
| | | * optionally initializes that instance. |
| | | * |
| | | * @param className The fully-qualified name of the entry cache |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * entry cache. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * @param className The fully-qualified name of the entry cache class |
| | | * to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the entry |
| | | * cache. It must not be {@code null}. |
| | | * @param initialize Indicates whether the entry cache instance should be |
| | | * initialized. |
| | | * |
| | | * @return The possibly initialized entry cache. |
| | | * |
| | |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the group |
| | | * implementation. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * @param initialize Indicates whether the group implementation instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized group implementation. |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | int msgID = MSGID_SASLCRAMMD5_NO_SUCH_IDENTITY_MAPPER; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(identityMapperDN), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | int msgID = MSGID_SASLDIGESTMD5_NO_SUCH_IDENTITY_MAPPER; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(identityMapperDN), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the attribute type to use for validating the certificates. If none |
| | | // is provided, then default to the userCertificate type. |
| | |
| | | { |
| | | int msgID = MSGID_SASLEXTERNAL_UNKNOWN_CERT_ATTR; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(attrTypeName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | if (certificateMapper == null) |
| | | { |
| | | int msgID = MSGID_SASLEXTERNAL_INVALID_CERTIFICATE_MAPPER_DN; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | String.valueOf(configuration.getCertificateMapperDN()))); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | import java.util.HashSet; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | import org.opends.server.admin.std.server.FIFOEntryCacheCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.IntegerConfigAttribute; |
| | | import org.opends.server.config.IntegerWithUnitConfigAttribute; |
| | | import org.opends.server.config.StringConfigAttribute; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.CacheEntry; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN of the configuration entry with which this component is |
| | | * associated. |
| | | * |
| | | * @return The DN of the configuration entry with which this component is |
| | | * associated. |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | return configEntryDN; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | * |
| | | * @return The set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | | int msgID = MSGID_FIFOCACHE_DESCRIPTION_MAX_MEMORY_PCT; |
| | | IntegerConfigAttribute maxMemoryPctAttr = |
| | | new IntegerConfigAttribute(ATTR_FIFOCACHE_MAX_MEMORY_PCT, |
| | | getMessage(msgID), true, false, false, true, |
| | | 1, true, 100, maxMemoryPercent); |
| | | attrList.add(maxMemoryPctAttr); |
| | | |
| | | |
| | | msgID = MSGID_FIFOCACHE_DESCRIPTION_MAX_ENTRIES; |
| | | IntegerConfigAttribute maxEntriesAttr = |
| | | new IntegerConfigAttribute(ATTR_FIFOCACHE_MAX_ENTRIES, |
| | | getMessage(msgID), true, false, false, |
| | | true, 0, false, 0, maxEntries); |
| | | attrList.add(maxEntriesAttr); |
| | | |
| | | |
| | | msgID = MSGID_FIFOCACHE_DESCRIPTION_LOCK_TIMEOUT; |
| | | IntegerWithUnitConfigAttribute lockTimeoutAttr = |
| | | new IntegerWithUnitConfigAttribute(ATTR_FIFOCACHE_LOCK_TIMEOUT, |
| | | getMessage(msgID), false, timeUnits, |
| | | true, 0, false, 0, lockTimeout, |
| | | TIME_UNIT_MILLISECONDS_FULL); |
| | | attrList.add(lockTimeoutAttr); |
| | | |
| | | |
| | | msgID = MSGID_FIFOCACHE_DESCRIPTION_INCLUDE_FILTERS; |
| | | ArrayList<String> includeStrings = |
| | | new ArrayList<String>(includeFilters.size()); |
| | | for (SearchFilter f : includeFilters) |
| | | { |
| | | includeStrings.add(f.toString()); |
| | | } |
| | | StringConfigAttribute includeAttr = |
| | | new StringConfigAttribute(ATTR_FIFOCACHE_INCLUDE_FILTER, |
| | | getMessage(msgID), false, true, false, |
| | | includeStrings); |
| | | attrList.add(includeAttr); |
| | | |
| | | |
| | | msgID = MSGID_FIFOCACHE_DESCRIPTION_EXCLUDE_FILTERS; |
| | | ArrayList<String> excludeStrings = |
| | | new ArrayList<String>(excludeFilters.size()); |
| | | for (SearchFilter f : excludeFilters) |
| | | { |
| | | excludeStrings.add(f.toString()); |
| | | } |
| | | StringConfigAttribute excludeAttr = |
| | | new StringConfigAttribute(ATTR_FIFOCACHE_EXCLUDE_FILTER, |
| | | getMessage(msgID), false, true, false, |
| | | excludeStrings); |
| | | attrList.add(excludeAttr); |
| | | |
| | | |
| | | return attrList; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | |
| | | HashSet<SearchFilter> newIncludeFilters = null; |
| | | HashSet<SearchFilter> newExcludeFilters = null; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | MSGID_FIFOCACHE_INVALID_INCLUDE_FILTER, |
| | | MSGID_FIFOCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | newExcludeFilters = EntryCacheCommon.getFilters ( |
| | | configuration.getExcludeFilter(), |
| | | MSGID_FIFOCACHE_CANNOT_DECODE_EXCLUDE_FILTER, |
| | | MSGID_FIFOCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | break; |
| | | case PHASE_ACCEPTABLE: // acceptable and apply are using the same |
| | |
| | | MSGID_FIFOCACHE_INVALID_INCLUDE_FILTER, |
| | | 0, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | newExcludeFilters = EntryCacheCommon.getFilters ( |
| | | configuration.getExcludeFilter(), |
| | | MSGID_FIFOCACHE_INVALID_EXCLUDE_FILTER, |
| | | 0, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | break; |
| | | } |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the path to the key store file. |
| | |
| | | int msgID = MSGID_FILE_KEYMANAGER_NO_SUCH_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(newKeyStoreFile), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | int msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(e))); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | int msgID = MSGID_FILE_KEYMANAGER_INVALID_TYPE; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(configuration.getKeyStoreType()), |
| | | String.valueOf(configEntryDN), getExceptionMessage(kse))); |
| | | String.valueOf(cfgEntryDN), getExceptionMessage(kse))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_KEYMANAGER_PIN_PROPERTY_NOT_SET; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(propertyName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_KEYMANAGER_PIN_ENVAR_NOT_SET; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(enVarName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_KEYMANAGER_PIN_NO_SUCH_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | else |
| | |
| | | { |
| | | int msgID = MSGID_FILE_KEYMANAGER_PIN_FILE_CANNOT_READ; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(ioe))); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_KEYMANAGER_PIN_FILE_EMPTY; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | // Pin wasn't defined anywhere. |
| | | int msgID = MSGID_FILE_KEYMANAGER_NO_PIN; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN))); |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the path to the trust store file. |
| | |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_NO_SUCH_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(newTrustStoreFile), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_CANNOT_DETERMINE_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(e))); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_INVALID_TYPE; |
| | | String message = getMessage(msgID, String.valueOf(storeType), |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(kse)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_PIN_PROPERTY_NOT_SET; |
| | | String message = getMessage(msgID, String.valueOf(pinProp), |
| | | String.valueOf(configEntryDN)); |
| | | String.valueOf(cfgEntryDN)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_PIN_ENVAR_NOT_SET; |
| | | String message = getMessage(msgID, String.valueOf(pinEnVar), |
| | | String.valueOf(configEntryDN)); |
| | | String.valueOf(cfgEntryDN)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_PIN_FILE_CANNOT_READ; |
| | | String message = getMessage(msgID, String.valueOf(pinFile), |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(ioe)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_PIN_FILE_EMPTY; |
| | | String message = getMessage(msgID, String.valueOf(pinFile), |
| | | String.valueOf(configEntryDN)); |
| | | String.valueOf(cfgEntryDN)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_PIN_NO_SUCH_FILE; |
| | | String message = getMessage(msgID, String.valueOf(pinFile), |
| | | String.valueOf(configEntryDN)); |
| | | String.valueOf(cfgEntryDN)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | String newCacheType = DEFAULT_FSCACHE_TYPE; |
| | | String newCacheHome = DEFAULT_FSCACHE_HOME; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the fingerprint attribute is defined in the server schema. |
| | | String attrName = configuration.getFingerprintAttribute(); |
| | |
| | | if (newFingerprintType == null) |
| | | { |
| | | unacceptableReasons.add(getMessage(MSGID_FCM_NO_SUCH_ATTR, |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | attrName)); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | int msgID = MSGID_SASLGSSAPI_NO_SUCH_IDENTITY_MAPPER; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(identityMapperDN), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the PIN needed to access the contents of the keystore file. |
| | |
| | | { |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_PIN_PROPERTY_NOT_SET; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(propertyName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_PIN_ENVAR_NOT_SET; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(enVarName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_PIN_NO_SUCH_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | else |
| | |
| | | { |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_PIN_FILE_CANNOT_READ; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | getExceptionMessage(ioe))); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_PIN_FILE_EMPTY; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(fileName), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | |
| | | { |
| | | // Pin wasn't defined anywhere. |
| | | int msgID = MSGID_PKCS11_KEYMANAGER_NO_PIN; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN))); |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | int msgID = MSGID_SASLPLAIN_NO_SUCH_IDENTITY_MAPPER; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(identityMapperDN), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.SortedSet; |
| | | import java.util.StringTokenizer; |
| | |
| | | import org.opends.server.admin.std.server.PasswordGeneratorCfg; |
| | | import org.opends.server.admin.std.server.RandomPasswordGeneratorCfg; |
| | | import org.opends.server.api.PasswordGenerator; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.StringConfigAttribute; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ByteStringFactory; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN of the configuration entry with which this component is |
| | | * associated. |
| | | * |
| | | * @return The DN of the configuration entry with which this component is |
| | | * associated. |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | return configEntryDN; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | * |
| | | * @return The set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | ArrayList<String> charsetValues = new ArrayList<String>(); |
| | | for (int i=0; i < characterSets.length; i++) |
| | | { |
| | | String encodedValue = characterSets[i].encode(); |
| | | if (! charsetValues.contains(encodedValue)) |
| | | { |
| | | charsetValues.add(encodedValue); |
| | | } |
| | | } |
| | | |
| | | |
| | | int msgID = MSGID_RANDOMPWGEN_DESCRIPTION_CHARSET; |
| | | attrList.add(new StringConfigAttribute(ATTR_PASSWORD_CHARSET, |
| | | getMessage(msgID), true, true, false, |
| | | charsetValues)); |
| | | |
| | | msgID = MSGID_RANDOMPWGEN_DESCRIPTION_PWFORMAT; |
| | | attrList.add(new StringConfigAttribute(ATTR_PASSWORD_FORMAT, |
| | | getMessage(msgID), true, false, |
| | | false, formatString)); |
| | | |
| | | |
| | | return attrList; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | |
| | | { |
| | | int msgID; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get the character sets for use in generating the password. At |
| | | // least one |
| | |
| | | if (currentPasSet.size() == 0) |
| | | { |
| | | msgID = MSGID_RANDOMPWGEN_NO_CHARSETS; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN)); |
| | | String message = getMessage(msgID, String.valueOf(cfgEntryDN)); |
| | | throw new ConfigException(msgID, message); |
| | | } |
| | | |
| | |
| | | if (charsets.containsKey(s.getName())) |
| | | { |
| | | msgID = MSGID_RANDOMPWGEN_CHARSET_NAME_CONFLICT; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN), s |
| | | String message = getMessage(msgID, String.valueOf(cfgEntryDN), s |
| | | .getName()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.locks.Lock; |
| | |
| | | import org.opends.server.admin.std.server.SoftReferenceEntryCacheCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.IntegerWithUnitConfigAttribute; |
| | | import org.opends.server.config.StringConfigAttribute; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.CacheEntry; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN of the configuration entry with which this component is |
| | | * associated. |
| | | * |
| | | * @return The DN of the configuration entry with which this component is |
| | | * associated. |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | return configEntryDN; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | * |
| | | * @return The set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | | int msgID = MSGID_SOFTREFCACHE_DESCRIPTION_LOCK_TIMEOUT; |
| | | IntegerWithUnitConfigAttribute lockTimeoutAttr = |
| | | new IntegerWithUnitConfigAttribute(ATTR_SOFTREFCACHE_LOCK_TIMEOUT, |
| | | getMessage(msgID), false, timeUnits, |
| | | true, 0, false, 0, lockTimeout, |
| | | TIME_UNIT_MILLISECONDS_FULL); |
| | | attrList.add(lockTimeoutAttr); |
| | | |
| | | |
| | | msgID = MSGID_SOFTREFCACHE_DESCRIPTION_INCLUDE_FILTERS; |
| | | ArrayList<String> includeStrings = |
| | | new ArrayList<String>(includeFilters.size()); |
| | | for (SearchFilter f : includeFilters) |
| | | { |
| | | includeStrings.add(f.toString()); |
| | | } |
| | | StringConfigAttribute includeAttr = |
| | | new StringConfigAttribute(ATTR_SOFTREFCACHE_INCLUDE_FILTER, |
| | | getMessage(msgID), false, true, false, |
| | | includeStrings); |
| | | attrList.add(includeAttr); |
| | | |
| | | |
| | | msgID = MSGID_SOFTREFCACHE_DESCRIPTION_EXCLUDE_FILTERS; |
| | | ArrayList<String> excludeStrings = |
| | | new ArrayList<String>(excludeFilters.size()); |
| | | for (SearchFilter f : excludeFilters) |
| | | { |
| | | excludeStrings.add(f.toString()); |
| | | } |
| | | StringConfigAttribute excludeAttr = |
| | | new StringConfigAttribute(ATTR_SOFTREFCACHE_EXCLUDE_FILTER, |
| | | getMessage(msgID), false, true, false, |
| | | excludeStrings); |
| | | attrList.add(excludeAttr); |
| | | |
| | | |
| | | return attrList; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | |
| | | HashSet<SearchFilter> newIncludeFilters = null; |
| | | HashSet<SearchFilter> newExcludeFilters = null; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | MSGID_SOFTREFCACHE_INVALID_INCLUDE_FILTER, |
| | | MSGID_SOFTREFCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | newExcludeFilters = EntryCacheCommon.getFilters ( |
| | | configuration.getExcludeFilter(), |
| | | MSGID_SOFTREFCACHE_CANNOT_DECODE_EXCLUDE_FILTER, |
| | | MSGID_SOFTREFCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | break; |
| | | case PHASE_ACCEPTABLE: // acceptable and apply are using the same |
| | |
| | | MSGID_SOFTREFCACHE_INVALID_INCLUDE_FILTER, |
| | | 0, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | newExcludeFilters = EntryCacheCommon.getFilters ( |
| | | configuration.getExcludeFilter(), |
| | | MSGID_SOFTREFCACHE_INVALID_EXCLUDE_FILTER, |
| | | 0, |
| | | errorHandler, |
| | | configEntryDN |
| | | newConfigEntryDN |
| | | ); |
| | | break; |
| | | } |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Get and validate the subject attribute to user attribute mappings. |
| | | LinkedHashMap<String,AttributeType> newAttributeMap = |
| | |
| | | if (colonPos <= 0) |
| | | { |
| | | int msgID = MSGID_SATUACM_INVALID_MAP_FORMAT; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | mapStr)); |
| | | configAcceptable = false; |
| | | break; |
| | |
| | | if ((certAttrName.length() == 0) || (userAttrName.length() == 0)) |
| | | { |
| | | int msgID = MSGID_SATUACM_INVALID_MAP_FORMAT; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | mapStr)); |
| | | configAcceptable = false; |
| | | break; |
| | |
| | | if (newAttributeMap.containsKey(certAttrName)) |
| | | { |
| | | int msgID = MSGID_SATUACM_DUPLICATE_CERT_ATTR; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | certAttrName)); |
| | | configAcceptable = false; |
| | | break; |
| | |
| | | { |
| | | int msgID = MSGID_SATUACM_NO_SUCH_ATTR; |
| | | unacceptableReasons.add(getMessage(msgID, mapStr, |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | userAttrName)); |
| | | configAcceptable = false; |
| | | break; |
| | |
| | | { |
| | | int msgID = MSGID_SATUACM_DUPLICATE_USER_ATTR; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | attrType.getNameOrOID())); |
| | | configAcceptable = false; |
| | | break mapLoop; |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the subject attribute is defined in the server schema. |
| | | String attrName = configuration.getSubjectAttribute(); |
| | |
| | | if (newSubjectType == null) |
| | | { |
| | | unacceptableReasons.add(getMessage(MSGID_SDTUACM_NO_SUCH_ATTR, |
| | | String.valueOf(configEntryDN), |
| | | String.valueOf(cfgEntryDN), |
| | | attrName)); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | DN cfgEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the plugin is only registered as a startup plugin. |
| | | if (configuration.getPluginType().isEmpty()) |
| | | { |
| | | int msgID = MSGID_PLUGIN_PROFILER_NO_PLUGIN_TYPES; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN)); |
| | | String message = getMessage(msgID, String.valueOf(cfgEntryDN)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | | } |
| | |
| | | if (t != PluginCfgDefn.PluginType.STARTUP) |
| | | { |
| | | int msgID = MSGID_PLUGIN_PROFILER_INVALID_PLUGIN_TYPE; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN), |
| | | String message = getMessage(msgID, String.valueOf(cfgEntryDN), |
| | | String.valueOf(t)); |
| | | unacceptableReasons.add(message); |
| | | configAcceptable = false; |
| | |
| | | int msgID = MSGID_PLUGIN_PROFILER_INVALID_PROFILE_DIR; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | profileDirectory.getAbsolutePath(), |
| | | String.valueOf(configEntryDN))); |
| | | String.valueOf(cfgEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | |