Package wt.impact

Class ImpactDelegate

java.lang.Object
wt.impact.ImpactDelegate
All Implemented Interfaces:
Serializable, Comparable<ImpactDelegate>
Direct Known Subclasses:
ImpactedDelegate, ImpactorDelegate

public abstract class ImpactDelegate extends Object implements Serializable, Comparable<ImpactDelegate>
Delegate used to abstract the behavior of Impactor and Impacted objects.

Supported API: true

Extendable: false
See Also:
  • Method Details

    • getImpactClass

      public abstract Class<?> getImpactClass()
      Return the root Impactor or Impactor class supported by this delegate.

      Supported API: true
    • getSelector

      public final String getSelector()
      Return the selector value for this delegate.

      Supported API: true
    • getRegisteredClass

      public final Class<?> getRegisteredClass()
      Return the registered class of this delegate.

      Supported API: true
    • getExcludedTypes

      public Set<TypeIdentifier> getExcludedTypes() throws WTException
      Return immutable set of TypeIdentifier objects defining the excluded sub-types (may be null or empty). Excluded types, and all of their sub-types, are subtracted from the set of included types. Excluded types must assignable to the class returned by getRegisteredClass().

      Supported API: true
      Returns:
      Set of excluded types (null or empty for no excluded types).
      Throws:
      WTException
    • getSingleExcludedTypes

      public Set<TypeIdentifier> getSingleExcludedTypes() throws WTException
      Return immutable set of TypeIdentifier objects defining the single excluded sub-types (may be null or empty). Single excluded types are subtracted from the set of included types, but none of their sub-types are excluded. Excluded types must assignable to the class returned by getRegisteredClass().

      Supported API: true
      Returns:
      Set of excluded types (null or empty for no excluded types).
      Throws:
      WTException
    • isCreateRuleValidationEnabled

      public boolean isCreateRuleValidationEnabled(Impact impactObj) throws WTException
      Determine if a new Impact object should be validated for creation by the association rules.

      Supported API: true
      Parameters:
      impactObj - New Impact object being created (other types ignored).
      Returns:
      True to enable validation (default), false to disable validation.
      Throws:
      WTException
    • isRemoveRuleValidationEnabled

      public boolean isRemoveRuleValidationEnabled(Impact impactObj) throws WTException
      Determine if a deleted Impact object should be validated for removal by the association rules.

      Supported API: true
      Parameters:
      impactObj - Existing Impact object being deleted (other types ignored).
      Returns:
      True to enable validation (default), false to disable validation.
      Throws:
      WTException
    • isNewIterationCopyForwardEnabled

      public boolean isNewIterationCopyForwardEnabled(IteratedImpact impactObj) throws WTException
      Return true (default) if impact links should be copied forward for new iterations of IteratedImpact objects.

      Supported API: true
      Parameters:
      impactObj - New iteration of an IteratedImpact object.
      Throws:
      WTException
    • filterCopyFowardForNewIteration

      public WTSet filterCopyFowardForNewIteration(IteratedImpact impactObj, WTSet impactLinks) throws WTException
      Filter links being copied forward for new iterations of IteratedImpact objects. This method allows extended delegates to choose what it copied forward. For example, if a specific Impact object requires that only links to the latest versions of other side objects are copied forward then this method can be overridden to filter out non-latest.

      Supported API: true
      Parameters:
      impactObj - New iteration of IteratedImpact object. One of the role objects of every link in the copyForwardLinks set is the predecessor version of this object.
      impactLinks - Set of all ImpactLink candidates to be copied forward (guaranteed to have at least one link). May include links to non-latest iterations and non-latest revisions of the other side objects.
      Returns:
      Subset of candidate links to be copied forward (may be null or empty). The returned set may only contain links that were passed in. The default behavior is to copy all links forward.
      Throws:
      WTException
    • isNewRevisionCopyForwardEnabled

      public boolean isNewRevisionCopyForwardEnabled(IteratedImpact impactObj) throws WTException
      Return true (default) if impact links should be copied forward for new revisions of IteratedImpactor or IteratedImpacted objects.

      Supported API: true
      Parameters:
      impactObj - New revision of an IteratedImpact object.
      Throws:
      WTException
    • filterCopyFowardForNewRevision

      public WTSet filterCopyFowardForNewRevision(IteratedImpact impactObj, WTSet impactLinks) throws WTException
      Filter links being copied forward for new revisions of IteratedImpact objects. This method allows extended delegates to choose what it copied forward. For example, if a specific Impact object requires that only links to the latest versions of other side objects are copied forward then this method can be overridden to filter out non-latest.

      Supported API: true
      Parameters:
      impactObj - New revision of IteratedImpact object. One of the role objects of every link in the copyForwardLinks set is the predecessor version of this object.
      impactLinks - Set of all ImpactLink candidates to be copied forward (guaranteed to have at least one link). May include links to non-latest iterations and non-latest revisions of the other side objects.
      Returns:
      Subset of candidate links to be copied forward (may be null or empty). The returned set may only contain links that were passed in. The default behavior is to copy all links forward.
      Throws:
      WTException
    • filterLinks

      public WTSet filterLinks(WTSet links, WTSet impactObjs) throws WTException
      Filter links for association rule validation. This method allows extended delegates to implement the appropriate filtering algorithm for their objects. For example, filtering out links to non-latest versions of impact objects. This delegate method is called by ImpactService.queryAndFilterImpactLinks(wt.fc.collections.WTCollection, Boolean).

      Supported API: true
      Parameters:
      links - Set of ImpactLink objects to be filtered.
      impactObjs - Set of original Impactor or Impacted role objects used to query for the links.
      Returns:
      Set of filtered ImpactLink objects. Return null (default) if the delegate does implement filtering and all links will be used. Return empty set if no links should be used.
      Throws:
      WTException
    • compareTo

      public int compareTo(ImpactDelegate other)
      Compare method used to order delegates for applying an impact. Default ordering priority:
      1. Increasing selector number
      2. Increasing alphanumeric by fully qualified class name (tie breaker)
      Extensions can override this method if an alternate ordering is needed. All implementations must return -1 if the other delegate is null.

      Supported API: true
      Specified by:
      compareTo in interface Comparable<ImpactDelegate>