@Override public String exportCtlSchemaFlatAsString(CTLSchemaDto schema) throws ControlServiceException { return ctlService.flatExportAsString(schema); }
@Override public String getFlatSchemaByCtlSchemaId(String schemaId) throws ControlServiceException { CTLSchemaDto ctlSchemaDto = getCtlSchemaById(schemaId); return ctlService.flatExportAsString(ctlSchemaDto); }
@Override public String compute(String key) { LOG.debug("Fetching result for ctl schemas"); CTLSchemaDto ctlSchema = ctlService.findCtlSchemaById(key); return ctlService.flatExportAsString(ctlSchema); } });
@Override public LogSchema getLogSchema(String applicationId, int logSchemaVersion) { LOG.debug("Fetching log schema for application {} and version {}", applicationId, logSchemaVersion); LogSchema logSchema = null; LogSchemaDto logSchemaDto = logSchemaService.findLogSchemaByAppIdAndVersion( applicationId, logSchemaVersion); CTLSchemaDto ctlSchema = ctlService.findCtlSchemaById(logSchemaDto.getCtlSchemaId()); String logFlatSchema = ctlService.flatExportAsString(ctlSchema); if (logSchemaDto != null) { logSchema = new LogSchema(logSchemaDto, logFlatSchema); } return logSchema; }
EndpointProfileSchemaDto profileSchema = cacheService.getProfileSchemaByAppAndVersion(key); CTLSchemaDto ctlSchemaDto = cacheService.getCtlSchemaById(profileSchema.getCtlSchemaId()); String schema = ctlService.flatExportAsString(ctlSchemaDto); schemaInfo = new BaseSchemaInfo(ctlSchemaDto.getId(), schema); clientProfileSchemas.put(key, schemaInfo); CTLSchemaDto ctlSchemaDto = cacheService.getCtlSchemaById( serverProfileSchema.getCtlSchemaId()); String schema = ctlService.flatExportAsString(ctlSchemaDto); schemaInfo = new BaseSchemaInfo(ctlSchemaDto.getId(), schema); serverProfileSchemas.put(key, schemaInfo);
private void generateSchemas(ConfigurationSchemaDto schema) throws SchemaCreationException { CTLSchemaDto ctlSchema = ctlService.findCtlSchemaById(schema.getCtlSchemaId()); String sch = ctlService.flatExportAsString(ctlSchema); DataSchema dataSchema = new DataSchema(sch); if (!dataSchema.isEmpty()) { SchemaGenerationAlgorithm schemaGenerator = schemaGeneratorFactory.createSchemaGenerator(dataSchema); ProtocolSchema protocol = schemaGenerator.getProtocolSchema(); BaseSchema base = schemaGenerator.getBaseSchema(); OverrideSchema override = schemaGenerator.getOverrideSchema(); if (!protocol.isEmpty() && !base.isEmpty() && !override.isEmpty()) { schema.setBaseSchema(base.getRawSchema()); schema.setProtocolSchema(protocol.getRawSchema()); schema.setOverrideSchema(override.getRawSchema()); } else { LOG.trace("One or more generated schemas are empty. base: {} protocol {} override {}", base, protocol, override); throw new IncorrectParameterException("Can't generate schemas. Check your data schema"); } } else { LOG.warn("Can't generate schemas because data schema is empty."); } }
String logSchemaBodyString = ctlService.flatExportAsString(logCtlSchema); String notificationSchemaBodyString = ctlService.flatExportAsString(notificationCtlSchema); String profileSchemaBodyString = ctlService.flatExportAsString(profileCtlSchema); String confSchemaBodyString = ctlService.flatExportAsString(confCtlSchema); ctlDtos.forEach( ctlDto -> flatEventClassCtlSchemas.add( new DataSchema(ctlService.flatExportAsString(ctlDto)).getRawSchema() ))
String schema = ctlService.flatExportAsString(ctlSchemaDto); String endConf = null; String appToken;