test_class.declarator: URI = "amqp://user:pass@host:1111/path"
test_class.modifier: private static final
test_class.original_string: private static final String URI = "amqp://user:pass@host:1111/path";
test_class.type: String
test_class.var_name: URI
test_class.declarator: CONNECTION_ID = TestConstants.createRandomConnectionId()
test_class.modifier: private static final
test_class.original_string: private static final ConnectionId CONNECTION_ID = TestConstants.createRandomConnectionId();
test_class.type: ConnectionId
test_class.var_name: CONNECTION_ID
test_class.declarator: AUTHORIZED = newAuthSubject("authorized")
test_class.modifier: private static final
test_class.original_string: private static final AuthorizationSubject AUTHORIZED = newAuthSubject("authorized");
test_class.type: AuthorizationSubject
test_class.var_name: AUTHORIZED
test_class.declarator: UNAUTHORIZED = newAuthSubject("unauthorized")
test_class.modifier: private static final
test_class.original_string: private static final AuthorizationSubject UNAUTHORIZED = newAuthSubject("unauthorized");
test_class.type: AuthorizationSubject
test_class.var_name: UNAUTHORIZED
test_class.declarator: DUMMY = newAuthSubject("dummy")
test_class.modifier: private static final
test_class.original_string: private static final AuthorizationSubject DUMMY = newAuthSubject("dummy");
test_class.type: AuthorizationSubject
test_class.var_name: DUMMY
test_class.declarator: HEADER_MAPPING =
              ConnectivityModelFactory.newHeaderMapping(Collections.singletonMap("reply-to", "{{fn:delete()}}"))
test_class.modifier: private static final
test_class.original_string: private static final HeaderMapping HEADER_MAPPING =
              ConnectivityModelFactory.newHeaderMapping(Collections.singletonMap("reply-to", "{{fn:delete()}}"));
test_class.type: HeaderMapping
test_class.var_name: HEADER_MAPPING
test_class.declarator: signalTopic
test_class.modifier: @Parameterized.Parameter
      public
test_class.original_string: @Parameterized.Parameter
      public Topic signalTopic;
test_class.type: Topic
test_class.var_name: signalTopic
test_class.declarator: readSubjects
test_class.modifier: @Parameterized.Parameter(1)
      public
test_class.original_string: @Parameterized.Parameter(1)
      public Set<AuthorizationSubject> readSubjects;
test_class.type: Set<AuthorizationSubject>
test_class.var_name: readSubjects
test_class.declarator: targets
test_class.modifier: @Parameterized.Parameter(2)
      public
test_class.original_string: @Parameterized.Parameter(2)
      public List<Target> targets;
test_class.type: List<Target>
test_class.var_name: targets
test_class.declarator: expectedTargets
test_class.modifier: @Parameterized.Parameter(3)
      public
test_class.original_string: @Parameterized.Parameter(3)
      public List<Target> expectedTargets;
test_class.type: List<Target>
test_class.var_name: expectedTargets
test_class.declarator: connectionMonitorRegistry = TestConstants.Monitoring.MONITOR_REGISTRY_MOCK
test_class.modifier: private final
test_class.original_string: private final ConnectionMonitorRegistry connectionMonitorRegistry = TestConstants.Monitoring.MONITOR_REGISTRY_MOCK;
test_class.type: ConnectionMonitorRegistry
test_class.var_name: connectionMonitorRegistry
test_class.file: services/connectivity/messaging/src/test/java/org/eclipse/ditto/services/connectivity/messaging/persistence/SignalFilterTest.java
test_class.identifier: SignalFilterTest
test_case.body: @Test
      public void test() {
          final Connection connection =
                  ConnectivityModelFactory.newConnectionBuilder(CONNECTION_ID,
                          ConnectionType.AMQP_10,
                          ConnectivityStatus.OPEN,
                          URI).targets(targets).build();
  
          final SignalFilter signalFilter = new SignalFilter(connection, connectionMonitorRegistry);
          final List<Target> filteredTargets = signalFilter.filter(signal(signalTopic, readSubjects));
          Assertions.assertThat(filteredTargets)
                  .isEqualTo(expectedTargets);
      }
test_case.class_method_signature: SignalFilterTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: build targets newConnectionBuilder filter signal isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: connection
focal_class.modifier: private final
focal_class.original_string: private final Connection connection;
focal_class.type: Connection
focal_class.var_name: connection
focal_class.declarator: connectionMonitorRegistry
focal_class.modifier: private final
focal_class.original_string: private final ConnectionMonitorRegistry<ConnectionMonitor> connectionMonitorRegistry;
focal_class.type: ConnectionMonitorRegistry<ConnectionMonitor>
focal_class.var_name: connectionMonitorRegistry
focal_class.file: services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/persistence/SignalFilter.java
focal_class.identifier: SignalFilter
focal_class.class_method_signature: SignalFilter.SignalFilter(final Connection connection,
              final ConnectionMonitorRegistry<ConnectionMonitor> connectionMonitorRegistry)
focal_class.full_signature:   SignalFilter(final Connection connection,
              final ConnectionMonitorRegistry<ConnectionMonitor> connectionMonitorRegistry)
focal_class.identifier: SignalFilter
focal_class.parameters: (final Connection connection,
              final ConnectionMonitorRegistry<ConnectionMonitor> connectionMonitorRegistry)
focal_class.signature:  SignalFilter(final Connection connection,
              final ConnectionMonitorRegistry<ConnectionMonitor> connectionMonitorRegistry)
