Search in sources :

Example 1 with WorkspaceEntityType

use of com.sequenceiq.cloudbreak.workspace.controller.WorkspaceEntityType in project cloudbreak by hortonworks.

the class LegacyStructuredEventFilter method initializePathRepositoryMap.

@PostConstruct
public void initializePathRepositoryMap() {
    Map<String, Object> workspaceEntityTypes = listableBeanFactory.getBeansWithAnnotation(WorkspaceEntityType.class);
    for (Object workspaceEntityType : workspaceEntityTypes.values()) {
        Path pathAnnotation = AnnotationUtils.findAnnotation(workspaceEntityType.getClass().getSuperclass(), Path.class);
        WorkspaceEntityType entityTypeAnnotation = AnnotationUtils.findAnnotation(workspaceEntityType.getClass(), WorkspaceEntityType.class);
        if (pathAnnotation != null) {
            String pathValue = pathAnnotation.value();
            Class<?> entityClass = entityTypeAnnotation.value();
            WorkspaceResourceRepository<?, ?> repository = repositoryLookupService.getRepositoryForEntity(entityClass);
            pathRepositoryMap.put(pathValue, repository);
        }
    }
}
Also used : Path(javax.ws.rs.Path) WorkspaceEntityType(com.sequenceiq.cloudbreak.workspace.controller.WorkspaceEntityType) PostConstruct(javax.annotation.PostConstruct)

Aggregations

WorkspaceEntityType (com.sequenceiq.cloudbreak.workspace.controller.WorkspaceEntityType)1 PostConstruct (javax.annotation.PostConstruct)1 Path (javax.ws.rs.Path)1