use of com.khartec.waltz.model.complexity.ComplexityRating in project waltz by khartec.
the class ServerComplexityHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
OrganisationalUnitDao ouDao = ctx.getBean(OrganisationalUnitDao.class);
ServerComplexityService serverService = ctx.getBean(ServerComplexityService.class);
ComplexityRatingService complexityService = ctx.getBean(ComplexityRatingService.class);
// EntityReference entityReference = EntityReference.mkRef(EntityKind.PERSON, 1);
EntityReference entityReference = EntityReference.mkRef(EntityKind.PERSON, 63);
List<ComplexityRating> complexity = FunctionUtilities.time("complexity", () -> complexityService.findForAppIdSelector(IdSelectionOptions.mkOpts(entityReference, HierarchyQueryScope.CHILDREN)));
}
use of com.khartec.waltz.model.complexity.ComplexityRating in project waltz by khartec.
the class AppViewService method getAppView.
public AppView getAppView(long id) {
EntityReference ref = ImmutableEntityReference.builder().kind(EntityKind.APPLICATION).id(id).build();
Future<Application> application = dbExecutorPool.submit(() -> applicationService.getById(id));
Future<OrganisationalUnit> orgUnit = dbExecutorPool.submit(() -> organisationalUnitService.getByAppId(id));
Future<List<String>> tags = dbExecutorPool.submit(() -> entityTagService.findTagsForEntityReference(mkRef(EntityKind.APPLICATION, id)));
Future<List<String>> aliases = dbExecutorPool.submit(() -> entityAliasService.findAliasesForEntityReference(ref));
Future<ComplexityRating> complexity = dbExecutorPool.submit(() -> complexityRatingService.getForApp(id));
return Unchecked.supplier(() -> ImmutableAppView.builder().app(application.get()).organisationalUnit(orgUnit.get()).tags(tags.get()).aliases(aliases.get()).complexity(complexity.get()).build()).get();
}
Aggregations