* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.config;
-import org.onap.aai.setup.SchemaServiceTranslator;
-import org.onap.aai.setup.SchemaVersions;
-import org.onap.aai.setup.SchemaVersionsBean;
-import org.onap.aai.setup.Translator;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.onap.aai.setup.*;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
-@ConditionalOnExpression("'${schema.translator.list}'.contains('schema-service')")
+@ConditionalOnProperty(name = "schema.translator.list", havingValue = "schema-service", matchIfMissing = false)
@PropertySource(value = "classpath:schema-ingest.properties", ignoreResourceNotFound = true)
@PropertySource(value = "file:${schema.ingest.file}", ignoreResourceNotFound = true)
public class SchemaServiceConfiguration {
return new SchemaVersionsBean();
}
+ @Bean(name = "schemaServiceVersions")
+ public SchemaServiceVersions schemaServiceVersions() {
+ return schemaVersionsBean().getSchemaVersions();
+ }
+
@Bean(name = "schemaVersions")
public SchemaVersions schemaVersions() {
- return schemaVersionsBean().getSchemaVersions();
+ return schemaServiceVersions();
}
@Bean(name = "schemaServiceTranslator")
public Translator schemaServiceTranslator() {
- return new SchemaServiceTranslator(schemaVersions());
+ return new SchemaServiceTranslator(schemaServiceVersions());
}
}