diff --git a/bom/build.gradle b/bom/build.gradle index 33099041433..0e7b9ffd1c8 100644 --- a/bom/build.gradle +++ b/bom/build.gradle @@ -87,7 +87,6 @@ ext { servletVersion = '4.0.1' jakartaServletVersion = '6.0.0' sleepycatVersion = '18.3.12' - snakeyamlVersion = '2.0' slf4jVersion = '2.0.6' snappyVersion = '1.1.10.2' springbootVersion = '3.1.1' @@ -114,6 +113,7 @@ ext { reactivestreamsVersion = '1.0.4' springdocStarterVersion = '2.1.0' jacocoVersion = '0.8.8' + snakeYamlVersion = '2.2' } dependencies { @@ -255,7 +255,6 @@ dependencies { // testng also used in our 'source' code to support unit tests api("org.testng:testng:${testngVersion}") api("joda-time:joda-time:${jodatimeVersion}") - api("org.yaml:snakeyaml:${snakeyamlVersion}") api("org.antlr:antlr-runtime:${antlrVersion}") api("org.antlr:ST4:${ST4Version}") api("org.apache.jena:jena-arq:${jenaVersion}") @@ -284,6 +283,7 @@ dependencies { api("org.slf4j:slf4j-simple:${slf4jVersion}") api("org.testng:testng:${testngVersion}") api("org.hamcrest:hamcrest:${hamcrestVersion}") + api("org.yaml:snakeyaml:${snakeYamlVersion}") // Explicitly enforced versions of transitive dependencies to mitigate potential CVEs reported by static security scans. //TODO: Remove dependency line below in case the new parent library is updated and pulls good version. diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/README.md b/open-metadata-implementation/server-chassis/server-chassis-spring/README.md index 6d9d5bc5a46..3065f8500f9 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/README.md +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/README.md @@ -1,5 +1,5 @@ - + # OMAG Server Chassis Spring @@ -15,18 +15,54 @@ To build the boot application jar from the current module use: ### Starting the application locally -You can run the application locally from this module with java using following command: +You can run the application locally in the current module with java using following command: ```bash -java -jar build/libs/server-chassis-spring-*-SNAPSHOT.jar --omag.server-config=classpath:samples/metadata-repository-server.json --server.port=9080 --server.ssl.enabled=false +java -jar build/libs/server-chassis-spring-*-SNAPSHOT.jar --omag.server-config-file=classpath:samples/metadata-repository-server.yml --server.port=9080 --server.ssl.enabled=false ``` -The command will run the application using provided parameters. For demo purpose we turn ssl off and run the application on http port 9080. +``` + Project Egeria - Open Metadata and Governance + ____ __ ___ ___ ______ _____ + / __ \ / |/ // | / ____/ / ___/ ___ ____ _ __ ___ ____ + / / / // /|_/ // /| | / / __ \__ \ / _ \ / __/| | / // _ \ / __/ + / /_/ // / / // ___ |/ /_/ / ___/ // __// / | |/ // __// / + \____//_/ /_//_/ |_|\____/ /____/ \___//_/ |___/ \___//_/ + + :: Powered by Spring Boot (v3.1.1) :: + +2023-09-07T10:08:05.779+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Starting OMAGServer using Java 17.0.8 with PID 4334 (/Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring/build/libs/server-chassis-spring-4.4-SNAPSHOT.jar started by DEVELOPER in /Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring) +2023-09-07T10:08:05.781+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : No active profile set, falling back to 1 default profile: "default" +2023-09-07T10:08:07.435+02:00 INFO 4334 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9080 (http) +2023-09-07T10:08:07.444+02:00 INFO 4334 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2023-09-07T10:08:07.444+02:00 INFO 4334 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.10] +2023-09-07T10:08:07.505+02:00 INFO 4334 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext +2023-09-07T10:08:07.506+02:00 INFO 4334 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1681 ms +2023-09-07T10:08:08.228+02:00 INFO 4334 --- [ main] EnvironmentConfiguration$$SpringCGLIB$$0 : SSL configuration started working directory: /Developer/egeria/open-metadata-implementation/server-chassis/server-chassis-spring +2023-09-07T10:08:08.685+02:00 INFO 4334 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator' +2023-09-07T10:08:08.749+02:00 INFO 4334 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9080 (http) with context path '' +2023-09-07T10:08:08.763+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Started OMAGServer in 3.384 seconds (process running for 3.851) +2023-09-07T10:08:08.786+02:00 INFO 4334 --- [ main] o.o.o.s.s.config.OMAGConfigHelper : Using configuration from class path resource [samples/metadata-repository-server.yml] +2023-09-07T10:08:09.024+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Sending activation request for server: cocoMDS1 and user: OMAGServer +2023-09-07T10:08:09.208+02:00 INFO 4334 --- [ main] o.o.o.s.springboot.OMAGServer : Activation succeeded for server: cocoMDS1 + +``` + +The command will run the application using parameters provided. The OMAG server instance is created and activated using the configuration file supplied via application property `omag.server-config-file`. +
To demonstrate basic functionality, we turn ssl off `server.ssl.enabled=false` and run the application on http port 9080 `server.port=9080`. + +### Quick-start configuration properties + +| Property name | Environment variable | Description | +|-------------------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| omag.server-config-file | OMAG_SERVERCONFIGFILE | [REQUIRED] The [OMAGServerConfig document](https://egeria-project.org/concepts/configuration-document/) file location.
Note the value should be defined as spring Resource i.e. starting with `classpath:` or `file:`
Both JSON and YAML files are supported. See [samples](src%2Fmain%2Fresources%2Fsamples) for sample configuration files. | +| server.port | SERVER_PORT | Configures port used by the embedded Tomcat server. | +| server.ssl.enabled | SERVER_SSL_ENABLED | Configures if SSL should be enabled for the embedded Tomcat server. | -### Configuration properties +Application can be further customized by setting supported spring boot and application specific properties. +
The default configuration that is already packaged within the JAR distribution is [application.properties](src%2Fmain%2Fresources%2Fapplication.properties). +
Following Spring application [external configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config) feature, all the properties can be customized at deploy/run time as shown in the quick-start example above. -| Property name | Environment variable | | Description | -|--------------------|----------------------|:----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| omag.server-config | OMAG_SERVER-CONFIG | | The [OMAGServerConfig document](https://egeria-project.org/concepts/configuration-document/) json file location **(Required)**. Note the value should be spring Resource i.e. starting with `classpath:` or `file:` | -| server.port | SERVER_PORT | | Configures port used by the embedded Tomcat server | -| server.ssl.enabled | SERVER_SSL_ENABLED | | Configures if SSL should be enabled for the embedded Tomcat server | \ No newline at end of file +---- +License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), +Copyright Contributors to the ODPi Egeria project. \ No newline at end of file diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/build.gradle b/open-metadata-implementation/server-chassis/server-chassis-spring/build.gradle index 0de2c37ad3b..dc99453e82d 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/build.gradle +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/build.gradle @@ -20,21 +20,22 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' - implementation 'org.springframework.boot:spring-boot-actuator-autoconfigure' - implementation 'org.springframework.boot:spring-boot-actuator' implementation 'org.springframework.boot:spring-boot-starter-tomcat' implementation 'org.slf4j:slf4j-api' implementation 'com.fasterxml.jackson.core:jackson-databind' implementation 'com.fasterxml.jackson.core:jackson-annotations' implementation 'jakarta.servlet:jakarta.servlet-api' - implementation 'jakarta.validation:jakarta.validation-api' implementation 'org.projectlombok:lombok' + implementation 'org.yaml:snakeyaml' + implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml' + implementation 'com.google.guava:guava' annotationProcessor 'org.projectlombok:lombok' runtimeOnly 'io.micrometer:micrometer-registry-prometheus' runtimeOnly 'ch.qos.logback:logback-classic' runtimeOnly 'org.hibernate:hibernate-validator' compileOnly 'io.swagger.core.v3:swagger-annotations-jakarta' + runtimeOnly 'com.fasterxml.jackson.core:jackson-core' compileOnly project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') @@ -42,21 +43,65 @@ dependencies { implementation project(':open-metadata-implementation:server-operations:server-operations-api') implementation project(':open-metadata-implementation:server-operations:server-operations-server') - /* IN DEVELOPMENT */ - - /* Pulling dependencies for some fo the sub-systems enabling 'Metadata Access Store' services */ - - runtimeOnly project(':open-metadata-implementation:repository-services:repository-services-spring') - runtimeOnly project(':open-metadata-implementation:access-services:asset-manager:asset-manager-spring') - runtimeOnly project(':open-metadata-implementation:access-services:asset-catalog:asset-catalog-spring') - runtimeOnly project(':open-metadata-implementation:access-services:data-manager:data-manager-spring') - - /* Pulling dependencies for some fo the sub-systems enabling 'Integration Daemon' services to test Database Integrator via JDBC integration connector */ - -// runtimeOnly project(':open-metadata-implementation:integration-services:database-integrator:database-integrator-server') -// runtimeOnly 'org.odpi.egeria:egeria-connector-resource-jdbc:1.1' -// runtimeOnly 'org.odpi.egeria:egeria-connector-integration-jdbc:1.1' -// runtimeOnly 'com.oracle.database.jdbc:ojdbc10:19.19.0.0' + if (!project.hasProperty("adminChassisOnly")) { + runtimeOnly project(':open-metadata-implementation:view-services:server-author-view:server-author-view-spring') + runtimeOnly project(':open-metadata-implementation:view-services:glossary-author-view:glossary-author-view-spring') + runtimeOnly project(':open-metadata-implementation:view-services:glossary-browser:glossary-browser-spring') + runtimeOnly project(':open-metadata-implementation:view-services:glossary-workflow:glossary-workflow-spring') + runtimeOnly project(':open-metadata-implementation:view-services:my-profile:my-profile-spring') + runtimeOnly project(':open-metadata-implementation:view-services:rex-view:rex-view-spring') + runtimeOnly project(':open-metadata-implementation:view-services:tex-view:tex-view-spring') + runtimeOnly project(':open-metadata-implementation:view-services:dino-view:dino-view-spring') + runtimeOnly project(':open-metadata-implementation:access-services:security-officer:security-officer-spring') + runtimeOnly project(':open-metadata-implementation:access-services:security-manager:security-manager-spring') + runtimeOnly project(':open-metadata-implementation:access-services:data-manager:data-manager-spring') + runtimeOnly project(':open-metadata-implementation:access-services:glossary-view:glossary-view-spring') + runtimeOnly project(':open-metadata-implementation:access-services:asset-lineage:asset-lineage-spring') + runtimeOnly project(':open-metadata-implementation:access-services:data-engine:data-engine-spring') + runtimeOnly project(':open-metadata-implementation:access-services:subject-area:subject-area-spring') + runtimeOnly project(':open-metadata-implementation:access-services:asset-catalog:asset-catalog-spring') + runtimeOnly project(':open-metadata-implementation:access-services:governance-program:governance-program-spring') + runtimeOnly project(':open-metadata-implementation:access-services:governance-engine:governance-engine-spring') + runtimeOnly project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-spring') + runtimeOnly project(':open-metadata-implementation:access-services:stewardship-action:stewardship-action-spring') + runtimeOnly project(':open-metadata-implementation:access-services:community-profile:community-profile-spring') + runtimeOnly project(':open-metadata-implementation:access-services:design-model:design-model-spring') + runtimeOnly project(':open-metadata-implementation:access-services:data-privacy:data-privacy-spring') + runtimeOnly project(':open-metadata-implementation:access-services:it-infrastructure:it-infrastructure-spring') + runtimeOnly project(':open-metadata-implementation:access-services:project-management:project-management-spring') + runtimeOnly project(':open-metadata-implementation:access-services:dev-ops:dev-ops-spring') + runtimeOnly project(':open-metadata-implementation:access-services:software-developer:software-developer-spring') + runtimeOnly project(':open-metadata-implementation:access-services:digital-architecture:digital-architecture-spring') + runtimeOnly project(':open-metadata-implementation:access-services:digital-service:digital-service-spring') + runtimeOnly project(':open-metadata-implementation:access-services:data-science:data-science-spring') + runtimeOnly project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-spring') + runtimeOnly project(':open-metadata-implementation:access-services:asset-manager:asset-manager-spring') + runtimeOnly project(':open-metadata-implementation:access-services:asset-owner:asset-owner-spring') + runtimeOnly project(':open-metadata-implementation:engine-services:asset-analysis:asset-analysis-spring') + runtimeOnly project(':open-metadata-implementation:engine-services:repository-governance:repository-governance-spring') + runtimeOnly project(':open-metadata-implementation:engine-services:governance-action:governance-action-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:security-integrator:security-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:organization-integrator:organization-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:infrastructure-integrator:infrastructure-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:lineage-integrator:lineage-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:files-integrator:files-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:display-integrator:display-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:database-integrator:database-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:analytics-integrator:analytics-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:api-integrator:api-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:catalog-integrator:catalog-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:search-integrator:search-integrator-spring') + runtimeOnly project(':open-metadata-implementation:integration-services:topic-integrator:topic-integrator-spring') + runtimeOnly project(':open-metadata-implementation:repository-services:repository-services-spring') + runtimeOnly project(':open-metadata-conformance-suite:open-metadata-conformance-suite-spring') + runtimeOnly project(':open-metadata-implementation:framework-services:ocf-metadata-management:ocf-metadata-spring') + runtimeOnly project(':open-metadata-implementation:framework-services:gaf-metadata-management:gaf-metadata-spring') + runtimeOnly project(':open-metadata-implementation:framework-services:oif-metadata-management:oif-metadata-spring') + runtimeOnly project(':open-metadata-implementation:governance-servers:data-engine-proxy-services:data-engine-proxy-services-spring') + runtimeOnly project(':open-metadata-implementation:governance-servers:integration-daemon-services:integration-daemon-services-spring') + runtimeOnly project(':open-metadata-implementation:governance-servers:engine-host-services:engine-host-services-spring') + runtimeOnly project(':open-metadata-implementation:governance-servers:open-lineage-services:open-lineage-services-spring') + } testImplementation 'org.junit.jupiter:junit-jupiter-api' testImplementation 'org.springframework.boot:spring-boot-test' diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServer.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServer.java index 683a57a2109..c046e1d8e1b 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServer.java +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServer.java @@ -2,12 +2,11 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.serverchassis.springboot; -import com.fasterxml.jackson.databind.ObjectMapper; import org.odpi.openmetadata.adminservices.configuration.properties.OMAGServerConfig; +import org.odpi.openmetadata.serverchassis.springboot.config.OMAGConfigHelper; +import org.odpi.openmetadata.serverchassis.springboot.exception.OMAGServerActivationError; import org.odpi.openmetadata.serveroperations.rest.SuccessMessageResponse; import org.odpi.openmetadata.serveroperations.server.OMAGServerOperationalServices; -import org.odpi.openmetadata.serverchassis.springboot.config.OMAGServerProperties; -import org.odpi.openmetadata.serverchassis.springboot.exception.OMAGServerActivationError; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -16,17 +15,14 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.event.ContextClosedEvent; import org.springframework.context.event.EventListener; -import java.io.IOException; import java.util.List; /** * OMAGServer provides the main program for the OMAG Server spring-boot based starter application. */ -@EnableConfigurationProperties(OMAGServerProperties.class) @SpringBootApplication( scanBasePackages = {"org.odpi.openmetadata"} ) @@ -34,24 +30,21 @@ public class OMAGServer implements ApplicationRunner { private static final Logger LOG = LoggerFactory.getLogger(OMAGServer.class); private final ConfigurableApplicationContext context; - private final ObjectMapper objectMapper; private final OMAGServerOperationalServices operationalServices; - private final OMAGServerProperties serverProperties; - private OMAGServerConfig serverConfigDocument; - private String serverName; + private OMAGConfigHelper configHelper; /** * Constructor injecting the beans required. */ @Autowired - public OMAGServer(ConfigurableApplicationContext ctx, ObjectMapper objectMapper,OMAGServerProperties omagServerProperties, OMAGServerOperationalServices operationalServices) { + public OMAGServer(ConfigurableApplicationContext ctx, OMAGConfigHelper configHelper, OMAGServerOperationalServices omagServerOperationalServices) { this.context = ctx; - this.objectMapper = objectMapper; - this.serverProperties = omagServerProperties; - this.operationalServices = operationalServices; + this.operationalServices = omagServerOperationalServices; + this.configHelper = configHelper; } + /** * Main program, creating spring boot application instance. * @param args @@ -69,7 +62,7 @@ public static void main(String[] args) { public void run(ApplicationArguments args) { LOG.debug("Application runner executing run"); try { - activateOMAGServerUsingPlatformServices(); + activateOMAGServer(); } catch (OMAGServerActivationError e) { LOG.error("Server activation failed due to internal application error", e); /** @@ -86,9 +79,9 @@ public void run(ApplicationArguments args) { */ @EventListener(ContextClosedEvent.class) private void onContextClosedEvent() { - if (serverName != null) { - LOG.info("Application stopped, deactivating server: {}", serverName); - operationalServices.deactivateTemporarilyServerList(serverProperties.getServerUser(), List.of(serverName)); + if (configHelper.getOmagServerConfig() != null) { + LOG.info("Application stopped, deactivating server: {}", configHelper.getOmagServerConfig().getLocalServerName()); + operationalServices.deactivateTemporarilyServerList(configHelper.getOmagServerConfig().getLocalServerUserId(), List.of(configHelper.getOmagServerConfig().getLocalServerName())); } } @@ -97,37 +90,27 @@ private void onContextClosedEvent() { * @see OMAGServerOperationalServices * * The activation process requires OMAGServerConfig document. - * @see org.odpi.openmetadata.adminservices.configuration.properties.OMAGServerConfig + * @see OMAGServerConfig * * The OMAGServerConfig document location is provided as org.springframework.core.io.Resource and configured by application property `omag.server-config`. * * @throws OMAGServerActivationError */ - private void activateOMAGServerUsingPlatformServices() throws OMAGServerActivationError { + private void activateOMAGServer() throws OMAGServerActivationError { LOG.debug("Activation started"); - try { - LOG.info("Configuration {}", serverProperties.getServerConfig()); - serverConfigDocument = objectMapper.reader().readValue(serverProperties.getServerConfig().getInputStream(), OMAGServerConfig.class); - - if (serverConfigDocument == null) { - LOG.info("Activation failed, the cause is that the OMAGServerConfig document is null"); - throw new OMAGServerActivationError("Activation failed, the cause is that the OMAGServerConfig document is null"); - } - - serverName = serverConfigDocument.getLocalServerName(); - LOG.info("Configuration document for server: {} - loaded successfully", serverName); - } catch (IOException e) { - LOG.info("Configuration document cannot be loaded from the resource provided - check application configuration"); - throw new OMAGServerActivationError( - String.format("Configuration document cannot be loaded from the resource provided - check application configuration"),e); + configHelper.loadConfig(); + + if (configHelper.getOmagServerConfig() == null) { + LOG.info("Activation failed, the cause is that the OMAGServerConfig document is null"); + throw new OMAGServerActivationError("Activation failed, the cause is that the OMAGServerConfig document is null"); } - LOG.info("Sending activation request for server: {} and user: {}", serverName, serverProperties.getServerUser()); + LOG.info("Sending activation request for server: {} and user: {}", configHelper.getOmagServerConfig().getLocalServerName(), configHelper.getOmagServerConfig().getLocalServerUserId()); SuccessMessageResponse response = operationalServices - .activateWithSuppliedConfig(serverProperties.getServerUser().trim(), serverConfigDocument.getLocalServerName(), serverConfigDocument); + .activateWithSuppliedConfig(configHelper.getOmagServerConfig().getLocalServerUserId(), configHelper.getOmagServerConfig().getLocalServerName(), configHelper.getOmagServerConfig()); if (response == null) { LOG.info("Activation has failed. The cause is that response is null"); @@ -140,7 +123,7 @@ private void activateOMAGServerUsingPlatformServices() throws OMAGServerActivati } if (response.getRelatedHTTPCode() == 200) { - LOG.info("Activation succeeded for server: {}", serverConfigDocument.getLocalServerName()); + LOG.info("Activation succeeded for server: {}", configHelper.getOmagServerConfig().getLocalServerName()); } } diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/AvailabilityProbesAutoConfiguration.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/AvailabilityProbesAutoConfiguration.java deleted file mode 100644 index 0ec27300d03..00000000000 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/AvailabilityProbesAutoConfiguration.java +++ /dev/null @@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.serverchassis.springboot.config; - -import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; -import org.springframework.boot.actuate.availability.LivenessStateHealthIndicator; -import org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.availability.ApplicationAvailability; -import org.springframework.context.annotation.Bean; - -import org.springframework.context.annotation.Configuration; - - -/** - * This class provides configuration for Application Availability support components. - */ -@Configuration(proxyBeanMethods = false) -@AutoConfigureAfter(ApplicationAvailabilityAutoConfiguration.class) -public class AvailabilityProbesAutoConfiguration { - - @Bean - @ConditionalOnEnabledHealthIndicator("livenessState") - @ConditionalOnMissingBean - public LivenessStateHealthIndicator livenessStateHealthIndicator(ApplicationAvailability applicationAvailability) { - return new LivenessStateHealthIndicator(applicationAvailability); - } - - @Bean - @ConditionalOnEnabledHealthIndicator("readinessState") - @ConditionalOnMissingBean - public ReadinessStateHealthIndicator readinessStateHealthIndicator( - ApplicationAvailability applicationAvailability) { - return new ReadinessStateHealthIndicator(applicationAvailability); - } - -} - diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGConfigHelper.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGConfigHelper.java new file mode 100644 index 00000000000..9658b9a4ba7 --- /dev/null +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGConfigHelper.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.serverchassis.springboot.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; +import com.google.common.io.Files; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.odpi.openmetadata.adminservices.configuration.properties.OMAGServerConfig; +import org.odpi.openmetadata.serverchassis.springboot.exception.OMAGServerActivationError; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.Resource; +import org.yaml.snakeyaml.Yaml; + +import java.util.Objects; + +/** + * This class provides support for loading OMAGServerConfig document from different configuration options/styles. + * It supports JSON and YAML file based OMAG server configuration; + * Additionally provides EXPERIMENTAL feature: configure OMAG server using native spring configuration properties. + */ +@EnableConfigurationProperties(OMAGServerProperties.class) +@Configuration +@Slf4j +public class OMAGConfigHelper { + + @Getter + final OMAGServerProperties serverProperties; + private final ObjectMapper jsonObjectMapper; + private final ObjectMapper yamlObjectMapper; + @Getter + OMAGServerConfig omagServerConfig; + static final String YAML = "yaml"; + static final String YML = "yml"; + static final String JSON = "json"; + + /** + * Constructor that injects required beans such as omag application properties and jackson object mappers. + * + * @param properties application properties prefixed with 'omag.' + * @param jsonObjectMapper pre-configured object mapper bean for json processing + * @param yamlObjectMapper pre-configured object mapper bean for yaml processing + */ + @Autowired + public OMAGConfigHelper(OMAGServerProperties properties, + @Qualifier("jsonObjectMapper") ObjectMapper jsonObjectMapper, + @Qualifier("yamlObjectMapper") ObjectMapper yamlObjectMapper) { + this.serverProperties = properties; + this.jsonObjectMapper = jsonObjectMapper; + this.yamlObjectMapper = yamlObjectMapper; + } + + /** + * Implements logic for deciding proper configuration source + * and loading its content into OMAGServerConfig configuration object + * + * @throws OMAGServerActivationError + */ + public void loadConfig() throws OMAGServerActivationError { + + try { + if (isConfigurationFileProvided()) { + + Resource serverConfigFile = serverProperties.getServerConfigFile(); + + log.info("Using configuration from {}", serverConfigFile); + + if (isJsonConfigurationFile(serverConfigFile)) { + // Read json based omag server configuration file + log.debug("JSON file detected, reading values using jsonObjectMapper..."); + omagServerConfig = jsonObjectMapper.reader().readValue(serverConfigFile.getInputStream(), OMAGServerConfig.class); + } else if (isYamlConfigurationFile(serverConfigFile)) { + try { + // Read yaml based omag server configuration file + log.debug("YAML file detected, reading values using yamlObjectMapper..."); + omagServerConfig = yamlObjectMapper.reader().readValue(serverConfigFile.getInputStream(), OMAGServerConfig.class); + } catch (InvalidTypeIdException e) { + log.debug("yamlObjectMapper failed reading values, trying snakeYaml..."); + Yaml yaml = new Yaml(); + omagServerConfig = yaml.loadAs(serverConfigFile.getInputStream(), OMAGServerConfig.class); + } + } else { + throw new OMAGServerActivationError("Configuration file is not supported"); + } + + } else if (isPropertiesConfiguration()) { + log.info("[EXPERIMENTAL] Configuring server using omag. application properties"); + omagServerConfig = serverProperties.getServerConfig(); + //TODO: Continue investigation + // At this point we should have property mapped OMAGServerConfig object. + // However, due to internal spring yaml to java object marshaling logic, Connection beans get wrongly typed Map for configurationProperties: + // Our code expects Map but gets Map -- this leads to wrong connector configuration compromising the connector functionality. + // Reference to the problematic code https://github.com/spring-projects/spring-framework/blob/main/spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java#L330C11-L330C52 + // The same mapping problem is described in spring-boot issue https://github.com/spring-projects/spring-boot/issues/6180 + } + + } catch (Exception e) { + log.info("Configuration document cannot be loaded from the resource provided - check application configuration"); + throw new OMAGServerActivationError( + "Configuration document cannot be loaded from the resource provided - check application configuration", e); + } + } + + private String getFileExtension(Resource serverConfigFile) { + return Files.getFileExtension(Objects.requireNonNull(serverConfigFile.getFilename())); + } + + private boolean isConfigurationFileProvided() { + return serverProperties.getServerConfigFile() != null; + } + + private boolean isJsonConfigurationFile(Resource serverConfigFile) { + return JSON.equalsIgnoreCase(Objects.requireNonNull(getFileExtension(serverConfigFile))); + } + private boolean isYamlConfigurationFile(Resource serverConfigFile) { + String fileExtension = Objects.requireNonNull(getFileExtension(serverConfigFile)); + return YAML.equalsIgnoreCase(fileExtension) || YML.equalsIgnoreCase(fileExtension); + } + + private boolean isPropertiesConfiguration() { + return serverProperties.getServerConfig() != null; + } + +} diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServerProperties.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServerProperties.java index 1b455fa40a0..47c81712657 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServerProperties.java +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServerProperties.java @@ -2,7 +2,6 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.serverchassis.springboot.config; -import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.odpi.openmetadata.adminservices.configuration.properties.OMAGServerConfig; @@ -11,9 +10,9 @@ import org.springframework.validation.annotation.Validated; /** - * This class provides validation support for OMAG specific application properties. + * Provides validation support for OMAG specific application properties. */ -@ConfigurationProperties(prefix = "omag") +@ConfigurationProperties(prefix = "omag", ignoreUnknownFields=false) @Getter @Setter @Validated @@ -23,13 +22,12 @@ public class OMAGServerProperties { * Configures the location of the OMAGServerConfig json document defined as org.springframework.core.io.Resource * This property is required and cannot be null. */ - @NotNull - private Resource serverConfig; - +// @NotNull + private Resource serverConfigFile; /** - * Configures the username parameter used to activate the OMAG server instance using platform operational services. - * Default value is set to 'system', can be overwritted + * Application property that maps to OMAGServerConfig document directly. + * USED ONLY TO EXPERIMENT DUE TO UNDERLYING SPRING YAML CONFIGURATION PROCESSING BEHAVIOUR THAT COMPROMISES THE CURRENT FUNCTIONALITY. */ - private String serverUser = "system"; + private OMAGServerConfig serverConfig; } diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServicesConfiguration.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServicesConfiguration.java index 74dd34484ef..dca69ad3630 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServicesConfiguration.java +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/OMAGServicesConfiguration.java @@ -9,7 +9,7 @@ /** - * This class provides configuration supporting OMAG related components required by the application. + * Provides configuration supporting OMAG related components required by the application. */ @Configuration public class OMAGServicesConfiguration { diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/ObjectMapperConfiguration.java b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/ObjectMapperConfiguration.java index b3856550b07..c944d263d01 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/ObjectMapperConfiguration.java +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/config/ObjectMapperConfiguration.java @@ -2,31 +2,35 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.serverchassis.springboot.config; - +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import lombok.extern.slf4j.Slf4j; + +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; /** - * This class provides configuration bean for customizing Jackson object mapper singleton instance configuration. + * Provides configurations for customizing + * json bean Jackson object mapper singleton instance configuration + * and + * yaml bean Jackson object mapper singleton instance configuration */ +@Slf4j @Configuration public class ObjectMapperConfiguration { - public static final String PREFIX = "Object mapper configuration started."; - private final Logger log = LoggerFactory.getLogger(this.getClass()); - public static ObjectMapper newObjectMapper(Jackson2ObjectMapperBuilder builder) { + private static ObjectMapper newObjectMapper(Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder) { - return builder + return jackson2ObjectMapperBuilder .serializationInclusion(NON_NULL) .failOnEmptyBeans(false) .failOnUnknownProperties(false) @@ -39,13 +43,30 @@ public static ObjectMapper newObjectMapper(Jackson2ObjectMapperBuilder builder) .build(); } - @Bean(name = {"objectMapper"}) - @Primary - ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { - - log.debug(PREFIX); - - return newObjectMapper(builder); + /** + * @param jackson2ObjectMapperBuilder a builder used to create ObjectMapper instances with a fluent API. + * @return JsonMapper a JSON-format specific ObjectMapper implementation + */ + @Bean + @Qualifier("jsonObjectMapper") + ObjectMapper objectMapper(Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder) { + return newObjectMapper(jackson2ObjectMapperBuilder); } -} + /** + * @return YAMLMapper a convenience version of ObjectMapper which is configured with YAMLFactory + */ + @Bean + @Qualifier("yamlObjectMapper") + public ObjectMapper yamlMapper() { + return YAMLMapper.builder() + .disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER) + .disable(YAMLGenerator.Feature.ALLOW_LONG_KEYS) + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES) + .build(); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.properties b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.properties index 784c900e6d9..b177aaa4121 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.properties +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.properties @@ -3,7 +3,7 @@ logging.level.org.odpi.openmetadata=error logging.level.org.odpi.openmetadata.frameworks.auditlog=info -logging.level.org.odpi.openmetadata.serverchassis.springboot=info +logging.level.org.odpi.openmetadata.serverchassis.springboot.config=debug management.health.defaults.enabled=false management.health.livenessstate.enabled=true @@ -15,6 +15,4 @@ management.endpoint.health.show-details=always management.endpoint.metrics.enabled=true management.endpoints.web.exposure.include=metrics,health -omag.server-config=classpath:samples/metadata-repository-server.json -omag.server-user=admin diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.yml b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.yml new file mode 100644 index 00000000000..8e800fe9750 --- /dev/null +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/application-dev.yml @@ -0,0 +1,36 @@ +--- +omag: +# server-config-file: classpath:samples/metadata-repository-server.json +# server-config-file: classpath:samples/metadata-repository-server.yaml + server-config-file: classpath:samples/metadata-repository-server.yml + server-config: + localServerName: cocoMDS1 + localServerUserId: OMAGServer + maxPageSize: 1000 + repositoryServicesConfig: + auditLogConnections: + - connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider + configurationProperties: + supportedSeverities: + - Error + localRepositoryConfig: + metadataCollectionId: 838005fc-e09f-4688-af89-58254a155cc6 + localRepositoryLocalConnection: + connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider + localRepositoryRemoteConnection: + connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider + configurationProperties: + password: "${app-secrets.dummyPasswordDemo}" + endpoint: + address: https://localhost:9443/servers/cocoMDS1 + eventsToSaveRule: ALL + eventsToSendRule: ALL +--- +app-secrets: + dummyPasswordDemo: top-secret \ No newline at end of file diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-access-server.json b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-access-server.json index 6a6373b0ebf..a68dd7b1c29 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-access-server.json +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-access-server.json @@ -5,7 +5,7 @@ "localServerName": "cocoMDS1", "localServerType": "Open Metadata and Governance Server", "localServerURL": "https://localhost:9443", - "localServerUserId": "OMAGServer", + "localServerUserId": "cocoMDS1npa", "maxPageSize": 1000, "accessServicesConfig": [ { @@ -20,8 +20,6 @@ "accessServiceWiki": "https://egeria-project.org/services/omas/asset-catalog/overview/", "accessServiceOperationalStatus": "ENABLED", "accessServiceOptions": { - "SupportedZones": [], - "DefaultZones": [], "SupportedTypesForSearch": [ "RelationalTable", "TabularColumn", @@ -49,8 +47,6 @@ "accessServiceWiki": "https://egeria-project.org/services/omas/asset-manager/overview/", "accessServiceOperationalStatus": "ENABLED", "accessServiceOptions": { - "SupportedZones": [], - "DefaultZones": [], "SupportedTypesForSearch": [ "RelationalTable", "TabularColumn", @@ -113,7 +109,6 @@ }, "configurationProperties": { "supportedSeverities": [ - "Information", "Startup", "Shutdown" ] diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.json b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.json index 414b7c6df0c..52e968111dc 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.json +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.json @@ -1,10 +1,7 @@ { "class": "OMAGServerConfig", "versionId": "V2.0", - "localServerId": "996892b6-7299-4046-8928-b6687a7818ee", "localServerName": "cocoMDS1", - "localServerType": "Open Metadata and Governance Server", - "localServerURL": "https://localhost:9443", "localServerUserId": "OMAGServer", "maxPageSize": 1000, "repositoryServicesConfig": { @@ -17,27 +14,7 @@ "displayName": "Console", "connectorType": { "class": "ConnectorType", - "headerVersion": 0, - "type": { - "typeId": "954421eb-33a6-462d-a8ca-b5709a1bd0d4", - "typeName": "ConnectorType", - "typeVersion": 1, - "typeDescription": "A set of properties describing a type of connector." - }, - "guid": "4afac741-3dcc-4c60-a4ca-a6dede994e3f", - "qualifiedName": "Egeria:AuditLogDestinationConnector:Console", - "displayName": "Console Audit Log Destination Connector", - "description": "Connector supports logging of audit log messages to stdout.", - "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider", - "connectorFrameworkName": "Open Connector Framework (OCF)", - "connectorInterfaceLanguage": "Java", - "connectorInterfaces": [ - "org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension", - "org.odpi.openmetadata.repositoryservices.connectors.stores.auditlogstore.OMRSAuditLogStore" - ], - "recognizedConfigurationProperties": [ - "supportedSeverities" - ] + "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider" }, "configurationProperties": { "supportedSeverities": [ @@ -61,32 +38,13 @@ "localRepositoryConfig": { "class": "LocalRepositoryConfig", "metadataCollectionId": "838005fc-e09f-4688-af89-58254a155cc6", - "localRepositoryMode": "OPEN_METADATA_NATIVE", "localRepositoryLocalConnection": { "class": "Connection", "headerVersion": 0, "displayName": "In Memory Local Repository Connection", "connectorType": { "class": "ConnectorType", - "headerVersion": 0, - "type": { - "typeId": "954421eb-33a6-462d-a8ca-b5709a1bd0d4", - "typeName": "ConnectorType", - "typeVersion": 1, - "typeDescription": "A set of properties describing a type of connector." - }, - "guid": "65cc9091-757f-4bcd-b937-426160be8bc2", - "qualifiedName": "Egeria:OMRSRepositoryConnector:InMemory", - "displayName": "In Memory OMRS Repository Connector", - "description": "Native open metadata repository connector that maps open metadata calls to a set of in memory hash maps - demo use only.", - "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider", - "connectorFrameworkName": "Open Connector Framework (OCF)", - "connectorInterfaceLanguage": "Java", - "connectorInterfaces": [ - "org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension", - "org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent", - "org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager" - ] + "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider" } }, "localRepositoryRemoteConnection": { @@ -95,29 +53,10 @@ "displayName": "Local Repository Remote Connection", "connectorType": { "class": "ConnectorType", - "headerVersion": 0, - "type": { - "typeId": "954421eb-33a6-462d-a8ca-b5709a1bd0d4", - "typeName": "ConnectorType", - "typeVersion": 1, - "typeDescription": "A set of properties describing a type of connector." - }, - "guid": "75ea56d1-656c-43fb-bc0c-9d35c5553b9e", - "qualifiedName": "Egeria:OMRSRepositoryConnector:CohortMemberClient:REST", - "displayName": "REST Cohort Member Client Connector", - "description": "Cohort member client connector that provides access to open metadata located in a remote repository via REST calls.", - "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider", - "connectorFrameworkName": "Open Connector Framework (OCF)", - "connectorInterfaceLanguage": "Java", - "connectorInterfaces": [ - "org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension", - "org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent", - "org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager" - ] + "connectorProviderClassName": "org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider" }, "endpoint": { "class": "Endpoint", - "headerVersion": 0, "address": "https://localhost:9443/servers/cocoMDS1" } }, diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yaml b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yaml new file mode 100644 index 00000000000..06d6b3555af --- /dev/null +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yaml @@ -0,0 +1,37 @@ +--- +class: OMAGServerConfig +localServerName: cocoMDS1 +localServerType: Open Metadata and Governance Server +localServerUserId: OMAGServer +maxPageSize: 1000 +repositoryServicesConfig: + class: RepositoryServicesConfig + auditLogConnections: + - class: Connection + connectorType: + class: ConnectorType + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider + configurationProperties: + supportedSeverities: + - Error + localRepositoryConfig: + class: LocalRepositoryConfig + metadataCollectionId: 838005fc-e09f-4688-af89-58254a155cc6 + localRepositoryLocalConnection: + class: Connection + connectorType: + class: ConnectorType + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider + localRepositoryRemoteConnection: + class: Connection + connectorType: + class: ConnectorType + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider + endpoint: + class: Endpoint + address: https://localhost:9443/servers/cocoMDS1 + eventsToSaveRule: ALL + eventsToSendRule: ALL \ No newline at end of file diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yml b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yml new file mode 100644 index 00000000000..0f199e570b3 --- /dev/null +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/main/resources/samples/metadata-repository-server.yml @@ -0,0 +1,26 @@ +--- +localServerName: cocoMDS1 +localServerUserId: OMAGServer +maxPageSize: 1000 +repositoryServicesConfig: + auditLogConnections: + - connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.auditlogstore.console.ConsoleAuditLogStoreProvider + configurationProperties: + supportedSeverities: + - Error + localRepositoryConfig: + metadataCollectionId: 838005fc-e09f-4688-af89-58254a155cc6 + localRepositoryLocalConnection: + connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider + localRepositoryRemoteConnection: + connectorType: + connectorProviderClassName: >- + org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider + endpoint: + address: https://localhost:9443/servers/cocoMDS1 + eventsToSaveRule: ALL + eventsToSendRule: ALL \ No newline at end of file diff --git a/open-metadata-implementation/server-chassis/server-chassis-spring/src/test/resources/application-test.properties b/open-metadata-implementation/server-chassis/server-chassis-spring/src/test/resources/application-test.properties index 2d730e29603..3fb1a269448 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/src/test/resources/application-test.properties +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/src/test/resources/application-test.properties @@ -1,7 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the ODPi Egeria project. -omag.server-config=classpath:samples/metadata-repository-server.json -omag.server-user=system-npa +omag.server-config-file=classpath:samples/metadata-repository-server.json server.port=8001 server.servlet.context-path=/actuator @@ -44,9 +43,9 @@ logging.level.org.odpi.openmetadata.repositoryservices=info logging.level.org.odpi.openmetadata.server=debug logging.level.org.springframework.web=info -logging.file.path=/var/logs -logging.file.name=egeria.log -logging.level.*=INFO +#logging.file.path=/var/logs +#logging.file.name=egeria.log +#logging.level.*=INFO logging.level.org.springframework=error #logging.level.org.odpi.openmetadata.commonservices=DEBUG