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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2006-2009 Sun Microsystems, Inc. 025 * Portions Copyright 2011-2015 ForgeRock AS 026 */ 027package org.opends.server.schema; 028import static org.opends.server.schema.SchemaConstants.*; 029 030import org.forgerock.opendj.ldap.schema.Schema; 031import org.forgerock.opendj.ldap.schema.Syntax; 032import org.opends.server.admin.std.server.AttributeSyntaxCfg; 033import org.opends.server.api.AttributeSyntax; 034 035/** 036 * This class implements the matching rule description syntax, which is used to 037 * hold matching rule definitions in the server schema. The format of this 038 * syntax is defined in RFC 2252. 039 */ 040public class MatchingRuleSyntax 041 extends AttributeSyntax<AttributeSyntaxCfg> 042{ 043 /** 044 * Creates a new instance of this syntax. Note that the only thing that 045 * should be done here is to invoke the default constructor for the 046 * superclass. All initialization should be performed in the 047 * <CODE>initializeSyntax</CODE> method. 048 */ 049 public MatchingRuleSyntax() 050 { 051 super(); 052 } 053 054 /** {@inheritDoc} */ 055 @Override 056 public Syntax getSDKSyntax(Schema schema) 057 { 058 return schema.getSyntax(SchemaConstants.SYNTAX_MATCHING_RULE_OID); 059 } 060 061 /** 062 * Retrieves the common name for this attribute syntax. 063 * 064 * @return The common name for this attribute syntax. 065 */ 066 @Override 067 public String getName() 068 { 069 return SYNTAX_MATCHING_RULE_NAME; 070 } 071 072 /** 073 * Retrieves the OID for this attribute syntax. 074 * 075 * @return The OID for this attribute syntax. 076 */ 077 @Override 078 public String getOID() 079 { 080 return SYNTAX_MATCHING_RULE_OID; 081 } 082 083 /** 084 * Retrieves a description for this attribute syntax. 085 * 086 * @return A description for this attribute syntax. 087 */ 088 @Override 089 public String getDescription() 090 { 091 return SYNTAX_MATCHING_RULE_DESCRIPTION; 092 } 093} 094