INNER CODE UNIT · Java

verifyPresenceOfNewAssociation

righettod/poc-graphql · src/main/java/eu/righettod/graphqlpoc/publishers/NewAssociationPublisher.java:57

    private Runnable verifyPresenceOfNewAssociation(ObservableEmitter<String> emitter) {
        return () -> {
            try {
                List<Dog> dogs = businessDataRepository.findAllDogs(false, 1000000);
                String vetName;
                for (Dog d : dogs) {
                    vetName = cacheAssociation.get(d.getName());
                    if (vetName == null && d.getVeterinary() != null) {
                        cacheAssociation.put(d.getName(), d.getVeterinary().getName());
                        emitter.onNext(String.format("Dog['%s'] associated with Veterinary['%s'].", d.getName(), d.getVeterinary().getName()));
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        };
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…