Interface PropagationConstraint
- All Superinterfaces:
Element,PropertyElement,Serializable
- All Known Implementing Classes:
PropagationConstraintImpl
@TypeMetadata(name="PropagationConstraint",
description="This type provides propagation constraint for **Relation** instances.\n\n- **`add`**:\n - `propagate`: Adding the source **Resource** instance (or the **Relation** instance itself) to Context C recursively adds the target **Entity** instance to C.\n - `unpropagate`: Adding the source **Resource** instance (or the **Relation** instance itself) to Context C does NOT add the target **Entity** instance to C.\n- **`remove`**:\n - `cascade`: Removing the source **Resource** instance (or the **Relation** instance itself) from Context C recursively removes the target **Entity** instance from C.\n - `cascadeWhenOrphan`: (Available for IsRelatedTo only) Removing the source **Resource** instance (or the IsRelatedTo instance itself) from Context C removes the target **Resource** instance from C only if the target **Resource** instance has no other incoming IsRelatedTo instances in Context C.\n - `keep`: Removing the source **Resource** instance (or the **Relation** instance itself) from Context C does NOT remove the target **Entity** instance from C.",
version="2.0.0")
@Change(version="2.0.0",description="Removed \'delete\' propagation constraint") @Change(version="1.1.0",description="Added \'delete\' propagation constraint") @Change(version="1.0.0",description="First Version")
public interface PropagationConstraint
extends PropertyElement
Defines the propagation behavior for a relation when an 'add to context' or
'remove from context' event occurs on the source entity or the relation itself.
The
getRemoveConstraint() value also governs whether the target entity
is cascade-deleted when the source entity or the relation itself is deleted
outright, not merely removed from one context — there is no separate constraint
for that scenario.
The default propagation constraints are:
- IsRelatedTo: add=unpropagate, remove=keep
- ConsistsOf: add=propagate, remove=cascade
- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefines the behavior for an 'add' operation.static enumDefines the behavior for a 'remove' from context operation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property name for the 'add' constraint.static final StringThe name of the PropagationConstraint property type.static final StringThe property name for the 'remove' constraint.Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, REDACTED, TYPE_PROPERTY, UNKNOWN_USER -
Method Summary
Modifier and TypeMethodDescriptionReturns the propagation constraint for the 'add' operation.Returns the propagation constraint for the 'remove' operation.voidsetAddConstraint(PropagationConstraint.AddConstraint addConstraint) Sets the propagation constraint for the 'add' operation.voidsetRemoveConstraint(PropagationConstraint.RemoveConstraint removeConstraint) Sets the propagation constraint for the 'remove' operation.Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
Field Details
-
NAME
The name of the PropagationConstraint property type.- See Also:
-
ADD_PROPERTY
The property name for the 'add' constraint.- See Also:
-
REMOVE_PROPERTY
The property name for the 'remove' constraint.- See Also:
-
-
Method Details
-
getAddConstraint
@ISProperty(name="add", description="It indicates the behavior to implement for the target **Entity** instance when an \'add\' action is performed on the source **Resource** instance (or the **Relation** instance itself). *(Defaults: IsRelatedTo=\'unpropagate\', ConsistsOf=\'propagate\').*", mandatory=true) PropagationConstraint.AddConstraint getAddConstraint()Returns the propagation constraint for the 'add' operation.- Returns:
- The
PropagationConstraint.AddConstraint.
-
setAddConstraint
Sets the propagation constraint for the 'add' operation.- Parameters:
addConstraint- ThePropagationConstraint.AddConstraintto set.
-
getRemoveConstraint
@ISProperty(name="remove", description="It indicates the behavior to implement for the target **Entity** instance when a \'remove\' action is performed. *(Defaults: IsRelatedTo=\'keep\', ConsistsOf=\'cascade\').*", mandatory=true) PropagationConstraint.RemoveConstraint getRemoveConstraint()Returns the propagation constraint for the 'remove' operation.- Returns:
- The
PropagationConstraint.RemoveConstraint.
-
setRemoveConstraint
Sets the propagation constraint for the 'remove' operation.- Parameters:
removeConstraint- ThePropagationConstraint.RemoveConstraintto set.
-