@Override public EndpointConfigurationDto saveEndpointConfiguration(EndpointConfigurationDto endpointConfigurationDto) { return getDto(endpointConfigurationDao.save(endpointConfigurationDto)); }
@Override public EndpointUserConfigurationDto findUserConfigurationByUserIdAndAppTokenAndSchemaVersion( String userId, String appToken, Integer schemaVersion) { return getDto(endpointUserConfigurationDao.findByUserIdAndAppTokenAndSchemaVersion( userId, appToken, schemaVersion)); }
@Override public ApplicationDto findAppByApplicationToken(String applicationToken) { ApplicationDto applicationDto = null; if (isNotBlank(applicationToken)) { applicationDto = getDto(applicationDao.findByApplicationToken(applicationToken)); } return applicationDto; }
@Override public LogAppenderDto findLogAppenderById(String id) { LOG.debug("Find log appender by id [{}]", id); return getDto(logAppenderDao.findById(id)); }
@Override public CTLSchemaDto findCtlSchemaByFqnAndVerAndTenantIdAndApplicationId(String fqn, Integer version, String tenantId, String applicationId) { if (isBlank(fqn) || version == null) { throw new IncorrectParameterException("Incorrect parameters for ctl schema request."); } LOG.debug("Find ctl schema by fqn {} version {}, tenant id {} and application id {}", fqn, version, tenantId, applicationId); return DaoUtil.getDto(ctlSchemaDao.findByFqnAndVerAndTenantIdAndApplicationId(fqn, version, tenantId, applicationId)); }
@Override @Transactional public EndpointGroupDto findEndpointGroupById(String id) { validateSqlId(id, "Can't find endpoint group by id. Incorrect id " + id); return getDto(endpointGroupDao.findById(id)); }
@Override public CTLSchemaDto findCtlSchemaById(String schemaId) { validateSqlId(schemaId, "Incorrect schema id for ctl request " + schemaId); LOG.debug("Find ctl schema by id [{}]", schemaId); return DaoUtil.getDto(ctlSchemaDao.findById(schemaId)); }
@Override public EventClassFamilyDto findEventClassFamilyByEcfvId(String id) { validateSqlId(id, "Event class family version id is incorrect. Can't find event class family " + "by ECF version id " + id); return getDto(eventClassFamilyDao.findByEcfvId(id)); }
@Override public EndpointUserDto findEndpointUserById(String id) { EndpointUserDto endpointUserDto = null; if (isValidId(id)) { endpointUserDto = getDto(endpointUserDao.findById(id)); } return endpointUserDto; }
@Override public ConfigurationDto findConfigurationById(String id) { validateSqlId(id, "Configuration id is incorrect. Can't find configuration by id " + id); return getDto(configurationDao.findById(id)); }
@Override public NotificationSchemaDto findNotificationSchemaByAppIdAndTypeAndVersion( String appId, NotificationTypeDto type, int majorVersion) { validateId(appId, "Can't find notification schema. Invalid application id: " + appId); return getDto(notificationSchemaDao.findNotificationSchemasByAppIdAndTypeAndVersion( appId, type, majorVersion)); }
@Override public EventClassFamilyDto findEventClassFamilyById(String id) { validateSqlId(id, "Event class family id is incorrect. Can't find event class family by id " + id); return getDto(eventClassFamilyDao.findById(id)); }
@Override public TenantDto findTenantById(String id) { TenantDto tenantDto = null; if (isValidSqlId(id)) { tenantDto = getDto(tenantDao.findById(id)); } return tenantDto; }
@Override public ConfigurationSchemaDto findConfSchemaByAppIdAndVersion(String applicationId, int version) { validateSqlId(applicationId, "Incorrect application id " + applicationId + ". Can't find configuration schema."); return getDto(configurationSchemaDao.findByAppIdAndVersion(applicationId, version)); }
private ConfigurationSchemaDto findLatestConfSchemaByAppId(String applicationId) { validateSqlId(applicationId, "Incorrect application id " + applicationId + ". Can't find latest configuration schema."); return getDto(configurationSchemaDao.findLatestByApplicationId(applicationId)); } }
@Override public EndpointProfileSchemaDto findProfileSchemaById(String id) { validateSqlId(id, "Can't find profile schema. Invalid profile schema id: " + id); return getDto(profileSchemaDao.findById(id)); }
@Override public EndpointProfileSchemaDto findProfileSchemaByAppIdAndVersion( String appId, int schemaVersion) { validateId(appId, "Can't find profile schema. Invalid application id: " + appId); return getDto(profileSchemaDao.findByAppIdAndVersion(appId, schemaVersion)); }
@Override public EndpointNotificationDto findUnicastNotificationById(String id) { validateId(id, "Can't find unicast notification. Invalid id " + id); return getDto(unicastNotificationDao.findById(id)); }
@Override public EventClassDto findEventClassById(String eventClassId) { if (isValidSqlId(eventClassId)) { LOG.debug("Find event class by id [{}] ", eventClassId); return getDto(eventClassDao.findById(eventClassId)); } else { throw new IncorrectParameterException("Incorrect event class id: " + eventClassId); } }
@Override public UserDto saveUser(UserDto userDto) { UserDto user = null; if (isValidSqlObject(userDto)) { user = getDto(userDao.save(new User(userDto))); } return user; }