001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2006-2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.schema;
028    
029    
030    
031    import org.opends.server.admin.std.server.EqualityMatchingRuleCfg;
032    import org.opends.server.config.ConfigException;
033    import org.opends.server.types.InitializationException;
034    
035    import static org.opends.server.schema.SchemaConstants.*;
036    import static org.opends.server.util.StaticUtils.*;
037    
038    
039    
040    /**
041     * This class implements the keywordMatch matching rule defined in X.520.  That
042     * document defines "keyword" as implementation-specific, but in this case we
043     * will interpret it in the same way as "word" for the wordMatch rule.
044     */
045    public class KeywordEqualityMatchingRule
046           extends WordEqualityMatchingRule
047    {
048      /**
049       * Creates a new instance of this wordMatch matching rule.
050       */
051      public KeywordEqualityMatchingRule()
052      {
053        super();
054      }
055    
056    
057    
058      /**
059       * {@inheritDoc}
060       */
061      public void initializeMatchingRule(EqualityMatchingRuleCfg configuration)
062             throws ConfigException, InitializationException
063      {
064        // No initialization is required.
065      }
066    
067    
068    
069      /**
070       * Retrieves the common name for this matching rule.
071       *
072       * @return  The common name for this matching rule, or <CODE>null</CODE> if
073       * it does not have a name.
074       */
075      public String getName()
076      {
077        return EMR_KEYWORD_NAME;
078      }
079    
080    
081    
082      /**
083       * Retrieves the OID for this matching rule.
084       *
085       * @return  The OID for this matching rule.
086       */
087      public String getOID()
088      {
089        return EMR_KEYWORD_OID;
090      }
091    }
092