com.orchestranetworks.schema
Interface ConstraintContext

All Superinterfaces:
SchemaNodeContext

public interface ConstraintContext
extends SchemaNodeContext

Provides methods for setting up a constraint in the context of its schema.

Dependencies and Validation

This context provides methods for declaring constraint's dependencies. Constraint's dependencies are used for minimizing the number of calls to the method Constraint.checkOccurrence(Object, ValueContextForValidation) in validation processes. Three modes are available:

  1. Local dependency: In this mode, the validation result of the current constraint depends only on the local value of the underlying node. Except for the change of this local value, the validation result will not be affected by any external events. This mode is enabled by calling the method setDependencyToLocalNode().
  2. Explicit dependencies: In this mode, the validation result of the current constraint depends only on updates of the source nodes that have been explicitly specified. Except for those updates and the change of the local value, the validation result will not be affected by any external events. This mode is enabled calling the methods:
  3. Unknown dependencies (default): In this mode, the validation result of the current constraint depends on unknown sources or events (for example, data stored in an external system). This is the default mode, enabled if neither of the above methods has been called.

IMPORTANT NOTES:

See Also:
Constraint

Method Summary
 void addDependency(AdaptationName aName, Path aPath)
          Deprecated. Does nothing.
 void addDependency(Path aPath)
          Deprecated. Does nothing.
 void addDependencyToInsertAndDelete(SchemaNode aTableSourceNode)
          Specifies that the validation result of the current constraint depends on the insertions and deletions in 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 in 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 in the specified table node of a given instance in a specific home.
 void addDependencyToInsertDeleteAndModify(SchemaNode aSourceNode)
          Specifies that the validation result of the current constraint depends on the insertions, modifications and deletions related to 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 related to the specified node in a given adaptation.
 void addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode, AdaptationReference containerReference, HomeKey homeReference)
          Specifies that the validation result of the current constraint depends on the insertions, modifications and deletions related to the specified node in a given adaptation in a specific home.
 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.
 void addValueDependencyToNode(SchemaNode referredNode)
          Deprecated. Replaced by methods addDependencyToModify(SchemaNode) and addDependencyToInsertDeleteAndModify(SchemaNode).
 void setDependencyToLocalNode()
          Specifies that the validation result of the current constraint depends only on the local value of the underlying node.
 
Methods inherited from interface com.orchestranetworks.schema.SchemaNodeContext
addError, addError, addInfo, addMessage, addWarning, getSchemaNode
 

Method Detail

addDependency

public void addDependency(Path aPath)
                   throws PathAccessException
Deprecated. Does nothing.

Throws:
PathAccessException

addDependency

public void addDependency(AdaptationName aName,
                          Path aPath)
Deprecated. Does nothing.


addValueDependencyToNode

public void addValueDependencyToNode(SchemaNode referredNode)
Deprecated. Replaced by methods addDependencyToModify(SchemaNode) and addDependencyToInsertDeleteAndModify(SchemaNode).


setDependencyToLocalNode

public void setDependencyToLocalNode()
Specifies that the validation result of the current constraint depends only on the local value of the underlying node. Except for the change of this local value, the validation result will not be affected by any external events.

For more information, see Dependencies and Validation section.

Throws:
IllegalStateException - if a value dependency has been added to this constraint

addDependencyToModify

public 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.

In the context 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.

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if the specified source node does not locally hold a value; that is:

addDependencyToInsertAndDelete

public void addDependencyToInsertAndDelete(SchemaNode aTableSourceNode)
Specifies that the validation result of the current constraint depends on the insertions and deletions in the specified table node.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if specified source is not a table node.

addDependencyToInsertAndDeleteInOtherInstance

public void addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer,
                                                          AdaptationReference containerReference,
                                                          HomeKey homeReference)
Specifies that the validation result of the current constraint depends on the insertions and deletions in the specified table node of a given instance in a specific home.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if specified source is not a table node. if specified containerReference is null. if specified homeReference is null.
See Also:
addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference)

addDependencyToInsertAndDeleteInOtherInstance

public void addDependencyToInsertAndDeleteInOtherInstance(Path tablePathInContainer,
                                                          AdaptationReference containerReference)
Specifies that the validation result of the current constraint depends on the insertions and deletions in the specified table node of a given instance.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if specified source is not a table node. if specified containerReference is null.
See Also:
addDependencyToInsertAndDeleteInOtherInstance(Path, AdaptationReference, HomeKey)

addDependencyToInsertDeleteAndModify

public void addDependencyToInsertDeleteAndModify(SchemaNode aSourceNode)
Specifies that the validation result of the current constraint depends on the insertions, modifications and deletions related to the specified node.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Parameters:
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 imply a revalidation of the current constraint for all the records of the table; if the source is a table occurrence node, the revalidation is more restrictive since only the modification of the specified node and any insertion or deletion will imply a revalidation.
Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if the specified source node is not a table node or a table occurrence node.

addDependencyToInsertDeleteAndModifyInOtherInstance

public void addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode,
                                                                AdaptationReference containerReference,
                                                                HomeKey homeReference)
Specifies that the validation result of the current constraint depends on the insertions, modifications and deletions related to the specified node in a given adaptation in a specific home.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Parameters:
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 imply a revalidation of the current constraint for all the records of the table; if the source is a table occurrence node, the revalidation is more restrictive since only the modification of the specified node and any insertion or deletion will imply a revalidation.
Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if the specified source node is not a table node or a table occurrence node. if specified containerReference is null. if specified homeReference is null.

addDependencyToInsertDeleteAndModifyInOtherInstance

public void addDependencyToInsertDeleteAndModifyInOtherInstance(SchemaNode sourceNode,
                                                                AdaptationReference containerReference)
Specifies that the validation result of the current constraint depends on the insertions, modifications and deletions related to the specified node in a given adaptation.

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:

Warning: A call to this method implies that all dependencies are explicitly declared (explicit dependencies mode). For more information, see Dependencies and Validation section.

Parameters:
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 imply a revalidation of the current constraint for all the records of the table; if the source is a table occurrence node, the revalidation is more restrictive since only the modification of the specified node and any insertion or deletion will imply a revalidation.
Throws:
IllegalStateException - if a local dependency has been set to this constraint.
IllegalArgumentException - if the specified source node is not a table node or a table occurrence node. if specified containerReference is null.


(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.