@Test public void getForClient() { DirectQueryHandler provider1 = new DirectQueryHandler(dummyStreamObserver, new ClientStreamIdentification(Topology.DEFAULT_CONTEXT, "client"), "component", "client"); queryRegistrationCache.add(new QueryDefinition(Topology.DEFAULT_CONTEXT, "test"), "test", provider1); queryRegistrationCache.add(new QueryDefinition(Topology.DEFAULT_CONTEXT, "test1"), "test", provider1); assertEquals(2, queryRegistrationCache.getForClient(provider1.getClientStreamIdentification()).size()); }
public List<QueryRegistration> getForClient(ClientStreamIdentification client) { return registrationsPerQuery.entrySet().stream() .map(e -> new QueryRegistration(e.getKey(), e.getValue().getHandler(client))) .filter(r -> r.queryHandler != null && r.queryHandler .getClientStreamIdentification().equals(client)) .collect(Collectors.toList()); }
QueryRegistrationCache { public List<QueryRegistration> getForClient(ClientStreamIdentification client) { return registrationsPerQuery.entrySet().stream() .map(e -> new QueryRegistration(e.getKey(), e.getValue().getHandler(client))) .filter(r -> r.queryHandler != null && r.queryHandler .getClientStreamIdentification().equals(client)) .collect(Collectors.toList()); } }
QueryRegistrationCache { public List<QueryRegistration> getForClient(ClientStreamIdentification client) { return registrationsPerQuery.entrySet().stream() .map(e -> new QueryRegistration(e.getKey(), e.getValue().getHandler(client))) .filter(r -> r.queryHandler != null && r.queryHandler .getClientStreamIdentification().equals(client)) .collect(Collectors.toList()); } @Autowired  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector,
                                  BiFunction<Map<String, MetaDataValue>, Set<ClientStreamIdentification>, Set<ClientStreamIdentification>> metaDataBasedNodeSelector);  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector); }
QueryRegistrationCache { public List<QueryRegistration> getForClient(ClientStreamIdentification client) { return registrationsPerQuery.entrySet().stream() .map(e -> new QueryRegistration(e.getKey(), e.getValue().getHandler(client))) .filter(r -> r.queryHandler != null && r.queryHandler .getClientStreamIdentification().equals(client)) .collect(Collectors.toList()); } @Autowired  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector,
                                  BiFunction<Map<String, MetaDataValue>, Set<ClientStreamIdentification>, Set<ClientStreamIdentification>> metaDataBasedNodeSelector);  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector); @EventListener void on(SubscriptionEvents.UnsubscribeQuery event); @EventListener void on(SubscriptionEvents.SubscribeQuery event); void remove(ClientStreamIdentification clientStreamIdentification); void remove(QueryDefinition queryDefinition, ClientStreamIdentification clientId); void add(QueryDefinition queryDefinition, String resultName,
                    QueryHandler queryHandler); Set<QueryHandler> find(String context, QueryRequest request); Collection<QueryHandler> findAll(String context, QueryRequest request); Map<QueryDefinition, Map<String, Set<QueryHandler<?>>>> getAll(); List<QueryRegistration> getForClient(ClientStreamIdentification client); QueryHandler find(String context, QueryRequest request, String clientStreamId); Set<ClientStreamIdentification> getClients(); Set<String> getResponseTypes(QueryDefinition key); }
QueryRegistrationCache { public List<QueryRegistration> getForClient(ClientStreamIdentification client) { return registrationsPerQuery.entrySet().stream() .map(e -> new QueryRegistration(e.getKey(), e.getValue().getHandler(client))) .filter(r -> r.queryHandler != null && r.queryHandler .getClientStreamIdentification().equals(client)) .collect(Collectors.toList()); } @Autowired  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector,
                                  BiFunction<Map<String, MetaDataValue>, Set<ClientStreamIdentification>, Set<ClientStreamIdentification>> metaDataBasedNodeSelector);  QueryRegistrationCache(QueryHandlerSelector queryHandlerSelector); @EventListener void on(SubscriptionEvents.UnsubscribeQuery event); @EventListener void on(SubscriptionEvents.SubscribeQuery event); void remove(ClientStreamIdentification clientStreamIdentification); void remove(QueryDefinition queryDefinition, ClientStreamIdentification clientId); void add(QueryDefinition queryDefinition, String resultName,
                    QueryHandler queryHandler); Set<QueryHandler> find(String context, QueryRequest request); Collection<QueryHandler> findAll(String context, QueryRequest request); Map<QueryDefinition, Map<String, Set<QueryHandler<?>>>> getAll(); List<QueryRegistration> getForClient(ClientStreamIdentification client); QueryHandler find(String context, QueryRequest request, String clientStreamId); Set<ClientStreamIdentification> getClients(); Set<String> getResponseTypes(QueryDefinition key);  }