public final class SchemaValidationPolicy extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaValidationPolicy.Action
An enumeration of the possible actions which can be performed when a
schema validation failure is encountered.
|
Modifier and Type | Method and Description |
---|---|
Schema |
adaptSchemaForValidation(Schema schema)
Returns a strict view of the provided schema if the this policy is
configured to check attributes and object class, or a non-strict view of
the schema if not.
|
SchemaValidationPolicy.Action |
checkAttributesAndObjectClasses()
Returns the policy for verifying that the user attributes in an entry
conform to its object classes.
|
SchemaValidationPolicy |
checkAttributesAndObjectClasses(SchemaValidationPolicy.Action policy)
Specifies the policy for verifying that the user attributes in an entry
conform to its object classes.
|
SchemaValidationPolicy.Action |
checkAttributeValues()
Returns the policy for verifying that the user attributes in an entry
conform to their associated attribute type descriptions.
|
SchemaValidationPolicy |
checkAttributeValues(SchemaValidationPolicy.Action policy)
Specifies the policy for verifying that the user attributes in an entry
conform to their associated attribute type descriptions.
|
SchemaValidationPolicy.Action |
checkDitContentRules()
Returns the policy for validating entries against content rules defined
in the schema.
|
SchemaValidationPolicy |
checkDitContentRules(SchemaValidationPolicy.Action policy)
Specifies the policy for validating entries against content rules defined
in the schema.
|
SchemaValidationPolicy.Action |
checkDitStructureRules()
Returns the policy for validating entries against structure rules defined
in the schema.
|
SchemaValidationPolicy |
checkDitStructureRules(SchemaValidationPolicy.Action policy,
Function<Dn,Entry,LdapException> parentEntryResolver)
Specifies the policy for validating entries against structure rules defined in the schema.
|
Function<Dn,Entry,LdapException> |
checkDitStructureRulesParentEntryResolver()
Returns the parent entry resolver which should be used for retrieving the parent entry
during DIT structure rule validation.
|
SchemaValidationPolicy.Action |
checkNameForms()
Returns the policy for validating entries against name forms defined in
the schema.
|
SchemaValidationPolicy |
checkNameForms(SchemaValidationPolicy.Action policy)
Specifies the policy for validating entries against name forms defined in
the schema.
|
static SchemaValidationPolicy |
copyOf(SchemaValidationPolicy policy)
Creates a copy of the provided schema validation policy.
|
static SchemaValidationPolicy |
defaultPolicy()
Creates a new schema validation policy with default settings.
|
static SchemaValidationPolicy |
ignoreAll()
Creates a new schema validation policy which will not perform any schema
validation.
|
SchemaValidationPolicy.Action |
requireSingleStructuralObjectClass()
Returns the policy for verifying that entries have only a single
structural object class.
|
SchemaValidationPolicy |
requireSingleStructuralObjectClass(SchemaValidationPolicy.Action policy)
Specifies the policy for verifying that entries have only a single
structural object class.
|
public static SchemaValidationPolicy copyOf(SchemaValidationPolicy policy)
policy
- The policy to be copied.public static SchemaValidationPolicy defaultPolicy()
public static SchemaValidationPolicy ignoreAll()
public SchemaValidationPolicy.Action checkAttributesAndObjectClasses()
By default entries which have missing or additional user attributes will be rejected.
public SchemaValidationPolicy checkAttributesAndObjectClasses(SchemaValidationPolicy.Action policy)
By default entries which have missing or additional user attributes will be rejected.
policy
- The policy for verifying that the user attributes in an entry
conform to its object classes.SchemaValidationPolicy
.public SchemaValidationPolicy.Action checkAttributeValues()
;binary
attribute option
By default entries which have invalid attribute values will be rejected.
public SchemaValidationPolicy checkAttributeValues(SchemaValidationPolicy.Action policy)
;binary
attribute option
By default entries which have invalid attribute values will be rejected.
policy
- The policy for verifying that the user attributes in an entry
conform to their associated attribute type descriptions.SchemaValidationPolicy
.public SchemaValidationPolicy.Action checkDitContentRules()
By default content rules will be ignored during validation.
public SchemaValidationPolicy checkDitContentRules(SchemaValidationPolicy.Action policy)
By default content rules will be ignored during validation.
policy
- The policy for validating entries against content rules
defined in the schema.SchemaValidationPolicy
.public SchemaValidationPolicy.Action checkDitStructureRules()
By default structure rules will be ignored during validation.
public SchemaValidationPolicy checkDitStructureRules(SchemaValidationPolicy.Action policy, Function<Dn,Entry,LdapException> parentEntryResolver)
By default structure rules will be ignored during validation.
policy
- The policy for validating entries against structure rules defined in the schema.parentEntryResolver
- The parent entry resolver function which should be used for retrieving the parent entry
during DIT structure rule validation.
The function's parameter is the name of the entry for which the parent must be resolved.
The function will return the entry that is the parent of the provided entry name,
if it can be be validated and was resolved successfully,
otherwise it will return null
if the parent entry is not to be validated,
otherwise it will throw LdapException
if the parent entry should be validated
but it could not be resolved.SchemaValidationPolicy
.IllegalArgumentException
- If resolver
was null
and checkDITStructureRules
is either WARN
or REJECT
.checkDitStructureRulesParentEntryResolver()
public Function<Dn,Entry,LdapException> checkDitStructureRulesParentEntryResolver()
By default no resolver is defined because structure rules will be ignored during validation.
{@link #checkDitStructureRules(Action, Function)}'s javadoc for a
description of the function's contract.
public SchemaValidationPolicy.Action checkNameForms()
By default name forms will be ignored during validation.
public SchemaValidationPolicy checkNameForms(SchemaValidationPolicy.Action policy)
By default name forms will be ignored during validation.
policy
- The policy for validating entries against name forms defined
in the schema.SchemaValidationPolicy
.public SchemaValidationPolicy.Action requireSingleStructuralObjectClass()
By default entries which do not have a structural object class or which have more than one structural object class will be rejected.
public SchemaValidationPolicy requireSingleStructuralObjectClass(SchemaValidationPolicy.Action policy)
By default entries which do not have a structural object class or which have more than one structural object class will be rejected.
policy
- The policy for checking that entries have one and only one
structural object class.SchemaValidationPolicy
.public Schema adaptSchemaForValidation(Schema schema)
schema
- The schema to be adapted according to this policy.schema
depending on
checkAttributesAndObjectClasses()
.Copyright 2010-2022 ForgeRock AS.