001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2006-2009 Sun Microsystems, Inc. 015 * Portions Copyright 2011-2016 ForgeRock AS. 016 */ 017package org.opends.server.schema; 018import static org.opends.server.schema.SchemaConstants.*; 019 020import org.forgerock.opendj.ldap.schema.Schema; 021import org.forgerock.opendj.ldap.schema.Syntax; 022import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg; 023import org.opends.server.api.AttributeSyntax; 024 025/** 026 * This class implements the matching rule description syntax, which is used to 027 * hold matching rule definitions in the server schema. The format of this 028 * syntax is defined in RFC 2252. 029 */ 030public class MatchingRuleSyntax 031 extends AttributeSyntax<AttributeSyntaxCfg> 032{ 033 /** 034 * Creates a new instance of this syntax. Note that the only thing that 035 * should be done here is to invoke the default constructor for the 036 * superclass. All initialization should be performed in the 037 * <CODE>initializeSyntax</CODE> method. 038 */ 039 public MatchingRuleSyntax() 040 { 041 super(); 042 } 043 044 /** {@inheritDoc} */ 045 @Override 046 public Syntax getSDKSyntax(Schema schema) 047 { 048 return schema.getSyntax(SchemaConstants.SYNTAX_MATCHING_RULE_OID); 049 } 050 051 /** 052 * Retrieves the common name for this attribute syntax. 053 * 054 * @return The common name for this attribute syntax. 055 */ 056 @Override 057 public String getName() 058 { 059 return SYNTAX_MATCHING_RULE_NAME; 060 } 061 062 /** 063 * Retrieves the OID for this attribute syntax. 064 * 065 * @return The OID for this attribute syntax. 066 */ 067 @Override 068 public String getOID() 069 { 070 return SYNTAX_MATCHING_RULE_OID; 071 } 072 073 /** 074 * Retrieves a description for this attribute syntax. 075 * 076 * @return A description for this attribute syntax. 077 */ 078 @Override 079 public String getDescription() 080 { 081 return SYNTAX_MATCHING_RULE_DESCRIPTION; 082 } 083} 084