Search in sources :

Example 1 with AuthoritativeSourceService

use of com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService 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)

Example 2 with AuthoritativeSourceService

use of com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService in project waltz by khartec.

the class AuthSourceHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    AuthoritativeSourceService svc = ctx.getBean(AuthoritativeSourceService.class);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DSLContext(org.jooq.DSLContext) AuthoritativeSourceService(com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService)

Example 3 with AuthoritativeSourceService

use of com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService in project waltz by khartec.

the class LogicalFlowDecoratorRatingsServiceHarness method main.

public static void main(String[] args) throws SQLException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    AuthoritativeSourceService authoritativeSourceService = ctx.getBean(AuthoritativeSourceService.class);
    List<AuthoritativeSource> authSources = authoritativeSourceService.findAll();
    OrganisationalUnitService organisationalUnitService = ctx.getBean(OrganisationalUnitService.class);
    OrganisationalUnitDao organisationalUnitDao = ctx.getBean(OrganisationalUnitDao.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    dsl.select(ORGANISATIONAL_UNIT.fields()).from(ORGANISATIONAL_UNIT).fetch(organisationalUnitDao.TO_DOMAIN_MAPPER);
    EntityHierarchyService hierarchyService = ctx.getBean(EntityHierarchyService.class);
    List<OrganisationalUnit> allOrgUnits = organisationalUnitService.findAll();
    List<FlatNode<OrganisationalUnit, Long>> ouNodes = ListUtilities.map(allOrgUnits, ou -> new FlatNode<>(ou.id().get(), ou.parentId(), ou));
    Forest<OrganisationalUnit, Long> ouForest = HierarchyUtilities.toForest(ouNodes);
    Map<Long, Node<OrganisationalUnit, Long>> nodeMap = ouForest.getAllNodes();
}
Also used : OrganisationalUnitService(com.khartec.waltz.service.orgunit.OrganisationalUnitService) OrganisationalUnitDao(com.khartec.waltz.data.orgunit.OrganisationalUnitDao) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityHierarchyService(com.khartec.waltz.service.entity_hierarchy.EntityHierarchyService) Node(com.khartec.waltz.common.hierarchy.Node) FlatNode(com.khartec.waltz.common.hierarchy.FlatNode) AuthoritativeSource(com.khartec.waltz.model.authoritativesource.AuthoritativeSource) DSLContext(org.jooq.DSLContext) AuthoritativeSourceService(com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService) OrganisationalUnit(com.khartec.waltz.model.orgunit.OrganisationalUnit) FlatNode(com.khartec.waltz.common.hierarchy.FlatNode)

Aggregations

AuthoritativeSourceService (com.khartec.waltz.service.authoritative_source.AuthoritativeSourceService)3 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)3 DSLContext (org.jooq.DSLContext)2 FlatNode (com.khartec.waltz.common.hierarchy.FlatNode)1 Node (com.khartec.waltz.common.hierarchy.Node)1 OrganisationalUnitDao (com.khartec.waltz.data.orgunit.OrganisationalUnitDao)1 EntityKind (com.khartec.waltz.model.EntityKind)1 EntityReference.mkRef (com.khartec.waltz.model.EntityReference.mkRef)1 AuthoritativeSource (com.khartec.waltz.model.authoritativesource.AuthoritativeSource)1 NonAuthoritativeSource (com.khartec.waltz.model.authoritativesource.NonAuthoritativeSource)1 OrganisationalUnit (com.khartec.waltz.model.orgunit.OrganisationalUnit)1 DIConfiguration (com.khartec.waltz.service.DIConfiguration)1 EntityHierarchyService (com.khartec.waltz.service.entity_hierarchy.EntityHierarchyService)1 OrganisationalUnitService (com.khartec.waltz.service.orgunit.OrganisationalUnitService)1 Consumer (java.util.function.Consumer)1