| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Stores the list of available locales on this JVM. |
| | | /** Stores the list of available locales on this JVM. */ |
| | | private static final Set<Locale> supportedLocales = new HashSet<Locale>( |
| | | Arrays.asList(Locale.getAvailableLocales())); |
| | | |
| | | // Current Configuration. |
| | | /** Current Configuration. */ |
| | | private CollationMatchingRuleCfg currentConfig; |
| | | |
| | | // Map of OID and the Matching Rule. |
| | | /** Map of OID and the Matching Rule. */ |
| | | private final Map<String, MatchingRule> matchingRules = |
| | | new HashMap<String, MatchingRule>(); |
| | | |
| | |
| | | super(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final Collection<org.forgerock.opendj.ldap.schema.MatchingRule> getMatchingRules() |
| | | { |
| | |
| | | matchingRules.clear(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMatchingRule(CollationMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | currentConfig.addCollationChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeMatchingRule() |
| | | { |
| | |
| | | currentConfig.removeCollationChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | CollationMatchingRuleCfg configuration) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CollationMatchingRuleCfg configuration, |
| | |
| | | return locale; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * A utility class for extracting the OID and Language Tag from the |
| | | * configuration entry. |
| | | */ |
| | | private final class CollationMapper |
| | | { |
| | | // OID of the collation rule. |
| | | /** OID of the collation rule. */ |
| | | private String oid; |
| | | |
| | | // Language Tag. |
| | | /** Language Tag. */ |
| | | private String lTag; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of CollationMapper. |
| | | * |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the OID part of the collation text. |
| | | * |
| | |
| | | return oid; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the language Tag of collation text. |
| | | * |