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. ThegetRemoveConstraint()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:
PropertyElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPropagationConstraint.AddConstraintDefines the behavior for an 'add' operation.static classPropagationConstraint.RemoveConstraintDefines the behavior for a 'remove' from context operation.
-
Field Summary
Fields Modifier and Type Field Description static StringADD_PROPERTYThe property name for the 'add' constraint.static StringNAMEThe name of the PropagationConstraint property type.static StringREMOVE_PROPERTYThe 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PropagationConstraint.AddConstraintgetAddConstraint()Returns the propagation constraint for the 'add' operation.PropagationConstraint.RemoveConstraintgetRemoveConstraint()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 Detail
-
NAME
static final String NAME
The name of the PropagationConstraint property type.- See Also:
- Constant Field Values
-
ADD_PROPERTY
static final String ADD_PROPERTY
The property name for the 'add' constraint.- See Also:
- Constant Field Values
-
REMOVE_PROPERTY
static final String REMOVE_PROPERTY
The property name for the 'remove' constraint.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
void setAddConstraint(PropagationConstraint.AddConstraint addConstraint)
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
void setRemoveConstraint(PropagationConstraint.RemoveConstraint removeConstraint)
Sets the propagation constraint for the 'remove' operation.- Parameters:
removeConstraint- ThePropagationConstraint.RemoveConstraintto set.
-
-