@Override public Schema exportCtlSchemaFlatAsSchema(CTLSchemaDto schema) throws ControlServiceException { return ctlService.flatExportAsSchema(schema); }
@Override public FileData exportCtlSchemaFlatAsLibrary(CTLSchemaDto schema) throws ControlServiceException { try { Schema avroSchema = ctlService.flatExportAsSchema(schema); String fileName = MessageFormat.format(CTL_LIBRARY_EXPORT_TEMPLATE, schema.getMetaInfo().getFqn(), schema.getVersion()); return SchemaLibraryGenerator.generateSchemaLibrary(avroSchema, fileName); } catch (Exception ex) { LOG.error("Unable to export flat CTL schema as library", ex); throw new ControlServiceException(ex); } }
@Override public Schema findEndpointConfigurationSchemaByEndpointKeyHash(String endpointKeyHash) throws KaaAdminServiceException { EndpointProfileDto endpointProfileDto = profileService .findEndpointProfileByEndpointKeyHash(endpointKeyHash); ConfigurationSchemaDto configurationSchemaDto = configurationService .findConfSchemaByAppIdAndVersion( endpointProfileDto.getApplicationId(), endpointProfileDto.getConfigurationVersion() ); CTLSchemaDto ctlSchemaDto = ctlService .findCtlSchemaById(configurationSchemaDto.getCtlSchemaId()); return ctlService.flatExportAsSchema(ctlSchemaDto); }