Search in sources :

Example 1 with NonAuthoritativeSource

use of com.khartec.waltz.model.authoritativesource.NonAuthoritativeSource in project waltz by khartec.

the class NonAuthSourceHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    AuthoritativeSourceService authoritativeSourceService = ctx.getBean(AuthoritativeSourceService.class);
    Consumer<NonAuthoritativeSource> dumpRow = r -> {
        System.out.println(String.format("%s | %d - %d", r.sourceReference().name().orElse("?"), r.dataTypeId(), r.count()));
    };
    // authoritativeSourceService.findNonAuthSources(mkRef(EntityKind.ORG_UNIT, 200L)).forEach(dumpRow);
    // authoritativeSourceService.findNonAuthSources(mkRef(EntityKind.DATA_TYPE, 6000L)).forEach(dumpRow);
    authoritativeSourceService.findNonAuthSources(mkRef(EntityKind.APP_GROUP, 41)).forEach(dumpRow);
}
Also used : Consumer(java.util.function.Consumer) NonAuthoritativeSource(com.khartec.waltz.model.authoritativesource.NonAuthoritativeSource) DIConfiguration(com.khartec.waltz.service.DIConfiguration) AuthoritativeSourceService(com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityReference.mkRef(com.khartec.waltz.model.EntityReference.mkRef) EntityKind(com.khartec.waltz.model.EntityKind) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) NonAuthoritativeSource(com.khartec.waltz.model.authoritativesource.NonAuthoritativeSource) AuthoritativeSourceService(com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService)

Aggregations

EntityKind (com.khartec.waltz.model.EntityKind)1 EntityReference.mkRef (com.khartec.waltz.model.EntityReference.mkRef)1 NonAuthoritativeSource (com.khartec.waltz.model.authoritativesource.NonAuthoritativeSource)1 DIConfiguration (com.khartec.waltz.service.DIConfiguration)1 AuthoritativeSourceService (com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService)1 Consumer (java.util.function.Consumer)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1