opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java
@@ -122,6 +122,18 @@ } /** * Adds this attribute type to the schema, overwriting any existing attribute type * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any attribute type with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } /** * Sets the matching rule that should be used for approximate matching * with this attribute type. * opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java
@@ -22,7 +22,7 @@ * * * Copyright 2009 Sun Microsystems, Inc. * Portions copyright 2011-2015 ForgeRock AS * Portions copyright 2011-2016 ForgeRock AS */ package org.forgerock.opendj.ldap.schema; @@ -104,6 +104,18 @@ } /** * Adds this DIT content rule to the schema, overwriting any existing DIT content rule * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any DIT content rule with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } /** * Adds the provided auxiliary classes to the list of auxiliary object * classes that entries subject to this DIT content rule may belong to. * opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java
@@ -22,7 +22,7 @@ * * * Copyright 2009 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS * Portions copyright 2015-2016 ForgeRock AS */ package org.forgerock.opendj.ldap.schema; @@ -98,6 +98,18 @@ return getSchemaBuilder().addDITStructureRule(new DITStructureRule(this), true); } /** * Adds this DIT structure rule to the schema, overwriting any existing DIT structure rule * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any DIT structure rule with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } @Override public Builder description(final String description) { return description0(description); opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
@@ -22,7 +22,7 @@ * * * Copyright 2009-2010 Sun Microsystems, Inc. * Portions copyright 2013-2015 ForgeRock AS. * Portions copyright 2013-2016 ForgeRock AS. */ package org.forgerock.opendj.ldap.schema; @@ -105,6 +105,18 @@ return getSchemaBuilder().addMatchingRule(new MatchingRule(this), true); } /** * Adds this matching rule to the schema, overwriting any existing matching rule * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any matching rule with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } @Override public Builder description(final String description) { return description0(description); opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUse.java
@@ -96,6 +96,18 @@ } /** * Adds this matching rule use to the schema, overwriting any existing matching rule use * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any matching rule use with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } /** * Adds the provided list of attribute types to the list of attribute * type the matching rule applies to. * opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
@@ -100,6 +100,18 @@ return getSchemaBuilder().addNameForm(new NameForm(this), true); } /** * Adds this name form to the schema, overwriting any existing name form * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any name form with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } @Override public Builder description(final String description) { return description0(description); opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
@@ -22,7 +22,7 @@ * * * Copyright 2009 Sun Microsystems, Inc. * Portions copyright 2015 ForgeRock AS. * Portions copyright 2015-2016 ForgeRock AS. */ package org.forgerock.opendj.ldap.schema; @@ -109,6 +109,18 @@ return getSchemaBuilder().addObjectClass(new ObjectClass(this), true); } /** * Adds this object class to the schema, overwriting any existing object class * with the same numeric OID if the overwrite parameter is set to {@code true}. * * @param overwrite * {@code true} if any object class with the same OID should be overwritten. * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { return overwrite ? addToSchemaOverwrite() : addToSchema(); } @Override public Builder description(final String description) { return description0(description); opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaBuilder.java
@@ -383,7 +383,7 @@ atBuilder.superiorType(superiorType) .syntax(syntax); return overwrite ? atBuilder.addToSchemaOverwrite() : atBuilder.addToSchema(); return atBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_ATTRTYPE_INVALID1.get(definition, e.getMessageObject()); throw new LocalizedIllegalArgumentException(msg, e.getCause()); @@ -490,7 +490,7 @@ } } return overwrite ? contentRuleBuilder.addToSchemaOverwrite() : contentRuleBuilder.addToSchema(); return contentRuleBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_DCR_INVALID1.get(definition, e.getMessageObject()); throw new LocalizedIllegalArgumentException(msg, e.getCause()); @@ -597,7 +597,7 @@ } ruleBuilder.nameForm(nameForm); return overwrite ? ruleBuilder.addToSchemaOverwrite() : ruleBuilder.addToSchema(); return ruleBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_DSR_INVALID1.get(definition, e.getMessageObject()); throw new LocalizedIllegalArgumentException(msg, e.getCause()); @@ -755,11 +755,7 @@ if (syntax == null) { throw new LocalizedIllegalArgumentException(ERR_ATTR_SYNTAX_MR_NO_SYNTAX.get(definition)); } if (overwrite) { matchingRuleBuilder.addToSchemaOverwrite(); } else { matchingRuleBuilder.addToSchema(); } matchingRuleBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_MR_INVALID1.get(definition, e.getMessageObject()); @@ -868,7 +864,7 @@ } useBuilder.attributes(attributes); return overwrite ? useBuilder.addToSchemaOverwrite() : useBuilder.addToSchema(); return useBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_MRUSE_INVALID1.get(definition, e.getMessageObject()); throw new LocalizedIllegalArgumentException(msg, e.getCause()); @@ -1066,11 +1062,7 @@ throw new LocalizedIllegalArgumentException(ERR_ATTR_SYNTAX_NAME_FORM_NO_REQUIRED_ATTR.get(definition)); } if (overwrite) { nameFormBuilder.addToSchemaOverwrite(); } else { nameFormBuilder.addToSchema(); } nameFormBuilder.addToSchema(overwrite); } catch (final DecodeException e) { final LocalizableMessage msg = ERR_ATTR_SYNTAX_NAME_FORM_INVALID1.get(definition, e.getMessageObject()); @@ -1401,7 +1393,7 @@ } ocBuilder.superiorObjectClasses(superiorClasses) .type(ocType); return overwrite ? ocBuilder.addToSchemaOverwrite() : ocBuilder.addToSchema(); return ocBuilder.addToSchema(overwrite); } } catch (final DecodeException e) { throw new LocalizedIllegalArgumentException( @@ -2364,19 +2356,11 @@ // unlikely, may be different in the new schema. for (final Syntax syntax : schema.getSyntaxes()) { if (overwrite) { buildSyntax(syntax, false).addToSchemaOverwrite(); } else { buildSyntax(syntax, false).addToSchema(); } buildSyntax(syntax, false).addToSchema(overwrite); } for (final MatchingRule matchingRule : schema.getMatchingRules()) { if (overwrite) { buildMatchingRule(matchingRule, false).addToSchemaOverwrite(); } else { buildMatchingRule(matchingRule, false).addToSchema(); } buildMatchingRule(matchingRule, false).addToSchema(overwrite); } for (final MatchingRuleUse matchingRuleUse : schema.getMatchingRuleUses()) { opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Syntax.java
@@ -22,7 +22,7 @@ * * * Copyright 2009 Sun Microsystems, Inc. * Portions copyright 2013-2014 ForgeRock AS. * Portions copyright 2013-2016 ForgeRock AS. */ package org.forgerock.opendj.ldap.schema; @@ -103,10 +103,7 @@ * @return The parent schema builder. */ SchemaBuilder addToSchema(final boolean overwrite) { if (overwrite) { return addToSchemaOverwrite(); } return addToSchema(); return overwrite ? addToSchemaOverwrite() : addToSchema(); } @Override