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-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2012-2016 ForgeRock AS. 016 */ 017package org.opends.server.schema; 018 019import static org.opends.server.schema.SchemaConstants.*; 020 021import org.forgerock.opendj.ldap.schema.Schema; 022import org.forgerock.opendj.ldap.schema.Syntax; 023import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg; 024import org.opends.server.api.AttributeSyntax; 025 026/** 027 * This class defines the binary attribute syntax, which is essentially a byte 028 * array using very strict matching. Equality, ordering, and substring matching 029 * will be allowed by default. 030 */ 031public class BinarySyntax 032 extends AttributeSyntax<AttributeSyntaxCfg> 033{ 034 035 /** 036 * Creates a new instance of this syntax. Note that the only thing that 037 * should be done here is to invoke the default constructor for the 038 * superclass. All initialization should be performed in the 039 * <CODE>initializeSyntax</CODE> method. 040 */ 041 public BinarySyntax() 042 { 043 super(); 044 } 045 046 /** {@inheritDoc} */ 047 @Override 048 public Syntax getSDKSyntax(Schema schema) 049 { 050 return schema.getSyntax(SchemaConstants.SYNTAX_BINARY_OID); 051 } 052 053 /** 054 * Retrieves the common name for this attribute syntax. 055 * 056 * @return The common name for this attribute syntax. 057 */ 058 @Override 059 public String getName() 060 { 061 return SYNTAX_BINARY_NAME; 062 } 063 064 /** 065 * Retrieves the OID for this attribute syntax. 066 * 067 * @return The OID for this attribute syntax. 068 */ 069 @Override 070 public String getOID() 071 { 072 return SYNTAX_BINARY_OID; 073 } 074 075 /** 076 * Retrieves a description for this attribute syntax. 077 * 078 * @return A description for this attribute syntax. 079 */ 080 @Override 081 public String getDescription() 082 { 083 return SYNTAX_BINARY_DESCRIPTION; 084 } 085} 086