focal_class.class_method_signature: SignalFilter.filter(final Signal<?> signal)
focal_class.full_signature: @SuppressWarnings("squid:S3864") List<Target> filter(final Signal<?> signal)
focal_class.identifier: filter
focal_class.modifiers: @SuppressWarnings("squid:S3864")
focal_class.parameters: (final Signal<?> signal)
focal_class.return: List<Target>
focal_class.signature: List<Target> filter(final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.isTargetAuthorized(final Target target, final Signal<?> signal)
focal_class.full_signature: private static boolean isTargetAuthorized(final Target target, final Signal<?> signal)
focal_class.identifier: isTargetAuthorized
focal_class.modifiers: private static
focal_class.parameters: (final Target target, final Signal<?> signal)
focal_class.return: boolean
focal_class.signature: boolean isTargetAuthorized(final Target target, final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.isTargetSubscribedForTopic(final Target target, final Signal<?> signal)
focal_class.full_signature: private boolean isTargetSubscribedForTopic(final Target target, final Signal<?> signal)
focal_class.identifier: isTargetSubscribedForTopic
focal_class.modifiers: private
focal_class.parameters: (final Target target, final Signal<?> signal)
focal_class.return: boolean
focal_class.signature: boolean isTargetSubscribedForTopic(final Target target, final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.applyTopicFilter(final Signal<?> signal)
focal_class.full_signature: private static Predicate<FilteredTopic> applyTopicFilter(final Signal<?> signal)
focal_class.identifier: applyTopicFilter
focal_class.modifiers: private static
focal_class.parameters: (final Signal<?> signal)
focal_class.return: Predicate<FilteredTopic>
focal_class.signature: Predicate<FilteredTopic> applyTopicFilter(final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.applyNamespaceFilter(final WithId signal)
focal_class.full_signature: private static Predicate<FilteredTopic> applyNamespaceFilter(final WithId signal)
focal_class.identifier: applyNamespaceFilter
focal_class.modifiers: private static
focal_class.parameters: (final WithId signal)
focal_class.return: Predicate<FilteredTopic>
focal_class.signature: Predicate<FilteredTopic> applyNamespaceFilter(final WithId signal)
focal_class.class_method_signature: SignalFilter.namespaceFromId(final WithId withId)
focal_class.full_signature: @Nullable private static String namespaceFromId(final WithId withId)
focal_class.identifier: namespaceFromId
focal_class.modifiers: @Nullable private static
focal_class.parameters: (final WithId withId)
focal_class.return: String
focal_class.signature: String namespaceFromId(final WithId withId)
focal_class.class_method_signature: SignalFilter.matchesFilterBeforeEnrichment(final FilteredTopic filteredTopic, final Signal<?> signal)
focal_class.full_signature: private boolean matchesFilterBeforeEnrichment(final FilteredTopic filteredTopic, final Signal<?> signal)
focal_class.identifier: matchesFilterBeforeEnrichment
focal_class.modifiers: private
focal_class.parameters: (final FilteredTopic filteredTopic, final Signal<?> signal)
focal_class.return: boolean
focal_class.signature: boolean matchesFilterBeforeEnrichment(final FilteredTopic filteredTopic, final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.parseCriteria(final String filter, final DittoHeaders dittoHeaders)
focal_class.full_signature: private Criteria parseCriteria(final String filter, final DittoHeaders dittoHeaders)
focal_class.identifier: parseCriteria
focal_class.modifiers: private
focal_class.parameters: (final String filter, final DittoHeaders dittoHeaders)
focal_class.return: Criteria
focal_class.signature: Criteria parseCriteria(final String filter, final DittoHeaders dittoHeaders)
focal_class.class_method_signature: SignalFilter.topicFromSignal(final Signal<?> signal)
focal_class.full_signature: private static Optional<Topic> topicFromSignal(final Signal<?> signal)
focal_class.identifier: topicFromSignal
focal_class.modifiers: private static
focal_class.parameters: (final Signal<?> signal)
focal_class.return: Optional<Topic>
focal_class.signature: Optional<Topic> topicFromSignal(final Signal<?> signal)
focal_class.class_method_signature: SignalFilter.getCriterionOfSignal(final Signal<?> signal)
focal_class.full_signature: @Nullable private static TopicPath.Criterion getCriterionOfSignal(final Signal<?> signal)
focal_class.identifier: getCriterionOfSignal
focal_class.modifiers: @Nullable private static
focal_class.parameters: (final Signal<?> signal)
focal_class.return: TopicPath.Criterion
focal_class.signature: TopicPath.Criterion getCriterionOfSignal(final Signal<?> signal)
focal_method.body: @SuppressWarnings("squid:S3864")
      List<Target> filter(final Signal<?> signal) {
          return connection.getTargets().stream()
                  .filter(t -> isTargetAuthorized(t, signal)) // this is cheaper, so check this first
                  // count authorized targets
                  .peek(authorizedTarget -> connectionMonitorRegistry.forOutboundDispatched(connection.getId(),
                          authorizedTarget.getAddress())
                          .success(signal))
                  .filter(t -> isTargetSubscribedForTopic(t, signal))
                  // count authorized + filtered targets
                  .peek(filteredTarget -> connectionMonitorRegistry.forOutboundFiltered(connection.getId(),
                          filteredTarget.getAddress())
                          .success(signal))
                  .collect(Collectors.toList());
      }
focal_method.class_method_signature: SignalFilter.filter(final Signal<?> signal)
focal_method.full_signature: @SuppressWarnings("squid:S3864") List<Target> filter(final Signal<?> signal)
focal_method.identifier: filter
focal_method.invocations: collect peek filter peek filter stream getTargets isTargetAuthorized success forOutboundDispatched getId getAddress isTargetSubscribedForTopic success forOutboundFiltered getId getAddress toList
focal_method.modifiers: @SuppressWarnings("squid:S3864")
focal_method.parameters: (final Signal<?> signal)
focal_method.return: List<Target>
focal_method.signature: List<Target> filter(final Signal<?> signal)