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-2008 Sun Microsystems, Inc. 025 * Portions Copyright 2012-2015 ForgeRock AS 026 */ 027package org.opends.server.schema; 028 029import static org.opends.server.schema.SchemaConstants.*; 030 031import org.forgerock.i18n.slf4j.LocalizedLogger; 032import org.forgerock.opendj.ldap.schema.Schema; 033import org.forgerock.opendj.ldap.schema.Syntax; 034import org.opends.server.admin.std.server.AttributeSyntaxCfg; 035import org.opends.server.api.AttributeSyntax; 036 037 038/** 039 * This class implements the UUID syntax, which is defined in RFC 4530. 040 * Equality and ordering matching will be allowed by default. 041 */ 042public class UUIDSyntax 043 extends AttributeSyntax<AttributeSyntaxCfg> 044{ 045 046 private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); 047 048 049 /** 050 * Creates a new instance of this syntax. Note that the only thing that 051 * should be done here is to invoke the default constructor for the 052 * superclass. All initialization should be performed in the 053 * <CODE>initializeSyntax</CODE> method. 054 */ 055 public UUIDSyntax() 056 { 057 super(); 058 } 059 060 /** {@inheritDoc} */ 061 @Override 062 public Syntax getSDKSyntax(Schema schema) 063 { 064 return schema.getSyntax(SchemaConstants.SYNTAX_UUID_OID); 065 } 066 067 /** 068 * Retrieves the common name for this attribute syntax. 069 * 070 * @return The common name for this attribute syntax. 071 */ 072 @Override 073 public String getName() 074 { 075 return SYNTAX_UUID_NAME; 076 } 077 078 /** 079 * Retrieves the OID for this attribute syntax. 080 * 081 * @return The OID for this attribute syntax. 082 */ 083 @Override 084 public String getOID() 085 { 086 return SYNTAX_UUID_OID; 087 } 088 089 /** 090 * Retrieves a description for this attribute syntax. 091 * 092 * @return A description for this attribute syntax. 093 */ 094 @Override 095 public String getDescription() 096 { 097 return SYNTAX_UUID_DESCRIPTION; 098 } 099 100} 101