| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | * Portions Copyright 2011-2016 ForgeRock AS |
| | | */ |
| | | package org.opends.server.schema; |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | | import org.forgerock.opendj.ldap.schema.MatchingRule; |
| | | import org.forgerock.opendj.ldap.schema.Syntax; |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.MatchingRuleUse; |
| | | import org.opends.server.types.Schema; |
| | |
| | | { |
| | | String woidString = woidBuffer.toString(); |
| | | AttributeType attr = schema.getAttributeType(woidString); |
| | | if (attr == null) |
| | | if (attr.isPlaceHolder() && !allowUnknownElements) |
| | | { |
| | | // This isn't good because it means that the matching rule use |
| | | // refers to an attribute type that we don't know anything about. |
| | | if (!allowUnknownElements) |
| | | { |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_ATTR_SYNTAX_MRUSE_UNKNOWN_ATTR.get(oid, woidString)); |
| | | } |
| | | attr = DirectoryServer.getAttributeTypeOrDefault(woidString); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_ATTR_SYNTAX_MRUSE_UNKNOWN_ATTR.get(oid, woidString)); |
| | | } |
| | | return attr; |
| | | } |