@Override public boolean equals(Object object) { return super.equals(object); }
@Override public int hashCode() { return super.hashCode(); } }
@Override public String getValue(T item) { return item.getDescription(); } }, 160);
@Override public Boolean getValue(T item) { return item.hasActive() && !item.hasDeprecated(); } }, 40);
@Override protected boolean canDelete(T value) { return value.hasDraft() || !value.hasDeprecated(); }
/** * Set data method. * * @param record the structure record */ public void setData(StructureRecordDto<T> record) { if (record.hasActive()) { activePanel.setData(record.getActiveStructureDto()); } if (record.hasDraft()) { inactivePanel.setData(record.getInactiveStructureDto()); } }
@Test public void findConfigurationRecordBySchemaIdAndEndpointGroupIdTest() { ConfigurationSchemaDto schema = generateConfSchemaDto(null, null, 1).get(0); EndpointGroupDto group = generateEndpointGroupDto(schema.getApplicationId()); ConfigurationDto activeConfig = generateConfigurationDto(schema.getId(), group.getId(), 1, true, false).get(0); ConfigurationDto inactiveConfig = generateConfigurationDto(schema.getId(), group.getId(), 1, false, false).get(0); StructureRecordDto<ConfigurationDto> record = configurationService .findConfigurationRecordBySchemaIdAndEndpointGroupId(schema.getId(), group.getId()); Assert.assertEquals(activeConfig, record.getActiveStructureDto()); Assert.assertEquals(inactiveConfig, record.getInactiveStructureDto()); }
protected void doDeactivate(final EventBus eventBus) { R activeStruct = record.getActiveStructureDto(); deactivateStruct(activeStruct.getId(), new BusyAsyncCallback<R>() { public void onSuccessImpl(R result) { goTo(getRecordPlace(applicationId, endpointGroupId, false, true, Math.random())); } public void onFailureImpl(Throwable caught) { Utils.handleException(caught, recordView); } }); }
protected void doActivate(final EventBus eventBus) { R inactiveStruct = record.getInactiveStructureDto(); activateStruct(inactiveStruct.getId(), new BusyAsyncCallback<R>() { public void onSuccessImpl(R result) { goTo(getRecordPlace(applicationId, endpointGroupId, false, true, Math.random())); } public void onFailureImpl(Throwable caught) { Utils.handleException(caught, recordView); } }); }
@Override public Boolean getValue(T item) { return item.hasDraft(); } }, 40);
@Override public void deleteConfigurationRecord(String schemaId, String endpointGroupId) throws KaaAdminServiceException { checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER); try { StructureRecordDto<ConfigurationDto> record = controlService.getConfigurationRecord( schemaId, endpointGroupId); checkEndpointGroupId(record.getEndpointGroupId()); String username = getCurrentUser().getUsername(); controlService.deleteConfigurationRecord(schemaId, endpointGroupId, username); } catch (Exception ex) { throw Utils.handleException(ex); } }
record = newRecord(); R inactiveStruct = createInactiveStruct(); record.setInactiveStructureDto(inactiveStruct); onRecordRetrieved(); } else {
@Test public void deleteConfigurationRecordTest() { ConfigurationSchemaDto schemaDto = generateConfSchemaDto(null, null, 1).get(0); EndpointGroupDto group = generateEndpointGroupDto(schemaDto.getApplicationId()); generateConfigurationDto(schemaDto.getId(), group.getId(), 1, true, false); ChangeConfigurationNotification notification = configurationService.deleteConfigurationRecord(schemaDto.getId(), group.getId(), null); Assert.assertNotNull(notification); ConfigurationDto configurationDto = notification.getConfigurationDto(); Assert.assertEquals(UpdateStatus.DEPRECATED, configurationDto.getStatus()); StructureRecordDto<ConfigurationDto> records = configurationService .findConfigurationRecordBySchemaIdAndEndpointGroupId(schemaDto.getId(), group.getId()); Assert.assertNull(records.getInactiveStructureDto()); Assert.assertEquals(UpdateStatus.DEPRECATED, records.getActiveStructureDto().getStatus()); }
@Override public int hashCode() { return super.hashCode(); } }
@Override public boolean equals(Object obj) { return super.equals(obj); }
@Override public int hashCode() { return super.hashCode(); } }
@Override public boolean equals(Object obj) { return super.equals(obj); }