@Override public ServerProfileSchemaDto findServerProfileSchema(String schemaId) { validateSqlId(schemaId, "Incorrect server profile schema id."); return getDto(serverProfileSchemaDao.findById(schemaId)); }
@Override public List<ServerProfileSchemaDto> findServerProfileSchemasByAppId(String appId) { validateSqlId(appId, "Incorrect application id."); return convertDtoList(serverProfileSchemaDao.findByAppId(appId)); }
@Override public ServerProfileSchemaDto findServerProfileSchemaByAppIdAndVersion(String appId, int schemaVersion) { validateSqlId(appId, "Can't find server profile schema. Invalid application id: " + appId); return getDto(serverProfileSchemaDao.findByAppIdAndVersion(appId, schemaVersion)); }
String id = dto.getId(); if (isBlank(id)) { ServerProfileSchema serverProfileSchema = serverProfileSchemaDao.findLatestByAppId(appId); int version = -1; if (serverProfileSchema != null) { } else { ServerProfileSchemaDto oldServerProfileSchemaDto = getDto( serverProfileSchemaDao.findById(id)); if (oldServerProfileSchemaDto != null) { oldServerProfileSchemaDto.editFields(dto); return getDto(serverProfileSchemaDao.save(new ServerProfileSchema(dto))); } else { throw new IncorrectParameterException("Invalid server profile schema object. Application "
@Override public void removeServerProfileSchemaById(String profileId) { validateSqlId(profileId, "Incorrect server profile schema id."); serverProfileSchemaDao.removeById(profileId); }
@Override public void removeServerProfileSchemaByAppId(String appId) { validateSqlId(appId, "Incorrect application id."); serverProfileSchemaDao.removeByAppId(appId); }
@Override public ServerProfileSchemaDto findLatestServerProfileSchema(String appId) { validateSqlId(appId, "Incorrect application id."); return getDto(serverProfileSchemaDao.findLatestByAppId(appId)); }
@Test public void findActualBySchemaIdAndGroupIdWithNullEndpointSchema() { ServerProfileSchemaDto ss = generateServerProfileSchema(null, null); List<ProfileFilter> filters = generateFilterWithoutSchemaGeneration(null, serverProfileSchemaDao.findById(ss.getId()), null, 1, UpdateStatus.ACTIVE); ProfileFilter first = filters.get(0); EndpointGroup group = first.getEndpointGroup(); ServerProfileSchema srv = first.getServerProfileSchema(); List<ProfileFilter> found = profileFilterDao.findActualBySchemaIdAndGroupId(null, srv.getStringId(), group.getStringId()); Assert.assertFalse(found.isEmpty()); }