Search in sources :

Example 1 with SqlServerAppSearch

use of com.khartec.waltz.data.application.search.SqlServerAppSearch in project waltz by khartec.

the class AppHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    // Water & Vole
    // P&S Blotter
    // P & S Gorilla
    List<Application> jimmy = new SqlServerAppSearch().search(dsl, "Water & Vole", EntitySearchOptions.mkForEntity(EntityKind.APPLICATION));
    System.out.println(jimmy);
// ApplicationService applicationService = ctx.getBean(ApplicationService.class);
// DSLContext dsl = ctx.getBean(DSLContext.class);
// 
// List<String> tagList = applicationService.findAllTags();
// 
// tagList.forEach(System.out::println);
// 
// System.out.println("---------------");
// 
// applicationService.findByTag("not-good-at-flying").forEach(a -> System.out.println(a.name()));
// 
// System.out.println(applicationService.findTagsForApplication(521L));
// 
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) SqlServerAppSearch(com.khartec.waltz.data.application.search.SqlServerAppSearch) DSLContext(org.jooq.DSLContext) Application(com.khartec.waltz.model.application.Application)

Example 2 with SqlServerAppSearch

use of com.khartec.waltz.data.application.search.SqlServerAppSearch in project waltz by khartec.

the class MsSqlSearchHarness method main.

public static void main(String[] args) {
    ApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    SqlServerAppSearch appSearch = new SqlServerAppSearch();
    EntitySearchOptions searchOptions = ImmutableEntitySearchOptions.builder().addEntityKinds(EntityKind.APPLICATION).userId("admin").limit(50).build();
    List<Application> results = appSearch.search(dsl, "sap", searchOptions);
    results.stream().filter(a -> a.entityLifecycleStatus() != EntityLifecycleStatus.REMOVED).forEach(a -> System.out.println(a.name() + " - " + a.lifecyclePhase()));
}
Also used : Application(com.khartec.waltz.model.application.Application) ImmutableEntitySearchOptions(com.khartec.waltz.model.entity_search.ImmutableEntitySearchOptions) List(java.util.List) SqlServerAppSearch(com.khartec.waltz.data.application.search.SqlServerAppSearch) DIConfiguration(com.khartec.waltz.service.DIConfiguration) DSLContext(org.jooq.DSLContext) EntitySearchOptions(com.khartec.waltz.model.entity_search.EntitySearchOptions) ApplicationContext(org.springframework.context.ApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityKind(com.khartec.waltz.model.EntityKind) EntityLifecycleStatus(com.khartec.waltz.model.EntityLifecycleStatus) ApplicationContext(org.springframework.context.ApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) SqlServerAppSearch(com.khartec.waltz.data.application.search.SqlServerAppSearch) ImmutableEntitySearchOptions(com.khartec.waltz.model.entity_search.ImmutableEntitySearchOptions) EntitySearchOptions(com.khartec.waltz.model.entity_search.EntitySearchOptions) DSLContext(org.jooq.DSLContext) Application(com.khartec.waltz.model.application.Application)

Aggregations

SqlServerAppSearch (com.khartec.waltz.data.application.search.SqlServerAppSearch)2 Application (com.khartec.waltz.model.application.Application)2 DSLContext (org.jooq.DSLContext)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 EntityKind (com.khartec.waltz.model.EntityKind)1 EntityLifecycleStatus (com.khartec.waltz.model.EntityLifecycleStatus)1 EntitySearchOptions (com.khartec.waltz.model.entity_search.EntitySearchOptions)1 ImmutableEntitySearchOptions (com.khartec.waltz.model.entity_search.ImmutableEntitySearchOptions)1 DIConfiguration (com.khartec.waltz.service.DIConfiguration)1 List (java.util.List)1 ApplicationContext (org.springframework.context.ApplicationContext)1