Class DfdStructure

java.lang.Object
be.kuleuven.cs.distrinet.sparta.core.model.DfdStructure

public final class DfdStructure extends Object
Structural facts about where DFD elements and threats sit in the model: enclosing trust boundaries, nesting depth, direct parents and trust-boundary crossings. Derived purely from the EMF containment hierarchy, so usable by any consumer (view, exports, report, CI).

All methods are null-tolerant: when a threat has no data flow (or a flow has no sender/recipient) the corresponding value is null or empty.

  • Method Details

    • parent

      public static DFDElement parent(EObject element)
      The direct DFD parent (trust boundary, or process for a decomposed process) of the given element, or null when it sits at the root of the model.
    • trustBoundaries

      public static List<TrustBoundaryContainer> trustBoundaries(EObject element)
      The trust boundaries enclosing the given element, outermost first.
    • trustBoundaryDepth

      public static int trustBoundaryDepth(EObject element)
      The number of trust boundaries enclosing the given element (0 = not inside any).
    • crossesTrustBoundary

      public static boolean crossesTrustBoundary(EObject from, EObject to)
      Whether a flow between the two elements crosses a trust boundary, i.e. they are not enclosed by exactly the same trust boundaries. This matches the flowContainerDiff pattern used by the threat queries for a flow's direct sender and recipient; the pattern additionally considers the endpoints reached through sender/recipient specifications.
    • crossesTrustBoundary

      public static Boolean crossesTrustBoundary(Threat threat)
      Whether the threat's data flow crosses a trust boundary, see crossesTrustBoundary(EObject, EObject).
      Returns:
      null when the threat has no flow with both a sender and a recipient
    • minTrustBoundaryDepth

      public static Integer minTrustBoundaryDepth(Threat threat)
      The lowest trust-boundary nesting depth among the threat's involved elements: the flow's sender and recipient, or the threatened element itself when the threat is not tied to a flow.
      Returns:
      null when there is no involved element
    • maxTrustBoundaryDepth

      public static Integer maxTrustBoundaryDepth(Threat threat)
      The highest trust-boundary nesting depth among the involved elements, see minTrustBoundaryDepth(be.kuleuven.cs.distrinet.sparta.core.model.Threat).
    • involvedElements

      public static List<EObject> involvedElements(Threat threat)
      The elements a threat involves: the data flow's sender and recipient, or the threatened element itself when the threat is not tied to a flow.