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/NameForm.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
index 5059b69..e876bf6 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions copyright 2011 ForgeRock AS
*/
package org.forgerock.opendj.ldap.schema;
@@ -250,6 +251,55 @@
/**
+ * Indicates whether the provided attribute type is included in the optional
+ * attribute list for this name form.
+ *
+ * @param attributeType
+ * The attribute type for which to make the determination.
+ * @return <code>true</code> if the provided attribute type is optional for
+ * this name form, 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 name form.
+ *
+ * @param attributeType
+ * The attribute type for which to make the determination.
+ * @return <code>true</code> if the provided attribute type is required by
+ * this name form, 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 name form.
+ *
+ * @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 name form, 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