@Test public void testRemoveNotAllowedForDefaultApplication() throws Exception { try { slaManagementService.removeApplicationSLA(DEFAULT_APPLICATION).toBlocking().firstOrDefault(null); fail(DEFAULT_APPLICATION + " cannot be removed"); } catch (IllegalArgumentException e) { } }
@Override public Observable<Void> removeApplicationSLA(String applicationName) { if (applicationName.equals(DEFAULT_APPLICATION)) { return Observable.error(new IllegalArgumentException(DEFAULT_APPLICATION + " cannot be removed")); } return storage.remove(applicationName).doOnCompleted(() -> capacityMonitoringService.refresh().subscribe()); }
DefaultApplicationSlaManagementService implements ApplicationSlaManagementService { @Override public Observable<Void> removeApplicationSLA(String applicationName) { if (applicationName.equals(DEFAULT_APPLICATION)) { return Observable.error(new IllegalArgumentException(DEFAULT_APPLICATION + " cannot be removed")); } return storage.remove(applicationName).doOnCompleted(() -> capacityMonitoringService.refresh().subscribe()); } }
DefaultApplicationSlaManagementService implements ApplicationSlaManagementService { @Override public Observable<Void> removeApplicationSLA(String applicationName) { if (applicationName.equals(DEFAULT_APPLICATION)) { return Observable.error(new IllegalArgumentException(DEFAULT_APPLICATION + " cannot be removed")); } return storage.remove(applicationName).doOnCompleted(() -> capacityMonitoringService.refresh().subscribe()); } @Inject  DefaultApplicationSlaManagementService(CapacityMonitoringService capacityMonitoringService,
                                                  ApplicationSlaStore storage,
                                                  ManagementSubsystemInitializer initializer); }
DefaultApplicationSlaManagementService implements ApplicationSlaManagementService { @Override public Observable<Void> removeApplicationSLA(String applicationName) { if (applicationName.equals(DEFAULT_APPLICATION)) { return Observable.error(new IllegalArgumentException(DEFAULT_APPLICATION + " cannot be removed")); } return storage.remove(applicationName).doOnCompleted(() -> capacityMonitoringService.refresh().subscribe()); } @Inject  DefaultApplicationSlaManagementService(CapacityMonitoringService capacityMonitoringService,
                                                  ApplicationSlaStore storage,
                                                  ManagementSubsystemInitializer initializer); @Override Collection<ApplicationSLA> getApplicationSLAs(); @Override Collection<ApplicationSLA> getApplicationSLAsForScheduler(String schedulerName); @Override Optional<ApplicationSLA> findApplicationSLA(String applicationName); @Override ApplicationSLA getApplicationSLA(String applicationName); @Override Observable<Void> addApplicationSLA(ApplicationSLA applicationSLA); @Override Observable<Void> removeApplicationSLA(String applicationName); }
DefaultApplicationSlaManagementService implements ApplicationSlaManagementService { @Override public Observable<Void> removeApplicationSLA(String applicationName) { if (applicationName.equals(DEFAULT_APPLICATION)) { return Observable.error(new IllegalArgumentException(DEFAULT_APPLICATION + " cannot be removed")); } return storage.remove(applicationName).doOnCompleted(() -> capacityMonitoringService.refresh().subscribe()); } @Inject  DefaultApplicationSlaManagementService(CapacityMonitoringService capacityMonitoringService,
                                                  ApplicationSlaStore storage,
                                                  ManagementSubsystemInitializer initializer); @Override Collection<ApplicationSLA> getApplicationSLAs(); @Override Collection<ApplicationSLA> getApplicationSLAsForScheduler(String schedulerName); @Override Optional<ApplicationSLA> findApplicationSLA(String applicationName); @Override ApplicationSLA getApplicationSLA(String applicationName); @Override Observable<Void> addApplicationSLA(ApplicationSLA applicationSLA); @Override Observable<Void> removeApplicationSLA(String applicationName);  }