@Override public List<ApplicationEventFamilyMapDto> findApplicationEventFamilyMapsByIds(List<String> ids) { LOG.debug("Find application event family maps by ids [{}]", ids); List<ApplicationEventFamilyMapDto> eventFamilies = Collections.emptyList(); if (ids != null && !ids.isEmpty()) { eventFamilies = convertDtoList(applicationEventFamilyMapDao.findByIds(ids)); } return eventFamilies; }
@Override public List<UserVerifierDto> findUserVerifiersByAppId(String appId) { LOG.debug("Find user verifiers by application id [{}]", appId); return convertDtoList(userVerifierDao.findByAppId(appId)); }
@Override public List<LogAppenderDto> findAllAppendersByAppId(String appId) { LOG.debug("Find vacant log appenders by application id [{}]", appId); return convertDtoList(logAppenderDao.findByAppId(appId)); }
@Override public List<CTLSchemaDto> findCtlSchemas() { LOG.debug("Find all ctl schemas"); return convertDtoList(ctlSchemaDao.find()); }
@Override public List<ApplicationEventFamilyMapDto> findByEcfIdAndVersion(String eventClassFamilyId, int version) { LOG.debug("Find application event family maps by ecf id [{}] and version", eventClassFamilyId, version); return convertDtoList(applicationEventFamilyMapDao.findByEcfIdAndVersion( eventClassFamilyId, version)); }
@Override public List<CTLSchemaDto> findSystemCtlSchemas() { LOG.debug("Find system ctl schemas"); return convertDtoList(ctlSchemaDao.findSystemSchemas()); }
@Override public List<HistoryDto> findHistoriesBySeqNumberStart(String appId, int startSeqNum) { LOG.debug("Find history range by application id [{}] and start sequence number {}", appId, startSeqNum); validateId(appId, "Can't find history by application id and start sequence number. " + "Invalid application id " + appId); return convertDtoList(historyDao.findBySeqNumberStart(appId, startSeqNum)); }
@Override public List<CTLSchemaDto> findAllCtlSchemasByFqnAndTenantIdAndApplicationId(String fqn, String tenantId, String applicationId) { validateString(fqn, "Incorrect fqn for ctl schema request."); LOG.debug("Find all ctl schemas by fqn {}, tenantId {} and applicationId {}", fqn, tenantId, applicationId); return convertDtoList(ctlSchemaDao.findAllByFqnAndTenantIdAndApplicationId(fqn, tenantId, applicationId)); }
@Override public List<ProfileFilterDto> findProfileFiltersByAppIdAndVersionsCombination( String appId, int endpointSchemaVersion, int serverSchemaVersion) { validateId(appId, "Can't find profile filter. Invalid application id: " + appId); return convertDtoList(profileFilterDao.findByAppIdAndSchemaVersionsCombination( appId, endpointSchemaVersion, serverSchemaVersion)); }
@Override public List<TopicDto> findTopicsByAppId(String appId) { validateId(appId, "Can't find topic. Invalid application id " + appId); return convertDtoList(topicDao.findTopicsByAppId(appId)); }
@Override public List<TopicDto> findTopicsByAppIdAndType(String appId, TopicTypeDto typeDto) { validateId(appId, "Can't find topics. Invalid application id " + appId); return convertDtoList(topicDao.findTopicsByAppIdAndType(appId, typeDto)); }
@Override public List<NotificationDto> findNotificationsByTopicIdAndVersionAndStartSecNum( String topicId, int seqNum, int sysNfVersion, int userNfVersion) { validateSqlId(topicId, "Can't find notifications. Invalid topic id: " + topicId); return convertDtoList(notificationDao.findNotificationsByTopicIdAndVersionAndStartSecNum( topicId, seqNum, sysNfVersion, userNfVersion)); }
@Override public List<NotificationSchemaDto> findNotificationSchemasByAppIdAndType( String appId, NotificationTypeDto type) { validateId(appId, "Can't find notification schemas. Invalid application id: " + appId); return convertDtoList(notificationSchemaDao.findNotificationSchemasByAppIdAndType(appId, type)); }
@Override public List<ConfigurationSchemaDto> findConfSchemasByAppId(String applicationId) { validateSqlId(applicationId, "Incorrect application id " + applicationId + ". Can't find configuration schemas."); return convertDtoList(configurationSchemaDao.findByApplicationId(applicationId)); }
@Override public List<EventClassFamilyDto> findEventClassFamiliesByTenantId( String tenantId) { List<EventClassFamilyDto> eventClassFamilies; if (isValidSqlId(tenantId)) { LOG.debug("Find event class families by tenant id [{}]", tenantId); eventClassFamilies = convertDtoList(eventClassFamilyDao.findByTenantId(tenantId)); } else { throw new IncorrectParameterException("Incorrect tenant id: " + tenantId); } return eventClassFamilies; }
@Override public List<CTLSchemaDto> findCtlSchemaDependents(String schemaId) { validateSqlId(schemaId, "Incorrect schema id for ctl schema request."); LOG.debug("Find dependents schemas for schema with id [{}]", schemaId); List<CTLSchemaDto> list = Collections.emptyList(); CtlSchema schemaDto = ctlSchemaDao.findById(schemaId); if (schemaDto != null) { list = convertDtoList(ctlSchemaDao.findDependentSchemas(schemaDto.getStringId())); } return list; }
@Override public List<EventClassFamilyVersionDto> findEventClassFamilyVersionsByEcfId(String ecfId) { validateSqlId(ecfId, "Event class family id is incorrect. Can't find event class family by id " + ecfId); EventClassFamily ecf = eventClassFamilyDao.findById(ecfId); return convertDtoList(ecf.getSchemas()); }
@Override public List<UserDto> findAllTenantAdminsByTenantId(String id) { if (isValidSqlId(id)) { return convertDtoList(userDao.findByTenantIdAndAuthority(id, KaaAuthorityDto.TENANT_ADMIN.name())); } return null; }
@Override public List<TopicDto> findTopicsByEndpointGroupId(String endpointGroupId) { validateId(endpointGroupId, "Can't find topics. Invalid endpoint group id " + endpointGroupId); EndpointGroup endpointGroup = endpointGroupDao.findById(endpointGroupId); Set<Topic> topics = endpointGroup.getTopics(); return convertDtoList(topics); }
@Override public List<UserDto> findAllTenantUsers(String tenantId) { if (isValidSqlId(tenantId)) { return convertDtoList(userDao.findByTenantIdAndAuthorities(tenantId, KaaAuthorityDto.TENANT_DEVELOPER.name(), KaaAuthorityDto.TENANT_USER.name())); } else { return null; //NOSONAR } } }