From a849a42d97109bc9242c50c7abbd9857e865bb5e Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 24 Jun 2011 14:57:52 +0000
Subject: [PATCH] Fix OPENDJ-205: Add support for rejecting and skipping records to the LDIF readers
---
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java
index 63b3c08..bb898db 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRule.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions copyright 2011 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -42,7 +43,7 @@
/**
* This class defines a DIT content rule, which defines the set of allowed,
* required, and prohibited attributes for entries with a given structural
- * objectclass, and also indicates which auxiliary classes that may be included
+ * objectclass, and also indicates which auxiliary classes may be included
* in the entry.
*/
public final class DITContentRule extends SchemaElement
@@ -287,6 +288,55 @@
/**
+ * Indicates whether the provided attribute type is included in the optional
+ * attribute list for this DIT content rule.
+ *
+ * @param attributeType
+ * The attribute type for which to make the determination.
+ * @return <code>true</code> if the provided attribute type is optional for
+ * this DIT content rule, or <code>false</code> if not.
+ */
+ public boolean isOptional(final AttributeType attributeType)
+ {
+ return optionalAttributes.contains(attributeType);
+ }
+
+
+
+ /**
+ * Indicates whether the provided attribute type is included in the required
+ * attribute list for this DIT content rule.
+ *
+ * @param attributeType
+ * The attribute type for which to make the determination.
+ * @return <code>true</code> if the provided attribute type is required by
+ * this DIT content rule, or <code>false</code> if not.
+ */
+ public boolean isRequired(final AttributeType attributeType)
+ {
+ return requiredAttributes.contains(attributeType);
+ }
+
+
+
+ /**
+ * Indicates whether the provided attribute type is in the list of required or
+ * optional attributes for this DIT content rule.
+ *
+ * @param attributeType
+ * The attribute type for which to make the determination.
+ * @return <code>true</code> if the provided attribute type is required or
+ * allowed for this DIT content rule, or <code>false</code> if it is
+ * not.
+ */
+ public boolean isRequiredOrOptional(final AttributeType attributeType)
+ {
+ return isRequired(attributeType) || isOptional(attributeType);
+ }
+
+
+
+ /**
* Returns the string representation of this schema definition in the form
* specified in RFC 2252.
*
--
Gitblit v1.10.0