class EndpointsApiController implements EndpointsApi {

    @Override
    @PreAuthorize("hasAuthority('VIEW_ENDPOINT_ACL')")
    public ResponseEntity<List<ServiceClient>> getEndpointServiceClients(String id) {
        Long endpointId = parseLongIdOrThrowNotFound(id);
        List<ServiceClientDto> serviceClientsByEndpoint;
        try {
            serviceClientsByEndpoint = serviceClientService.getServiceClientsByEndpoint(endpointId);
        } catch (EndpointNotFoundException e) {
            throw new ResourceNotFoundException(NOT_FOUND_ERROR_MSG + " " + id);
        } catch (ClientNotFoundException e) {
            throw new ConflictException(e);
        }
        List<ServiceClient> serviceClients = serviceClientConverter
                .convertServiceClientDtos(serviceClientsByEndpoint);
        Collections.sort(serviceClients, serviceClientSortingComparator);
        return new ResponseEntity<>(serviceClients, HttpStatus.OK);
    }

    @Autowired public  EndpointsApiController(
            EndpointService endpointService,
            EndpointConverter endpointConverter,
            AccessRightService accessRightService,
            ServiceClientConverter serviceClientConverter,
            ServiceClientHelper serviceClientHelper,
            ServiceClientService serviceClientService);

}