Search in sources :

Example 1 with ApiAuthRoleMetadataList

use of com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadataList in project cloudbreak by hortonworks.

the class AuthRolesResourceOperation method readAuthRolesMetadata.

public ResponseEntity<ApiAuthRoleMetadataList> readAuthRolesMetadata(String mockUuid, @Valid String view) {
    ClouderaManagerDto dto = clouderaManagerStoreService.read(mockUuid);
    List<ApiAuthRoleMetadata> collect = dto.getUsers().stream().flatMap(u -> u.getAuthRoles().stream()).map(r -> new ApiAuthRoleMetadata().role("ROLE_ADMIN").uuid(r.getUuid()).displayName(r.getDisplayName())).collect(Collectors.toList());
    return responseCreatorComponent.exec(new ApiAuthRoleMetadataList().items(collect));
}
Also used : Inject(javax.inject.Inject) Valid(javax.validation.Valid) List(java.util.List) ClouderaManagerDto(com.sequenceiq.mock.clouderamanager.ClouderaManagerDto) ClouderaManagerStoreService(com.sequenceiq.mock.clouderamanager.ClouderaManagerStoreService) ResponseCreatorComponent(com.sequenceiq.mock.clouderamanager.ResponseCreatorComponent) ApiAuthRoleMetadataList(com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadataList) ResponseEntity(org.springframework.http.ResponseEntity) Controller(org.springframework.stereotype.Controller) ApiAuthRoleMetadata(com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadata) Collectors(java.util.stream.Collectors) ApiAuthRoleMetadataList(com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadataList) ClouderaManagerDto(com.sequenceiq.mock.clouderamanager.ClouderaManagerDto) ApiAuthRoleMetadata(com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadata)

Aggregations

ClouderaManagerDto (com.sequenceiq.mock.clouderamanager.ClouderaManagerDto)1 ClouderaManagerStoreService (com.sequenceiq.mock.clouderamanager.ClouderaManagerStoreService)1 ResponseCreatorComponent (com.sequenceiq.mock.clouderamanager.ResponseCreatorComponent)1 ApiAuthRoleMetadata (com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadata)1 ApiAuthRoleMetadataList (com.sequenceiq.mock.swagger.model.ApiAuthRoleMetadataList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 Valid (javax.validation.Valid)1 ResponseEntity (org.springframework.http.ResponseEntity)1 Controller (org.springframework.stereotype.Controller)1