public interface DependenciesDefinitionContext extends SchemaNodeContext
This context provides methods for declaring a constraint's dependencies.
Constraint dependencies are used to minimize the number of calls to
these constraints during the validation process.
For instance, in the context of programmatic constraints, calls to
the method
Constraint.checkOccurrence(Object, ValueContextForValidation)
will be minimized if dependencies are defined.
Three modes are available:
ConstraintContext.setDependencyToLocalNode()
.
addDependencyToModify(SchemaNode)
.addDependencyToInsertAndDelete(SchemaNode)
.addDependencyToInsertDeleteAndModify(SchemaNode)
.addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference)
.addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference, HomeKey)
.addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode, AdaptationReference)
.addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode, AdaptationReference, HomeKey)
.osd:inheritance
).
Attention:
osd:inheritance
) are not allowed.
Constraints applied on elements defining a value function
will be automatically set to Unknown dependencies mode.
Consequently, if a constraint attempts to specify an explicit dependency, an
IllegalArgumentException
will be thrown.
Modifier and Type | Method and Description |
---|---|
void |
addDependencyToInsertAndDelete(SchemaNode aTableSourceNode)
Specifies that the validation result of the current constraint
depends on the insertions and deletions of the specified table node.
|
void |
addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer,
AdaptationReference containerReference)
Specifies that the validation result of the current constraint
depends on the insertions and deletions of the specified table node
of a given instance.
|
void |
addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer,
AdaptationReference containerReference,
HomeKey homeReference)
Specifies that the validation result of the current constraint
depends on the insertions and deletions of the specified table node
of a given dataset in a specific dataspace.
|
void |
addDependencyToInsertDeleteAndModify(SchemaNode aSourceNode)
Specifies that the validation result of the current constraint
depends on insertions, modifications and deletions
on the specified node.
|
void |
addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode,
AdaptationReference containerReference)
Specifies that the validation result of the current constraint
depends on the insertions, modifications and deletions
on the specified node in a given dataset.
|
void |
addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode,
AdaptationReference containerDataSetReference,
HomeKey dataSpaceReference)
Specifies that the validation result of the current constraint
depends on the insertions, modifications and deletions
on the specified node in a given dataset in a specific dataspace.
|
void |
addDependencyToModify(SchemaNode aLocalSource)
Specifies that the validation result of the current constraint
depends on the value of the specified source node in the same record.
|
addError, addError, addInfo, addMessage, addWarning, getSchemaNode
void addDependencyToModify(SchemaNode aLocalSource)
In terms of incremental validation, this means that, in the context of the modified record, this constraint is subject to revalidation each time the value of the source node is modified.
Attention:
osd:inheritance
),
this constraint will be considered to be
in unknown dependencies mode.
IllegalStateException
- if a local dependency has been set to this constraint.IllegalStateException
- if this constraint is set to Unknown dependencies mode.IllegalStateException
- if this method is called in a ConstraintContextOnTable
.IllegalArgumentException
- if the specified source node does not have a local value; that is:
void addDependencyToInsertAndDelete(SchemaNode aTableSourceNode)
In the context of incremental validation, this means that the current constraint will be subject to a global (re)validation for all records of the table if any of the following events occur:
IllegalStateException
- if a local dependency has been set for this constraint.IllegalStateException
- if this constraint is set in Unknown dependencies mode.IllegalArgumentException
- if specified source is not a table node.void addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer, AdaptationReference containerReference, HomeKey homeReference)
In the context of incremental validation, this means that the current constraint will be subject to a global (re)validation for all the records of the table if any of the following events occur:
Attention: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and validation above.
IllegalStateException
- if a local dependency has been set for this constraint.IllegalArgumentException
- if specified source is not a table node.
if specified containerReference is null
.
if specified homeReference is null
.addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference)
void addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer, AdaptationReference containerReference)
In terms of incremental validation, this means that the current constraint will be subject to a global (re)validation for all the records of the table if any of the following events occur:
Attention: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and validation above.
IllegalStateException
- if a local dependency has been set for this constraint.IllegalArgumentException
- if specified source is not a table node.
if specified containerReference is null
.addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference, HomeKey)
void addDependencyToInsertDeleteAndModify(SchemaNode aSourceNode)
In terms of incremental validation, this means that the current constraint will be subject to a global (re)validation for all the records of the table if any of the following events occur:
Attention:
osd:inheritance
),
this constraint will be considered to be in unknown dependencies mode.
aSourceNode
- specifies the source node and table on which this constraint depends;
if the source is a table node,
any insertion, modification and deletion in the table will result in the revalidation
of the current constraint for all records of the table;
if the source is a table record node,
the revalidation is more restrictive since
only modification of the specified node and any insertions or deletions
will result in revalidation.IllegalStateException
- if a local dependency has been set for this constraint.IllegalStateException
- if this constraint is set in Unknown dependencies mode.IllegalArgumentException
- if the specified source node is not a table
node
or table record node.
void addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode, AdaptationReference containerDataSetReference, HomeKey dataSpaceReference)
In terms of incremental validation, this means that the current constraint will be subject to a global (re)validation for all the records of the table if any of the following events occur:
Attention:
osd:inheritance
),
this constraint will be considered to be in unknown dependencies mode.
sourceNode
- specifies the source node and table on which this constraint depends;
if the source is a table node,
any insertion, modification and deletion in the table will result in the revalidation
of the current constraint for all the records of the table;
if the source is a table record node,
the revalidation is more restrictive since
only the modification of the specified node or any insertion or deletion
will result in revalidation.IllegalStateException
- if a local dependency has been set for this constraint.IllegalStateException
- if this constraint is set in Unknown dependencies mode.IllegalArgumentException
- if the specified source node is not a table
node
or a table record node.
if specified containerReference
is null
.
if specified homeReference
is null
.void addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode, AdaptationReference containerReference)
In the context of incremental validation, this means that the current constraint will be subject to a global (re)validation for all the records of the table if any of the following events occur:
Attention:
osd:inheritance
) then
this constraint will be considered to be in unknown dependencies mode.
sourceNode
- specifies the source node and table on which this constraint depends;
if the source is a table node,
any insertion, modification and deletion in the table will result in the revalidation
of the current constraint for all the records of the table;
if the source is a table record node,
the revalidation is more restrictive since
only the modification of the specified node or any insertion or deletion
will result in revalidation.IllegalStateException
- if a local dependency has been set for this constraint.IllegalStateException
- if this constraint is set in Unknown dependencies mode.IllegalArgumentException
- if the specified source node is not a table
node
or a table record node.
if specified containerReference
is null
.