Class ThreatApplicable

java.lang.Object
org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification<org.eclipse.viatra.query.runtime.api.GenericPatternMatcher>
org.eclipse.viatra.query.runtime.api.GenericQuerySpecification<org.eclipse.viatra.query.runtime.api.GenericPatternMatcher>
org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher
be.kuleuven.cs.distrinet.sparta.queries.internal.ThreatApplicable
All Implemented Interfaces:
org.eclipse.viatra.query.runtime.api.IQuerySpecification<org.eclipse.viatra.query.runtime.api.GenericPatternMatcher>, org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader

public final class ThreatApplicable extends org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher
A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.

Original source:

         ///////////////////// Pattern variants which require crossing the trust boundary and place certain restrictions on the flow/////////////////////
         //
         // The Through pattern variants (contrary to the to variants) require the flow to cross a trust
         // boundary.
         // In addition, the fow has to be between certain types of elements
         //
         ///////////////////// ////////////////////////////////////////////////////////// /////////////////////
         //pattern flowThroughElementComm(location : DataFlow, p : DataFlowEntity, p2 : DataFlowEntity,
         //                                                     t : ThreatType) {
         //     Process(p);
         //     Process(p2);
         //     find threatApplicable(location,t,"ProcessToProcess");
         //     find communication(p,location,p2);
         //     find flowContainerDiff(p,p2);
         //} or {
         //     Process(p);
         //     DataStore(p2);
         //     find threatApplicable(location,t,"ProcessToDataStore");
         //     find communication(p,location,p2);
         //     find flowContainerDiff(p,p2);
         //} or {
         //     ExternalEntity(p);
         //     Process(p2);
         //     find threatApplicable(location,t,"ExternalEntityToProcess");
         //     find communication(p,location,p2);
         //     find flowContainerDiff(p,p2);
         //}
         
         
         
         //////////////////////// ThreatType finding helper patterns ///////////////
         //
         // find all applicable threats
         private pattern threatApplicable(location : DFDElement, t : ThreatType, pattrn : EString) {
                ThreatType(t);
                ThreatType.enabled(t,true);
                find threatPattern(t,pattrn);
                // there is no parent disalbing the threat
                neg find threatTypeParentDisabled(t);
                // there is no parent disabling the pattern
                neg find threatPatternDisabled(t,pattrn);
                // there is no spec disabling the threat
                neg find threatSpecDisable(t);
                // there is no spec disabling the pattern
                neg find threatSpecPatternDisable(t,pattrn);
                // there is no spec disabling the element type
                neg find threatSpecTypeDisable(t,location);
         }
 
See Also:
  • invalid reference
    GenericPatternMatcher
  • invalid reference
    GenericPatternMatch
  • Field Summary

    Fields inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification

    wrappedPQuery
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher

    getPreferredScopeClass, instantiate, instantiate, newEmptyMatch, newMatch

    Methods inherited from class org.eclipse.viatra.query.runtime.api.GenericQuerySpecification

    defaultInstantiate, getVisibility

    Methods inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification

    ensureInitializedInternal, getAllAnnotations, getAnnotationsByName, getFirstAnnotationByName, getFullyQualifiedName, getInternalQueryRepresentation, getMatcher, getParameterNames, getParameters, getPositionOfParameter, processInitializerError

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.viatra.query.runtime.api.IQuerySpecification

    getPProblems, getStatus

    Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader

    getParameter, getSimpleName
  • Method Details

    • instance

      public static ThreatApplicable instance()
      Returns:
      the singleton instance of the query specification