class ApplicationSlaManagementResource implements ApplicationSlaManagementEndpoint {

    @GET
    @Override
    public List<ApplicationSlaRepresentation> getApplicationSLAs(@QueryParam("extended") boolean extended, @QueryParam("schedulerName") String schedulerName) {
        List<ApplicationSlaRepresentation> result = new ArrayList<>();

        String cellId = extended ? configuration.getCellName() : null;
        Map<String, ReservationUsage> usageMap = extended ? reservationUsageCalculator.buildUsage() : Collections.emptyMap();
        Collection<ApplicationSLA> applicationSLAs;
        if (Strings.isNullOrEmpty(schedulerName)) {
            applicationSLAs = applicationSlaManagementService.getApplicationSLAs();
        } else {
            applicationSLAs = applicationSlaManagementService.getApplicationSLAsForScheduler(schedulerName);
        }
        applicationSLAs.forEach(a -> result.add(asRepresentation(a, cellId, usageMap.get(a.getAppName()))));
        return result;
    }

    @Inject public  ApplicationSlaManagementResource(MasterConfiguration configuration,
                                            ApplicationSlaManagementService applicationSlaManagementService,
                                            ReservationUsageCalculator reservationUsageCalculator);

}