From 829f3c84a1f6efe512d4a084ed5cdc81f5bd147d Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Mon, 4 Sep 2023 12:32:16 +0100 Subject: [PATCH 1/4] Update verion to 4.3 Signed-off-by: Mandy Chessell --- build.gradle | 2 +- .../License-Example-Files/License_for_POM_Files.xml | 2 +- .../test-cases/platform-origin-test-case.md | 2 +- .../docs/README.md | 2 +- .../docs/overview-of-the-graph-repository-connector.md | 4 ++-- .../serverchassis/springboot/OMAGServerPlatform.java | 2 +- .../server/OMAGServerPlatformOriginServices.java | 2 +- .../server-chassis/server-chassis-spring/README.md | 2 +- .../uichassis/springboot/EgeriaUIPlatform.java | 2 +- .../open-metadata-deployment/docker/README.md | 2 +- .../docker/configure/Dockerfile | 2 +- .../open-metadata-deployment/docker/egeria/Dockerfile | 2 +- .../docker/egeria/Dockerfile.selfbuild | 6 +++--- .../open-metadata-deployment/docker/egeria/README.md | 10 +++++----- .../docker/platform/Dockerfile | 2 +- .../open-metadata-deployment/docker/platform/README.md | 4 ++-- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 4d847e0a83f..7533a70b04a 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ plugins { */ allprojects { group = 'org.odpi.egeria' - version = '4.3-SNAPSHOT' + version = '4.3' // Signing/publish used in parent & child projects apply plugin: 'maven-publish' diff --git a/developer-resources/License-Example-Files/License_for_POM_Files.xml b/developer-resources/License-Example-Files/License_for_POM_Files.xml index 44cdb762f32..c18b8104f82 100644 --- a/developer-resources/License-Example-Files/License_for_POM_Files.xml +++ b/developer-resources/License-Example-Files/License_for_POM_Files.xml @@ -10,7 +10,7 @@ egeria org.odpi.egeria - 4.3-SNAPSHOT + 4.3 Add module name here diff --git a/open-metadata-conformance-suite/docs/platform-workbench/test-cases/platform-origin-test-case.md b/open-metadata-conformance-suite/docs/platform-workbench/test-cases/platform-origin-test-case.md index 3a1931917fa..f798774e321 100644 --- a/open-metadata-conformance-suite/docs/platform-workbench/test-cases/platform-origin-test-case.md +++ b/open-metadata-conformance-suite/docs/platform-workbench/test-cases/platform-origin-test-case.md @@ -37,7 +37,7 @@ open metadata services are activated. "successfulAssertions" : [ "Origin descriptor retrieved from platform." ], "unsuccessfulAssertions" : [ ], "discoveredProperties" : { - "Repository origin id" : "Egeria OMAG Server Platform (version 4.3-SNAPSHOT)" + "Repository origin id" : "Egeria OMAG Server Platform (version 4.3)" } } ``` diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/docs/README.md b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/docs/README.md index 73f4fcc9a94..edd0d3fc69a 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/docs/README.md +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/docs/README.md @@ -43,7 +43,7 @@ following: ``` - 4.3-SNAPSHOT + 4.3 diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/docs/overview-of-the-graph-repository-connector.md b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/docs/overview-of-the-graph-repository-connector.md index 77fbdc21c72..b5ee7635661 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/docs/overview-of-the-graph-repository-connector.md +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/docs/overview-of-the-graph-repository-connector.md @@ -546,7 +546,7 @@ storage.backend=berkeleyje # Default: (no default value) # Data Type: String # Mutability: LOCAL -storage.directory=../../../egeria-install/egeria-omag-4.3-SNAPSHOT/data/servers/Metadata_Server/repository/graph/berkeley +storage.directory=../../../egeria-install/egeria-omag-4.3/data/servers/Metadata_Server/repository/graph/berkeley # The indexing backend used to extend and optimize JanusGraph's query # functionality. This setting is optional. JanusGraph can use multiple @@ -573,7 +573,7 @@ index.search.backend=lucene # Default: (no default value) # Data Type: String # Mutability: MASKABLE -index.search.directory=../../../egeria-install/egeria-omag-4.3-SNAPSHOT/data/servers/Metadata_Server/repository/graph/searchindex +index.search.directory=../../../egeria-install/egeria-omag-4.3/data/servers/Metadata_Server/repository/graph/searchindex ``` ---- License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), diff --git a/open-metadata-implementation/platform-chassis/platform-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServerPlatform.java b/open-metadata-implementation/platform-chassis/platform-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServerPlatform.java index 15923b9d7fd..eca407e0eba 100644 --- a/open-metadata-implementation/platform-chassis/platform-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServerPlatform.java +++ b/open-metadata-implementation/platform-chassis/platform-chassis-spring/src/main/java/org/odpi/openmetadata/serverchassis/springboot/OMAGServerPlatform.java @@ -45,7 +45,7 @@ @OpenAPIDefinition( info = @Info( title = "Egeria's Open Metadata and Governance (OMAG) Server Platform", - version = "4.3-SNAPSHOT", + version = "4.3", description = "The OMAG Server Platform provides a runtime process and platform for Open Metadata and Governance (OMAG) Services.\n" + "\n" + "The OMAG services are configured and activated in OMAG Servers using the Administration Services.\n" + diff --git a/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformOriginServices.java b/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformOriginServices.java index c3ba807eab0..16dce25fbdc 100644 --- a/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformOriginServices.java +++ b/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformOriginServices.java @@ -8,7 +8,7 @@ */ public class OMAGServerPlatformOriginServices { - final String implementationOrigin = "Egeria OMAG Server Platform (version 4.3-SNAPSHOT)\n"; + final String implementationOrigin = "Egeria OMAG Server Platform (version 4.3)\n"; /** * Return the origin of this server platform implementation. 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..ba80397dddf 100644 --- a/open-metadata-implementation/server-chassis/server-chassis-spring/README.md +++ b/open-metadata-implementation/server-chassis/server-chassis-spring/README.md @@ -18,7 +18,7 @@ To build the boot application jar from the current module use: You can run the application locally from this 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-*.jar --omag.server-config=classpath:samples/metadata-repository-server.json --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. diff --git a/open-metadata-implementation/user-interfaces/ui-chassis/ui-chassis-spring/src/main/java/org/odpi/openmetadata/userinterface/uichassis/springboot/EgeriaUIPlatform.java b/open-metadata-implementation/user-interfaces/ui-chassis/ui-chassis-spring/src/main/java/org/odpi/openmetadata/userinterface/uichassis/springboot/EgeriaUIPlatform.java index 6443438b79c..2b72069ab9b 100644 --- a/open-metadata-implementation/user-interfaces/ui-chassis/ui-chassis-spring/src/main/java/org/odpi/openmetadata/userinterface/uichassis/springboot/EgeriaUIPlatform.java +++ b/open-metadata-implementation/user-interfaces/ui-chassis/ui-chassis-spring/src/main/java/org/odpi/openmetadata/userinterface/uichassis/springboot/EgeriaUIPlatform.java @@ -28,7 +28,7 @@ @OpenAPIDefinition( info = @Info( title = "Egeria's Spring Boot based UI RESTful web services API", - version = "4.3-SNAPSHOT", + version = "4.3", description = "", license = @License(name = "Apache-2.0 License", url = "https://www.apache.org/licenses/LICENSE-2.0"), contact = @Contact(url = "https://egeria-project.org", name = "Egeria Project", diff --git a/open-metadata-resources/open-metadata-deployment/docker/README.md b/open-metadata-resources/open-metadata-deployment/docker/README.md index 2cf246493e8..5849045acd6 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/README.md +++ b/open-metadata-resources/open-metadata-deployment/docker/README.md @@ -34,7 +34,7 @@ In this example: ## Limitations -- All docker builds will currently set the tag (version) to be the same as the maven version (eg. 4.3-SNAPSHOT). This +- All docker builds will currently set the tag (version) to be the same as the maven version (eg. 4.3). This means that when testing it is imperative to always force-pull fresh images, or an old version may be used. For example, when using kubernetes ensure `imagePullPolicy = 'Always'`. Previously every single change was versioned, but this led to significant overhead in storage as well as constant changes in the source code just to do a rebuild. diff --git a/open-metadata-resources/open-metadata-deployment/docker/configure/Dockerfile b/open-metadata-resources/open-metadata-deployment/docker/configure/Dockerfile index 6933de720b3..6e10e779a5e 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/configure/Dockerfile +++ b/open-metadata-resources/open-metadata-deployment/docker/configure/Dockerfile @@ -2,7 +2,7 @@ # Copyright Contributors to the Egeria project FROM docker.io/library/alpine:3.18.2 -ARG version=4.3-SNAPSHOT +ARG version=4.3 ARG VCS_REF=unknown ARG VCS_ORIGIN=unknown ARG BUILD_TIME=unknown diff --git a/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile b/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile index 2dc0da928bd..99e57990f28 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile +++ b/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile @@ -17,7 +17,7 @@ #FROM registry.access.redhat.com/ubi9/openjdk-17-runtime FROM registry.access.redhat.com/ubi9/openjdk-17 -ARG version=4.3-SNAPSHOT +ARG version=4.3 ARG VCS_REF=unknown ARG VCS_ORIGIN=unknown ARG BUILD_TIME=unknown diff --git a/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile.selfbuild b/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile.selfbuild index fe9092c98db..6f697c9f6df 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile.selfbuild +++ b/open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile.selfbuild @@ -25,12 +25,12 @@ ARG runimg=registry.access.redhat.com/ubi9/openjdk-17 FROM $buildimg as build -# Defaults to 'main' but could be 'egeria-release-4.0' or a commit id like '969fde1042fc4fda70961f979c4634159466e081' +# Defaults to 'main' but could be 'egeria-release-4.3' or a commit id like '969fde1042fc4fda70961f979c4634159466e081' ARG srcref=main # Defaults to egeria repo - but could be a different fork if needed ARG srcurl=https://github.com/odpi/egeria # this should not be needed, and must match the source, but we'll use for now -ARG version=4.3-SNAPSHOT +ARG version=4.3 # Replace build parms if needed ARG buildparms="build -x test -x javadoc --no-build-cache" # Can optionally specify build time so that we tag the image appropriately @@ -61,7 +61,7 @@ ARG srcref=main # Defaults to egeria repo - but could be a different fork if needed ARG srcurl=https://github.com/odpi/egeria # this should not be needed, and must match the source, but we'll use for now -ARG version=4.3-SNAPSHOT +ARG version=4.3 # Replace build parms if needed ARG buildparms="build -x test -x javadoc" # Can optionally specify build time so that we tag the image appropriately diff --git a/open-metadata-resources/open-metadata-deployment/docker/egeria/README.md b/open-metadata-resources/open-metadata-deployment/docker/egeria/README.md index 8a37d3f615d..c91fa3e460a 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/egeria/README.md +++ b/open-metadata-resources/open-metadata-deployment/docker/egeria/README.md @@ -35,7 +35,7 @@ This is the Dockerfile we use to publish the official images. It works by utiliz To use this * Run a full egeria build with `./gradlew build` from the project root - * Run `mkdir -p open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly && cp -r open-metadata-distribution/open-metadata-assemblies/build/unpacked/egeria-4.3-SNAPSHOT-distribution.tar.gz/. open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly` - replacing the version label as appropriate + * Run `mkdir -p open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly && cp -r open-metadata-distribution/open-metadata-assemblies/build/unpacked/egeria-4.3-distribution.tar.gz/. open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly` - replacing the version label as appropriate * Run `docker build -t egeria:myversion -f Dockerfile .` in this directory to create the image @@ -54,7 +54,7 @@ The following additional arguments are allowed |--|---------|--|--|--| | runimg | No | Yes | registry.access.redhat.com/ubi9/openjdk-17 | Container image used for building egeria | | buildimg | No |Yes | registry.access.redhat.com/ubi9/openjdk-17 | Container image used for runtime ie launching egeria | -| version | Yes | Yes | 4.3-SNAPSHOT | Version string - must be correct so that the right jar file gets launched. Do not rely on default | +| version | Yes | Yes | 4.3 | Version string - must be correct so that the right jar file gets launched. Do not rely on default | | srcurl | No | Yes | https://github.com/odpi/egeria | Specifies url of github repo to clone | | srcref | No | Yes | main | Specifies branch, or tag of code within the repo | buildparms | No | Yes | build -x test -x javadoc | Gradle invocation to build egeria | @@ -167,7 +167,7 @@ With that in place we can now run our docker image, this time making use of the $ docker run -p 9443:9443 -v source=egeria-data,target=/deployments/data odpi/egeria:latest /usr/local/s2i/run: line 15: /opt/jboss/container/maven/default//scl-enable-maven: No such file or directory Starting the Java application using /opt/jboss/container/java/run/run-java.sh ... -INFO exec java -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -XX:MaxMetaspaceSize=1g -cp "." -jar /deployments/platform/omag-server-platform-4.3-SNAPSHOT.jar +INFO exec java -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -XX:MaxMetaspaceSize=1g -cp "." -jar /deployments/platform/omag-server-platform-4.3.jar ODPi Egeria ____ __ ___ ___ ______ _____ ____ _ _ ___ / __ \ / |/ // | / ____/ / ___/ ___ ____ _ __ ___ ____ / _ \ / / __ / / / _ /__ ____ _ _ @@ -183,7 +183,7 @@ INFO exec java -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRat Note that you'll be able to see the image version, build date, last git update etc (this is an old example from 1.6, when we used http & port 8080) ``` $ docker inspect --format='{{range $k, $v := .ContainerConfig.Labels}} {{- printf "%s = \"%s\"\n" $k $v -}} {{end}}' odpi/egeria:latest -org.opencontainers.image.vendor = "= ODPi org.opencontainers.image.title = Egeria org.opencontainers.image.description = Common image for core ODPi Egeria runtime. org.opencontainers.image.url = https://egeria.odpi.org/ org.opencontainers.image.source = https://github.com/odpi/egeria org.opencontainers.image.authors = ODPi Egeria org.opencontainers.image.revision = 2e8b97d org.opencontainers.image.licenses = Apache-2.0 org.opencontainers.image.created = 2020-03-25T12:03:52+0000 org.opencontainers.image.version = 1.6-SNAPSHOT org.opencontainers.image.documentation = https://egeria.odpi.org/open-metadata-resources/open-metadata-deployment/docker/egeria/ org.opencontainers.image.ext.vcs-date = 2020-03-25T11:46:50+0000 org.opencontainers.image.ext.docker.cmd = docker run -d -p 8080:8080 odpi/egeria org.opencontainers.image.ext.docker.cmd.devel = docker run -d -p 8080:8080 -p 5005:5005 -e JAVA_DEBUG=true odpi/egeria org.opencontainers.image.ext.docker.debug = docker exec -it /bin/sh org.opencontainers.image.ext.docker.params = JAVA_DEBUG=set to true to enable JVM debugging" +org.opencontainers.image.vendor = "= ODPi org.opencontainers.image.title = Egeria org.opencontainers.image.description = Common image for core ODPi Egeria runtime. org.opencontainers.image.url = https://egeria.odpi.org/ org.opencontainers.image.source = https://github.com/odpi/egeria org.opencontainers.image.authors = ODPi Egeria org.opencontainers.image.revision = 2e8b97d org.opencontainers.image.licenses = Apache-2.0 org.opencontainers.image.created = 2020-03-25T12:03:52+0000 org.opencontainers.image.version = 4.3 org.opencontainers.image.documentation = https://egeria.odpi.org/open-metadata-resources/open-metadata-deployment/docker/egeria/ org.opencontainers.image.ext.vcs-date = 2020-03-25T11:46:50+0000 org.opencontainers.image.ext.docker.cmd = docker run -d -p 8080:8080 odpi/egeria org.opencontainers.image.ext.docker.cmd.devel = docker run -d -p 8080:8080 -p 5005:5005 -e JAVA_DEBUG=true odpi/egeria org.opencontainers.image.ext.docker.debug = docker exec -it /bin/sh org.opencontainers.image.ext.docker.params = JAVA_DEBUG=set to true to enable JVM debugging" ``` ### Runtime parameters @@ -236,7 +236,7 @@ you may need to create another job to retrieve the required libraries or content #### Adding to the image through a docker build Use the egeria image as a base, for example begin your custom Dockerfile with -`FROM odpi/egeria:4.3-SNAPSHOT` +`FROM odpi/egeria:4.3` Then add in the files you need, as well as customize the LOADER_PATH variable ie `COPY myextralib.jar /deployments/platform/lib` diff --git a/open-metadata-resources/open-metadata-deployment/docker/platform/Dockerfile b/open-metadata-resources/open-metadata-deployment/docker/platform/Dockerfile index 408215a611e..b162ebd5b96 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/platform/Dockerfile +++ b/open-metadata-resources/open-metadata-deployment/docker/platform/Dockerfile @@ -17,7 +17,7 @@ #FROM registry.access.redhat.com/ubi9/openjdk-17-runtime FROM registry.access.redhat.com/ubi9/openjdk-17 -ARG version=4.3-SNAPSHOT +ARG version=4.3 ARG VCS_REF=unknown ARG VCS_ORIGIN=unknown ARG BUILD_TIME=unknown diff --git a/open-metadata-resources/open-metadata-deployment/docker/platform/README.md b/open-metadata-resources/open-metadata-deployment/docker/platform/README.md index b7022064f63..7ab57525e92 100644 --- a/open-metadata-resources/open-metadata-deployment/docker/platform/README.md +++ b/open-metadata-resources/open-metadata-deployment/docker/platform/README.md @@ -107,7 +107,7 @@ With that in place we can now run our docker image, this time making use of the $ docker run -p 9443:9443 -v source=egeria-data,target=/deployments/platform/data odpi/egeria-platform:latest /usr/local/s2i/run: line 15: /opt/jboss/container/maven/default//scl-enable-maven: No such file or directory Starting the Java application using /opt/jboss/container/java/run/run-java.sh ... -INFO exec java -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -XX:MaxMetaspaceSize=1g -cp "." -jar /deployments/platform/omag-server-platform-4.3-SNAPSHOT.jar +INFO exec java -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -XX:MaxMetaspaceSize=1g -cp "." -jar /deployments/platform/omag-server-platform-4.3.jar ODPi Egeria ____ __ ___ ___ ______ _____ ____ _ _ ___ / __ \ / |/ // | / ____/ / ___/ ___ ____ _ __ ___ ____ / _ \ / / __ / / / _ /__ ____ _ _ @@ -176,7 +176,7 @@ you may need to create another job to retrieve the required libraries or content #### Adding to the image through a docker build Use the egeria image as a base, for example begin your custom Dockerfile with -`FROM odpi/egeria-platform:4.3-SNAPSHOT` +`FROM odpi/egeria-platform:4.3` Then add in the files you need, as well as customize the LOADER_PATH variable ie `COPY myextralib.jar /deployments/platform/extra` From 7ddbb1e4569167bfd714432eabd24ac1d355dd4f Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 5 Jan 2024 18:19:27 +0000 Subject: [PATCH 2/4] Add fat jar for XTDB Signed-off-by: Mandy Chessell --- .../omag-server-platform/build.gradle | 2 +- .../xtdb-repository-connector/build.gradle | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/open-metadata-distribution/omag-server-platform/build.gradle b/open-metadata-distribution/omag-server-platform/build.gradle index 8c7b9af34e0..c3639418963 100644 --- a/open-metadata-distribution/omag-server-platform/build.gradle +++ b/open-metadata-distribution/omag-server-platform/build.gradle @@ -189,7 +189,7 @@ distributions { from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-archive-connectors:open-metadata-archive-directory-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-collection-store-connectors:inmemory-repository-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-collection-store-connectors:graph-repository-connector').fatJar } - from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-collection-store-connectors:xtdb-repository-connector').jar } + from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-collection-store-connectors:xtdb-repository-connector').shadowJar } from { project(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:open-metadata-collection-store-connectors:omrs-rest-repository-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:csv-file-connector').jar } diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/xtdb-repository-connector/build.gradle b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/xtdb-repository-connector/build.gradle index dce935bb272..36bb5cdf766 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/xtdb-repository-connector/build.gradle +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/xtdb-repository-connector/build.gradle @@ -3,6 +3,10 @@ * Copyright Contributors to the ODPi Egeria project. */ +plugins { + id 'application' + id "com.github.johnrengelman.shadow" +} dependencies { // Compile only - already included in egeria @@ -60,3 +64,7 @@ dependencies { description = 'An OMRS Repository Connector for a historical metadata back-end based on XTDB.' +shadowJar { + mainClassName = '' + archiveClassifier = 'jar-with-dependencies' +} \ No newline at end of file From b6b986b42217df59f48048c36cf81ff115fd2536 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Fri, 5 Jan 2024 18:20:26 +0000 Subject: [PATCH 3/4] Fix miscellaneous warnings Signed-off-by: Mandy Chessell --- .../csvfile/CSVFileStoreProvider.java | 11 +++++++++ .../ffdc/CSVFileConnectorErrorCode.java | 23 +++++++++++++++++++ .../ffdc/exception/FileReadException.java | 3 +++ .../ffdc/DataFolderConnectorErrorCode.java | 23 +++++++++++++++++++ .../RESTClientCheckedExceptionBase.java | 3 +++ .../RESTConfigurationException.java | 5 ++++ .../ffdc/exceptions/RESTServerException.java | 5 ++++ .../beans/SchemaAttributeCategory.java | 21 +++++++++++++++++ 8 files changed, 94 insertions(+) diff --git a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/CSVFileStoreProvider.java b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/CSVFileStoreProvider.java index 671a75134fe..0762b94f74e 100644 --- a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/CSVFileStoreProvider.java +++ b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/CSVFileStoreProvider.java @@ -22,8 +22,19 @@ public class CSVFileStoreProvider extends ConnectorProviderBase private static final String expectedDataFormat = "csv"; private static final String assetTypeName = "CSVFile"; + /** + * columnNames configuration property + */ public static final String columnNamesProperty = "columnNames"; + + /** + * delimiterCharacter configuration property + */ public static final String delimiterCharacterProperty = "delimiterCharacter"; + + /** + * quote character configuration property + */ public static final String quoteCharacterProperty = "quoteCharacter"; diff --git a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/CSVFileConnectorErrorCode.java b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/CSVFileConnectorErrorCode.java index 67934ecc80c..819eb4a6b31 100644 --- a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/CSVFileConnectorErrorCode.java +++ b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/CSVFileConnectorErrorCode.java @@ -27,26 +27,49 @@ */ public enum CSVFileConnectorErrorCode implements ExceptionMessageSet { + /** + * CSV-FILE-CONNECTOR-400-001 - The file name is null in the Connection object {0} + */ FILE_NOT_SPECIFIED(400, "CSV-FILE-CONNECTOR-400-001", "The file name is null in the Connection object {0}", "The connector is unable to open the structure file because the name of the file is not passed in the Connection object.", "The name of the file should be set up in the address property of the connection's Endpoint object."), + + /** + * CSV-FILE-CONNECTOR-400-002 - The file {0} given in Connection object {1} is a directory + */ DIRECTORY_SPECIFIED(400, "CSV-FILE-CONNECTOR-400-002", "The file {0} given in Connection object {1} is a directory", "The connector is unable to work with a directory.", "Ensure a valid file name is passed in the address property in the Endpoint object of the Connection object."), + + /** + * CSV-FILE-CONNECTOR-400-003 - The file {0} given in Connection object {1} is not readable + */ FILE_NOT_READABLE(400, "CSV-FILE-CONNECTOR-400-003", "The file {0} given in Connection object {1} is not readable", "The connector is unable to open the file.", "Ensure the name of a readable file is passed in the address property in the Endpoint object of the Connection object."), + + /** + * CSV-FILE-CONNECTOR-400-004 - File {0} does not have {1} rows + */ FILE_TOO_SHORT(400, "CSV-FILE-CONNECTOR-400-004", "File {0} does not have {1} rows", "The connector is unable to retrieve the requested record because the file is too short.", "Ensure the record number requested is within the size of the file. Method getRecordCount will provide information on the number of data records in the file"), + + /** + * CSV-FILE-CONNECTOR-404-001 - The file named {0} in the Connection object {1} does not exist + */ FILE_NOT_FOUND(404, "CSV-FILE-CONNECTOR-404-001", "The file named {0} in the Connection object {1} does not exist", "The connector is unable to open the structure file.", "Add an existing file to the address property of the connection's Endpoint object."), + + /** + * CSV-FILE-CONNECTOR-500-001 - The connector received an unexpected IO exception when reading the file named {0}; the error message was: {1} + */ UNEXPECTED_IO_EXCEPTION(500, "CSV-FILE-CONNECTOR-500-001", "The connector received an unexpected IO exception when reading the file named {0}; the error message was: {1}", "The connector is unable to process the structure file.", diff --git a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/exception/FileReadException.java b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/exception/FileReadException.java index 32a1a76b826..3256a7c3a05 100644 --- a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/exception/FileReadException.java +++ b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/csv-file-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/csvfile/ffdc/exception/FileReadException.java @@ -15,6 +15,9 @@ */ public class FileReadException extends ConnectorCheckedException { + /** + * Name of the file in error. + */ private final String fileName; /** diff --git a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/data-folder-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/datafolder/ffdc/DataFolderConnectorErrorCode.java b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/data-folder-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/datafolder/ffdc/DataFolderConnectorErrorCode.java index 891effc3cd6..bff8ff976df 100644 --- a/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/data-folder-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/datafolder/ffdc/DataFolderConnectorErrorCode.java +++ b/open-metadata-implementation/adapters/open-connectors/data-store-connectors/file-connectors/data-folder-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/datastore/datafolder/ffdc/DataFolderConnectorErrorCode.java @@ -26,26 +26,49 @@ */ public enum DataFolderConnectorErrorCode implements ExceptionMessageSet { + /** + * DATA-FOLDER-CONNECTOR-400-001 - The folder name is null in the Connection object {0} + */ FOLDER_NOT_SPECIFIED(400, "DATA-FOLDER-CONNECTOR-400-001", "The folder name is null in the Connection object {0}", "The connector is unable to open the folder because the name of the folder is not passed in the Connection object.", "The name of the folder should be set up in the address property of the connection's Endpoint object."), + + /** + * DATA-FOLDER-CONNECTOR-400-002 - The folder {0} given in Connection object {1} is a file + */ FILE_NOT_DIRECTORY(400, "DATA-FOLDER-CONNECTOR-400-002", "The folder {0} given in Connection object {1} is a file", "The connector is unable to work with a file.", "Ensure a valid folder name is passed in the address property in the Endpoint object of the Connection object."), + + /** + * DATA-FOLDER-CONNECTOR-400-003 - The folder {0} given in Connection object {1} is not readable + */ FOLDER_NOT_READABLE(400, "DATA-FOLDER-CONNECTOR-400-003", "The folder {0} given in Connection object {1} is not readable", "The connector is unable to open the folder because it does not have permission to read the file.", "Ensure a readable folder name is passed in the address property in the Endpoint object of the Connection object."), + + /** + * DATA-FOLDER-CONNECTOR-404-001 - The folder named {0} in the Connection object {1} does not exist + */ FOLDER_NOT_FOUND(404, "DATA-FOLDER-CONNECTOR-404-001", "The folder named {0} in the Connection object {1} does not exist", "The connector is unable to open the folder because it does not exist.", "Add the name of an existing folder to the address property of the connection's Endpoint object."), + + /** + * DATA-FOLDER-CONNECTOR-500-001 - The connector received an unexpected security exception when reading the file named {0}; the error message was: {1} + */ UNEXPECTED_SECURITY_EXCEPTION(500, "DATA-FOLDER-CONNECTOR-500-001", "The connector received an unexpected security exception when reading the file named {0}; the error message was: {1}", "The connector is unable to process the folder.", "Use details from the error message to determine the cause of the security exception and retry the request once it is resolved."), + + /** + * DATA-FOLDER-CONNECTOR-500-002 - The connector received an unexpected IO exception when reading the folder named {0}; the error message was: {1} + */ UNEXPECTED_IO_EXCEPTION(500, "DATA-FOLDER-CONNECTOR-500-002", "The connector received an unexpected IO exception when reading the folder named {0}; the error message was: {1}", "The connector is unable to process the data in the folder.", diff --git a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTClientCheckedExceptionBase.java b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTClientCheckedExceptionBase.java index 5eafd0ff11a..fb798444a8c 100644 --- a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTClientCheckedExceptionBase.java +++ b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTClientCheckedExceptionBase.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions; +import java.io.Serial; import java.util.Objects; /** @@ -22,6 +23,8 @@ public abstract class RESTClientCheckedExceptionBase extends Exception private final String reportedUserAction; private Exception reportedCaughtException = null; + @Serial + private static final long serialVersionUID = 1L; /** * This is the typical constructor used for creating an exception. diff --git a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTConfigurationException.java b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTConfigurationException.java index dd55f21bb35..a8d946090d3 100644 --- a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTConfigurationException.java +++ b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTConfigurationException.java @@ -2,12 +2,17 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions; +import java.io.Serial; + /** * The RESTConfigurationException is thrown by the connector when it is not able to configure * a client to call a REST API. */ public class RESTConfigurationException extends RESTClientCheckedExceptionBase { + @Serial + private static final long serialVersionUID = 1L; + /** * This is the typical constructor used for creating an exception. * diff --git a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTServerException.java b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTServerException.java index 0df1dcbda05..64934c99d16 100644 --- a/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTServerException.java +++ b/open-metadata-implementation/adapters/open-connectors/rest-client-connectors/rest-client-connectors-api/src/main/java/org/odpi/openmetadata/adapters/connectors/restclients/ffdc/exceptions/RESTServerException.java @@ -2,12 +2,17 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.adapters.connectors.restclients.ffdc.exceptions; +import java.io.Serial; + /** * The RESTServerException is thrown by the REST client connector when it is not able to communicate with the * REST server. */ public class RESTServerException extends RESTClientCheckedExceptionBase { + @Serial + private static final long serialVersionUID = 1L; + /** * This is the typical constructor used for creating an exception. * diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/SchemaAttributeCategory.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/SchemaAttributeCategory.java index 19019475b51..ad63625776a 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/SchemaAttributeCategory.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/SchemaAttributeCategory.java @@ -20,13 +20,34 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum SchemaAttributeCategory implements Serializable { + /** + * The schema type is unknown. + */ UNKNOWN (0, "", "The schema type is unknown."), + + /** + * There may be multiple instances of this attribute. The instances are ordered and the same value may appear in different instances. + */ ARRAY (1, "Array" , "There may be multiple instances of this attribute. " + "The instances are ordered and the same value may appear in different instances."), + + /** + * There may be multiple instances of this attribute. The instances are unordered and the same value can not + * appear in more than one instance. + */ SET (2, "Set" , "There may be multiple instances of this attribute. " + "The instances are unordered and the same value can not appear in more than one instance."), + + /** + * There may be multiple instances of this attribute. The instances are unordered and the same value may + * appear in different instances. + */ BAG (3, "Bag", "There may be multiple instances of this attribute. " + "The instances are unordered and the same value may appear in different instances."), + + /** + * There is at maximum, only one instance of the attribute. + */ SINGLETON (4, "Singleton", "There is at maximum, only one instance of the attribute."); private final int schemaTypeCode; From 6f853fae8e6e0bbc3ec47f841ec223a5038fd55f Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 10 Jan 2024 11:15:46 +0000 Subject: [PATCH 4/4] Add the Survey Action Framework Signed-off-by: Mandy Chessell --- .../omag-server-platform/build.gradle | 2 + .../open-metadata-assemblies/build.gradle | 2 + .../handlers/DataAssetExchangeHandler.java | 7 +- .../service/DataEngineRESTServices.java | 4 +- .../DataManagerOMRSTopicListener.java | 2 +- .../RegisteredDiscoveryServiceConverter.java | 5 +- .../RegisteredGovernanceServiceConverter.java | 7 +- .../GovernanceConfigurationHandler.java | 122 +- .../GovernanceEngineOMRSTopicListener.java | 12 +- .../DuplicateSuspectDiscoveryService.java | 180 -- .../DataFilesMonitorIntegrationConnector.java | 12 +- .../survey-action-connectors/README.md | 26 + .../survey-action-connectors/build.gradle | 32 + .../surveyaction/AuditableSurveyService.java | 210 +++ .../SequentialSurveyPipeline.java | 33 + .../SequentialSurveyPipelineProvider.java | 39 + .../ffdc/SurveyServiceErrorCode.java | 167 ++ .../surveyaction/ffdc/package-info.java | 7 + .../fileclassifier/FileClassifier.java | 254 +++ .../fileclassifier/package-info.java | 7 + .../connectors/surveyaction/package-info.java | 7 + .../surveycsv/CSVSurveyService.java | 721 ++++++++ .../surveycsv/CSVSurveyServiceProvider.java} | 23 +- .../surveyaction/surveycsv/package-info.java | 7 + .../surveyfile/FileSurveyService.java | 131 ++ .../surveyfile/FileSurveyServiceProvider.java | 40 + .../surveyaction/surveyfile/package-info.java | 7 + .../surveyfolder/FolderSurveyService.java | 293 +++ .../FolderSurveyServiceProvider.java | 40 + .../surveyfolder/package-info.java | 7 + .../generichandlers/AnnotationBuilder.java | 66 +- .../generichandlers/AnnotationHandler.java | 86 +- .../AnnotationReviewBuilder.java | 50 +- .../generichandlers/AssetHandler.java | 2 +- .../generichandlers/DataFieldHandler.java | 2 +- .../DiscoveryAnalysisReportBuilder.java | 2 +- .../DiscoveryAnalysisReportHandler.java | 2 +- .../generichandlers/EngineActionBuilder.java | 4 +- .../generichandlers/EngineActionHandler.java | 18 +- .../FilesAndFoldersHandler.java | 28 +- .../GovernanceActionProcessStepHandler.java | 10 +- .../generichandlers/ODFConverter.java | 398 +--- .../OpenMetadataAPIGenericConverter.java | 189 +- .../OpenMetadataAPIGenericHandler.java | 14 +- .../generichandlers/ReferenceableBuilder.java | 16 +- .../RelationalDataHandler.java | 6 +- .../SchemaAttributeHandler.java | 2 +- .../gaf/rest/ArchiveRequestBody.java | 125 ++ .../gaf/client/OpenMetadataClientBase.java | 87 + .../converters/OpenMetadataConverterBase.java | 189 +- .../gaf/handlers/MetadataElementHandler.java | 81 + .../server/OpenMetadataStoreRESTServices.java | 81 +- .../spring/OpenMetadataStoreResource.java | 28 +- .../client/ConnectedAPIOperations.java | 28 +- .../client/ConnectedAssetClientBase.java | 10 +- .../client/ConnectedAssetLineage.java | 44 +- .../client/ConnectedAssetRatings.java | 34 +- .../ConnectedAssetRelatedAssetProperties.java | 43 +- .../client/ConnectedAssetUniverse.java | 118 +- .../client/ConnectedCertifications.java | 24 +- .../client/ConnectedCommentReplies.java | 16 +- .../client/ConnectedComments.java | 16 +- .../client/ConnectedConnections.java | 14 +- .../client/ConnectedDeployedAPIOperation.java | 10 +- .../ConnectedDeployedAPISchemaType.java | 6 +- .../client/ConnectedExternalIdentifiers.java | 14 +- .../client/ConnectedExternalReferences.java | 14 +- .../client/ConnectedFeedback.java | 12 +- .../client/ConnectedInformalTags.java | 14 +- .../client/ConnectedLicenses.java | 14 +- .../client/ConnectedLikes.java | 14 +- .../client/ConnectedLocations.java | 14 +- .../client/ConnectedNestedSchemaType.java | 6 +- .../client/ConnectedNoteLogs.java | 16 +- .../client/ConnectedNotes.java | 14 +- .../client/ConnectedRelatedAssets.java | 16 +- .../ConnectedRelatedMediaReferences.java | 14 +- .../client/ConnectedSchemaAttributes.java | 26 +- .../EgeriaConnectedAssetProperties.java | 24 +- .../frameworks/README.md | 10 +- .../event-action-framework/README.md | 27 + .../client/MetadataElementInterface.java | 53 + .../mapper/OpenMetadataProperty.java | 234 ++- .../mapper/OpenMetadataType.java | 618 ++++--- .../mapper/OpenMetadataWikiPages.java | 5 + .../properties/ArchiveProperties.java | 190 ++ .../refdata/DeployedImplementationType.java | 33 +- .../connectors/properties/AssetDetail.java | 9 +- .../connectors/properties/AssetSummary.java | 5 +- .../connectors/properties/AssetUniverse.java | 6 +- .../properties/NestedSchemaType.java | 4 +- .../properties/TestAssetUniverse.java | 4 +- .../discovery/properties/Annotation.java | 5 +- ...entAttachmentClassificationAnnotation.java | 182 -- .../SuspectDuplicateAnnotation.java | 294 --- .../context/OpenMetadataAccess.java | 48 +- .../survey-action-framework/README.md | 28 + .../survey-action-framework/build.gradle | 26 + .../surveyaction/AnnotationStore.java | 211 +++ .../DiscoveryAssetCatalogStore.java | 136 ++ .../SurveyActionPipelineConnector.java | 66 + .../surveyaction/SurveyActionService.java | 10 + .../SurveyActionServiceConnector.java | 216 +++ .../SurveyActionServiceProvider.java | 87 + .../surveyaction/SurveyAssetStore.java | 135 ++ .../surveyaction/SurveyContext.java | 287 +++ .../surveyaction/SurveyOpenMetadataStore.java | 1594 +++++++++++++++++ .../surveyaction/ffdc/SAFErrorCode.java | 141 ++ .../surveyaction/properties/Annotation.java | 457 +++++ .../properties/AnnotationStatus.java | 169 ++ .../properties/ClassificationAnnotation.java} | 64 +- .../properties/DataClassAnnotation.java | 193 ++ .../properties/DataFieldAnnotation.java | 84 + .../properties/DataProfileAnnotation.java | 524 ++++++ .../properties/DataProfileLogAnnotation.java} | 56 +- .../DataSourceMeasurementAnnotation.java} | 75 +- .../DataSourcePhysicalStatusAnnotation.java} | 135 +- .../surveyaction/properties/PropertyBase.java | 193 ++ .../properties/QualityAnnotation.java} | 90 +- .../RelationshipAdviceAnnotation.java} | 103 +- .../RequestForActionAnnotation.java | 211 +++ .../properties/SchemaAnalysisAnnotation.java} | 85 +- .../properties/SemanticAnnotation.java | 222 +++ .../surveyaction/properties/SurveyReport.java | 396 ++++ .../properties/AnnotationStatusTest.java | 139 ++ .../properties/AnnotationTest.java | 193 ++ .../GovernanceArchiveHelper.java | 16 +- .../open-connector-archives/build.gradle | 1 + .../OpenConnectorArchiveWriter.java | 225 ++- .../opentypes/OpenMetadataTypesArchive.java | 423 ++++- .../OpenMetadataTypesArchive1_2.java | 472 +++-- .../OpenMetadataTypesArchive1_3.java | 434 +---- .../OpenMetadataTypesArchive1_5.java | 60 - .../OpenMetadataTypesArchive2_4.java | 62 +- .../OpenMetadataTypesArchive2_5.java | 2 +- .../OpenMetadataTypesArchive2_6.java | 111 +- .../OpenMetadataTypesArchive3_12.java | 69 +- .../OpenMetadataTypesArchive3_13.java | 6 +- .../OpenMetadataTypesArchive3_15.java | 8 +- .../OpenMetadataTypesArchive3_5.java | 47 - .../OpenMetadataTypesArchive3_8.java | 73 +- .../OpenMetadataTypesArchive4_0.java | 30 +- .../samples/assetlookup/AssetLookUp.java | 2 +- .../fvt/assets/CreateAssetTest.java | 2 +- settings.gradle | 2 + 145 files changed, 11005 insertions(+), 3560 deletions(-) delete mode 100644 open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryService.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/README.md create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/build.gradle create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/AuditableSurveyService.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipeline.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipelineProvider.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/SurveyServiceErrorCode.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/FileClassifier.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyService.java rename open-metadata-implementation/adapters/open-connectors/{discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryProvider.java => survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyServiceProvider.java} (54%) create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyService.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyServiceProvider.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyService.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyServiceProvider.java create mode 100644 open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/package-info.java create mode 100644 open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-api/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/rest/ArchiveRequestBody.java create mode 100644 open-metadata-implementation/frameworks/event-action-framework/README.md create mode 100644 open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ArchiveProperties.java delete mode 100644 open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentClassificationAnnotation.java delete mode 100644 open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/README.md create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/build.gradle create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/AnnotationStore.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/DiscoveryAssetCatalogStore.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionPipelineConnector.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionService.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceConnector.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceProvider.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyAssetStore.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyContext.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyOpenMetadataStore.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/ffdc/SAFErrorCode.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/Annotation.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatus.java rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentValueAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/ClassificationAnnotation.java} (60%) create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataClassAnnotation.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataFieldAnnotation.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileAnnotation.java rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentValueAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileLogAnnotation.java} (65%) rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentDuplicateAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourceMeasurementAnnotation.java} (51%) rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentClassificationAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourcePhysicalStatusAnnotation.java} (50%) create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/PropertyBase.java rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/QualityAnnotation.java} (52%) rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentRelationshipAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RelationshipAdviceAnnotation.java} (51%) create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RequestForActionAnnotation.java rename open-metadata-implementation/frameworks/{open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentRelationshipAnnotation.java => survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SchemaAnalysisAnnotation.java} (53%) create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SemanticAnnotation.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SurveyReport.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatusTest.java create mode 100644 open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationTest.java diff --git a/open-metadata-distribution/omag-server-platform/build.gradle b/open-metadata-distribution/omag-server-platform/build.gradle index c3639418963..5030b5afb2c 100644 --- a/open-metadata-distribution/omag-server-platform/build.gradle +++ b/open-metadata-distribution/omag-server-platform/build.gradle @@ -42,6 +42,7 @@ dependencies { implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:openapi-integration-connector') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:openlineage-integration-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:elasticsearch-integration-connector') + implementation project(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:dynamic-archiver-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors') @@ -197,6 +198,7 @@ distributions { from { project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:jdbc-resource-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:configuration-store-connectors:configuration-encrypted-file-store-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:configuration-store-connectors:configuration-file-store-connector').jar } + from { project(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:dynamic-archiver-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors').jar } diff --git a/open-metadata-distribution/open-metadata-assemblies/build.gradle b/open-metadata-distribution/open-metadata-assemblies/build.gradle index 6331e36b27e..82cdfffff9d 100644 --- a/open-metadata-distribution/open-metadata-assemblies/build.gradle +++ b/open-metadata-distribution/open-metadata-assemblies/build.gradle @@ -44,6 +44,7 @@ dependencies { implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:openlineage-integration-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:elasticsearch-integration-connector') implementation project(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors') + implementation project(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:dynamic-archiver-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:event-bus-connectors:open-metadata-topic-connectors:inmemory-open-metadata-topic-connector') @@ -144,6 +145,7 @@ distributions { from { project(':open-metadata-implementation:adapters:open-connectors:configuration-store-connectors:configuration-encrypted-file-store-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:configuration-store-connectors:configuration-file-store-connector').jar } from { project(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors').jar } + from { project(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:dynamic-archiver-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors').jar } from { project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:files-integration-connectors').jar } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java index a199a66e6f0..32e63b4c196 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java @@ -11,6 +11,7 @@ import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; import org.odpi.openmetadata.commonservices.generichandlers.FilesAndFoldersHandler; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -238,7 +239,7 @@ public String createDataAsset(String userId, if (assetProperties instanceof DataStoreProperties dataStoreProperties) { - assetExtendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, dataStoreProperties.getPathName()); + assetExtendedProperties.put(OpenMetadataProperty.PATH_NAME.name, dataStoreProperties.getPathName()); assetExtendedProperties.put(OpenMetadataType.STORE_CREATE_TIME_PROPERTY_NAME, dataStoreProperties.getCreateTime()); assetExtendedProperties.put(OpenMetadataType.STORE_UPDATE_TIME_PROPERTY_NAME, dataStoreProperties.getModifiedTime()); } @@ -332,7 +333,7 @@ public String createDataAsset(String userId, if (((repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataType.DATA_FILE_TYPE_NAME)) || (repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataType.DATA_FOLDER_TYPE_NAME))) && (assetExtendedProperties != null) && - (assetExtendedProperties.get(OpenMetadataType.PATH_NAME_PROPERTY_NAME) != null)) + (assetExtendedProperties.get(OpenMetadataProperty.PATH_NAME.name) != null)) { final String pathNameParameterName = "assetProperties.getExtendedProperties().get(parameterName)"; filesAndFoldersHandler.addFileAssetPath(userId, @@ -341,7 +342,7 @@ public String createDataAsset(String userId, assetGUID, assetGUIDParameterName, typeName, - assetProperties.getExtendedProperties().get(OpenMetadataType.PATH_NAME_PROPERTY_NAME).toString(), + assetProperties.getExtendedProperties().get(OpenMetadataProperty.PATH_NAME.name).toString(), pathNameParameterName, forLineage, forDuplicateProcessing, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/service/DataEngineRESTServices.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/service/DataEngineRESTServices.java index 33e164928b0..2b59975a39e 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/service/DataEngineRESTServices.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/service/DataEngineRESTServices.java @@ -1714,11 +1714,11 @@ private HashMap getExtendedProperties(DataFile file) { if (file instanceof CSVFile) { CSVFile csvFile = (CSVFile) file; - extendedProperties.put(OpenMetadataType.FILE_TYPE_PROPERTY_NAME, csvFile.getFileType()); + extendedProperties.put(OpenMetadataProperty.FILE_TYPE.name, csvFile.getFileType()); extendedProperties.put(OpenMetadataType.DELIMITER_CHARACTER_PROPERTY_NAME, csvFile.getDelimiterCharacter()); extendedProperties.put(OpenMetadataType.QUOTE_CHARACTER_PROPERTY_NAME, csvFile.getQuoteCharacter()); } else { - extendedProperties.put(OpenMetadataType.FILE_TYPE_PROPERTY_NAME, file.getFileType()); + extendedProperties.put(OpenMetadataProperty.FILE_TYPE.name, file.getFileType()); } return extendedProperties; } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java index ed839d6d1ae..9cfbb09e6e5 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/listener/DataManagerOMRSTopicListener.java @@ -296,7 +296,7 @@ private void processRelationshipEvent(DataManagerOutboundEventType eventType, (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.API_REQUEST_RELATIONSHIP_TYPE_NAME)) || (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.API_RESPONSE_RELATIONSHIP_TYPE_NAME)) || (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.API_OPERATIONS_RELATIONSHIP_TYPE_NAME)) || - (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_NAME)) || + (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.typeName)) || (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.FOREIGN_KEY_RELATIONSHIP_TYPE_NAME)) || (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.NESTED_FILE_TYPE_NAME)) || (repositoryHelper.isTypeOf(sourceName, instanceTypeName, OpenMetadataType.LINKED_FILE_TYPE_NAME)) || diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/RegisteredDiscoveryServiceConverter.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/RegisteredDiscoveryServiceConverter.java index 28422ea699a..4bfac55522f 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/RegisteredDiscoveryServiceConverter.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-server/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/converters/RegisteredDiscoveryServiceConverter.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.discoveryengine.converters; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.frameworks.discovery.properties.DiscoveryServiceProperties; import org.odpi.openmetadata.frameworks.discovery.properties.RegisteredDiscoveryService; @@ -69,11 +70,11 @@ public RegisteredDiscoveryService getBean(DiscoveryServiceProperties discoverySe if (instanceProperties != null) { String requestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, instanceProperties, methodName); Map analysisParameters = repositoryHelper.getStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, instanceProperties, methodName); diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RegisteredGovernanceServiceConverter.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RegisteredGovernanceServiceConverter.java index 5f1f5b3b71f..540225b9c4f 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RegisteredGovernanceServiceConverter.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/converters/RegisteredGovernanceServiceConverter.java @@ -6,6 +6,7 @@ import org.odpi.openmetadata.accessservices.governanceengine.metadataelements.RegisteredGovernanceServiceElement; import org.odpi.openmetadata.accessservices.governanceengine.properties.RegisteredGovernanceService; import org.odpi.openmetadata.accessservices.governanceengine.properties.RegisteredGovernanceServiceProperties; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; @@ -70,14 +71,14 @@ public RegisteredGovernanceServiceElement getBean(GovernanceServiceElement gover if (instanceProperties != null) { String requestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, instanceProperties, methodName); RegisteredGovernanceServiceProperties registeredGovernanceServiceProperties = new RegisteredGovernanceServiceProperties(); String serviceRequestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, instanceProperties, methodName); @@ -93,7 +94,7 @@ public RegisteredGovernanceServiceElement getBean(GovernanceServiceElement gover registeredGovernanceServiceProperties.setServiceRequestType(serviceRequestType); } registeredGovernanceServiceProperties.setRequestParameters(repositoryHelper.getStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, instanceProperties, methodName)); diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java index c31a221940a..4e7636361b6 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java @@ -281,7 +281,7 @@ public GovernanceEngineElement getGovernanceEngineByGUID(String userId, return governanceEngineHandler.getBeanFromRepository(userId, guid, guidParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, false, false, new Date(), @@ -316,8 +316,8 @@ public GovernanceEngineElement getGovernanceEngineByName(String userId, return governanceEngineHandler.getBeanByValue(userId, name, nameParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, specificMatchPropertyNames, false, false, @@ -347,8 +347,8 @@ public List getAllGovernanceEngines(String userId, final String methodName = "getAllGovernanceEngines"; return governanceEngineHandler.getBeansByType(userId, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, null, startingFrom, maximumResults, @@ -409,8 +409,8 @@ public void updateGovernanceEngine(String userId, patchLevel, source, additionalProperties, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, extendedProperties, repositoryHelper, serviceName, @@ -423,8 +423,8 @@ public void updateGovernanceEngine(String userId, null, guid, guidParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, properties, false, methodName); @@ -461,8 +461,8 @@ public void deleteGovernanceEngine(String userId, null, guid, guidParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, qualifiedNameParameter, qualifiedName, false, @@ -643,7 +643,7 @@ public String createGovernanceService(String userId, assetGUID, null, assetGUIDParameterName, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, embeddedConnection.getEmbeddedConnection(), null, false, @@ -728,7 +728,7 @@ public GovernanceServiceElement getGovernanceServiceByGUID(String userId, return governanceServiceHandler.getAssetWithConnection(userId, guid, guidParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, new Date(), @@ -759,8 +759,8 @@ public GovernanceServiceElement getGovernanceServiceByName(String userId, return governanceServiceHandler.getAssetByNameWithConnection(userId, name, nameParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, new Date(), @@ -790,8 +790,8 @@ public List getAllGovernanceServices(String userId, final String methodName = "getAllGovernanceServices"; return governanceServiceHandler.getAllAssetsWithConnection(userId, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, startingFrom, maximumResults, false, @@ -832,7 +832,7 @@ public List getGovernanceServiceRegistrations(String userId, connectionHandler.getBeanFromRepository(userId, governanceServiceGUID, guidParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, effectiveTime, @@ -840,7 +840,7 @@ public List getGovernanceServiceRegistrations(String userId, List relationships = repositoryHandler.getRelationshipsByType(userId, governanceServiceGUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, OpenMetadataType.CONNECTION_TO_ASSET_TYPE_GUID, OpenMetadataType.CONNECTION_TO_ASSET_TYPE_NAME, 1, @@ -919,8 +919,8 @@ public void updateGovernanceService(String userId, null, description, additionalProperties, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, extendedProperties, null, null, @@ -962,8 +962,8 @@ public void deleteGovernanceService(String userId, null, guid, guidParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, qualifiedNameParameter, qualifiedName, false, @@ -1015,9 +1015,9 @@ public void registerGovernanceServiceWithEngine(String userId, invalidParameterHandler, userId, governanceEngineGUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, 2, false, false, @@ -1034,7 +1034,7 @@ public void registerGovernanceServiceWithEngine(String userId, if (supportedGovernanceService != null) { String existingRequestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, supportedGovernanceService.getProperties(), methodName); @@ -1053,13 +1053,13 @@ public void registerGovernanceServiceWithEngine(String userId, */ InstanceProperties properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, supportedGovernanceService.getProperties(), - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, defaultAnalysisParameters, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, serviceRequestType, methodName); repositoryHandler.updateRelationshipProperties(userId, @@ -1094,19 +1094,19 @@ public void registerGovernanceServiceWithEngine(String userId, repositoryHelper.addStringPropertyToInstance(serviceName, instanceProperties, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, governanceRequestType, methodName); instanceProperties = repositoryHelper.addStringPropertyToInstance(serviceName, instanceProperties, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, serviceRequestType, methodName); instanceProperties = repositoryHelper.addStringMapPropertyToInstance(serviceName, instanceProperties, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, defaultAnalysisParameters, methodName); @@ -1115,15 +1115,15 @@ public void registerGovernanceServiceWithEngine(String userId, null, governanceEngineGUID, governanceEngineGUIDParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, governanceServiceGUID, governanceServiceGUIDParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, governanceEngineHandler.getSupportedZones(), - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, instanceProperties, new Date(), methodName); @@ -1159,10 +1159,10 @@ public RegisteredGovernanceServiceElement getRegisteredGovernanceService(String List relationships = repositoryHandler.getRelationshipsBetweenEntities(userId, governanceServiceGUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, governanceEngineGUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, 1, false, false, @@ -1208,11 +1208,11 @@ public List getRegisteredGovernanceServices( List relationships = governanceEngineHandler.getAttachmentLinks(userId, governanceEngineGUID, governanceEngineGUIDParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, null, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, 2, false, false, @@ -1259,7 +1259,7 @@ public List getRegisteredGovernanceServices( * Build the request type list for the service. */ String requestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, relationship.getProperties(), methodName); @@ -1268,11 +1268,11 @@ public List getRegisteredGovernanceServices( RegisteredGovernanceServiceProperties relationshipProperties = new RegisteredGovernanceServiceProperties(); relationshipProperties.setServiceRequestType(repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, relationship.getProperties(), methodName)); relationshipProperties.setRequestParameters(repositoryHelper.getStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, relationship.getProperties(), methodName)); @@ -1331,9 +1331,9 @@ public void unregisterGovernanceServiceRequestFromEngine(String userId, invalidParameterHandler, userId, governanceEngineGUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, 2, false, false, @@ -1350,7 +1350,7 @@ public void unregisterGovernanceServiceRequestFromEngine(String userId, if (supportedGovernanceService != null) { String existingRequestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, supportedGovernanceService.getProperties(), methodName); @@ -1362,14 +1362,14 @@ public void unregisterGovernanceServiceRequestFromEngine(String userId, null, governanceEngineGUID, governanceEngineGUIDParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, governanceServiceGUID, governanceServiceGUIDParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, supportedGovernanceService, new Date(), methodName); @@ -1410,9 +1410,9 @@ public void unregisterGovernanceServiceFromEngine(String userId, invalidParameterHandler, userId, governanceEngineGUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, 2, false, false, @@ -1438,14 +1438,14 @@ public void unregisterGovernanceServiceFromEngine(String userId, null, governanceEngineGUID, governanceEngineGUIDParameter, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, governanceServiceGUID, governanceServiceGUIDParameter, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeGUID, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, false, false, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, supportedGovernanceService, new Date(), methodName); diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java index ba5dd34434f..b2b2d2d7c9b 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/outtopic/GovernanceEngineOMRSTopicListener.java @@ -127,7 +127,7 @@ private boolean processGovernanceEngineEvent(String sourceName, { if (repositoryHelper.isTypeOf(sourceName, type.getTypeDefName(), - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME)) + OpenMetadataType.GOVERNANCE_ENGINE.typeName)) { eventPublisher.publishRefreshGovernanceEngineEvent(entity.getGUID(), repositoryHelper.getStringProperty(sourceName, @@ -161,7 +161,7 @@ private boolean excludeGovernanceEngineEvent(String sourceName, { return (repositoryHelper.isTypeOf(sourceName, type.getTypeDefName(), - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME)); + OpenMetadataType.GOVERNANCE_ENGINE.typeName)); } } @@ -190,7 +190,7 @@ private boolean processSupportedGovernanceService(String sourceName, { if (repositoryHelper.isTypeOf(sourceName, type.getTypeDefName(), - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME)) + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName)) { EntityProxy governanceEngineEntityProxy = relationship.getEntityOneProxy(); EntityProxy governanceServiceEntityProxy = relationship.getEntityTwoProxy(); @@ -204,7 +204,7 @@ private boolean processSupportedGovernanceService(String sourceName, methodName), governanceServiceEntityProxy.getGUID(), repositoryHelper.getStringProperty(sourceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, relationship.getProperties(), methodName)); return true; @@ -236,7 +236,7 @@ private boolean excludeSupportedGovernanceService(String sourceName, { return repositoryHelper.isTypeOf(sourceName, type.getTypeDefName(), - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME); + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName); } } @@ -369,7 +369,7 @@ private boolean excludeGovernanceManagementEvents(String sourceName, { if (repositoryHelper.isTypeOf(sourceName, type.getTypeDefName(), - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME)) + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName)) { return true; } diff --git a/open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryService.java b/open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryService.java deleted file mode 100644 index 23925f676b0..00000000000 --- a/open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryService.java +++ /dev/null @@ -1,180 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.adapters.connectors.discoveryservices.discoverduplicates; - -import org.odpi.openmetadata.adapters.connectors.discoveryservices.AuditableDiscoveryService; -import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; -import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; -import org.odpi.openmetadata.frameworks.discovery.DiscoveryAnnotationStore; -import org.odpi.openmetadata.frameworks.discovery.DiscoveryAssetCatalogStore; -import org.odpi.openmetadata.frameworks.discovery.properties.SuspectDuplicateAnnotation; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * DuplicateSuspectDiscoveryService is a discovery service that looks for assets in the asset catalog that seem to be - * duplicates of the asset supplied in the context. - */ -public class DuplicateSuspectDiscoveryService extends AuditableDiscoveryService -{ - private static final String QUALIFIED_NAME_PROPERTY = "qualifiedName"; - private static final String DISPLAY_NAME_PROPERTY = "displayName"; - private static final String NETWORK_ADDRESS_PROPERTY = "Connection::Endpoint::address"; - - private final Map> suspectDuplicateReport = new HashMap<>(); - - /** - * Indicates that the discovery service is completely configured and can begin processing. - * - * @throws ConnectorCheckedException there is a problem within the discovery service. - */ - @Override - public void start() throws ConnectorCheckedException - { - final String methodName = "start"; - - super.start(); - - try - { - String assetGUID = discoveryContext.getAssetGUID(); - AssetUniverse asset = discoveryContext.getAssetStore().getAssetProperties(); - - if (asset == null) - { - super.logNoAsset(assetGUID, methodName); - return; - } - - /* - * Extract the information from the requested asset that will be used to identify duplicates. - */ - List endpointNetworkAddresses = super.getNetworkAddresses(asset); - String qualifiedName = asset.getQualifiedName(); - String displayName = asset.getDisplayName(); - - DiscoveryAssetCatalogStore assetCatalogStore = discoveryContext.getAssetCatalogStore(); - - /* - * Just pull in up to the maximum page size - if locating more duplicates that this upper limit then there are bigger problems. - * Duplicate assets are returned based on qualified name, display name and endpoint address. - */ - List retrievedAssetGUIDs = assetCatalogStore.getAssetsByQualifiedName(qualifiedName,0, assetCatalogStore.getMaxPageSize()); - this.captureDuplicateSuspects(retrievedAssetGUIDs, QUALIFIED_NAME_PROPERTY); - - if (displayName != null) - { - retrievedAssetGUIDs = assetCatalogStore.getAssetsByName(displayName,0, assetCatalogStore.getMaxPageSize()); - this.captureDuplicateSuspects(retrievedAssetGUIDs, DISPLAY_NAME_PROPERTY); - } - - if (endpointNetworkAddresses != null) - { - for (String networkAddress : endpointNetworkAddresses) - { - if (networkAddress != null) - { - retrievedAssetGUIDs = assetCatalogStore.getAssetsByName(displayName,0, assetCatalogStore.getMaxPageSize()); - this.captureDuplicateSuspects(retrievedAssetGUIDs, NETWORK_ADDRESS_PROPERTY); - } - } - } - - recordAnnotations(); - } - catch (ConnectorCheckedException error) - { - throw error; - } - catch (Exception error) - { - super.handleUnexpectedException(methodName, error); - } - } - - - /** - * Capture details of the assets that match on a specific property. - * - * @param duplicateSuspectGUIDs list of matching unique identifiers - * @param propertyName property name that they match on - */ - private void captureDuplicateSuspects(List duplicateSuspectGUIDs, - String propertyName) - { - if (duplicateSuspectGUIDs != null) - { - for (String duplicateSuspectGUID : duplicateSuspectGUIDs) - { - if (duplicateSuspectGUID != null) - { - List duplicateSuspectRecord = suspectDuplicateReport.get(duplicateSuspectGUID); - - if (duplicateSuspectRecord == null) - { - duplicateSuspectRecord = new ArrayList<>(); - } - - duplicateSuspectRecord.add(propertyName); - suspectDuplicateReport.put(duplicateSuspectGUID, duplicateSuspectRecord); - } - } - } - } - - - /** - * Take the suspect duplicates report and turn it into annotations. - * - * @throws InvalidParameterException problem with the guid - * @throws UserNotAuthorizedException problem with user id - * @throws PropertyServerException problem connecting to metadata server - */ - private void recordAnnotations() throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "recordAnnotations"; - - DiscoveryAnnotationStore annotationStore = discoveryContext.getAnnotationStore(); - - if (suspectDuplicateReport.isEmpty()) - { - /* - * This asset is unique - create an annotation to show there are no duplicate suspects. - */ - SuspectDuplicateAnnotation annotation = new SuspectDuplicateAnnotation(); - - annotation.setAnnotationType("Unique Asset"); - annotation.setSummary("No matching assets found based on qualified name, display name and endpoint addresses."); - - annotationStore.addAnnotationToDiscoveryReport(annotation); - } - else - { - /* - * Create a duplicate suspect annotation for each asset found in the suspect duplicate report. - */ - for (String suspectGUID : suspectDuplicateReport.keySet()) - { - if (suspectGUID != null) - { - SuspectDuplicateAnnotation annotation = new SuspectDuplicateAnnotation(); - - annotation.setAnnotationType("Duplicate Suspect Asset"); - annotation.setSummary("This asset appears to refer to the same physical asset."); - annotation.setMatchingPropertyNames(suspectDuplicateReport.get(suspectGUID)); - - annotationStore.addAnnotationToDiscoveryReport(annotation); - } - } - } - } -} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java index da8c327f894..da2bb14e09a 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java @@ -35,7 +35,7 @@ public class DataFilesMonitorIntegrationConnector extends BasicFilesMonitorInteg private static final String fileTypeCategory = OpenMetadataValidValues.constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null); private static final String deployedImplementationTypeCategory = OpenMetadataValidValues.constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, @@ -300,7 +300,7 @@ private void catalogFile(File file, * Is the file name or file extension recognized? */ ValidMetadataValue validMetadataValue = validMetadataValues.getValidMetadataValue(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_NAME.name, file.getName()); List consistentValues = null; @@ -308,7 +308,7 @@ private void catalogFile(File file, if (validMetadataValue != null) { consistentValues = validMetadataValues.getConsistentMetadataValues(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_NAME.name, null, validMetadataValue.getPreferredValue(), 0, @@ -319,13 +319,13 @@ private void catalogFile(File file, if (fileExtension != null) { validMetadataValue = validMetadataValues.getValidMetadataValue(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, fileExtension); if (validMetadataValue != null) { consistentValues = validMetadataValues.getConsistentMetadataValues(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, null, validMetadataValue.getPreferredValue(), 0, @@ -355,7 +355,7 @@ private void catalogFile(File file, List consistentFileTypeValues = validMetadataValues.getConsistentMetadataValues( OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null, validMetadataValue.getPreferredValue(), 0, diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/README.md b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/README.md new file mode 100644 index 00000000000..29fa4fc01a0 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/README.md @@ -0,0 +1,26 @@ + + + +![TechPreview](../../../../images/egeria-content-status-tech-preview.png#pagewidth) + +# Survey Action Service Connectors + +The survey action service connectors contain the implementation of the +[survey action services](https://egeria-project.org/concepts/survey-action-service) +provided by Egeria. + +* **Sequential Survey Pipeline** - Runs nested survey action services in a sequence. + +* **CSV Survey Service** - Extracts the column names from the first line of the file, counts up the number of records in the file + and extracts its last modified time. + +* **Apache Atlas Survey Service** is a survey action service that gathers statistics about the + Apache Atlas server and stores it in a Survey Report attached to the SoftwareServer entity + that represents the Apache Atlas server. + + +Return to [open-connectors](..) module. + +---- +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/adapters/open-connectors/survey-action-connectors/build.gradle b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/build.gradle new file mode 100644 index 00000000000..180b3125e6c --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/build.gradle @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Contributors to the ODPi Egeria project. + */ + + +dependencies { + compileOnly project(':open-metadata-implementation:frameworks:audit-log-framework') + compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework') + compileOnly project(':open-metadata-implementation:frameworks:survey-action-framework') + compileOnly project(':open-metadata-implementation:frameworks:governance-action-framework') + compileOnly project(':open-metadata-implementation:repository-services:repository-services-apis') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:csv-file-connector') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:system-connectors:apache-atlas-rest-connector') + compileOnly 'org.slf4j:slf4j-api' + testImplementation 'org.testng:testng' + compileOnly 'com.fasterxml.jackson.core:jackson-annotations' + +} + +description = 'Survey Action Service Connectors' + +java { + withJavadocJar() +} + +test { + useTestNG() + // This will default to standard search pattern - see https://docs.gradle.org/current/userguide/java_testing.html#sec:test_detection + scanForTestClasses = false +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/AuditableSurveyService.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/AuditableSurveyService.java new file mode 100644 index 00000000000..828e5f89d05 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/AuditableSurveyService.java @@ -0,0 +1,210 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.surveyaction; + +import org.odpi.openmetadata.adapters.connectors.surveyaction.ffdc.SurveyServiceErrorCode; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.properties.*; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementType; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.Endpoint; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceConnector; + +import java.util.ArrayList; +import java.util.List; + +/** + * AuditableSurveyService is a base class for survey action services that provides common error handling routines. + */ +public abstract class AuditableSurveyService extends SurveyActionServiceConnector +{ + /** + * Log that no asset has been returned to the survey action service. It is unable to proceed without this basic information. + * + * @param assetGUID the unique identifier of the asset from the discovery context + * @param methodName calling method + * + * @throws ConnectorCheckedException resulting exception + */ + protected void throwNoAsset(String assetGUID, + String methodName) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SurveyServiceErrorCode.NO_ASSET.getMessageDefinition(assetGUID, + surveyActionServiceName), + this.getClass().getName(), + methodName); + } + + + /** + * Log that the survey action service can not process the type of asset it has been passed. + * + * @param assetGUID identifier of the asset + * @param assetType type of the asset + * @param supportedAssetType supported asset types + * @param methodName calling method + * @throws ConnectorCheckedException resulting exception + */ + protected void throwWrongTypeOfAsset(String assetGUID, + String assetType, + String supportedAssetType, + String methodName) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SurveyServiceErrorCode.INVALID_ASSET_TYPE.getMessageDefinition(assetGUID, + assetType, + surveyActionServiceName, + supportedAssetType), + this.getClass().getName(), + methodName); + } + + + /** + * Log that the survey action service can not process the type of asset it has been passed. + * + * @param assetGUID identifier of the asset + * @param assetTypeName type of the asset + * @param assetResourceName name of the resource + * @param assetResourceType type of the resource + * @param supportedResourceType supported resource types + * @param methodName calling method + * @throws ConnectorCheckedException resulting exception + */ + protected void throwWrongTypeOfResource(String assetGUID, + String assetTypeName, + String assetResourceName, + String assetResourceType, + String supportedResourceType, + String methodName) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SurveyServiceErrorCode.INVALID_RESOURCE.getMessageDefinition(assetTypeName, + assetGUID, + assetResourceName, + assetResourceType, + surveyActionServiceName, + supportedResourceType), + this.getClass().getName(), + methodName); + } + + + /** + * Log that the survey action service can not process the type of asset it has been passed. + * + * @param assetGUID identifier of the asset + * @param assetTypeName type of the asset + * @param assetResourceName name of the resource + * @param methodName calling method + * @throws ConnectorCheckedException resulting exception + */ + protected void throwMissingResource(String assetGUID, + String assetTypeName, + String assetResourceName, + String methodName) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SurveyServiceErrorCode.NO_RESOURCE.getMessageDefinition(assetTypeName, + assetGUID, + assetResourceName), + this.getClass().getName(), + methodName); + } + + + /** + * Log that the survey action service can not process the type of root schema it has been passed. + * + * @param assetGUID identifier of the asset + * @param rootSchemaType type of the root schema + * @param supportedRootSchemaType supported root schema types + * @param methodName calling method + * @throws ConnectorCheckedException resulting exception + */ + protected void throwWrongTypeOfRootSchema(String assetGUID, + String rootSchemaType, + String supportedRootSchemaType, + String methodName) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SurveyServiceErrorCode.INVALID_ROOT_SCHEMA_TYPE.getMessageDefinition(assetGUID, + rootSchemaType, + surveyActionServiceName, + supportedRootSchemaType), + this.getClass().getName(), + methodName); + } + + + /** + * Return the type name for the asset. An exception is thrown if the type name is not available. + * + * @param asset asset universe + * @param methodName calling method + * @return asset's type name + * @throws ConnectorCheckedException resulting exception + */ + protected String getAssetTypeName(AssetUniverse asset, + String methodName) throws ConnectorCheckedException + { + ElementType elementType = asset.getType(); + + if (elementType != null) + { + return elementType.getTypeName(); + } + + throw new ConnectorCheckedException(SurveyServiceErrorCode.NO_ASSET_TYPE.getMessageDefinition(asset.toString(), surveyActionServiceName), + this.getClass().getName(), + methodName); + } + + + /** + * Return the network address of this asset. + * + * @param asset asset to extract address from + * @return the list of network addresses + */ + protected List getNetworkAddresses(AssetUniverse asset) + { + if (asset != null) + { + Connections connections = asset.getConnections(); + + if (connections != null) + { + List networkAddresses = new ArrayList<>(); + + while (connections.hasNext()) + { + Connection connectionProperties = connections.next(); + + if (connectionProperties != null) + { + Endpoint endpointProperties = connectionProperties.getEndpoint(); + + if (endpointProperties != null) + { + if (endpointProperties.getAddress() != null) + { + /* + * Only add one copy of a specific address. + */ + if (! networkAddresses.contains(endpointProperties.getAddress())) + { + networkAddresses.add(endpointProperties.getAddress()); + } + } + } + } + } + + if (! networkAddresses.isEmpty()) + { + return networkAddresses; + } + } + } + + return null; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipeline.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipeline.java new file mode 100644 index 00000000000..28128ce6691 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipeline.java @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionPipelineConnector; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceConnector; + +/** + * SequentialSurveyPipeline is a survey action pipeline that provides an inline sequential invocation of the + * supplied survey action services. + */ +public class SequentialSurveyPipeline extends SurveyActionPipelineConnector +{ + /** + * This implementation provides an inline sequential invocation of the supplied survey action services. + * + * @throws ConnectorCheckedException there is a problem within the survey action service. + */ + @Override + protected void runSurveyPipeline() throws ConnectorCheckedException + { + for (SurveyActionServiceConnector embeddedSurveyService : super.embeddedSurveyActionServices) + { + if (embeddedSurveyService != null) + { + embeddedSurveyService.setSurveyContext(super.surveyContext); + embeddedSurveyService.start(); + embeddedSurveyService.disconnect(); + } + } + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipelineProvider.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipelineProvider.java new file mode 100644 index 00000000000..6d01f3fb791 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/SequentialSurveyPipelineProvider.java @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceProvider; + +/** + * SequentialDiscoveryPipelineProvider is the provider for the SequentialDiscoveryPipeline - an ODF discovery pipeline connector. + */ +public class SequentialSurveyPipelineProvider extends SurveyActionServiceProvider +{ + static final String connectorTypeGUID = "30f2c202-7f2d-4d5d-9b17-6064f32f3c74"; + static final String connectorTypeName = "Sequential Survey Pipeline Connector"; + static final String connectorTypeDescription = "Connector supports the sequential execution of survey action services."; + + /** + * Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific + * discovery service implementation. + */ + public SequentialSurveyPipelineProvider() + { + Class connectorClass = SequentialSurveyPipeline.class; + + super.setConnectorClassName(connectorClass.getName()); + + ConnectorType connectorType = new ConnectorType(); + connectorType.setType(ConnectorType.getConnectorTypeType()); + connectorType.setGUID(connectorTypeGUID); + connectorType.setQualifiedName(connectorTypeName); + connectorType.setDisplayName(connectorTypeName); + connectorType.setDescription(connectorTypeDescription); + connectorType.setConnectorProviderClassName(this.getClass().getName()); + connectorType.setSupportedAssetTypeName(supportedAssetTypeName); + + super.connectorTypeBean = connectorType; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/SurveyServiceErrorCode.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/SurveyServiceErrorCode.java new file mode 100644 index 00000000000..6898f5c109c --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/SurveyServiceErrorCode.java @@ -0,0 +1,167 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.ffdc; + +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageDefinition; +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageSet; + + +/** + * The SurveyServiceErrorCode is used to define first failure data capture (FFDC) for errors that occur + * when running Survey Action Services. It is + * used in conjunction with both Checked and Runtime (unchecked) exceptions. + * The 5 fields in the enum are: + *
    + *
  • HTTP Error Code - for translating between REST and JAVA - Typically the numbers used are:
  • + *
    • + *
    • 500 - internal error
    • + *
    • 400 - invalid parameters
    • + *
    • 404 - not found
    • + *
    • 409 - data conflict errors - eg item already defined
    • + *
  • + *
  • Error Message Id - to uniquely identify the message
  • + *
  • Error Message Text - includes placeholder to allow additional values to be captured
  • + *
  • SystemAction - describes the result of the error
  • + *
  • UserAction - describes how a consumer should correct the error
  • + *
+ */ +public enum SurveyServiceErrorCode implements ExceptionMessageSet +{ + /** + * SURVEY-ACTION-SERVICE-400-001 - Asset {0} is of type {1} but survey action service {2} only supports the following asset type(s): {3} + */ + INVALID_ASSET_TYPE(400, "SURVEY-ACTION-SERVICE-400-001", + "Asset {0} is of type {1} but survey action service {2} only supports the following asset type(s): {3}", + "The survey action service terminates.", + "The caller has requested a governance request type that is incompatible with the type of the " + + "asset that has been supplied. This problem could be resolved by issuing the survey request with " + + "a governance request type that is compatible with the asset, or changing the survey action service " + + "associated with the governance request type to one that supports this type of asset."), + + /** + * SURVEY-ACTION-SERVICE-400-002 - Asset {0} has a root schema of type {1} but survey action service {2} only supports the following root schema type(s): {3} + */ + INVALID_ROOT_SCHEMA_TYPE(400, "SURVEY-ACTION-SERVICE-400-002", + "Asset {0} has a root schema of type {1} but survey action service {2} only supports the following root schema type(s): {3}", + "The survey action service terminates because it can not proceed.", + "The caller has requested a governance request type that is unable to process a root schema for an asset because its type is unsupported." + + " This problem could be resolved by issuing the survey request with " + + "a governance request type that is compatible with the asset's schema, or changing the survey action service " + + "associated with the governance request type to one that supports this type of schema."), + + /** + * SURVEY-ACTION-SERVICE-400-003 - {0} asset {1} describes a resource called {2} which is of type {3} but survey action service {4} only supports the following type(s) of resources: {5} + */ + INVALID_RESOURCE(400, "SURVEY-ACTION-SERVICE-400-003", + "{0} asset {1} describes a resource called {2} which is of type {3} but survey action service {4} only supports the following type(s) of resources: {5}", + "The survey action service terminates because it does not know how to process this type of resource.", + "There is a mismatch between the asset in the open metadata catalog and the resource that it represents. Update the asset in the asset catalog so that it is matched with more appropriate services."), + + /** + * SURVEY-ACTION-SERVICE-400-004 - {0} asset {1} describes a resource called {2} does not exist + */ + NO_RESOURCE(400, "SURVEY-ACTION-SERVICE-400-004", + "{0} asset {1} describes a resource called {2} that does not exist", + "The survey action service terminates because it does not have access to the resource.", + "Ensure the resource is correctly identified in the asset. Rerun this request when the resource is created."), + + /** + * SURVEY-ACTION-SERVICE-500-001 - No information about the asset {0} has been returned from the asset store for survey action service {1} + */ + NO_ASSET(500, "SURVEY-ACTION-SERVICE-500-001", + "No information about the asset {0} has been returned from the asset store for survey action service {1}", + "The survey action service terminates without running any automated survey function.", + "This is an unexpected condition because if the metadata server was unavailable, an exception would have been caught."), + + /** + * SURVEY-ACTION-SERVICE-500-002 - No type name is available for the asset passed to survey action service {0}. The full asset contents are: {1} + */ + NO_ASSET_TYPE(500, "SURVEY-ACTION-SERVICE-500-002", + "No type name is available for the asset passed to survey action service {0}. The full asset contents are: {1}", + "The survey action service terminates without running the requested automated survey function.", + "This is an unexpected condition because this value should always be returned with an asset."), + ; + + + + + private final int httpErrorCode; + private final String errorMessageId; + private final String errorMessage; + private final String systemAction; + private final String userAction; + + + /** + * The constructor expects to be passed one of the enumeration rows defined above. + * + * @param httpErrorCode error code to use over REST calls + * @param errorMessageId unique id for the message + * @param errorMessage text for the message + * @param systemAction description of the action taken by the system when the error condition happened + * @param userAction instructions for resolving the error + */ + SurveyServiceErrorCode(int httpErrorCode, String errorMessageId, String errorMessage, String systemAction, String userAction) + { + this.httpErrorCode = httpErrorCode; + this.errorMessageId = errorMessageId; + this.errorMessage = errorMessage; + this.systemAction = systemAction; + this.userAction = userAction; + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are no message inserts. + * + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition() + { + return new ExceptionMessageDefinition(httpErrorCode, + errorMessageId, + errorMessage, + systemAction, + userAction); + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are values to be inserted into the message. + * + * @param params array of parameters (all strings). They are inserted into the message according to the numbering in the message text. + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition(String... params) + { + ExceptionMessageDefinition messageDefinition = new ExceptionMessageDefinition(httpErrorCode, + errorMessageId, + errorMessage, + systemAction, + userAction); + + messageDefinition.setMessageParameters(params); + + return messageDefinition; + } + + + /** + * JSON-style toString + * + * @return string of property names and values for this enum + */ + @Override + public String toString() + { + return "ErrorCode{" + + "httpErrorCode=" + httpErrorCode + + ", errorMessageId='" + errorMessageId + '\'' + + ", errorMessage='" + errorMessage + '\'' + + ", systemAction='" + systemAction + '\'' + + ", userAction='" + userAction + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/package-info.java new file mode 100644 index 00000000000..e4af0c6c050 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/ffdc/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * First Failure Data Capture (FFDC) definitions. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.ffdc; \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/FileClassifier.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/FileClassifier.java new file mode 100644 index 00000000000..c687d014285 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/FileClassifier.java @@ -0,0 +1,254 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.surveyaction.fileclassifier; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataValidValues; +import org.odpi.openmetadata.frameworks.governanceaction.properties.ValidMetadataValue; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyOpenMetadataStore; + +import java.io.File; +import java.util.List; + +public class FileClassifier +{ + private String fileExtension = null; + private String fileType = null; + private String deployedImplementationType = null; + private String assetTypeName = OpenMetadataType.DATA_FILE_TYPE_NAME; + private boolean canRead = false; + private boolean canWrite = false; + private boolean canExecute = false; + + + /** + * Retrieves the extension from a path name. For example, if the pathname is "one/two/three.txt", the method + * returns "txt". If the path name has multiple extensions, such as "my-jar.jar.gz", the final extension is returned (ie "gz"). + * Null is returned if there is no file extension in the path name. + * + * @param pathName path name of file or directory + * @return file extension + */ + public static String getFileExtension(String pathName) + { + final String fileTypeDivider = "\\."; + + String result = null; + + if ((pathName != null) && (! pathName.isEmpty())) + { + String[] tokens = pathName.split(fileTypeDivider); + + if (tokens.length > 1) + { + result = tokens[tokens.length - 1]; + } + } + + return result; + } + + + private static final String fileTypeCategory = + OpenMetadataValidValues.constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_TYPE.name, + null); + private static final String deployedImplementationTypeCategory = + OpenMetadataValidValues.constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.DEPLOYED_IMPLEMENTATION_TYPE.name, + null); + + + /** + * Use the valid values to classify the file. + * + * @param openMetadataStore open metadata where the valid values are stored. + * @param file file to analyse + * @throws InvalidParameterException invalid parameter + * @throws PropertyServerException problem connecting to the open metadata repositories + * @throws UserNotAuthorizedException insufficient access + */ + public FileClassifier (SurveyOpenMetadataStore openMetadataStore, + File file) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + this.fileExtension = getFileExtension(file.getAbsolutePath()); + + + /* + * Is the file name or file extension recognized? + */ + ValidMetadataValue validMetadataValue = openMetadataStore.getValidMetadataValue(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_NAME.name, + file.getName()); + + List consistentValues = null; + + if (validMetadataValue != null) + { + consistentValues = openMetadataStore.getConsistentMetadataValues(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_NAME.name, + null, + validMetadataValue.getPreferredValue(), + 0, + 5); + } + else + { + if (this.fileExtension != null) + { + validMetadataValue = openMetadataStore.getValidMetadataValue(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, + this.fileExtension); + + if (validMetadataValue != null) + { + consistentValues = openMetadataStore.getConsistentMetadataValues(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, + null, + validMetadataValue.getPreferredValue(), + 0, + 5); + } + } + + this.canRead = file.canRead(); + this.canWrite = file.canWrite(); + this.canExecute = file.canExecute(); + } + + + /* + * The fileType valid metadata value links to the deployed implementation type. + */ + if (consistentValues != null) + { + for (ValidMetadataValue consistentValue : consistentValues) + { + if (consistentValue != null) + { + if (fileTypeCategory.equals(consistentValue.getCategory())) + { + this.fileType = consistentValue.getPreferredValue(); + + if ((consistentValue.getAdditionalProperties() != null) && + (consistentValue.getAdditionalProperties().get(OpenMetadataValidValues.ASSET_SUB_TYPE_NAME) != null)) + { + this.assetTypeName = consistentValue.getAdditionalProperties().get(OpenMetadataValidValues.ASSET_SUB_TYPE_NAME); + } + + List consistentFileTypeValues = + openMetadataStore.getConsistentMetadataValues(OpenMetadataType.DATA_FILE_TYPE_NAME, + OpenMetadataProperty.FILE_TYPE.name, + null, + validMetadataValue.getPreferredValue(), + 0, + 5); + + if (consistentFileTypeValues != null) + { + for (ValidMetadataValue consistentFileTypeValue : consistentFileTypeValues) + { + if (consistentFileTypeValue != null) + { + if (deployedImplementationTypeCategory.equals(consistentValue.getCategory())) + { + this.deployedImplementationType = consistentValue.getPreferredValue(); + } + } + } + } + } + } + } + } + + this.canRead = file.canRead(); + this.canWrite = file.canWrite(); + this.canExecute = file.canExecute(); + } + + + /** + * Return the file extension of the file. + * + * @return letters after the "dot" + */ + public String getFileExtension() + { + return fileExtension; + } + + + /** + * return the logical file type. + * + * @return string name + */ + public String getFileType() + { + return fileType; + } + + + /** + * Return the deployed implementation type. + * + * @return string name + */ + public String getDeployedImplementationType() + { + return deployedImplementationType; + } + + + /** + * Return the asset type name. + * + * @return string name + */ + public String getAssetTypeName() + { + return assetTypeName; + } + + + /** + * Is the file readable? + * + * @return boolean + */ + public boolean isCanRead() + { + return canRead; + } + + + /** + * Is the file writable? + * + * @return boolean + */ + public boolean isCanWrite() + { + return canWrite; + } + + + /** + * Is the file executable? + * + * @return boolean + */ + public boolean isCanExecute() + { + return canExecute; + } + +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/package-info.java new file mode 100644 index 00000000000..173258f5abc --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/fileclassifier/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * File classifier utility. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.fileclassifier; \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/package-info.java new file mode 100644 index 00000000000..a45af8c0791 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * Egeria supplied Survey Action Service Connectors and utilities. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction; \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyService.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyService.java new file mode 100644 index 00000000000..04836b304c3 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyService.java @@ -0,0 +1,721 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveycsv; + +import org.odpi.openmetadata.adapters.connectors.datastore.csvfile.CSVFileStoreConnector; +import org.odpi.openmetadata.adapters.connectors.surveyaction.AuditableSurveyService; +import org.odpi.openmetadata.frameworks.connectors.Connector; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; +import org.odpi.openmetadata.frameworks.connectors.properties.NestedSchemaType; +import org.odpi.openmetadata.frameworks.connectors.properties.SchemaAttributes; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaAttribute; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaType; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; +import org.odpi.openmetadata.frameworks.governanceaction.properties.ArchiveProperties; +import org.odpi.openmetadata.frameworks.governanceaction.search.ElementProperties; +import org.odpi.openmetadata.frameworks.governanceaction.search.PropertyHelper; +import org.odpi.openmetadata.frameworks.surveyaction.AnnotationStore; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyAssetStore; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyOpenMetadataStore; +import org.odpi.openmetadata.frameworks.surveyaction.properties.AnnotationStatus; +import org.odpi.openmetadata.frameworks.surveyaction.properties.DataProfileAnnotation; +import org.odpi.openmetadata.frameworks.surveyaction.properties.DataSourcePhysicalStatusAnnotation; +import org.odpi.openmetadata.frameworks.surveyaction.properties.SchemaAnalysisAnnotation; + +import java.util.*; + + +/** + * CSVSurveyService is a survey action service implementation for analysing CSV Files to + * columns and profile the data in them. + */ +public class CSVSurveyService extends AuditableSurveyService +{ + private final static String STRING_TYPE_NAME = "string"; + private final static String CHAR_TYPE_NAME = "char"; + private final static String DATE_TYPE_NAME = "date"; + private final static String INT_TYPE_NAME = "int"; + private final static String LONG_TYPE_NAME = "long"; + private final static String BOOLEAN_TYPE_NAME = "boolean"; + private final static String FLOAT_TYPE_NAME = "float"; + private final static String BOOLEAN_UC_TRUE = "TRUE"; + private final static String BOOLEAN_LC_TRUE = "true"; + private final static String BOOLEAN_UC_FALSE = "FALSE"; + private final static String BOOLEAN_LC_FALSE = "false"; + private final static String schemaType = OpenMetadataType.TABULAR_SCHEMA_TYPE_TYPE_NAME; + private final static String schemaName = "CSV"; + + private final PropertyHelper propertyHelper = new PropertyHelper(); + + private Connector connector = null; + + + /** + * Return the best guess for the data field type. + * + * @param existingType current type guess + * @param newFieldValue next field value to process + * @return new best guess + */ + private String getDataFieldType(String existingType, String newFieldValue) + { + if (STRING_TYPE_NAME.equals(existingType)) + { + return STRING_TYPE_NAME; + } + + if (newFieldValue == null) + { + return existingType; + } + + if ((BOOLEAN_LC_TRUE.equals(newFieldValue)) || + (BOOLEAN_UC_TRUE.equals(newFieldValue)) || + (BOOLEAN_LC_FALSE.equals(newFieldValue)) || + (BOOLEAN_UC_FALSE.equals(newFieldValue))) + + { + if ((existingType == null) || (existingType.equals(BOOLEAN_TYPE_NAME))) + { + return BOOLEAN_TYPE_NAME; + } + else + { + return STRING_TYPE_NAME; + } + } + + return STRING_TYPE_NAME; + } + + + /** + * Return the updated value count for this column. + * + * @param existingValueCount current value count + * @param newFieldValue next field value to process + * @return new value count + */ + private Map getValueCount(Map existingValueCount, String newFieldValue) + { + if (existingValueCount == null) + { + Map newValueCount = new HashMap<>(); + + newValueCount.put(newFieldValue, 1); + + return newValueCount; + } + + Integer countForValue = existingValueCount.get(newFieldValue); + + if (countForValue == null) + { + existingValueCount.put(newFieldValue, 1); + } + else + { + existingValueCount.put(newFieldValue, countForValue + 1); + } + + return existingValueCount; + } + + + /** + * Return the updated value list. + * + * @param existingValueList existing value list + * @param newFieldValue next field value to process + * @return updated value list + */ + private List getValueList(List existingValueList, String newFieldValue) + { + if (existingValueList == null) + { + List newValueList = new ArrayList<>(); + + newValueList.add(newFieldValue); + + return newValueList; + } + + if (! existingValueList.contains(newFieldValue)) + { + existingValueList.add(newFieldValue); + } + + return existingValueList; + } + + + /** + * Indicates that the survey action service is completely configured and can begin processing. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + @Override + public void start() throws ConnectorCheckedException + { + final String methodName = "start"; + + super.start(); + + try + { + AnnotationStore annotationStore = surveyContext.getAnnotationStore(); + SurveyOpenMetadataStore openMetadataStore = surveyContext.getOpenMetadataStore(); + SurveyAssetStore assetStore = surveyContext.getAssetStore(); + + /* + * Before performing any real work, check the type of the asset. + */ + AssetUniverse assetUniverse = assetStore.getAssetProperties(); + + if (assetUniverse == null) + { + super.throwNoAsset(assetStore.getAssetGUID(), methodName); + return; + } + else if (! propertyHelper.isTypeOf(assetUniverse, OpenMetadataType.CSV_FILE_TYPE_NAME)) + { + super.throwWrongTypeOfAsset(assetUniverse.getGUID(), + assetUniverse.getType().getTypeName(), + OpenMetadataType.CSV_FILE_TYPE_NAME, + methodName); + return; + } + + /* + * If a schema type is attached, it must be of the correct type so that information from the asset can + * be matched to it. + */ + SchemaType rootSchemaType = assetUniverse.getRootSchemaType(); + + String schemaTypeGUID; + SchemaAttributes schemaAttributes; + + if (rootSchemaType == null) + { + /* + * Set up a new schema type. + */ + schemaTypeGUID = createSchemaType(openMetadataStore, assetUniverse); + schemaAttributes = null; + } + else if (rootSchemaType instanceof NestedSchemaType nestedSchemaType) + { + /* + * There is a root schema type already. + * Check the type of the root schema is tabular and, assuming it is ok, extract its details. + */ + if (propertyHelper.isTypeOf(nestedSchemaType, schemaType)) + { + schemaTypeGUID = nestedSchemaType.getGUID(); + schemaAttributes = nestedSchemaType.getSchemaAttributes(); + } + else + { + assetStore.logAssetAuditMessage(surveyActionServiceName, "Invalid type of nested root schema: " + rootSchemaType.getClass().getName()); + + super.throwWrongTypeOfRootSchema(assetUniverse.getGUID(), + nestedSchemaType.getType().getTypeName(), + schemaType, + methodName); + return; + } + } + else + { + /* + * Throw an exception the schema type is completely wrong. + */ + assetStore.logAssetAuditMessage(surveyActionServiceName, "Invalid type of root schema: " + rootSchemaType.getClass().getName()); + + super.throwWrongTypeOfRootSchema(assetUniverse.getGUID(), + rootSchemaType.getType().getTypeName(), + schemaType, + methodName); + return; + } + + /* + * The asset should have a special connector for CSV files. If the connector is wrong, + * the cast will fail. + */ + connector = assetStore.getConnectorToAsset(); + + CSVFileStoreConnector assetConnector = (CSVFileStoreConnector)connector; + + int delimiterCount = 0; + long recordCount = assetConnector.getRecordCount(); + List columnNames = assetConnector.getColumnNames(); + + /* + * Store the key dimensions of the schema. + */ + SchemaAnalysisAnnotation schemaAnnotation = new SchemaAnalysisAnnotation(); + + schemaAnnotation.setAnnotationType("DeriveSchemaFromData"); + schemaAnnotation.setSummary("Extract schema from column names and values."); + schemaAnnotation.setSchemaName(schemaName); + schemaAnnotation.setSchemaTypeName(schemaType); + schemaAnnotation.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + + Map additionalProperties = new HashMap<>(); + + if (columnNames != null) + { + additionalProperties.put("Column Count", Integer.toString(columnNames.size())); + additionalProperties.put("Column Names", columnNames.toString()); + } + else + { + additionalProperties.put("Column Count", "0"); + additionalProperties.put("Column Names", "[]"); + } + + schemaAnnotation.setAdditionalProperties(additionalProperties); + + annotationStore.addAnnotation(schemaAnnotation, schemaTypeGUID); + + DataSourcePhysicalStatusAnnotation measurementAnnotation = new DataSourcePhysicalStatusAnnotation(); + Map measurementProperties = new HashMap<>(); + + measurementAnnotation.setAnnotationType("ExtractDataStoreProperties"); + measurementAnnotation.setSummary("Extract properties from the file."); + + measurementProperties.put("File Name", assetConnector.getFileName()); + measurementProperties.put("Record Count", Long.toString(recordCount)); + + measurementAnnotation.setModifiedTime(assetConnector.getLastUpdateDate()); + measurementAnnotation.setDataSourceProperties(measurementProperties); + measurementAnnotation.setSize(Integer.getInteger(String.valueOf(assetConnector.getFile().length()))); + + annotationStore.addAnnotation(measurementAnnotation, surveyContext.getAssetGUID()); + + /* + * Perform the analysis on the store. + */ + Map dataFields = new HashMap<>(); + + if (columnNames != null) + { + int position = 0; + + for (String columnName : columnNames) + { + if (columnName != null) + { + DataField dataField = new DataField(); + + dataField.setDataFieldPosition(position); + dataField.setDataFieldName(columnName); + + DataProfileAnnotation dataProfile = dataField.getDataProfileAnnotation(); + + dataProfile.setAnnotationType("InspectDataValues"); + dataProfile.setSummary("Iterate through values to determine values present and how often they appear."); + + dataFields.put(position, dataField); + position++; + } + } + + if (position > 0) + { + delimiterCount = position - 1; + } + + for (int recordNumber=0; recordNumber < recordCount ; recordNumber++) + { + List recordValues = assetConnector.readRecord(recordNumber); + + if ((recordValues != null) && (! recordValues.isEmpty())) + { + int columnPosition = 0; + int recordLength = 0; + + for (String fieldValue : recordValues) + { + DataField dataField = dataFields.get(columnPosition); + DataProfileAnnotation dataProfile = dataField.getDataProfileAnnotation(); + + dataField.setDataFieldType(this.getDataFieldType(dataField.getDataFieldType(), fieldValue)); + + dataProfile.setValueCount(this.getValueCount(dataProfile.getValueCount(), fieldValue)); + dataProfile.setValueList(this.getValueList(dataProfile.getValueList(), fieldValue)); + + recordLength = recordLength + fieldValue.length(); + + columnPosition++; + } + } + } + + /* + * Match the schema attributes and the annotations + */ + if (schemaAttributes == null) + { + /* + * Add a completely new schema based on the discovered columns. + */ + for (int columnNumber=0 ; columnNumber < columnNames.size(); columnNumber++) + { + String schemaAttributeGUID = this.addSchemaAttributeToSchemaType(openMetadataStore, + assetUniverse, + schemaTypeGUID, + dataFields.get(columnNumber)); + + annotationStore.addAnnotation(dataFields.get(columnNumber).getDataProfileAnnotation(), schemaAttributeGUID); + } + } + else + { + /* + * Need to match the discovered data fields with the existing schema attributes. + * The aim is to have the open metadata schema exactly match the columns found in the + * CSV file. We also want to preserve schema attributes that do match so previous annotations + * and lineage relationships are not lost. + * + * CSV files are positional. They may have multiple columns with the same names, + * so we can only cater for small changes to the schema, eg adding/deleting columns. + * A comprehensive reorganization of the columns will result in a new schema. + */ + int columnNumber = 0; + while (schemaAttributes.hasNext()) + { + SchemaAttribute schemaAttribute = schemaAttributes.next(); + boolean found = false; + + for (int i=columnNumber; i initialClassifications = new HashMap<>(); + + ElementProperties classificationProperties = propertyHelper.addStringProperty(null, + OpenMetadataProperty.SCHEMA_TYPE_NAME.name, + OpenMetadataType.PRIMITIVE_SCHEMA_TYPE_TYPE_NAME); + classificationProperties = propertyHelper.addStringProperty(classificationProperties, + OpenMetadataProperty.DATA_TYPE.name, + dataField.getDataFieldType()); + + initialClassifications.put(OpenMetadataType.TYPE_EMBEDDED_ATTRIBUTE_CLASSIFICATION_TYPE_NAME, + classificationProperties); + + return openMetadataStore.createMetadataElementInStore(OpenMetadataType.TABULAR_COLUMN_TYPE_NAME, + ElementStatus.ACTIVE, + initialClassifications, + assetUniverse.getGUID(), + null, + null, + elementProperties, + null, + schemaTypeGUID, + OpenMetadataType.TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_NAME, + null, + true); + } + + + /** + * Update the values in an existing schema attribute. + * + * @param openMetadataStore client to access the open metadata repositories + * @param schemaAttributeGUID unique identifier of the schema attribute to update + * @param dataField details of the latest retrieved values + * @throws InvalidParameterException invalid parameter + * @throws PropertyServerException repository not working + * @throws UserNotAuthorizedException insufficient security + */ + private void updateSchemaAttribute(SurveyOpenMetadataStore openMetadataStore, + String schemaAttributeGUID, + DataField dataField) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + ElementProperties elementProperties = propertyHelper.addStringProperty(null, + OpenMetadataProperty.DISPLAY_NAME.name, + dataField.getDataFieldName()); + + elementProperties = propertyHelper.addIntProperty(elementProperties, + OpenMetadataProperty.POSITION.name, + dataField.getDataFieldPosition()); + + openMetadataStore.updateMetadataElementInStore(schemaAttributeGUID, false, elementProperties); + + ElementProperties classificationProperties = propertyHelper.addStringProperty(null, + OpenMetadataProperty.SCHEMA_TYPE_NAME.name, + OpenMetadataType.PRIMITIVE_SCHEMA_TYPE_TYPE_NAME); + classificationProperties = propertyHelper.addStringProperty(classificationProperties, + OpenMetadataProperty.DATA_TYPE.name, + dataField.getDataFieldType()); + + openMetadataStore.reclassifyMetadataElementInStore(schemaAttributeGUID, + OpenMetadataType.TYPE_EMBEDDED_ATTRIBUTE_CLASSIFICATION_TYPE_NAME, + false, + classificationProperties); + } + + + + /** + * DataField acts as a cache of information about a single column in the CSV File + */ + private static class DataField + { + private String dataFieldName = null; + private String dataFieldType = null; + private int dataFieldPosition = 0; + private final DataProfileAnnotation dataProfileAnnotation = new DataProfileAnnotation(); + private String matchingSchemaAttributeGUID = null; + + + /** + * Return the name of the column. + * + * @return string + */ + public String getDataFieldName() + { + return dataFieldName; + } + + /** + * Set up the name of the column. + * + * @param dataFieldName string + */ + public void setDataFieldName(String dataFieldName) + { + this.dataFieldName = dataFieldName; + } + + + /** + * Return the type of the column as best that can be determined. + * + * @return string + */ + public String getDataFieldType() + { + return dataFieldType; + } + + + /** + * Set up the type of the column. + * + * @param dataFieldType string + */ + public void setDataFieldType(String dataFieldType) + { + this.dataFieldType = dataFieldType; + } + + + /** + * Return the position of the column in the file. + * + * @return int + */ + public int getDataFieldPosition() + { + return dataFieldPosition; + } + + + /** + * Set up the position of the column in the file. + * + * @param dataFieldPosition int + */ + public void setDataFieldPosition(int dataFieldPosition) + { + this.dataFieldPosition = dataFieldPosition; + } + + + /** + * Return the matching unique identifier for the schema attribute (if any). + * + * @return string guid + */ + public String getMatchingSchemaAttributeGUID() + { + return matchingSchemaAttributeGUID; + } + + + /** + * Set up the matching unique identifier for the schema attribute. + * + * @param matchingSchemaAttributeGUID string guid + */ + public void setMatchingSchemaAttributeGUID(String matchingSchemaAttributeGUID) + { + this.matchingSchemaAttributeGUID = matchingSchemaAttributeGUID; + } + + + /** + * Return the data profile annotation for this data field. + * + * @return data profile annotation + */ + public DataProfileAnnotation getDataProfileAnnotation() + { + return dataProfileAnnotation; + } + } + + + /** + * Free up any resources held since the connector is no longer needed. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public synchronized void disconnect() throws ConnectorCheckedException + { + if (connector != null) + { + connector.disconnect(); + } + + super.disconnect(); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryProvider.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyServiceProvider.java similarity index 54% rename from open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryProvider.java rename to open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyServiceProvider.java index 269313a4bdb..e03921e9391 100644 --- a/open-metadata-implementation/adapters/open-connectors/discovery-service-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/discoveryservices/discoverduplicates/DuplicateSuspectDiscoveryProvider.java +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/CSVSurveyServiceProvider.java @@ -1,27 +1,28 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.adapters.connectors.discoveryservices.discoverduplicates; +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveycsv; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; -import org.odpi.openmetadata.frameworks.discovery.DiscoveryServiceProvider; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceProvider; /** - * DuplicateSuspectDiscoveryProvider is the provider for the DuplicateSuspectDiscoveryService - an ODF discovery service connector. + * CSVSurveyServiceProvider provides the connector provider for the CSV Survey Action Service */ -public class DuplicateSuspectDiscoveryProvider extends DiscoveryServiceProvider +public class CSVSurveyServiceProvider extends SurveyActionServiceProvider { - static final String connectorTypeGUID = "721dd52e-bf25-4841-badb-aa3b6b4fa6ea"; - static final String connectorTypeName = "Duplicate Suspect Discovery Service Connector"; - static final String connectorTypeDescription = "Connector supports the detection of potentially duplicate assets."; + static final String connectorTypeGUID = "2a844ac9-bb86-4765-9f3c-04df148c05a5"; + static final String connectorTypeName = "CSV Survey Action Service Connector"; + static final String connectorTypeDescription = "Connector supports the schema extraction and profiling of data in a CSV file."; /** * Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific - * discovery service implementation. + * OCF Connector implementation. */ - public DuplicateSuspectDiscoveryProvider() + public CSVSurveyServiceProvider() { - String connectorClass = "org.odpi.openmetadata.adapters.connectors.discoveryservices.discoverduplicates.DuplicateSuspectDiscoveryService"; + super(); + + String connectorClass = "org.odpi.openmetadata.adapters.connectors.surveyaction.surveycsv.CSVSurveyService"; super.setConnectorClassName(connectorClass); diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/package-info.java new file mode 100644 index 00000000000..253150ee89e --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveycsv/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * CSV Survey Action Service Connector. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveycsv; \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyService.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyService.java new file mode 100644 index 00000000000..83d3d129895 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyService.java @@ -0,0 +1,131 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfile; + +import org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore; +import org.odpi.openmetadata.adapters.connectors.surveyaction.AuditableSurveyService; +import org.odpi.openmetadata.adapters.connectors.surveyaction.fileclassifier.FileClassifier; +import org.odpi.openmetadata.frameworks.connectors.Connector; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; +import org.odpi.openmetadata.frameworks.governanceaction.search.PropertyHelper; +import org.odpi.openmetadata.frameworks.surveyaction.AnnotationStore; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyAssetStore; +import org.odpi.openmetadata.frameworks.surveyaction.properties.DataSourcePhysicalStatusAnnotation; + +import java.io.File; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + + +/** + * FileSurveyService is a survey action service implementation for analysing a file to + * columns and profile the data in them. + */ +public class FileSurveyService extends AuditableSurveyService +{ + private final PropertyHelper propertyHelper = new PropertyHelper(); + + private Connector connector = null; + + + /** + * Indicates that the survey action service is completely configured and can begin processing. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + @Override + public void start() throws ConnectorCheckedException + { + final String methodName = "start"; + + super.start(); + + try + { + AnnotationStore annotationStore = surveyContext.getAnnotationStore(); + SurveyAssetStore assetStore = surveyContext.getAssetStore(); + + /* + * Before performing any real work, check the type of the asset. + */ + AssetUniverse assetUniverse = assetStore.getAssetProperties(); + + if (assetUniverse == null) + { + super.throwNoAsset(assetStore.getAssetGUID(), methodName); + return; + } + else if (! propertyHelper.isTypeOf(assetUniverse, OpenMetadataType.DATA_FILE_TYPE_NAME)) + { + super.throwWrongTypeOfAsset(assetUniverse.getGUID(), + assetUniverse.getType().getTypeName(), + OpenMetadataType.DATA_FILE_TYPE_NAME, + methodName); + return; + } + + /* + * The asset should have a special connector for files. If the connector is wrong, + * the cast will fail. + */ + connector = assetStore.getConnectorToAsset(); + BasicFileStore assetConnector = (BasicFileStore)connector; + + File file = assetConnector.getFile(); + + FileClassifier fileClassifier = new FileClassifier(surveyContext.getOpenMetadataStore(), file); + + DataSourcePhysicalStatusAnnotation measurementAnnotation = new DataSourcePhysicalStatusAnnotation(); + + measurementAnnotation.setAnnotationType("ExtractDataStoreProperties"); + measurementAnnotation.setSummary("Extract properties from the file."); + measurementAnnotation.setModifiedTime(new Date(file.lastModified())); + measurementAnnotation.setSize(Integer.getInteger(String.valueOf(file.length()))); + + Map dataSourceProperties = new HashMap<>(); + + dataSourceProperties.put(OpenMetadataProperty.FILE_NAME.name, file.getName()); + dataSourceProperties.put(OpenMetadataProperty.PATH_NAME.name, file.getAbsolutePath()); + dataSourceProperties.put(OpenMetadataProperty.FILE_EXTENSION.name, fileClassifier.getFileExtension()); + dataSourceProperties.put(OpenMetadataProperty.FILE_TYPE.name, fileClassifier.getFileType()); + dataSourceProperties.put(OpenMetadataProperty.DEPLOYED_IMPLEMENTATION_TYPE.name, fileClassifier.getDeployedImplementationType()); + dataSourceProperties.put("assetTypeName", fileClassifier.getAssetTypeName()); + dataSourceProperties.put("canRead", Boolean.toString(fileClassifier.isCanRead())); + dataSourceProperties.put("canWrite", Boolean.toString(fileClassifier.isCanWrite())); + dataSourceProperties.put("canExecute", Boolean.toString(fileClassifier.isCanExecute())); + + measurementAnnotation.setDataSourceProperties(dataSourceProperties); + + annotationStore.addAnnotation(measurementAnnotation, surveyContext.getAssetGUID()); + } + catch (ConnectorCheckedException error) + { + throw error; + } + catch (Exception error) + { + super.handleUnexpectedException(methodName, error); + } + } + + + /** + * Free up any resources held since the connector is no longer needed. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public synchronized void disconnect() throws ConnectorCheckedException + { + if (connector != null) + { + connector.disconnect(); + } + + super.disconnect(); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyServiceProvider.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyServiceProvider.java new file mode 100644 index 00000000000..8d1bf65e6cb --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/FileSurveyServiceProvider.java @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfile; + +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceProvider; + +/** + * FileSurveyServiceProvider provides the connector provider for the File Survey Action Service + */ +public class FileSurveyServiceProvider extends SurveyActionServiceProvider +{ + static final String connectorTypeGUID = "0c06ebb3-0a8f-476f-b8f8-602c01643523"; + static final String connectorTypeName = "File Survey Action Service Connector"; + static final String connectorTypeDescription = "Connector supports the extractions of basic file properties."; + + /** + * Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific + * OCF Connector implementation. + */ + public FileSurveyServiceProvider() + { + super(); + + String connectorClass = "org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfile.FileSurveyService"; + + super.setConnectorClassName(connectorClass); + + ConnectorType connectorType = new ConnectorType(); + connectorType.setType(ConnectorType.getConnectorTypeType()); + connectorType.setGUID(connectorTypeGUID); + connectorType.setQualifiedName(connectorTypeName); + connectorType.setDisplayName(connectorTypeName); + connectorType.setDescription(connectorTypeDescription); + connectorType.setConnectorProviderClassName(this.getClass().getName()); + connectorType.setSupportedAssetTypeName(supportedAssetTypeName); + + super.connectorTypeBean = connectorType; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/package-info.java new file mode 100644 index 00000000000..888a379d774 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfile/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * File Survey Action Service Connector. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfile; \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyService.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyService.java new file mode 100644 index 00000000000..4930aedd7ea --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyService.java @@ -0,0 +1,293 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfolder; + +import org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore; +import org.odpi.openmetadata.adapters.connectors.surveyaction.AuditableSurveyService; +import org.odpi.openmetadata.adapters.connectors.surveyaction.fileclassifier.FileClassifier; +import org.odpi.openmetadata.frameworks.connectors.Connector; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataValidValues; +import org.odpi.openmetadata.frameworks.governanceaction.search.PropertyHelper; +import org.odpi.openmetadata.frameworks.surveyaction.AnnotationStore; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyAssetStore; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyOpenMetadataStore; +import org.odpi.openmetadata.frameworks.surveyaction.properties.AnnotationStatus; +import org.odpi.openmetadata.frameworks.surveyaction.properties.DataProfileAnnotation; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + + +/** + * CSVSurveyService is a survey action service implementation for analysing CSV Files to + * columns and profile the data in them. + */ +public class FolderSurveyService extends AuditableSurveyService +{ + private final PropertyHelper propertyHelper = new PropertyHelper(); + private Connector connector = null; + + + private final Map fileExtensionCounts = new HashMap<>(); + private final Map fileTypeCounts = new HashMap<>(); + private final Map fileNameCounts = new HashMap<>(); + private final Map assetTypeCounts = new HashMap<>(); + private final Map deployedImplementationTypeCounts = new HashMap<>(); + private final Map canReadCounts = new HashMap<>(); + private final Map canWriteCounts = new HashMap<>(); + private final Map canExecuteCounts = new HashMap<>(); + + + /** + * Return the updated value count for this column. + * + * @param existingValueCount current value count + * @param newFieldValue next field value to process + */ + private void updateValueCount(Map existingValueCount, boolean newFieldValue) + { + Integer existingCount = existingValueCount.get(String.valueOf(newFieldValue)); + + if (existingCount == null) + { + existingValueCount.put(String.valueOf(newFieldValue), 1); + } + else + { + existingValueCount.put(String.valueOf(newFieldValue), existingCount + 1); + } + } + + + /** + * Return the updated value count for this column. + * + * @param existingValueCount current value count + * @param newFieldValue next field value to process + */ + private void updateValueCount(Map existingValueCount, String newFieldValue) + { + Integer countForValue = existingValueCount.get(newFieldValue); + + if (countForValue == null) + { + existingValueCount.put(newFieldValue, 1); + } + else + { + existingValueCount.put(newFieldValue, countForValue + 1); + } + } + + + /** + * Indicates that the survey action service is completely configured and can begin processing. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + @Override + public void start() throws ConnectorCheckedException + { + final String methodName = "start"; + + super.start(); + + try + { + AnnotationStore annotationStore = surveyContext.getAnnotationStore(); + SurveyOpenMetadataStore openMetadataStore = surveyContext.getOpenMetadataStore(); + SurveyAssetStore assetStore = surveyContext.getAssetStore(); + + /* + * Before performing any real work, check the type of the asset. + */ + AssetUniverse assetUniverse = assetStore.getAssetProperties(); + + if (assetUniverse == null) + { + super.throwNoAsset(assetStore.getAssetGUID(), methodName); + return; + } + else if (! propertyHelper.isTypeOf(assetUniverse, OpenMetadataType.FILE_FOLDER_TYPE_NAME)) + { + super.throwWrongTypeOfAsset(assetUniverse.getGUID(), + assetUniverse.getType().getTypeName(), + OpenMetadataType.FILE_FOLDER_TYPE_NAME, + methodName); + return; + } + + + /* + * The asset should have a special connector for files. If the connector is wrong, + * the cast will fail. + */ + connector = assetStore.getConnectorToAsset(); + BasicFileStore assetConnector = (BasicFileStore)connector; + + File rootFolder = assetConnector.getFile(); + + if (! rootFolder.isDirectory()) + { + throwWrongTypeOfResource(assetUniverse.getGUID(), + assetUniverse.getType().getTypeName(), + rootFolder.getName(), + "file", + "directory (folder)", + methodName); + } + + if (! rootFolder.exists()) + { + throwMissingResource(assetUniverse.getGUID(), + assetUniverse.getType().getTypeName(), + rootFolder.getName(), + methodName); + } + + /* + * Scan the folder (and sub-folders) and count up its contents + */ + profileFolder(openMetadataStore, rootFolder); + + DataProfileAnnotation dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile File Extensions"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count each file extension."); + dataProfile.setValueCount(fileExtensionCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile File Names"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count each file name."); + dataProfile.setValueCount(fileNameCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile File Types"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count each file type."); + dataProfile.setValueCount(fileTypeCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile Asset Types"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count each potential asset type if they were catalogued in open metadata."); + dataProfile.setValueCount(assetTypeCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile Deployed Implementation Types"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count each potential deployed implementation type if they were catalogued in open metadata."); + dataProfile.setValueCount(deployedImplementationTypeCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile Readable Files"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count how many are readable."); + dataProfile.setValueCount(canReadCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile Writable Files"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count how many are writable."); + dataProfile.setValueCount(canWriteCounts); + annotationStore.addAnnotation(dataProfile, null); + + dataProfile = new DataProfileAnnotation(); + + dataProfile.setAnnotationType("Profile Executable Files"); + dataProfile.setAnnotationStatus(AnnotationStatus.NEW_ANNOTATION); + dataProfile.setSummary("Iterate through files under a directory (folder) and count how many are executable."); + dataProfile.setValueCount(canExecuteCounts); + annotationStore.addAnnotation(dataProfile, null); + } + catch (ConnectorCheckedException error) + { + throw error; + } + catch (Exception error) + { + super.handleUnexpectedException(methodName, error); + } + } + + + /** + * Profile a single folder. + * + * @param openMetadataStore open metadata client + * @param fileFolder folder to profile + * @throws InvalidParameterException invalid parameter + * @throws PropertyServerException problem connecting to the open metadata repositories + * @throws UserNotAuthorizedException insufficient access + */ + private void profileFolder(SurveyOpenMetadataStore openMetadataStore, + File fileFolder) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + if ((fileFolder != null) && (fileFolder.listFiles() != null)) + { + for (File nestedFile : Objects.requireNonNull(fileFolder.listFiles())) + { + if (nestedFile.isDirectory()) + { + profileFolder(openMetadataStore, nestedFile); + } + else + { + FileClassifier fileClassifier = new FileClassifier(openMetadataStore, nestedFile); + + updateValueCount(fileExtensionCounts, fileClassifier.getFileExtension()); + updateValueCount(fileNameCounts, nestedFile.getName()); + updateValueCount(fileTypeCounts, fileClassifier.getFileType()); + updateValueCount(deployedImplementationTypeCounts, fileClassifier.getDeployedImplementationType()); + updateValueCount(assetTypeCounts, fileClassifier.getAssetTypeName()); + + updateValueCount(canReadCounts, fileClassifier.isCanRead()); + updateValueCount(canWriteCounts, fileClassifier.isCanWrite()); + updateValueCount(canExecuteCounts, fileClassifier.isCanExecute()); + } + } + } + } + + + /** + * Free up any resources held since the connector is no longer needed. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public synchronized void disconnect() throws ConnectorCheckedException + { + if (connector != null) + { + connector.disconnect(); + } + + super.disconnect(); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyServiceProvider.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyServiceProvider.java new file mode 100644 index 00000000000..86a3eac4311 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/FolderSurveyServiceProvider.java @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfolder; + +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; +import org.odpi.openmetadata.frameworks.surveyaction.SurveyActionServiceProvider; + +/** + * FolderSurveyServiceProvider provides the connector provider for the Folder Survey Action Service + */ +public class FolderSurveyServiceProvider extends SurveyActionServiceProvider +{ + static final String connectorTypeGUID = "297ede10-a004-4aa6-9af3-55e400551531"; + static final String connectorTypeName = "Folder Survey Action Service Connector"; + static final String connectorTypeDescription = "Connector supports the surveying of file in a directory (folder) and the directories beneath it."; + + /** + * Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific + * OCF Connector implementation. + */ + public FolderSurveyServiceProvider() + { + super(); + + String connectorClass = "org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfolder.FolderSurveyService"; + + super.setConnectorClassName(connectorClass); + + ConnectorType connectorType = new ConnectorType(); + connectorType.setType(ConnectorType.getConnectorTypeType()); + connectorType.setGUID(connectorTypeGUID); + connectorType.setQualifiedName(connectorTypeName); + connectorType.setDisplayName(connectorTypeName); + connectorType.setDescription(connectorTypeDescription); + connectorType.setConnectorProviderClassName(this.getClass().getName()); + connectorType.setSupportedAssetTypeName(supportedAssetTypeName); + + super.connectorTypeBean = connectorType; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/package-info.java b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/package-info.java new file mode 100644 index 00000000000..eee10de6af0 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/survey-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/surveyaction/surveyfolder/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * Folder (directory) Survey Action Service Connector. + */ +package org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfolder; \ No newline at end of file diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationBuilder.java index 75f354fbae5..6ad1d9b7b0e 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationBuilder.java @@ -412,41 +412,40 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval properties = repositoryHelper.addStringPropertyToInstance(serviceName, null, - OpenMetadataType.ANNOTATION_TYPE_PROPERTY_NAME, + OpenMetadataProperty.ANNOTATION_TYPE.name, annotationType, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.SUMMARY_PROPERTY_NAME, + OpenMetadataProperty.SUMMARY.name, summary, methodName); properties = repositoryHelper.addIntPropertyToInstance(serviceName, properties, - OpenMetadataType.CONFIDENCE_LEVEL_PROPERTY_NAME, + OpenMetadataProperty.CONFIDENCE_LEVEL.name, confidenceLevel, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.EXPRESSION_PROPERTY_NAME, + OpenMetadataProperty.EXPRESSION.name, expression, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.EXPLANATION_PROPERTY_NAME, + OpenMetadataProperty.EXPLANATION.name, explanation, methodName); - properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.ANALYSIS_STEP_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_STEP.name, analysisStep, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.JSON_PROPERTIES_PROPERTY_NAME, + OpenMetadataProperty.JSON_PROPERTIES.name, jsonProperties, methodName); properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, @@ -497,10 +496,7 @@ else if (repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataType.SEMAN { return addSemanticAnnotationInstanceProperties(properties, methodName); } - else if (repositoryHelper.isTypeOf(serviceName, typeName, OpenMetadataType.SUSPECT_DUPLICATE_ANNOTATION_TYPE_NAME)) - { - return this.addSuspectDuplicateAnnotationInstanceProperties(properties, methodName); - } + return properties; } @@ -786,7 +782,7 @@ private InstanceProperties addRequestForActionAnnotationInstanceProperties(Insta { properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.DISCOVERY_ACTIVITY_PROPERTY_NAME, + OpenMetadataType.ACTION_SOURCE_NAME, discoveryActivity, methodName); @@ -868,48 +864,4 @@ private InstanceProperties addSemanticAnnotationInstanceProperties(InstancePrope return properties; } - - - /** - * Return the supplied bean properties in an InstanceProperties object for the annotation entity. - * - * @param properties properties to fill out - * @param methodName name of the calling method - * @return InstanceProperties object - */ - private InstanceProperties addSuspectDuplicateAnnotationInstanceProperties(InstanceProperties properties, - String methodName) - { - properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, - properties, - OpenMetadataType.DUPLICATE_ANCHOR_GUIDS_PROPERTY_NAME, - duplicateAnchorGUIDs, - methodName); - - properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, - properties, - OpenMetadataType.MATCHING_PROPERTY_NAMES_PROPERTY_NAME, - matchingPropertyNames, - methodName); - - properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, - properties, - OpenMetadataType.MATCHING_CLASSIFICATION_NAMES_PROPERTY_NAME, - matchingClassificationNames, - methodName); - - properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, - properties, - OpenMetadataType.MATCHING_ATTACHMENT_GUIDS_PROPERTY_NAME, - matchingAttachmentGUIDs, - methodName); - - properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, - properties, - OpenMetadataType.MATCHING_RELATIONSHIP_GUIDS_PROPERTY_NAME, - matchingRelationshipGUIDs, - methodName); - - return properties; - } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationHandler.java index e7f7b9595af..556ad7d56a4 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationHandler.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.commonservices.generichandlers; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; @@ -90,7 +91,7 @@ public AnnotationHandler(OpenMetadataAPIGenericConverter converter, */ public List getTypesOfAnnotation() { - return repositoryHelper.getSubTypesOf(serviceName, OpenMetadataType.ANNOTATION_TYPE_NAME); + return repositoryHelper.getSubTypesOf(serviceName, OpenMetadataType.ANNOTATION.typeName); } @@ -101,7 +102,7 @@ public List getTypesOfAnnotation() */ public Map getTypesOfAnnotationDescriptions() { - List annotationTypeList = repositoryHelper.getSubTypesOf(serviceName, OpenMetadataType.ANNOTATION_TYPE_NAME); + List annotationTypeList = repositoryHelper.getSubTypesOf(serviceName, OpenMetadataType.ANNOTATION.typeName); Map annotationDescriptions = new HashMap<>(); if (annotationTypeList != null) @@ -240,14 +241,6 @@ else if (annotation instanceof SemanticAnnotation semanticAnnotation) semanticAnnotation.getCandidateGlossaryTermGUIDs(), semanticAnnotation.getCandidateGlossaryCategoryGUIDs()); } - else if (annotation instanceof SuspectDuplicateAnnotation suspectDuplicateAnnotation) - { - builder.setSuspectDuplicateSubTypeProperties(suspectDuplicateAnnotation.getDuplicateAnchorGUIDs(), - suspectDuplicateAnnotation.getMatchingPropertyNames(), - suspectDuplicateAnnotation.getMatchingClassificationNames(), - suspectDuplicateAnnotation.getMatchingAttachmentGUIDs(), - suspectDuplicateAnnotation.getMatchingRelationshipGUIDs()); - } return builder; } @@ -263,7 +256,7 @@ private String getAnnotationTypeGUID(String typeName, String methodName) throws InvalidParameterException { return invalidParameterHandler.validateTypeName(typeName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, serviceName, methodName, repositoryHelper); @@ -286,14 +279,9 @@ private String getAnnotationTypeName(Annotation annotation) { return annotation.getTypeName(); } - - if (annotation instanceof SuspectDuplicateAnnotation) - { - return OpenMetadataType.SUSPECT_DUPLICATE_ANNOTATION_TYPE_NAME; - } } - return OpenMetadataType.ANNOTATION_TYPE_NAME; + return OpenMetadataType.ANNOTATION.typeName; } @@ -401,7 +389,7 @@ public String addAnnotationToDiscoveryReport(String userId, null, annotationGUID, annotationParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, discoveryReportGUID, discoveryReportGUIDParameterName, OpenMetadataType.DISCOVERY_ANALYSIS_REPORT_TYPE_NAME, @@ -526,7 +514,7 @@ public String addAnnotationToAnnotation(String userId, EntityDetail anchorEntity = this.validateAnchorEntity(userId, parentAnnotationGUID, parentAnnotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, true, false, false, @@ -549,15 +537,15 @@ public String addAnnotationToAnnotation(String userId, null, parentAnnotationGUID, parentAnnotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, annotationGUID, annotationParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, false, false, supportedZones, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_GUID, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_NAME, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeName, null, null, null, @@ -607,8 +595,8 @@ public void updateAnnotation(String userId, null, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_GUID, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeGUID, + OpenMetadataType.ANNOTATION.typeName, false, false, supportedZones, @@ -660,8 +648,8 @@ public void addAnnotationReview(String userId, { final String annotationReviewGUIDParameterName = "annotationReviewGUID"; - String typeGUID = OpenMetadataType.ANNOTATION_REVIEW_TYPE_GUID; - String typeName = OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME; + String typeGUID = OpenMetadataType.ANNOTATION_REVIEW.typeGUID; + String typeName = OpenMetadataType.ANNOTATION_REVIEW.typeName; if (annotationReviewTypeGUID != null) { @@ -688,7 +676,7 @@ public void addAnnotationReview(String userId, EntityDetail anchorEntity = this.validateAnchorEntity(userId, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, true, false, false, @@ -718,15 +706,15 @@ public void addAnnotationReview(String userId, null, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, annotationReviewGUID, annotationReviewGUIDParameterName, - OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME, + OpenMetadataType.ANNOTATION_REVIEW.typeName, false, false, supportedZones, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_GUID, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_NAME, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeName, builder.getReviewLinkInstanceProperties(methodName), null, null, @@ -760,8 +748,8 @@ public void deleteAnnotation(String userId, null, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_GUID, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeGUID, + OpenMetadataType.ANNOTATION.typeName, null, null, false, @@ -800,7 +788,7 @@ public B getAnnotation(String userId, EntityDetail entity = repositoryHandler.getEntityByGUID(userId, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, false, false, new Date(), @@ -839,10 +827,10 @@ private B getAnnotationBean(String userId, EntityDetail annotationReviewEntity = this.getAttachedEntity(userId, annotationEntity.getGUID(), annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_GUID, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_NAME, - OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeName, + OpenMetadataType.ANNOTATION_REVIEW.typeName, 2, false, false, @@ -859,7 +847,7 @@ private B getAnnotationBean(String userId, List annotationRelationships = this.getAllAttachmentLinks(userId, annotationEntity.getGUID(), null, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, false, false, effectiveTime, @@ -907,7 +895,7 @@ private List getLinkedAnnotations(String userId, rootGUIDTypeName, relationshipTypeGUID, relationshipTypeName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, null, null, 0, @@ -1003,7 +991,7 @@ private List getLinkedAnnotations(String userId, if ((relationship != null) && (relationship.getProperties() != null)) { int annotationStatusOrdinal = repositoryHelper.getEnumPropertyOrdinal(serviceName, - OpenMetadataType.ANNOTATION_STATUS_PROPERTY_NAME, + OpenMetadataProperty.ANNOTATION_STATUS.name, relationship.getProperties(), methodName); @@ -1018,7 +1006,7 @@ private List getLinkedAnnotations(String userId, EntityDetail annotationEntity = repositoryHandler.getEntityByGUID(userId, entityProxy.getGUID(), entityProxyGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, false, false, effectiveTime, @@ -1153,9 +1141,9 @@ public List getExtendedAnnotations(String userId, return this.getLinkedAnnotations(userId, annotationGUID, annotationGUIDParameter, - OpenMetadataType.ANNOTATION_TYPE_NAME, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_GUID, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeName, startingFrom, pageSize, methodName); @@ -1192,9 +1180,9 @@ public List getExtendedAnnotations(String userId, return this.getLinkedAnnotations(userId, annotationGUID, annotationGUIDParameter, - OpenMetadataType.ANNOTATION_TYPE_NAME, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_GUID, - OpenMetadataType.ANNOTATION_TO_EXTENSION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeName, annotationStatus, startingFrom, pageSize, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationReviewBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationReviewBuilder.java index d52dc577b62..b69d666b1b9 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationReviewBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AnnotationReviewBuilder.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.commonservices.generichandlers; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataProperty; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; @@ -85,15 +86,15 @@ public InstanceProperties getReviewLinkInstanceProperties(String methodName) th { properties = repositoryHelper.addEnumPropertyToInstance(serviceName, null, - OpenMetadataType.ANNOTATION_STATUS_PROPERTY_NAME, - OpenMetadataType.ASSET_OWNER_TYPE_ENUM_TYPE_GUID, - OpenMetadataType.ASSET_OWNER_TYPE_ENUM_TYPE_NAME, + OpenMetadataProperty.ANNOTATION_STATUS.name, + OpenMetadataType.ANNOTATION_STATUS_ENUM_TYPE_GUID, + OpenMetadataType.ANNOTATION_STATUS_ENUM_TYPE_NAME, annotationStatus, methodName); } catch (TypeErrorException error) { - errorHandler.handleUnsupportedType(error, methodName, OpenMetadataType.ASSET_OWNER_TYPE_ENUM_TYPE_NAME); + errorHandler.handleUnsupportedType(error, methodName, OpenMetadataType.ANNOTATION_STATUS_ENUM_TYPE_NAME); } return properties; @@ -111,32 +112,21 @@ public InstanceProperties getInstanceProperties(String methodName) { InstanceProperties properties = new InstanceProperties(); - if (reviewDate != null) - { - properties = repositoryHelper.addDatePropertyToInstance(serviceName, - properties, - OpenMetadataType.REVIEW_DATE_PROPERTY_NAME, - reviewDate, - methodName); - } - - if (steward != null) - { - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataType.STEWARD_PROPERTY_NAME, - steward, - methodName); - } - - if (reviewComment != null) - { - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataType.COMMENT_PROPERTY_NAME, - reviewComment, - methodName); - } + properties = repositoryHelper.addDatePropertyToInstance(serviceName, + properties, + OpenMetadataProperty.REVIEW_DATE.name, + reviewDate, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataProperty.STEWARD.name, + steward, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataProperty.COMMENT.name, + reviewComment, + methodName); return properties; } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java index fb1002bcbfc..46e9061e604 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java @@ -634,7 +634,7 @@ public String addAssetFromTemplate(String userId, { extendedProperties = new HashMap<>(); - extendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + extendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); } AssetBuilder builder = new AssetBuilder(qualifiedName, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DataFieldHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DataFieldHandler.java index a5a3c91033b..f607fc764f5 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DataFieldHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DataFieldHandler.java @@ -650,7 +650,7 @@ public String addDataFieldToDiscoveryReport(String userId, externalSourceName, annotationGUID, annotationGUIDParameterName, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, OpenMetadataType.DISCOVERED_DATA_FIELD_TYPE_GUID, OpenMetadataType.DISCOVERED_DATA_FIELD_TYPE_NAME, dataFieldPosition, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportBuilder.java index a6a255eb8b3..0b10846a583 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportBuilder.java @@ -104,7 +104,7 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, properties, - OpenMetadataType.ANALYSIS_PARAMS_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_PARAMETERS.name, analysisParameters, methodName); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportHandler.java index 1bb2d237c57..4ac89869a91 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/DiscoveryAnalysisReportHandler.java @@ -139,7 +139,7 @@ public String createDiscoveryAnalysisReport(String userId, repositoryHandler.getEntityByGUID(userId, discoveryEngineGUIDParameterName, assetGUID, - OpenMetadataType.DISCOVERY_ENGINE_TYPE_NAME, + OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeName, forLineage, forDuplicateProcessing, effectiveTime, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionBuilder.java index d2c806deb67..1aa41dd86d8 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionBuilder.java @@ -224,13 +224,13 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, requestType, methodName); properties = repositoryHelper.addStringMapPropertyToInstance(serviceName, properties, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, requestParameters, methodName); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionHandler.java index d121776b649..28f39039e03 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/EngineActionHandler.java @@ -319,12 +319,12 @@ private String prepareEngineActionFromProcessStep(String userId, governanceActionProcessStepExecutorRelationship.getEntityTwoProxy().getUniqueProperties(), methodName); String requestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, governanceActionProcessStepExecutorRelationship.getProperties(), methodName); Map requestParameters = repositoryHelper.getStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, governanceActionProcessStepExecutorRelationship.getProperties(), methodName); @@ -1117,8 +1117,8 @@ private String validateGovernanceEngineName(String userId, governanceEngineName, governanceEngineNameParameterName, OpenMetadataProperty.QUALIFIED_NAME.name, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_GUID, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeGUID, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, false, false, serviceSupportedZones, @@ -1138,11 +1138,11 @@ private String validateGovernanceEngineName(String userId, List relationships = this.getAttachmentLinks(userId, governanceEngineGUID, governanceEngineNameParameterName, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID, - OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID, + OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, null, - OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_SERVICE.typeName, 2, false, false, @@ -1167,7 +1167,7 @@ private String validateGovernanceEngineName(String userId, for (Relationship relationship : relationships) { String relationshipRequestType = repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, relationship.getProperties(), methodName); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java index 426de892c49..31bede0262e 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java @@ -422,7 +422,7 @@ private String createFolder(String userId, Map extendedProperties = new HashMap<>(); - extendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + extendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); return folderHandler.createAssetWithConnection(userId, externalSourceGUID, @@ -508,9 +508,9 @@ private String createFileAsset(String userId, extendedProperties = new HashMap<>(initialExtendedProperties); } - extendedProperties.put(OpenMetadataType.FILE_TYPE_PROPERTY_NAME, fileType); - extendedProperties.put(OpenMetadataType.FILE_NAME_PROPERTY_NAME, fileName); - extendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + extendedProperties.put(OpenMetadataProperty.FILE_TYPE.name, fileType); + extendedProperties.put(OpenMetadataProperty.FILE_NAME.name, fileName); + extendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); String fileAssetTypeName = OpenMetadataType.DATA_FILE_TYPE_NAME; if (typeName != null) @@ -1609,7 +1609,7 @@ private Map getExtendedProperties(String pathName, if (pathName != null) { - assetExtendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + assetExtendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); } if (createTime != null) @@ -1644,7 +1644,7 @@ private Map getExtendedProperties(String pathName, if (fileType != null) { - assetExtendedProperties.put(OpenMetadataType.FILE_TYPE_PROPERTY_NAME, fileType); + assetExtendedProperties.put(OpenMetadataProperty.FILE_TYPE.name, fileType); } if (assetExtendedProperties.isEmpty()) @@ -2356,7 +2356,7 @@ public List addCSVFileToCatalog(String userId, Map extendedProperties = new HashMap<>(); extendedProperties.put(OpenMetadataType.DELIMITER_CHARACTER_PROPERTY_NAME, delimiterCharacter.toString()); extendedProperties.put(OpenMetadataType.QUOTE_CHARACTER_PROPERTY_NAME, quoteCharacter.toString()); - extendedProperties.put(OpenMetadataType.FILE_TYPE_PROPERTY_NAME, fileType); + extendedProperties.put(OpenMetadataProperty.FILE_TYPE.name, fileType); Map configurationProperties = new HashMap<>(); @@ -2589,7 +2589,7 @@ public void updateFileInCatalog(String userId, assetExtendedProperties = new HashMap<>(); } - assetExtendedProperties.put(OpenMetadataType.FILE_NAME_PROPERTY_NAME, this.getFileName(fullPath)); + assetExtendedProperties.put(OpenMetadataProperty.FILE_NAME.name, this.getFileName(fullPath)); } fileHandler.updateAsset(userId, @@ -3183,7 +3183,7 @@ private String getFolderGUIDByPathName(String userId, final String pathNameParameterName = "pathName"; List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); List entities = fileHandler.getEntitiesByValue(userId, pathName, @@ -3249,7 +3249,7 @@ public FOLDER getFolderByPathName(String userId, final String pathNameParameterName = "pathName"; List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); List folders = folderHandler.getBeansByValue(userId, pathName, @@ -3320,7 +3320,7 @@ public List findFoldersByPathName(String userId, final String pathNameParameterName = "pathName"; List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); return folderHandler.getBeansByValue(userId, pathName, @@ -3645,7 +3645,7 @@ public FILE getDataFileByPathName(String userId, PropertyServerException { List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); List files = fileHandler.getBeansByValue(userId, pathName, @@ -3716,7 +3716,7 @@ public List findDataFilesByPathName(String userId, PropertyServerException { List specificMatchPropertyNames = new ArrayList<>(); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); return fileHandler.getBeansByValue(userId, pathName, @@ -3772,7 +3772,7 @@ public List findDataFilesByName(String userId, List specificMatchPropertyNames = new ArrayList<>(); specificMatchPropertyNames.add(OpenMetadataProperty.QUALIFIED_NAME.name); specificMatchPropertyNames.add(OpenMetadataProperty.DISPLAY_NAME.name); - specificMatchPropertyNames.add(OpenMetadataType.PATH_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataProperty.PATH_NAME.name); return fileHandler.getBeansByValue(userId, name, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceActionProcessStepHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceActionProcessStepHandler.java index 8e91692435a..ea03786d5ea 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceActionProcessStepHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GovernanceActionProcessStepHandler.java @@ -212,13 +212,13 @@ private void linkGovernanceActionExecutor(String userId, InstanceProperties relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, null, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, requestType, methodName); relationshipProperties = repositoryHelper.addStringMapPropertyToInstance(serviceName, relationshipProperties, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, requestParameters, methodName); @@ -230,7 +230,7 @@ private void linkGovernanceActionExecutor(String userId, OpenMetadataType.GOVERNANCE_ACTION_PROCESS_STEP_TYPE_NAME, governanceEngineGUID, governanceEngineGUIDParameterName, - OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ENGINE.typeName, forLineage, forDuplicateProcessing, serviceSupportedZones, @@ -483,13 +483,13 @@ private void updateExecutorRelationship(String userId, relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, relationshipProperties, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, requestType, methodName); relationshipProperties = repositoryHelper.addStringMapPropertyToInstance(serviceName, relationshipProperties, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, requestParameters, methodName); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ODFConverter.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ODFConverter.java index c477a041f26..39e29ad573c 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ODFConverter.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ODFConverter.java @@ -88,30 +88,6 @@ else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType { return getNewDataSourceMeasurementAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_VALUE_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentValueAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_CLASSIFICATION_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentClassificationAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_RELATIONSHIP_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentRelationshipAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_ATTACHMENT_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentAttachmentValueAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_ATTACHMENT_CLASS_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentAttachmentClassificationAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.DIVERGENT_ATTACHMENT_REL_ANNOTATION_TYPE_NAME)) - { - return getNewDivergentAttachmentRelationshipAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.QUALITY_ANNOTATION_TYPE_NAME)) { return getNewQualityAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); @@ -132,11 +108,7 @@ else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType { return getNewSemanticAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.SUSPECT_DUPLICATE_ANNOTATION_TYPE_NAME)) - { - return getNewSuspectDuplicateAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); - } - else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.ANNOTATION_TYPE_NAME)) + else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.ANNOTATION.typeName)) { return getNewAnnotation(beanClass, primaryEntity, supplementaryEntities, relationships, methodName); } @@ -145,7 +117,7 @@ else if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType /* * This will throw an exception */ - super.validateInstanceType(OpenMetadataType.ANNOTATION_TYPE_NAME, + super.validateInstanceType(OpenMetadataType.ANNOTATION.typeName, beanClass.getName(), primaryEntity, methodName); @@ -496,310 +468,6 @@ private Annotation getNewDataSourcePhysicalStatusAnnotation(Class b } - /** - * Using the supplied instances, return a new instance of the DivergentValueAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentValueAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentValueAnnotation annotation = new DivergentValueAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentPropertyNames(this.removeDivergentPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - - /** - * Using the supplied instances, return a new instance of the DivergentClassificationAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentClassificationAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentClassificationAnnotation annotation = new DivergentClassificationAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentClassificationName(this.removeDivergentClassificationName(remainingProperties)); - annotation.setDivergentClassificationPropertyNames(this.removeDivergentClassificationPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - - /** - * Using the supplied instances, return a new instance of the DivergentRelationshipAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentRelationshipAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentRelationshipAnnotation annotation = new DivergentRelationshipAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentRelationshipGUID(this.removeDivergentRelationshipGUID(remainingProperties)); - annotation.setDivergentRelationshipPropertyNames(this.removeDivergentRelationshipPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - - /** - * Using the supplied instances, return a new instance of the DivergentValueAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentAttachmentValueAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentAttachmentValueAnnotation annotation = new DivergentAttachmentValueAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setAttachmentGUID(this.removeAttachmentGUID(remainingProperties)); - annotation.setDuplicateAttachmentGUID(this.removeDuplicateAttachmentGUID(remainingProperties)); - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentPropertyNames(this.removeDivergentPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - - /** - * Using the supplied instances, return a new instance of the DivergentClassificationAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentAttachmentClassificationAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentAttachmentClassificationAnnotation annotation = new DivergentAttachmentClassificationAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setAttachmentGUID(this.removeAttachmentGUID(remainingProperties)); - annotation.setDuplicateAttachmentGUID(this.removeDuplicateAttachmentGUID(remainingProperties)); - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentClassificationName(this.removeDivergentClassificationName(remainingProperties)); - annotation.setDivergentClassificationPropertyNames(this.removeDivergentClassificationPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - - /** - * Using the supplied instances, return a new instance of the DivergentRelationshipAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewDivergentAttachmentRelationshipAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - DivergentAttachmentRelationshipAnnotation annotation = new DivergentAttachmentRelationshipAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setAttachmentGUID(this.removeAttachmentGUID(remainingProperties)); - annotation.setDuplicateAttachmentGUID(this.removeDuplicateAttachmentGUID(remainingProperties)); - annotation.setDuplicateAnchorGUID(this.removeDuplicateAnchorGUID(remainingProperties)); - annotation.setDivergentRelationshipGUID(this.removeDivergentRelationshipGUID(remainingProperties)); - annotation.setDivergentRelationshipPropertyNames(this.removeDivergentClassificationPropertyNames(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - /** * Using the supplied instances, return a new instance of the QualityAnnotation bean. * @@ -1067,58 +735,6 @@ private Annotation getNewSemanticAnnotation(Class beanClass, } - /** - * Using the supplied instances, return a new instance of the SuspectDuplicateAnnotation bean. - * - * @param beanClass name of the class to create - * @param primaryEntity entity that is the root of the collection of entities that make up the - * content of the bean - * @param supplementaryEntities entities connected to the primary entity by the relationships - * @param relationships relationships linking the entities - * @param methodName calling method - * @return bean populated with properties from the instances supplied in the constructor - * @throws PropertyServerException there is a problem instantiating the bean - */ - private Annotation getNewSuspectDuplicateAnnotation(Class beanClass, - EntityDetail primaryEntity, - List supplementaryEntities, - List relationships, - String methodName) throws PropertyServerException - { - try - { - SuspectDuplicateAnnotation annotation = new SuspectDuplicateAnnotation(); - - InstanceProperties remainingProperties = fillInCommonAnnotationProperties(beanClass, - annotation, - primaryEntity, - supplementaryEntities, - relationships, - methodName); - - annotation.setDuplicateAnchorGUIDs(this.removeDuplicateAnchorGUIDs(remainingProperties)); - annotation.setMatchingPropertyNames(this.removeMatchingPropertyNames(remainingProperties)); - annotation.setMatchingClassificationNames(this.removeMatchingClassificationNames(remainingProperties)); - annotation.setMatchingAttachmentGUIDs(this.removeMatchingAttachmentGUIDs(remainingProperties)); - annotation.setMatchingRelationshipGUIDs(this.removeMatchingRelationshipGUIDs(remainingProperties)); - - /* - * Any remaining properties are returned in the extended properties. They are - * assumed to be defined in a subtype. - */ - annotation.setExtendedProperties(this.getRemainingExtendedProperties(remainingProperties)); - - return annotation; - } - catch (ClassCastException error) - { - super.handleInvalidBeanClass(beanClass.getName(), error, methodName); - } - - return null; - } - - /** * Using the supplied instances, return a new instance of the SchemaAnalysisAnnotation bean. * @@ -1214,7 +830,7 @@ private InstanceProperties fillInCommonAnnotationProperties(Class b { String actualTypeName = entity.getType().getTypeDefName(); - if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME)) + if (repositoryHelper.isTypeOf(serviceName, actualTypeName, OpenMetadataType.ANNOTATION_REVIEW.typeName)) { InstanceProperties properties = new InstanceProperties(entity.getProperties()); @@ -1232,7 +848,7 @@ private InstanceProperties fillInCommonAnnotationProperties(Class b { if (relationship != null) { - if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_NAME)) + if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeName)) { annotation.setAnnotationStatus(this.getAnnotationStatusFromProperties(instanceProperties)); } @@ -1258,12 +874,10 @@ private AnnotationStatus getAnnotationStatusFromProperties(InstanceProperties { Map instancePropertiesMap = properties.getInstanceProperties(); - InstancePropertyValue instancePropertyValue = instancePropertiesMap.get(OpenMetadataType.ANNOTATION_STATUS_PROPERTY_NAME); + InstancePropertyValue instancePropertyValue = instancePropertiesMap.get(OpenMetadataProperty.ANNOTATION_STATUS.name); - if (instancePropertyValue instanceof EnumPropertyValue) + if (instancePropertyValue instanceof EnumPropertyValue enumPropertyValue) { - EnumPropertyValue enumPropertyValue = (EnumPropertyValue) instancePropertyValue; - switch (enumPropertyValue.getOrdinal()) { case 0: diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java index ec6f881e5fe..2cae6eb92d2 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java @@ -3246,7 +3246,7 @@ protected String removePathName(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.getStringProperty(serviceName, - OpenMetadataType.PATH_NAME_PROPERTY_NAME, + OpenMetadataProperty.PATH_NAME.name, instanceProperties, methodName); } @@ -3509,7 +3509,7 @@ protected String removeFileType(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, instanceProperties, methodName); } @@ -5389,7 +5389,7 @@ protected String removeRequestType(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, instanceProperties, methodName); } @@ -5411,7 +5411,7 @@ protected String removeServiceRequestType(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, instanceProperties, methodName); } @@ -5434,7 +5434,7 @@ protected Map removeRequestParameters(InstanceProperties instanc if (instanceProperties != null) { return repositoryHelper.removeStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, instanceProperties, methodName); } @@ -6785,7 +6785,7 @@ protected Map removeAnalysisParameters(InstanceProperties instan if (instanceProperties != null) { return repositoryHelper.removeStringMapFromProperty(serviceName, - OpenMetadataType.ANALYSIS_PARAMS_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_PARAMETERS.name, instanceProperties, methodName); } @@ -6807,7 +6807,7 @@ protected String removeAnalysisStep(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.ANALYSIS_STEP_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_STEP.name, instanceProperties, methodName); } @@ -6829,7 +6829,7 @@ protected String removeAnnotationType(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.ANNOTATION_TYPE_PROPERTY_NAME, + OpenMetadataProperty.ANNOTATION_TYPE.name, instanceProperties, methodName); } @@ -6851,7 +6851,7 @@ protected int removeConfidenceLevel(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeIntProperty(serviceName, - OpenMetadataType.CONFIDENCE_LEVEL_PROPERTY_NAME, + OpenMetadataProperty.CONFIDENCE_LEVEL.name, instanceProperties, methodName); } @@ -6895,7 +6895,7 @@ protected String removeExpression(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.ANNOTATION_TYPE_PROPERTY_NAME, + OpenMetadataProperty.EXPRESSION.name, instanceProperties, methodName); } @@ -6917,7 +6917,7 @@ protected String removeExplanation(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.EXPLANATION_PROPERTY_NAME, + OpenMetadataProperty.EXPLANATION.name, instanceProperties, methodName); } @@ -6939,7 +6939,7 @@ protected String removeJsonProperties(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.JSON_PROPERTIES_PROPERTY_NAME, + OpenMetadataProperty.JSON_PROPERTIES.name, instanceProperties, methodName); } @@ -6961,7 +6961,7 @@ protected Date removeReviewDate(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeDateProperty(serviceName, - OpenMetadataType.REVIEW_DATE_PROPERTY_NAME, + OpenMetadataProperty.REVIEW_DATE.name, instanceProperties, methodName); } @@ -6983,7 +6983,7 @@ protected String removeSteward(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.STEWARD_PROPERTY_NAME, + OpenMetadataProperty.STEWARD.name, instanceProperties, methodName); } @@ -7005,7 +7005,7 @@ protected String removeComment(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.COMMENT_PROPERTY_NAME, + OpenMetadataProperty.COMMENT.name, instanceProperties, methodName); } @@ -7522,141 +7522,6 @@ protected int removeQualityScore(InstanceProperties instanceProperties) } - - /** - * Extract and delete the duplicateAnchorGUID standing property from the supplied instance properties. - * - * @param instanceProperties properties from entity - * @return string text or null - */ - protected String removeDuplicateAnchorGUID(InstanceProperties instanceProperties) - { - final String methodName = "removeDuplicateAnchorGUID"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.DUPLICATE_ANCHOR_GUID_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentPropertyNames property from the supplied instance properties. - * - * @param instanceProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentPropertyNames(InstanceProperties instanceProperties) - { - final String methodName = "removeDivergentPropertyNames"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_PROPERTY_NAMES_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - /** - * Extract and delete the divergentClassificationName standing property from the supplied instance properties. - * - * @param instanceProperties properties from entity - * @return string text or null - */ - protected String removeDivergentClassificationName(InstanceProperties instanceProperties) - { - final String methodName = "removeDivergentClassificationName"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.DIVERGENT_CLASSIFICATION_NAME_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentClassificationPropertyNames property from the supplied instance properties. - * - * @param instanceProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentClassificationPropertyNames(InstanceProperties instanceProperties) - { - final String methodName = "removeDivergentClassificationPropertyNames"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_CLASSIFICATION_PROPERTY_NAMES_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - - /** - * Extract and delete the divergentRelationshipGUID standing property from the supplied instance properties. - * - * @param instanceProperties properties from entity - * @return string text or null - */ - protected String removeDivergentRelationshipGUID(InstanceProperties instanceProperties) - { - final String methodName = "removeDivergentRelationshipGUID"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.DIVERGENT_RELATIONSHIP_GUID_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentRelationshipPropertyNames property from the supplied instance properties. - * - * @param instanceProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentRelationshipPropertyNames(InstanceProperties instanceProperties) - { - final String methodName = "removeDivergentRelationshipPropertyNames"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_RELATIONSHIP_PROPERTY_NAMES_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - - /** * Extract and delete the attachmentGUID standing property from the supplied instance properties. * @@ -7679,28 +7544,6 @@ protected String removeAttachmentGUID(InstanceProperties instanceProperties) } - /** - * Extract and delete the duplicateAttachmentGUID standing property from the supplied instance properties. - * - * @param instanceProperties properties from entity - * @return string text or null - */ - protected String removeDuplicateAttachmentGUID(InstanceProperties instanceProperties) - { - final String methodName = "removeDuplicateAttachmentGUID"; - - if (instanceProperties != null) - { - return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.DUPLICATE_ATTACHMENT_GUID_PROPERTY_NAME, - instanceProperties, - methodName); - } - - return null; - } - - /** * Extract and delete the relatedEntityGUID standing property from the supplied instance properties. * @@ -7801,7 +7644,7 @@ protected String removeDiscoveryActivity(InstanceProperties instanceProperties) if (instanceProperties != null) { return repositoryHelper.removeStringProperty(serviceName, - OpenMetadataType.DISCOVERY_ACTIVITY_PROPERTY_NAME, + OpenMetadataType.ACTION_SOURCE_NAME, instanceProperties, methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java index a07667fbc71..fb8336eaf2d 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java @@ -2481,7 +2481,7 @@ private AnchorIdentifiers getAnchorGUIDForAnnotation(String userId, */ List relationships = repositoryHandler.getRelationshipsByType(userId, annotationGUID, - OpenMetadataType.ANNOTATION_TYPE_NAME, + OpenMetadataType.ANNOTATION.typeName, null, null, 1, @@ -2513,7 +2513,7 @@ else if (repositoryHelper.isTypeOf(serviceName, proxy.getType().getTypeDefName() return parentAnchorIdentifiers; } } - else if (repositoryHelper.isTypeOf(serviceName, proxy.getType().getTypeDefName(), OpenMetadataType.ANNOTATION_TYPE_NAME)) + else if (repositoryHelper.isTypeOf(serviceName, proxy.getType().getTypeDefName(), OpenMetadataType.ANNOTATION.typeName)) { return this.getAnchorGUIDForAnnotation(userId, proxy.getGUID(), forLineage, forDuplicateProcessing, effectiveTime, methodName); } @@ -2557,10 +2557,10 @@ private AnchorIdentifiers getAnchorGUIDForAnnotationReview(String userId, */ Relationship relationship = repositoryHandler.getUniqueRelationshipByType(userId, annotationReviewGUID, - OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME, + OpenMetadataType.ANNOTATION_REVIEW.typeName, false, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_GUID, - OpenMetadataType.ANNOTATION_REVIEW_LINK_TYPE_NAME, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeGUID, + OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeName, forLineage, forDuplicateProcessing, effectiveTime, @@ -2911,11 +2911,11 @@ else if (repositoryHelper.isTypeOf(serviceName, targetTypeName, OpenMetadataType { anchorIdentifiers = this.getAnchorGUIDForOpenDiscoveryAnalysisReport(localServerUserId, targetGUID, forLineage, forDuplicateProcessing, effectiveTime, methodName); } - else if (repositoryHelper.isTypeOf(serviceName, targetTypeName, OpenMetadataType.ANNOTATION_TYPE_NAME)) + else if (repositoryHelper.isTypeOf(serviceName, targetTypeName, OpenMetadataType.ANNOTATION.typeName)) { anchorIdentifiers = this.getAnchorGUIDForAnnotation(localServerUserId, targetGUID, forLineage, forDuplicateProcessing, effectiveTime, methodName); } - else if (repositoryHelper.isTypeOf(serviceName, targetTypeName, OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME)) + else if (repositoryHelper.isTypeOf(serviceName, targetTypeName, OpenMetadataType.ANNOTATION_REVIEW.typeName)) { anchorIdentifiers = this.getAnchorGUIDForAnnotationReview(localServerUserId, targetGUID, forLineage, forDuplicateProcessing, effectiveTime, methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java index 746536bfbfb..374dc7aaac8 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java @@ -30,9 +30,9 @@ public class ReferenceableBuilder extends OpenMetadataAPIGenericBuilder * @param serviceName name of this OMAS * @param serverName name of local server */ - protected ReferenceableBuilder(OMRSRepositoryHelper repositoryHelper, - String serviceName, - String serverName) + public ReferenceableBuilder(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) { super(OpenMetadataType.REFERENCEABLE.typeGUID, OpenMetadataType.REFERENCEABLE.typeName, @@ -512,11 +512,11 @@ public void setMemento(String userId, * @param methodName name of the calling method * @return InstanceProperties object */ - InstanceProperties getMementoProperties(Date archiveDate, - String archiveUser, - String archiveProcess, - Map archiveProperties, - String methodName) + public InstanceProperties getMementoProperties(Date archiveDate, + String archiveUser, + String archiveProcess, + Map archiveProperties, + String methodName) { InstanceProperties properties = repositoryHelper.addDatePropertyToInstance(serviceName, null, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java index a4144862084..68c67674ec2 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java @@ -305,7 +305,7 @@ public String createDatabase(String userId, assetExtendedProperties.putAll(extendedProperties); } - assetExtendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + assetExtendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); assetExtendedProperties.put(OpenMetadataType.STORE_CREATE_TIME_PROPERTY_NAME, createTime); assetExtendedProperties.put(OpenMetadataType.STORE_UPDATE_TIME_PROPERTY_NAME, modifiedTime); assetExtendedProperties.put(OpenMetadataType.DATABASE_TYPE_PROPERTY_NAME, databaseType); @@ -505,7 +505,7 @@ public String createDatabase(String userId, assetExtendedProperties.putAll(extendedProperties); } - assetExtendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + assetExtendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); assetExtendedProperties.put(OpenMetadataType.STORE_CREATE_TIME_PROPERTY_NAME, createTime); assetExtendedProperties.put(OpenMetadataType.STORE_UPDATE_TIME_PROPERTY_NAME, modifiedTime); assetExtendedProperties.put(OpenMetadataType.DATABASE_TYPE_PROPERTY_NAME, databaseType); @@ -979,7 +979,7 @@ public void updateDatabase(String userId, assetExtendedProperties.putAll(extendedProperties); } - assetExtendedProperties.put(OpenMetadataType.PATH_NAME_PROPERTY_NAME, pathName); + assetExtendedProperties.put(OpenMetadataProperty.PATH_NAME.name, pathName); assetExtendedProperties.put(OpenMetadataType.STORE_CREATE_TIME_PROPERTY_NAME, createTime); assetExtendedProperties.put(OpenMetadataType.STORE_UPDATE_TIME_PROPERTY_NAME, modifiedTime); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SchemaAttributeHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SchemaAttributeHandler.java index 78882ae67e5..5ec027f7107 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SchemaAttributeHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/SchemaAttributeHandler.java @@ -1227,7 +1227,7 @@ private List getSchemaAttributeRelationships(String userId, { results.add(relationship); } - else if (OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_NAME.equals(typeName)) + else if (OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.typeName.equals(typeName)) { results.add(relationship); } diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-api/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/rest/ArchiveRequestBody.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-api/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/rest/ArchiveRequestBody.java new file mode 100644 index 00000000000..b13ac12b034 --- /dev/null +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-api/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/rest/ArchiveRequestBody.java @@ -0,0 +1,125 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.frameworkservices.gaf.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.frameworks.governanceaction.properties.ArchiveProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ArchiveRequestBody provides a structure for passing the archive information for a metadata element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ArchiveRequestBody extends UpdateRequestBody +{ + private ArchiveProperties archiveProperties = null; + + + /** + * Default constructor + */ + public ArchiveRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ArchiveRequestBody(ArchiveRequestBody template) + { + super(template); + + if (template != null) + { + archiveProperties = template.getArchiveProperties(); + } + } + + + /** + * Return the archive properties. + * + * @return properties + */ + public ArchiveProperties getArchiveProperties() + { + return archiveProperties; + } + + + /** + * Set up the archive properties. + * + * @param archiveProperties properties + */ + public void setArchiveProperties(ArchiveProperties archiveProperties) + { + this.archiveProperties = archiveProperties; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "ArchiveRequestBody{" + + "archiveProperties=" + archiveProperties + + "} " + super.toString(); + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + ArchiveRequestBody that = (ArchiveRequestBody) objectToCompare; + return archiveProperties == that.archiveProperties; + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), archiveProperties); + } +} diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/OpenMetadataClientBase.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/OpenMetadataClientBase.java index 29aee26b985..b17e440ec71 100644 --- a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/OpenMetadataClientBase.java +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/OpenMetadataClientBase.java @@ -1680,6 +1680,93 @@ public void deleteMetadataElementInStore(String userId, } + /** + * Archive a specific metadata element. + * + * @param userId caller's userId + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void archiveMetadataElementInStore(String userId, + String metadataElementGUID, + ArchiveProperties archiveProperties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.archiveMetadataElementInStore(userId, + null, + null, + metadataElementGUID, + archiveProperties, + forLineage, + forDuplicateProcessing, + effectiveTime); + } + + + /** + * Archive a specific metadata element. + * + * @param userId caller's userId + * @param externalSourceGUID unique identifier of the software capability that owns this collection + * @param externalSourceName unique name of the software capability that owns this collection + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void archiveMetadataElementInStore(String userId, + String externalSourceGUID, + String externalSourceName, + String metadataElementGUID, + ArchiveProperties archiveProperties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "archiveMetadataElementInStore"; + final String guidParameterName = "metadataElementGUID"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/framework-services/{1}/open-metadata-store/users/{2}/metadata-elements/{3}/archive"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); + + ArchiveRequestBody requestBody = new ArchiveRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setForLineage(forLineage); + requestBody.setForDuplicateProcessing(forDuplicateProcessing); + requestBody.setEffectiveTime(effectiveTime); + requestBody.setArchiveProperties(archiveProperties); + + restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + serviceURLMarker, + userId, + metadataElementGUID); + } + + /** * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to * a metadata element. diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/converters/OpenMetadataConverterBase.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/converters/OpenMetadataConverterBase.java index ea536ee7a46..4ad7bda05ab 100644 --- a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/converters/OpenMetadataConverterBase.java +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/client/converters/OpenMetadataConverterBase.java @@ -2942,7 +2942,7 @@ protected String removePathName(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.getStringProperty(serviceName, - OpenMetadataType.PATH_NAME_PROPERTY_NAME, + OpenMetadataProperty.PATH_NAME.name, elementProperties, methodName); } @@ -3205,7 +3205,7 @@ protected String removeFileType(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, elementProperties, methodName); } @@ -5005,7 +5005,7 @@ protected String removeRequestType(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_TYPE.name, elementProperties, methodName); } @@ -5027,7 +5027,7 @@ protected String removeServiceRequestType(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, + OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, elementProperties, methodName); } @@ -5050,7 +5050,7 @@ protected Map removeRequestParameters(ElementProperties elementP if (elementProperties != null) { return propertyHelper.removeStringMapFromProperty(serviceName, - OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, + OpenMetadataProperty.REQUEST_PARAMETERS.name, elementProperties, methodName); } @@ -6317,7 +6317,7 @@ protected Map removeAnalysisParameters(ElementProperties element if (elementProperties != null) { return propertyHelper.removeStringMapFromProperty(serviceName, - OpenMetadataType.ANALYSIS_PARAMS_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_PARAMETERS.name, elementProperties, methodName); } @@ -6329,7 +6329,7 @@ protected Map removeAnalysisParameters(ElementProperties element /** * Extract the analysis step property from the supplied element properties. * - * @param elementProperties properties from discovery analysis report entities + * @param elementProperties properties from entities * @return string property or null */ protected String removeAnalysisStep(ElementProperties elementProperties) @@ -6339,7 +6339,7 @@ protected String removeAnalysisStep(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.ANALYSIS_STEP_PROPERTY_NAME, + OpenMetadataProperty.ANALYSIS_STEP.name, elementProperties, methodName); } @@ -6361,7 +6361,7 @@ protected String removeAnnotationType(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.ANNOTATION_TYPE_PROPERTY_NAME, + OpenMetadataProperty.ANNOTATION_TYPE.name, elementProperties, methodName); } @@ -6383,7 +6383,7 @@ protected int removeConfidenceLevel(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeIntProperty(serviceName, - OpenMetadataType.CONFIDENCE_LEVEL_PROPERTY_NAME, + OpenMetadataProperty.CONFIDENCE_LEVEL.name, elementProperties, methodName); } @@ -6427,7 +6427,7 @@ protected String removeExpression(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.ANNOTATION_TYPE_PROPERTY_NAME, + OpenMetadataProperty.EXPRESSION.name, elementProperties, methodName); } @@ -6471,7 +6471,7 @@ protected String removeExplanation(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.EXPLANATION_PROPERTY_NAME, + OpenMetadataProperty.EXPLANATION.name, elementProperties, methodName); } @@ -6493,7 +6493,7 @@ protected String removeJsonProperties(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.JSON_PROPERTIES_PROPERTY_NAME, + OpenMetadataProperty.JSON_PROPERTIES.name, elementProperties, methodName); } @@ -6515,7 +6515,7 @@ protected Date removeReviewDate(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeDateProperty(serviceName, - OpenMetadataType.REVIEW_DATE_PROPERTY_NAME, + OpenMetadataProperty.REVIEW_DATE.name, elementProperties, methodName); } @@ -6537,7 +6537,7 @@ protected String removeSteward(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.STEWARD_PROPERTY_NAME, + OpenMetadataProperty.STEWARD.name, elementProperties, methodName); } @@ -6624,7 +6624,7 @@ protected String removeComment(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.COMMENT_PROPERTY_NAME, + OpenMetadataProperty.COMMENT.name, elementProperties, methodName); } @@ -7141,140 +7141,6 @@ protected int removeQualityScore(ElementProperties elementProperties) } - - /** - * Extract and delete the duplicateAnchorGUID standing property from the supplied element properties. - * - * @param elementProperties properties from element - * @return string text or null - */ - protected String removeDuplicateAnchorGUID(ElementProperties elementProperties) - { - final String methodName = "removeDuplicateAnchorGUID"; - - if (elementProperties != null) - { - return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.DUPLICATE_ANCHOR_GUID_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentPropertyNames property from the supplied element properties. - * - * @param elementProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentPropertyNames(ElementProperties elementProperties) - { - final String methodName = "removeDivergentPropertyNames"; - - if (elementProperties != null) - { - return propertyHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_PROPERTY_NAMES_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - - /** - * Extract and delete the divergentClassificationName standing property from the supplied element properties. - * - * @param elementProperties properties from element - * @return string text or null - */ - protected String removeDivergentClassificationName(ElementProperties elementProperties) - { - final String methodName = "removeDivergentClassificationName"; - - if (elementProperties != null) - { - return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.DIVERGENT_CLASSIFICATION_NAME_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentClassificationPropertyNames property from the supplied element properties. - * - * @param elementProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentClassificationPropertyNames(ElementProperties elementProperties) - { - final String methodName = "removeDivergentClassificationPropertyNames"; - - if (elementProperties != null) - { - return propertyHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_CLASSIFICATION_PROPERTY_NAMES_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - - - /** - * Extract and delete the divergentRelatedMetadataElementsGUID standing property from the supplied element properties. - * - * @param elementProperties properties from element - * @return string text or null - */ - protected String removeDivergentRelatedMetadataElementsGUID(ElementProperties elementProperties) - { - final String methodName = "removeDivergentRelatedMetadataElementsGUID"; - - if (elementProperties != null) - { - return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.DIVERGENT_RELATIONSHIP_GUID_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - - /** - * Extract the divergentRelatedMetadataElementsPropertyNames property from the supplied element properties. - * - * @param elementProperties properties from annotation entities - * @return list of values - */ - protected List removeDivergentRelatedMetadataElementsPropertyNames(ElementProperties elementProperties) - { - final String methodName = "removeDivergentRelatedMetadataElementsPropertyNames"; - - if (elementProperties != null) - { - return propertyHelper.removeStringArrayProperty(serviceName, - OpenMetadataType.DIVERGENT_RELATIONSHIP_PROPERTY_NAMES_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - - /** * Extract and delete the attachmentGUID standing property from the supplied element properties. * @@ -7297,27 +7163,6 @@ protected String removeAttachmentGUID(ElementProperties elementProperties) } - /** - * Extract and delete the duplicateAttachmentGUID standing property from the supplied element properties. - * - * @param elementProperties properties from element - * @return string text or null - */ - protected String removeDuplicateAttachmentGUID(ElementProperties elementProperties) - { - final String methodName = "removeDuplicateAttachmentGUID"; - - if (elementProperties != null) - { - return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.DUPLICATE_ATTACHMENT_GUID_PROPERTY_NAME, - elementProperties, - methodName); - } - - return null; - } - /** * Extract and delete the relatedEntityGUID standing property from the supplied element properties. @@ -7398,7 +7243,7 @@ protected String removeDiscoveryActivity(ElementProperties elementProperties) if (elementProperties != null) { return propertyHelper.removeStringProperty(serviceName, - OpenMetadataType.DISCOVERY_ACTIVITY_PROPERTY_NAME, + OpenMetadataType.ACTION_SOURCE_NAME, elementProperties, methodName); } diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/handlers/MetadataElementHandler.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/handlers/MetadataElementHandler.java index 6f52758026f..a78cc0c4998 100644 --- a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/handlers/MetadataElementHandler.java +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/handlers/MetadataElementHandler.java @@ -4,6 +4,7 @@ import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericConverter; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableBuilder; import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -13,6 +14,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; +import org.odpi.openmetadata.frameworks.governanceaction.properties.ArchiveProperties; import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElement; import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElements; import org.odpi.openmetadata.frameworks.governanceaction.search.ArrayTypePropertyValue; @@ -1731,6 +1733,85 @@ public void deleteMetadataElementInStore(String userId, } + /** + * Archive a specific metadata element. + * + * @param userId caller's userId + * @param externalSourceGUID unique identifier of the software capability that owns this collection + * @param externalSourceName unique name of the software capability that owns this collection + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param serviceSupportedZones list of supported zones for this service + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void archiveMetadataElementInStore(String userId, + String externalSourceGUID, + String externalSourceName, + String metadataElementGUID, + ArchiveProperties archiveProperties, + boolean forLineage, + boolean forDuplicateProcessing, + List serviceSupportedZones, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "metadataElementGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); + + ReferenceableBuilder builder = new ReferenceableBuilder(repositoryHelper, serviceName, serverName); + + if (archiveProperties != null) + { + super.archiveBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + guidParameterName, + OpenMetadataType.OPEN_METADATA_ROOT.typeName, + builder.getMementoProperties(archiveProperties.getArchiveDate(), + userId, + archiveProperties.getArchiveProcess(), + archiveProperties.getArchiveProperties(), + methodName), + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + } + else + { + super.archiveBeanInRepository(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + guidParameterName, + OpenMetadataType.OPEN_METADATA_ROOT.typeName, + builder.getMementoProperties(null, + userId, + null, + null, + methodName), + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + } + } + + /** * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to * a metadata element. diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/OpenMetadataStoreRESTServices.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/OpenMetadataStoreRESTServices.java index 50ee7119a96..b2d8727fd8b 100644 --- a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/OpenMetadataStoreRESTServices.java +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/OpenMetadataStoreRESTServices.java @@ -1451,11 +1451,10 @@ public VoidResponse deleteMetadataElementInStore(String serverName, try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + MetadataElementHandler handler = instanceHandler.getMetadataElementHandler(userId, serverName, methodName); if (requestBody != null) { - MetadataElementHandler handler = instanceHandler.getMetadataElementHandler(userId, serverName, methodName); - handler.deleteMetadataElementInStore(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), @@ -1468,8 +1467,84 @@ public VoidResponse deleteMetadataElementInStore(String serverName, } else { - restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + handler.deleteMetadataElementInStore(userId, + null, + null, + metadataElementGUID, + false, + false, + instanceHandler.getSupportedZones(userId, serverName, serviceURLMarker, methodName), + null, + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Archive a specific metadata element. + * + * @param serverName name of server instance to route request to + * @param serviceURLMarker the identifier of the access service (for example asset-owner for the Asset Owner OMAS) + * @param userId caller's userId + * @param metadataElementGUID unique identifier of the metadata element to update + * @param requestBody null request body + * + * @return void or + * InvalidParameterException the unique identifier is null or invalid in some way + * UserNotAuthorizedException the governance action service is not authorized to archive this element + * PropertyServerException there is a problem with the metadata store + */ + public VoidResponse archiveMetadataElementInStore(String serverName, + String serviceURLMarker, + String userId, + String metadataElementGUID, + ArchiveRequestBody requestBody) + { + final String methodName = "archiveMetadataElementInStore"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + AuditLog auditLog = null; + VoidResponse response = new VoidResponse(); + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + MetadataElementHandler handler = instanceHandler.getMetadataElementHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.archiveMetadataElementInStore(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + metadataElementGUID, + requestBody.getArchiveProperties(), + requestBody.getForLineage(), + requestBody.getForDuplicateProcessing(), + instanceHandler.getSupportedZones(userId, serverName, serviceURLMarker, methodName), + requestBody.getEffectiveTime(), + methodName); } + else + { + handler.archiveMetadataElementInStore(userId, + null, + null, + metadataElementGUID, + null, + false, + false, + instanceHandler.getSupportedZones(userId, serverName, serviceURLMarker, methodName), + null, + methodName); } } catch (Exception error) { diff --git a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-spring/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/spring/OpenMetadataStoreResource.java b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-spring/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/spring/OpenMetadataStoreResource.java index ade6acc8c4e..1924135933e 100644 --- a/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-spring/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/spring/OpenMetadataStoreResource.java +++ b/open-metadata-implementation/framework-services/gaf-metadata-management/gaf-metadata-spring/src/main/java/org/odpi/openmetadata/frameworkservices/gaf/server/spring/OpenMetadataStoreResource.java @@ -826,12 +826,38 @@ public VoidResponse deleteMetadataElementInStore(@PathVariable String @PathVariable String serviceURLMarker, @PathVariable String userId, @PathVariable String metadataElementGUID, - @RequestBody UpdateRequestBody requestBody) + @RequestBody(required = false) UpdateRequestBody requestBody) { return restAPI.deleteMetadataElementInStore(serverName, serviceURLMarker, userId, metadataElementGUID, requestBody); } + /** + * Archive a specific metadata element. + * + * @param serverName name of server instance to route request to + * @param serviceURLMarker the identifier of the access service (for example asset-owner for the Asset Owner OMAS) + * @param userId caller's userId + * @param metadataElementGUID unique identifier of the metadata element to update + * @param requestBody null request body + * + * @return void or + * InvalidParameterException the unique identifier is null or invalid in some way + * UserNotAuthorizedException the governance action service is not authorized to archive this element + * PropertyServerException there is a problem with the metadata store + */ + @PostMapping(path = "/metadata-elements/{metadataElementGUID}/archive") + + public VoidResponse archiveMetadataElementInStore(@PathVariable String serverName, + @PathVariable String serviceURLMarker, + @PathVariable String userId, + @PathVariable String metadataElementGUID, + @RequestBody(required = false) ArchiveRequestBody requestBody) + { + return restAPI.archiveMetadataElementInStore(serverName, serviceURLMarker, userId, metadataElementGUID, requestBody); + } + + /** * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to * a metadata element. diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAPIOperations.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAPIOperations.java index 172cc6b2302..8ecadc59b2e 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAPIOperations.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAPIOperations.java @@ -19,13 +19,13 @@ */ public class ConnectedAPIOperations extends APIOperations { - private String serviceName; - private String serverName; - private String userId; - private String omasServerURL; - private String schemaGUID; - private int maxCacheSize; - private OCFRESTClient restClient; + private String serviceName; + private String serverName; + private String userId; + private String platformURLRoot; + private String schemaGUID; + private int maxCacheSize; + private OCFRESTClient restClient; private final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); @@ -35,7 +35,7 @@ public class ConnectedAPIOperations extends APIOperations * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param schemaGUID unique identifier of the parent schema type. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -45,7 +45,7 @@ public class ConnectedAPIOperations extends APIOperations ConnectedAPIOperations(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String schemaGUID, int totalElementCount, int maxCacheSize, @@ -56,7 +56,7 @@ public class ConnectedAPIOperations extends APIOperations this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.schemaGUID = schemaGUID; this.maxCacheSize = maxCacheSize; this.restClient = restClient; @@ -78,7 +78,7 @@ private ConnectedAPIOperations(ConnectedAPIOperations template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.schemaGUID = template.schemaGUID; this.maxCacheSize = template.maxCacheSize; this.restClient = template.restClient; @@ -117,7 +117,7 @@ protected List getCachedList(int cacheStartPointer, try { APIOperationsResponse restResult = restClient.callOCFAPIOperationsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -148,7 +148,7 @@ protected List getCachedList(int cacheStartPointer, apiOperation.getResponseAttributeCount(), serviceName, serverName, - omasServerURL, + platformURLRoot, userId, maxCacheSize, restClient)); @@ -163,7 +163,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java index 217722a93fe..aeaa1711478 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java @@ -39,7 +39,7 @@ public class ConnectedAssetClientBase implements ConnectorFactoryInterface * Create a new client with no authentication embedded in the HTTP request. * * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param serverPlatformURLRoot the network address of the server running the OCF REST services * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param auditLog destination for log messages * @throws InvalidParameterException there is a problem creating the client-side components to issue any @@ -67,7 +67,7 @@ public ConnectedAssetClientBase(String serverName, * Create a new client with no authentication embedded in the HTTP request. * * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param serverPlatformURLRoot the network address of the server running the OCF REST services * @param maxPageSize maximum page size for this process * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param auditLog destination for log messages @@ -98,7 +98,7 @@ public ConnectedAssetClientBase(String serverName, * Create a new client with no authentication embedded in the HTTP request. * * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param serverPlatformURLRoot the network address of the server running the OCF REST services * @param serviceURLMarker indicator of the OMAS that this client is supporting * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. @@ -116,7 +116,7 @@ public ConnectedAssetClientBase(String serverName, * userId/password of the calling server. The end user's userId is sent on each request. * * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param serverPlatformURLRoot the network address of the server running the OCF REST services * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param userId caller's userId embedded in all HTTP requests * @param password caller's userId embedded in all HTTP requests @@ -149,7 +149,7 @@ public ConnectedAssetClientBase(String serverName, * userId/password of the calling server. The end user's userId is sent on each request. * * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param serverPlatformURLRoot the network address of the server running the OCF REST services * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param userId caller's userId embedded in all HTTP requests * @param password caller's userId embedded in all HTTP requests diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetLineage.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetLineage.java index 07bdafac635..579694604f3 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetLineage.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetLineage.java @@ -10,13 +10,13 @@ */ public class ConnectedAssetLineage extends AssetLineage { - private String serviceName; - private String serverName; - private String userId; - private String omasServerURL; - private String assetGUID; - private int maxCacheSize; - private OCFRESTClient restClient; + private String serviceName; + private String serverName; + private String userId; + private String platformURLRoot; + private String assetGUID; + private int maxCacheSize; + private OCFRESTClient restClient; /** @@ -26,7 +26,7 @@ public class ConnectedAssetLineage extends AssetLineage * @param serviceName calling service * @param serverName name of server to use on server calls. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and * cached in the element list at any one time. If a number less than one is supplied, 1 is used. @@ -35,20 +35,20 @@ public class ConnectedAssetLineage extends AssetLineage ConnectedAssetLineage(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int maxCacheSize, OCFRESTClient restClient) { super(); - this.serviceName = serviceName; - this.serverName = serverName; - this.userId = userId; - this.omasServerURL = omasServerURL; - this.assetGUID = assetGUID; - this.maxCacheSize = maxCacheSize; - this.restClient = restClient; + this.serviceName = serviceName; + this.serverName = serverName; + this.userId = userId; + this.platformURLRoot = platformURLRoot; + this.assetGUID = assetGUID; + this.maxCacheSize = maxCacheSize; + this.restClient = restClient; } @@ -63,12 +63,12 @@ private ConnectedAssetLineage(ConnectedAssetLineage template) if (template != null) { - this.serviceName = template.serviceName; - this.serverName = template.serverName; - this.userId = template.userId; - this.omasServerURL = template.omasServerURL; - this.assetGUID = template.assetGUID; - this.restClient = template.restClient; + this.serviceName = template.serviceName; + this.serverName = template.serverName; + this.userId = template.userId; + this.platformURLRoot = template.platformURLRoot; + this.assetGUID = template.assetGUID; + this.restClient = template.restClient; } } } diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRatings.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRatings.java index 147e7d0f7db..214a4c4f97f 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRatings.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRatings.java @@ -21,12 +21,12 @@ */ public class ConnectedAssetRatings extends Ratings { - private String serviceName; - private String serverName; - private String userId; - private String omasServerURL; - private String assetGUID; - private OCFRESTClient restClient; + private String serviceName; + private String serverName; + private String userId; + private String platformURLRoot; + private String assetGUID; + private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedAssetRatings extends Ratings * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedAssetRatings extends Ratings ConnectedAssetRatings(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedAssetRatings extends Ratings this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -74,12 +74,12 @@ private ConnectedAssetRatings(ConnectedAssetRatings template) if (template != null) { - this.serviceName = template.serviceName; - this.serverName = template.serverName; - this.userId = template.userId; - this.omasServerURL = template.omasServerURL; - this.assetGUID = template.assetGUID; - this.restClient = template.restClient; + this.serviceName = template.serviceName; + this.serverName = template.serverName; + this.userId = template.userId; + this.platformURLRoot = template.platformURLRoot; + this.assetGUID = template.assetGUID; + this.restClient = template.restClient; } } @@ -118,7 +118,7 @@ protected List getCachedList(int cacheStartPointer, try { RatingsResponse restResult = restClient.callOCFRatingsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -152,7 +152,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java index b45c194d04f..75ef798e84b 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetRelatedAssetProperties.java @@ -15,10 +15,8 @@ * RelatedAssetProperties is associated a related asset for a connector's EgeriaConnectedAssetProperties. Connectors provide access to * assets. EgeriaConnectedAssetProperties returns properties (metadata) about the connector's asset. RelatedAssetProperties * returns similar information for an asset related to the connected asset - * * It is a generic interface for all types of open metadata assets. However, it assumes the asset's metadata model * inherits from Asset (see model 0010 in Area 0). - * * The EgeriaConnectedAssetProperties returns metadata about the asset at three levels of detail: *
    *
  • assetSummary - used for displaying details of the asset in summary lists or hover text
  • @@ -26,7 +24,6 @@ * of the relationships to other metadata entities *
  • assetUniverse - used to define the broader context for the asset
  • *
- * * RelatedAssetProperties is a base class for the connector's metadata API that returns null, * for the asset's properties. Metadata repository implementations extend this class to add their * implementation of the refresh() method that calls to the metadata repository to populate the metadata properties. @@ -35,9 +32,9 @@ public class ConnectedAssetRelatedAssetProperties extends org.odpi.openmetadata. { private String serviceName; private String serverName; - private String userId = null; - private String omasServerURL = null; - private String assetGUID = null; + private String userId = null; + private String platformURLRoot = null; + private String assetGUID = null; private OCFRESTClient restClient; private final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); @@ -52,7 +49,7 @@ public class ConnectedAssetRelatedAssetProperties extends org.odpi.openmetadata. * @param serviceName calling service * @param serverName name of the server. * @param userId identifier of calling user - * @param omasServerURL url of server + * @param platformURLRoot url of server * @param assetGUID String unique id for connected asset. * @param restClient client to call REST API */ @@ -60,18 +57,18 @@ public ConnectedAssetRelatedAssetProperties(RelatedAsset bean, String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, OCFRESTClient restClient) { super(bean); - this.serviceName = serviceName; - this.serverName = serverName; - this.userId = userId; - this.omasServerURL = omasServerURL; - this.assetGUID = assetGUID; - this.restClient = restClient; + this.serviceName = serviceName; + this.serverName = serverName; + this.userId = userId; + this.platformURLRoot = platformURLRoot; + this.assetGUID = assetGUID; + this.restClient = restClient; } @@ -86,12 +83,12 @@ public ConnectedAssetRelatedAssetProperties(ConnectedAssetRelatedAssetProperties if (template != null) { - this.serviceName = template.serviceName; - this.serverName = template.serverName; - this.userId = template.userId; - this.omasServerURL = template.omasServerURL; - this.assetGUID = template.assetGUID; - this.restClient = template.restClient; + this.serviceName = template.serviceName; + this.serverName = template.serverName; + this.userId = template.userId; + this.platformURLRoot = template.platformURLRoot; + this.assetGUID = template.assetGUID; + this.restClient = template.restClient; } } @@ -116,7 +113,7 @@ public void refresh() throws PropertyServerException, UserNotAuthorizedException { assetProperties = ConnectedAssetUniverse.create(serviceName, serverName, - omasServerURL, + platformURLRoot, userId, assetGUID, restClient); @@ -127,7 +124,7 @@ public void refresh() throws PropertyServerException, UserNotAuthorizedException } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } log.debug("Returning from method: " + methodName + " having retrieved: " + assetProperties.toString()); @@ -144,7 +141,7 @@ public String toString() { return "ConnectedAssetRelatedAssetProperties{" + "userId='" + userId + '\'' + - ", omasServerURL='" + omasServerURL + '\'' + + ", platformURLRoot='" + platformURLRoot + '\'' + ", assetGUID='" + assetGUID + '\'' + ", extendedProperties=" + assetProperties + '}'; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetUniverse.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetUniverse.java index c8512685611..67db21dda8c 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetUniverse.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedAssetUniverse.java @@ -13,12 +13,11 @@ /** - * ConnectedAssetUniverse is the OMAS client library implementation of the Open Connector Framework + * ConnectedAssetUniverse is the client library implementation of the Open Connector Framework * (OCF) AssetUniverse object. AssetUniverse provides read-only access to the properties known * about an asset. ConnectedAssetUniverse configures AssetUniverse (and its dependent objects) * with the information necessary to populate the AssetUniverse contents from the open metadata * repositories. - * * All of ConnectedAssetUniverse's work is done in the constructors. They extract basic information * about the asset and push objects to the super class to retrieve the more detailed properties. * These properties are only retrieved on demand. @@ -31,12 +30,11 @@ public class ConnectedAssetUniverse extends AssetUniverse private static final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); /** - * Private constructor used by the create() static factory methods for instantiation - * of ConnectedAssetUniverse objects. + * Private constructor for the "create()" static factory methods used to instantiate ConnectedAssetUniverse objects. * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @@ -48,7 +46,7 @@ private ConnectedAssetUniverse(AssetResponse assetResponse, OCFRESTClient restClient, String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, @@ -58,7 +56,7 @@ private ConnectedAssetUniverse(AssetResponse assetResponse, this.processAssetResponse(serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID, restClient, @@ -71,7 +69,7 @@ private ConnectedAssetUniverse(AssetResponse assetResponse, * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @@ -81,24 +79,25 @@ private ConnectedAssetUniverse(AssetResponse assetResponse, */ public static ConnectedAssetUniverse create(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - OCFRESTClient restClient = new OCFRESTClient(remoteServerName, omasServerURL); - AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, omasServerURL, restClient, userId, assetGUID); + OCFRESTClient restClient = new OCFRESTClient(remoteServerName, platformURLRoot); + AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, platformURLRoot, restClient, userId, assetGUID); return new ConnectedAssetUniverse(assetResponse, restClient, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID); } + /** * Static factory method used for creating a ConnectedAssetUniverse object where a userId and password * of the local calling server are embedded in the HTTP request. @@ -107,7 +106,7 @@ public static ConnectedAssetUniverse create(String serviceName, * @param remoteServerName name of the server. * @param localServerUserId userId of the local server. * @param localServerPassword password of the local server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @@ -119,20 +118,20 @@ public static ConnectedAssetUniverse create(String serviceName, String remoteServerName, String localServerUserId, String localServerPassword, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - OCFRESTClient restClient = new OCFRESTClient(remoteServerName, omasServerURL, localServerUserId, localServerPassword); - AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, omasServerURL, restClient, userId, assetGUID); + OCFRESTClient restClient = new OCFRESTClient(remoteServerName, platformURLRoot, localServerUserId, localServerPassword); + AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, platformURLRoot, restClient, userId, assetGUID); return new ConnectedAssetUniverse(assetResponse, restClient, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID); } @@ -142,7 +141,7 @@ public static ConnectedAssetUniverse create(String serviceName, * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @param restClient client for calling rest APIs @@ -153,20 +152,20 @@ public static ConnectedAssetUniverse create(String serviceName, */ public static ConnectedAssetUniverse create(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID, OCFRESTClient restClient) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, omasServerURL, restClient, userId, assetGUID); + AssetResponse assetResponse = getAssetSummary(serviceName, remoteServerName, platformURLRoot, restClient, userId, assetGUID); return new ConnectedAssetUniverse(assetResponse, restClient, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID); } @@ -177,7 +176,7 @@ public static ConnectedAssetUniverse create(String serviceName, * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @param connectionGUID unique id for connection used to access asset. @@ -188,21 +187,21 @@ public static ConnectedAssetUniverse create(String serviceName, */ public static ConnectedAssetUniverse create(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - OCFRESTClient restClient = new OCFRESTClient(remoteServerName, omasServerURL); - AssetResponse assetResponse = getConnectedAssetSummary(serviceName, remoteServerName, omasServerURL, restClient, userId, assetGUID, connectionGUID); + OCFRESTClient restClient = new OCFRESTClient(remoteServerName, platformURLRoot); + AssetResponse assetResponse = getConnectedAssetSummary(serviceName, remoteServerName, platformURLRoot, restClient, userId, assetGUID, connectionGUID); return new ConnectedAssetUniverse(assetResponse, restClient, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID); } @@ -215,7 +214,7 @@ public static ConnectedAssetUniverse create(String serviceName, * @param remoteServerName name of the server. * @param localServerUserId userId of the local server. * @param localServerPassword password of the local server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId userId of user making request. * @param assetGUID unique id for asset. * @param connectionGUID unique id for connection used to access asset. @@ -228,21 +227,21 @@ public static ConnectedAssetUniverse create(String serviceName, String remoteServerName, String localServerUserId, String localServerPassword, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - OCFRESTClient restClient = new OCFRESTClient(remoteServerName, omasServerURL, localServerUserId, localServerPassword); - AssetResponse assetResponse = getConnectedAssetSummary(serviceName, remoteServerName, omasServerURL, restClient, userId, assetGUID, connectionGUID); + OCFRESTClient restClient = new OCFRESTClient(remoteServerName, platformURLRoot, localServerUserId, localServerPassword); + AssetResponse assetResponse = getConnectedAssetSummary(serviceName, remoteServerName, platformURLRoot, restClient, userId, assetGUID, connectionGUID); return new ConnectedAssetUniverse(assetResponse, restClient, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID); } @@ -252,7 +251,7 @@ public static ConnectedAssetUniverse create(String serviceName, * * @param serviceName calling service * @param remoteServerName server to call. - * @param omasServerURL url root of the remote server. + * @param platformURLRoot url root of the remote server. * @param userId userId of calling user. * @param assetGUID unique identifier of the asset. * @param restClient client to issue REST call. @@ -261,7 +260,7 @@ public static ConnectedAssetUniverse create(String serviceName, */ private void processAssetResponse(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, String assetGUID, OCFRESTClient restClient, @@ -272,7 +271,7 @@ private void processAssetResponse(String serviceName, super.externalIdentifiers = new ConnectedExternalIdentifiers(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getExternalIdentifierCount(), MAX_CACHE_SIZE, @@ -284,7 +283,7 @@ private void processAssetResponse(String serviceName, super.relatedMediaReferences = new ConnectedRelatedMediaReferences(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getRelatedMediaReferenceCount(), MAX_CACHE_SIZE, @@ -296,7 +295,7 @@ private void processAssetResponse(String serviceName, super.noteLogs = new ConnectedNoteLogs(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getNoteLogsCount(), MAX_CACHE_SIZE, @@ -308,7 +307,7 @@ private void processAssetResponse(String serviceName, super.externalReferences = new ConnectedExternalReferences(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getExternalReferencesCount(), MAX_CACHE_SIZE, @@ -320,7 +319,7 @@ private void processAssetResponse(String serviceName, super.connections = new ConnectedConnections(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getConnectionCount(), MAX_CACHE_SIZE, @@ -332,7 +331,7 @@ private void processAssetResponse(String serviceName, super.licenses = new ConnectedLicenses(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getLicenseCount(), MAX_CACHE_SIZE, @@ -344,7 +343,7 @@ private void processAssetResponse(String serviceName, super.certifications = new ConnectedCertifications(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getCertificationCount(), MAX_CACHE_SIZE, @@ -354,7 +353,7 @@ private void processAssetResponse(String serviceName, super.feedback = new ConnectedFeedback(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getCommentCount(), assetResponse.getLikeCount(), @@ -368,7 +367,7 @@ private void processAssetResponse(String serviceName, super.knownLocations = new ConnectedLocations(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getKnownLocationsCount(), MAX_CACHE_SIZE, @@ -378,7 +377,7 @@ private void processAssetResponse(String serviceName, super.lineage = new ConnectedAssetLineage(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, MAX_CACHE_SIZE, restClient); @@ -388,7 +387,7 @@ private void processAssetResponse(String serviceName, super.relatedAssets = new ConnectedRelatedAssets(serviceName, remoteServerName, userId, - omasServerURL, + platformURLRoot, assetGUID, assetResponse.getRelatedAssetCount(), MAX_CACHE_SIZE, @@ -399,20 +398,21 @@ private void processAssetResponse(String serviceName, { super.schema = this.getSchemaType(serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetResponse.getSchemaType(), restClient); } } + /** * Returns the basic information about the asset. The connection guid allows the short description for the * asset to be filled out. * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param restClient client to call REST API * @param userId String userId of user making request. * @param assetGUID String unique id for asset. @@ -425,7 +425,7 @@ private void processAssetResponse(String serviceName, */ private static AssetResponse getConnectedAssetSummary(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, OCFRESTClient restClient, String userId, String assetGUID, @@ -436,14 +436,14 @@ private static AssetResponse getConnectedAssetSummary(String serviceName, final String methodName = "getConnectedAssetSummary"; final String urlTemplate = "/servers/{0}/open-metadata/framework-services/{1}/connected-asset/users/{2}/assets/{3}/via-connection/{4}"; - invalidParameterHandler.validateOMAGServerPlatformURL(omasServerURL, remoteServerName, methodName); + invalidParameterHandler.validateOMAGServerPlatformURL(platformURLRoot, remoteServerName, methodName); AssetResponse restResult = null; try { restResult = restClient.callOCFAssetGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, remoteServerName, serviceName, userId, @@ -460,7 +460,7 @@ private static AssetResponse getConnectedAssetSummary(String serviceName, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, platformURLRoot); } return restResult; @@ -473,7 +473,7 @@ private static AssetResponse getConnectedAssetSummary(String serviceName, * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param restClient client to call REST API * @param userId String userId of user making request. * @param assetGUID String unique id for asset. @@ -485,7 +485,7 @@ private static AssetResponse getConnectedAssetSummary(String serviceName, */ private static AssetResponse getAssetSummary(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, OCFRESTClient restClient, String userId, String assetGUID) throws InvalidParameterException, @@ -495,14 +495,14 @@ private static AssetResponse getAssetSummary(String serviceName, final String methodName = "getAssetSummary"; final String urlTemplate = "/servers/{0}/open-metadata/framework-services/{1}/connected-asset/users/{2}/assets/{3}"; - invalidParameterHandler.validateOMAGServerPlatformURL(omasServerURL, remoteServerName, methodName); + invalidParameterHandler.validateOMAGServerPlatformURL(platformURLRoot, remoteServerName, methodName); AssetResponse restResult = null; try { restResult = restClient.callOCFAssetGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, remoteServerName, serviceName, userId, @@ -518,7 +518,7 @@ private static AssetResponse getAssetSummary(String serviceName, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, platformURLRoot); } return restResult; @@ -530,7 +530,7 @@ private static AssetResponse getAssetSummary(String serviceName, * * @param serviceName calling service * @param remoteServerName name of the server. - * @param omasServerURL url used to call the server. + * @param platformURLRoot url used to call the server. * @param userId String userId of user making request. * @param bean schema type bean that has the properties for the schema type. * @param restClient client to call REST API @@ -539,7 +539,7 @@ private static AssetResponse getAssetSummary(String serviceName, */ private SchemaType getSchemaType(String serviceName, String remoteServerName, - String omasServerURL, + String platformURLRoot, String userId, SchemaType bean, OCFRESTClient restClient) @@ -553,7 +553,7 @@ else if (bean instanceof ComplexSchemaType) return new ConnectedNestedSchemaType((ComplexSchemaType)bean, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, MAX_CACHE_SIZE, restClient); @@ -563,7 +563,7 @@ else if (bean instanceof APISchemaType) return new ConnectedDeployedAPISchemaType((APISchemaType) bean, serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, MAX_CACHE_SIZE, restClient); diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCertifications.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCertifications.java index b3111f58419..c305972e727 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCertifications.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCertifications.java @@ -24,7 +24,7 @@ class ConnectedCertifications extends Certifications private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ class ConnectedCertifications extends Certifications * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ class ConnectedCertifications extends Certifications ConnectedCertifications(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ class ConnectedCertifications extends Certifications this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -74,12 +74,12 @@ private ConnectedCertifications(ConnectedCertifications template) if (template != null) { - this.serviceName = template.serviceName; - this.serverName = template.serverName; - this.userId = template.userId; - this.omasServerURL = template.omasServerURL; - this.assetGUID = template.assetGUID; - this.restClient = template.restClient; + this.serviceName = template.serviceName; + this.serverName = template.serverName; + this.userId = template.userId; + this.platformURLRoot = template.platformURLRoot; + this.assetGUID = template.assetGUID; + this.restClient = template.restClient; } } @@ -131,7 +131,7 @@ protected List getCachedList(int cacheStartPointer, try { CertificationsResponse restResult = restClient.callOCFCertificationsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -165,7 +165,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCommentReplies.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCommentReplies.java index 6d4e0ffe171..398d20303ab 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCommentReplies.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedCommentReplies.java @@ -25,7 +25,7 @@ public class ConnectedCommentReplies extends CommentReplies private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String rootCommentGUID; private int maxCacheSize; private OCFRESTClient restClient; @@ -38,7 +38,7 @@ public class ConnectedCommentReplies extends CommentReplies * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param rootCommentGUID unique identifier of the comment that the replies are attached to. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -48,7 +48,7 @@ public class ConnectedCommentReplies extends CommentReplies ConnectedCommentReplies(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String rootCommentGUID, int totalElementCount, int maxCacheSize, @@ -59,7 +59,7 @@ public class ConnectedCommentReplies extends CommentReplies this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.rootCommentGUID = rootCommentGUID; this.maxCacheSize = maxCacheSize; this.restClient = restClient; @@ -80,7 +80,7 @@ private ConnectedCommentReplies(ConnectedCommentReplies template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.rootCommentGUID = template.rootCommentGUID; this.maxCacheSize = template.maxCacheSize; this.restClient = template.restClient; @@ -142,7 +142,7 @@ protected List getCachedList(int cacheStartPointer, try { CommentsResponse restResult = restClient.callOCFCommentsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -175,7 +175,7 @@ protected List getCachedList(int cacheStartPointer, commentReplies = new ConnectedCommentReplies(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, bean.getGUID(), commentResponse.getReplyCount(), maxCacheSize, @@ -194,7 +194,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedComments.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedComments.java index a6b0fbfe407..a14a81b3a4f 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedComments.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedComments.java @@ -26,7 +26,7 @@ public class ConnectedComments extends Comments private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private int maxCacheSize; private OCFRESTClient restClient; @@ -40,7 +40,7 @@ public class ConnectedComments extends Comments * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -50,7 +50,7 @@ public class ConnectedComments extends Comments ConnectedComments(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -61,7 +61,7 @@ public class ConnectedComments extends Comments this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.maxCacheSize = maxCacheSize; this.restClient = restClient; @@ -82,7 +82,7 @@ private ConnectedComments(ConnectedComments template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.maxCacheSize = template.maxCacheSize; this.restClient = template.restClient; @@ -145,7 +145,7 @@ protected List getCachedList(int cacheStartPointer, try { CommentsResponse restResult = restClient.callOCFCommentsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -178,7 +178,7 @@ protected List getCachedList(int cacheStartPointer, commentReplies = new ConnectedCommentReplies(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, bean.getGUID(), commentResponse.getReplyCount(), maxCacheSize, @@ -197,7 +197,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedConnections.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedConnections.java index 334e8aa5e1f..04c7015244a 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedConnections.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedConnections.java @@ -24,7 +24,7 @@ public class ConnectedConnections extends Connections private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedConnections extends Connections * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedConnections extends Connections ConnectedConnections(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedConnections extends Connections this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedConnections(ConnectedConnections template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -116,7 +116,7 @@ protected List getCachedList(int cacheStartPointer, try { ConnectionsResponse restResult = restClient.callOCFConnectionsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -150,7 +150,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java index 81be2f2708a..a8bf1473be8 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java @@ -13,7 +13,7 @@ class ConnectedDeployedAPIOperation extends DeployedAPIOperation * @param bean super class properties * @param serviceName calling service * @param serverName name of the server. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param userId user id to use on server calls. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and * cached in the element list at any one time. If a number less than one is supplied, 1 is used. @@ -25,7 +25,7 @@ class ConnectedDeployedAPIOperation extends DeployedAPIOperation int responseAttributeCount, String serviceName, String serverName, - String omasServerURL, + String platformURLRoot, String userId, int maxCacheSize, OCFRESTClient restClient) @@ -37,7 +37,7 @@ class ConnectedDeployedAPIOperation extends DeployedAPIOperation super.headerAttributes = new ConnectedSchemaAttributes(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, this.getGUID(), maxCacheSize, headerAttributeCount, @@ -50,7 +50,7 @@ class ConnectedDeployedAPIOperation extends DeployedAPIOperation super.headerAttributes = new ConnectedSchemaAttributes(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, this.getGUID(), maxCacheSize, requestAttributeCount, @@ -63,7 +63,7 @@ class ConnectedDeployedAPIOperation extends DeployedAPIOperation super.headerAttributes = new ConnectedSchemaAttributes(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, this.getGUID(), maxCacheSize, responseAttributeCount, diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPISchemaType.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPISchemaType.java index b8847647972..4185d75a92a 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPISchemaType.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedDeployedAPISchemaType.java @@ -13,7 +13,7 @@ class ConnectedDeployedAPISchemaType extends DeployedAPISchemaType * @param bean super class properties * @param serviceName calling service * @param serverName name of the server. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param userId user id to use on server calls. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and * cached in the element list at any one time. If a number less than one is supplied, 1 is used. @@ -22,7 +22,7 @@ class ConnectedDeployedAPISchemaType extends DeployedAPISchemaType ConnectedDeployedAPISchemaType(APISchemaType bean, String serviceName, String serverName, - String omasServerURL, + String platformURLRoot, String userId, int maxCacheSize, OCFRESTClient restClient) @@ -34,7 +34,7 @@ class ConnectedDeployedAPISchemaType extends DeployedAPISchemaType super.apiOperations = new ConnectedAPIOperations(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, this.getGUID(), maxCacheSize, this.getOperationCount(), diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalIdentifiers.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalIdentifiers.java index 57008d604ab..51d6245d8d9 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalIdentifiers.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalIdentifiers.java @@ -24,7 +24,7 @@ public class ConnectedExternalIdentifiers extends ExternalIdentifiers private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedExternalIdentifiers extends ExternalIdentifiers * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedExternalIdentifiers extends ExternalIdentifiers ConnectedExternalIdentifiers(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedExternalIdentifiers extends ExternalIdentifiers this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedExternalIdentifiers(ConnectedExternalIdentifiers template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -135,7 +135,7 @@ protected List getCachedList(int cacheStartPointer, try { ExternalIdentifiersResponse restResult = restClient.callOCFExternalIdentifiersGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -169,7 +169,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalReferences.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalReferences.java index 50a658d6968..b0254db96aa 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalReferences.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedExternalReferences.java @@ -24,7 +24,7 @@ public class ConnectedExternalReferences extends ExternalReferences private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedExternalReferences extends ExternalReferences * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedExternalReferences extends ExternalReferences ConnectedExternalReferences(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedExternalReferences extends ExternalReferences this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedExternalReferences(ConnectedExternalReferences template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -116,7 +116,7 @@ protected List getCachedList(int cacheStartPointer, try { ExternalReferencesResponse restResult = restClient.callOCFExternalReferencesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -150,7 +150,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedFeedback.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedFeedback.java index 33f993afccd..b10e628fea9 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedFeedback.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedFeedback.java @@ -18,7 +18,7 @@ public class ConnectedFeedback extends AssetFeedback * @param serviceName calling service * @param serverName name of server to use on server calls. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param commentCount the total number of comments to process. A negative value is converted to 0. * @param likeCount the total number of likes to process. A negative value is converted to 0. @@ -31,7 +31,7 @@ public class ConnectedFeedback extends AssetFeedback ConnectedFeedback(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int commentCount, int likeCount, @@ -47,7 +47,7 @@ public class ConnectedFeedback extends AssetFeedback super.comments = new ConnectedComments(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, assetGUID, commentCount, maxCacheSize, @@ -60,7 +60,7 @@ public class ConnectedFeedback extends AssetFeedback super.likes = new ConnectedLikes(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, assetGUID, likeCount, maxCacheSize, @@ -72,7 +72,7 @@ public class ConnectedFeedback extends AssetFeedback super.ratings = new ConnectedAssetRatings(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, assetGUID, ratingCount, maxCacheSize, @@ -84,7 +84,7 @@ public class ConnectedFeedback extends AssetFeedback super.informalTags = new ConnectedInformalTags(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, assetGUID, tagCount, maxCacheSize, diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedInformalTags.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedInformalTags.java index 40c80345ef3..90b76da753d 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedInformalTags.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedInformalTags.java @@ -25,7 +25,7 @@ public class ConnectedInformalTags extends InformalTags private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -37,7 +37,7 @@ public class ConnectedInformalTags extends InformalTags * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -47,7 +47,7 @@ public class ConnectedInformalTags extends InformalTags ConnectedInformalTags(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -58,7 +58,7 @@ public class ConnectedInformalTags extends InformalTags this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -78,7 +78,7 @@ private ConnectedInformalTags(ConnectedInformalTags template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -118,7 +118,7 @@ protected List getCachedList(int cacheStartPointer, try { InformalTagsResponse restResult = restClient.callOCFInformalTagsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -152,7 +152,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLicenses.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLicenses.java index b145006b6a1..01684697b12 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLicenses.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLicenses.java @@ -24,7 +24,7 @@ public class ConnectedLicenses extends Licenses private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedLicenses extends Licenses * @param serviceName name of calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedLicenses extends Licenses ConnectedLicenses(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedLicenses extends Licenses this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedLicenses(ConnectedLicenses template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -116,7 +116,7 @@ protected List getCachedList(int cacheStartPointer, try { LicensesResponse restResult = restClient.callOCFLicensesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -150,7 +150,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLikes.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLikes.java index 794037a6f84..b30eea836ad 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLikes.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLikes.java @@ -24,7 +24,7 @@ public class ConnectedLikes extends Likes private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedLikes extends Likes * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedLikes extends Likes ConnectedLikes(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedLikes extends Likes this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedLikes(ConnectedLikes template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -117,7 +117,7 @@ protected List getCachedList(int cacheStartPointer, try { LikesResponse restResult = restClient.callOCFLikesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -151,7 +151,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLocations.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLocations.java index b5e3a5abae8..71973228607 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLocations.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedLocations.java @@ -24,7 +24,7 @@ public class ConnectedLocations extends Locations private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -35,7 +35,7 @@ public class ConnectedLocations extends Locations * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -45,7 +45,7 @@ public class ConnectedLocations extends Locations ConnectedLocations(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -56,7 +56,7 @@ public class ConnectedLocations extends Locations this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -76,7 +76,7 @@ private ConnectedLocations(ConnectedLocations template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -115,7 +115,7 @@ protected List getCachedList(int cacheStartPointer, try { LocationsResponse restResult = restClient.callOCFLocationsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -149,7 +149,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNestedSchemaType.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNestedSchemaType.java index 1bf72eb50fd..160b9c0d46e 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNestedSchemaType.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNestedSchemaType.java @@ -14,7 +14,7 @@ class ConnectedNestedSchemaType extends NestedSchemaType * @param bean super class properties * @param serviceName calling service * @param serverName name of the server. - * @param omasServerURL url root of the server to use. + * @param platformRootURL url root of the server to use. * @param userId user id to use on server calls. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and * cached in the element list at any one time. If a number less than one is supplied, 1 is used. @@ -23,7 +23,7 @@ class ConnectedNestedSchemaType extends NestedSchemaType ConnectedNestedSchemaType(ComplexSchemaType bean, String serviceName, String serverName, - String omasServerURL, + String platformRootURL, String userId, int maxCacheSize, OCFRESTClient restClient) @@ -33,7 +33,7 @@ class ConnectedNestedSchemaType extends NestedSchemaType super.schemaAttributes = new ConnectedSchemaAttributes(serviceName, serverName, userId, - omasServerURL, + platformRootURL, this.getGUID(), this.getAttributeCount(), maxCacheSize, diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNoteLogs.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNoteLogs.java index 4dfae877661..d09f1a524d0 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNoteLogs.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNoteLogs.java @@ -25,7 +25,7 @@ public class ConnectedNoteLogs extends NoteLogs private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -37,7 +37,7 @@ public class ConnectedNoteLogs extends NoteLogs * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -47,7 +47,7 @@ public class ConnectedNoteLogs extends NoteLogs ConnectedNoteLogs(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -58,7 +58,7 @@ public class ConnectedNoteLogs extends NoteLogs this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -78,7 +78,7 @@ private ConnectedNoteLogs(ConnectedNoteLogs template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -117,7 +117,7 @@ protected List getCachedList(int cacheStartPointer, try { NoteLogsResponse restResult = restClient.callOCFNoteLogsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -148,7 +148,7 @@ protected List getCachedList(int cacheStartPointer, new ConnectedNotes(serviceName, serverName, userId, - omasServerURL, + platformURLRoot, noteLogResponse.getNoteLog().getGUID(), noteLogResponse.getNoteCount(), maximumSize, @@ -162,7 +162,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNotes.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNotes.java index 582045e0cbd..1378778de0e 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNotes.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedNotes.java @@ -24,7 +24,7 @@ public class ConnectedNotes extends Notes private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String noteLogGUID; private OCFRESTClient restClient; @@ -35,7 +35,7 @@ public class ConnectedNotes extends Notes * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param noteLogGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -45,7 +45,7 @@ public class ConnectedNotes extends Notes ConnectedNotes(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String noteLogGUID, int totalElementCount, int maxCacheSize, @@ -56,7 +56,7 @@ public class ConnectedNotes extends Notes this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.noteLogGUID = noteLogGUID; this.restClient = restClient; } @@ -76,7 +76,7 @@ private ConnectedNotes( ConnectedNotes template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.noteLogGUID = template.noteLogGUID; this.restClient = template.restClient; } @@ -115,7 +115,7 @@ protected List getCachedList(int cacheStartPointer, try { NotesResponse restResult = restClient.callOCFNotesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -149,7 +149,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedAssets.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedAssets.java index e1fed009173..07b2bda0fee 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedAssets.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedAssets.java @@ -24,7 +24,7 @@ public class ConnectedRelatedAssets extends RelatedAssets private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -36,7 +36,7 @@ public class ConnectedRelatedAssets extends RelatedAssets * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -46,7 +46,7 @@ public class ConnectedRelatedAssets extends RelatedAssets ConnectedRelatedAssets(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -57,7 +57,7 @@ public class ConnectedRelatedAssets extends RelatedAssets this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -77,7 +77,7 @@ private ConnectedRelatedAssets(ConnectedRelatedAssets template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -116,7 +116,7 @@ protected List getCachedList(int cacheStartPointer, try { RelatedAssetsResponse restResult = restClient.callOCFRelatedAssetsGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -145,7 +145,7 @@ protected List getCachedList(int cacheStartPointer, serviceName, serverName, userId, - omasServerURL, + platformURLRoot, assetGUID, restClient)); } @@ -156,7 +156,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedMediaReferences.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedMediaReferences.java index 386aa5a5609..11e70e569c6 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedMediaReferences.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedRelatedMediaReferences.java @@ -24,7 +24,7 @@ public class ConnectedRelatedMediaReferences extends RelatedMediaReferences private String serviceName; private String serverName; private String userId; - private String omasServerURL; + private String platformURLRoot; private String assetGUID; private OCFRESTClient restClient; @@ -37,7 +37,7 @@ public class ConnectedRelatedMediaReferences extends RelatedMediaReferences * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformURLRoot url root of the server to use. * @param assetGUID unique identifier of the asset. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -47,7 +47,7 @@ public class ConnectedRelatedMediaReferences extends RelatedMediaReferences ConnectedRelatedMediaReferences(String serviceName, String serverName, String userId, - String omasServerURL, + String platformURLRoot, String assetGUID, int totalElementCount, int maxCacheSize, @@ -58,7 +58,7 @@ public class ConnectedRelatedMediaReferences extends RelatedMediaReferences this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.assetGUID = assetGUID; this.restClient = restClient; } @@ -78,7 +78,7 @@ private ConnectedRelatedMediaReferences(ConnectedRelatedMediaReferences template this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; this.restClient = template.restClient; } @@ -116,7 +116,7 @@ protected List getCachedList(int cacheStartPointer, try { RelatedMediaReferencesResponse restResult = restClient.callOCFRelatedMediaReferencesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformURLRoot + urlTemplate, serverName, serviceName, userId, @@ -150,7 +150,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformURLRoot); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedSchemaAttributes.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedSchemaAttributes.java index 50771199fea..f56ce699056 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedSchemaAttributes.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/ConnectedSchemaAttributes.java @@ -19,13 +19,13 @@ */ public class ConnectedSchemaAttributes extends SchemaAttributes { - private String serviceName; - private String serverName; - private String userId; - private String omasServerURL; - private String schemaGUID; - private int maxCacheSize; - private OCFRESTClient restClient; + private String serviceName; + private String serverName; + private String userId; + private String platformRootURL; + private String schemaGUID; + private int maxCacheSize; + private OCFRESTClient restClient; private final RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler(); @@ -35,7 +35,7 @@ public class ConnectedSchemaAttributes extends SchemaAttributes * @param serviceName calling service * @param serverName name of the server. * @param userId user id to use on server calls. - * @param omasServerURL url root of the server to use. + * @param platformRootURL url root of the server to use. * @param schemaGUID unique identifier of the parent schema type. * @param totalElementCount the total number of elements to process. A negative value is converted to 0. * @param maxCacheSize maximum number of elements that should be retrieved from the property server and @@ -45,7 +45,7 @@ public class ConnectedSchemaAttributes extends SchemaAttributes ConnectedSchemaAttributes(String serviceName, String serverName, String userId, - String omasServerURL, + String platformRootURL, String schemaGUID, int totalElementCount, int maxCacheSize, @@ -56,7 +56,7 @@ public class ConnectedSchemaAttributes extends SchemaAttributes this.serviceName = serviceName; this.serverName = serverName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformRootURL = platformRootURL; this.schemaGUID = schemaGUID; this.maxCacheSize = maxCacheSize; this.restClient = restClient; @@ -78,7 +78,7 @@ private ConnectedSchemaAttributes(ConnectedSchemaAttributes template) this.serviceName = template.serviceName; this.serverName = template.serverName; this.userId = template.userId; - this.omasServerURL = template.omasServerURL; + this.platformRootURL = template.platformRootURL; this.schemaGUID = template.schemaGUID; this.maxCacheSize = template.maxCacheSize; this.restClient = template.restClient; @@ -117,7 +117,7 @@ protected List getCachedList(int cacheStartPointer, try { SchemaAttributesResponse restResult = restClient.callOCFSchemaAttributesGetRESTCall(methodName, - omasServerURL + urlTemplate, + platformRootURL + urlTemplate, serverName, serviceName, userId, @@ -154,7 +154,7 @@ protected List getCachedList(int cacheStartPointer, } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, serverName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, serverName, platformRootURL); } return null; diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/EgeriaConnectedAssetProperties.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/EgeriaConnectedAssetProperties.java index e626e89c5f7..eec74892391 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/EgeriaConnectedAssetProperties.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/client/EgeriaConnectedAssetProperties.java @@ -39,7 +39,7 @@ public class EgeriaConnectedAssetProperties extends ConnectedAssetProperties private String userId = null; private String localServerUserId = null; private String localServerPassword = null; - private String omasServerURL = null; + private String platformURLRoot = null; private String connectorInstanceId = null; private ConnectionProperties connection = null; private String assetGUID = null; @@ -54,7 +54,7 @@ public class EgeriaConnectedAssetProperties extends ConnectedAssetProperties * @param serviceName calling service * @param remoteServerName name of the server. * @param userId identifier of calling user - * @param omasServerURL url of server + * @param platformURLRoot url of server * @param connectorInstanceId unique identifier of connector. * @param connection connection information for connector. * @param assetGUID String unique id for connected asset. @@ -62,7 +62,7 @@ public class EgeriaConnectedAssetProperties extends ConnectedAssetProperties public EgeriaConnectedAssetProperties(String serviceName, String remoteServerName, String userId, - String omasServerURL, + String platformURLRoot, String connectorInstanceId, ConnectionProperties connection, String assetGUID) @@ -72,7 +72,7 @@ public EgeriaConnectedAssetProperties(String serviceName, this.serviceName = serviceName; this.remoteServerName = remoteServerName; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.connectorInstanceId = connectorInstanceId; this.connection = connection; this.assetGUID = assetGUID; @@ -87,7 +87,7 @@ public EgeriaConnectedAssetProperties(String serviceName, * @param localServerUserId userId to use on the rest call. * @param localServerPassword password to use on the rest call. * @param userId identifier of calling user - * @param omasServerURL url of server + * @param platformURLRoot url of server * @param connectorInstanceId unique identifier of connector. * @param connection connection information for connector. * @param assetGUID String unique id for connected asset. @@ -97,7 +97,7 @@ public EgeriaConnectedAssetProperties(String serviceName, String localServerUserId, String localServerPassword, String userId, - String omasServerURL, + String platformURLRoot, String connectorInstanceId, ConnectionProperties connection, String assetGUID) @@ -109,7 +109,7 @@ public EgeriaConnectedAssetProperties(String serviceName, this.localServerUserId = localServerUserId; this.localServerPassword = localServerPassword; this.userId = userId; - this.omasServerURL = omasServerURL; + this.platformURLRoot = platformURLRoot; this.connectorInstanceId = connectorInstanceId; this.connection = connection; this.assetGUID = assetGUID; @@ -134,7 +134,7 @@ public EgeriaConnectedAssetProperties(EgeriaConnectedAssetProperties template) this.userId = template.userId; this.connection = template.connection; this.connectorInstanceId = template.connectorInstanceId; - this.omasServerURL = template.omasServerURL; + this.platformURLRoot = template.platformURLRoot; this.assetGUID = template.assetGUID; } } @@ -165,7 +165,7 @@ public void refresh() throws PropertyServerException, UserNotAuthorizedException remoteServerName, localServerUserId, localServerPassword, - omasServerURL, + platformURLRoot, userId, assetGUID, connection.getGUID()); @@ -174,7 +174,7 @@ public void refresh() throws PropertyServerException, UserNotAuthorizedException { assetProperties = ConnectedAssetUniverse.create(serviceName, remoteServerName, - omasServerURL, + platformURLRoot, userId, assetGUID, connection.getGUID()); @@ -186,7 +186,7 @@ public void refresh() throws PropertyServerException, UserNotAuthorizedException } catch (Exception error) { - restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, omasServerURL); + restExceptionHandler.handleUnexpectedException(error, methodName, remoteServerName, platformURLRoot); } log.debug("Returning from method: " + methodName + " having retrieved: " + assetProperties.toString()); @@ -206,7 +206,7 @@ public String toString() ", remoteServerName='" + remoteServerName + '\'' + ", userId='" + userId + '\'' + ", localServerUserId='" + localServerUserId + '\'' + - ", omasServerURL='" + omasServerURL + '\'' + + ", platformURLRoot='" + platformURLRoot + '\'' + ", connectorInstanceId='" + connectorInstanceId + '\'' + ", connection=" + connection + ", assetGUID='" + assetGUID + '\'' + diff --git a/open-metadata-implementation/frameworks/README.md b/open-metadata-implementation/frameworks/README.md index feac3af631c..26baf95ddba 100644 --- a/open-metadata-implementation/frameworks/README.md +++ b/open-metadata-implementation/frameworks/README.md @@ -26,7 +26,15 @@ or the organization in some way. (called discovery services) that access data-related assets and extract characteristics about the data that can be stored in an open metadata repository. -**Note:** Both the discovery services and the governance actions are specialized OCF connectors, making the OCF the +* **[Survey Action Framework (SAF)](survey-action-framework)** provides the interfaces and base implementations for components + (called survey action services) that survey and extract characteristics + about the real-world resources and stores them in an open metadata repository. + +* **[Event Action Framework (EAF)](event-action-framework)** provides the interfaces and base implementations for components + (called survey action services) that survey and extract characteristics + about the real-world resources and stores them in an open metadata repository. + +**Note:** The survey services, discovery services and the governance actions are specialized OCF connectors, making the OCF the **only** plug-in mechanism in the open metadata and governance technology. ---- diff --git a/open-metadata-implementation/frameworks/event-action-framework/README.md b/open-metadata-implementation/frameworks/event-action-framework/README.md new file mode 100644 index 00000000000..72218eaa5c5 --- /dev/null +++ b/open-metadata-implementation/frameworks/event-action-framework/README.md @@ -0,0 +1,27 @@ + + + +![InDevelopment](../../../images/egeria-content-status-in-development.png#pagewidth) + +# Event Action Framework (EAF) + +The Event Action Framework (EAF) enables the creation of governance services that manage events. +These events may be instantaneous, or cover an extended time period. An event may be in the past, occurring now, or is something in the future that is being planned for. + +Events are described in open metadata using [context events](https://egeria-project.org/concepts/context-event). The context event provides an anchor point for information and activity around the event. Services that use the event action framework are: + +* Collecting and cataloguing data about the event. +* Managing metadata associated with the event. +* Sending and receiving notifications related to an event. +* Initiating other actions at specific moments in time that related to the event. + +More information is available on Egeria's [documentation site](https://egeria-project.org/frameworks/eaf/overview/). + + +---- +Return to [frameworks](..). + + +---- +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/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/client/MetadataElementInterface.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/client/MetadataElementInterface.java index b60aab74a89..2ba8a8766cd 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/client/MetadataElementInterface.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/client/MetadataElementInterface.java @@ -6,6 +6,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.frameworks.governanceaction.properties.ArchiveProperties; import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataElement; import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElement; import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElements; @@ -658,6 +659,58 @@ void deleteMetadataElementInStore(String userId, PropertyServerException; + /** + * Archive a specific metadata element. + * + * @param userId caller's userId + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + void archiveMetadataElementInStore(String userId, + String metadataElementGUID, + ArchiveProperties archiveProperties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Archive a specific metadata element. + * + * @param userId caller's userId + * @param externalSourceGUID unique identifier of the software capability that owns this collection + * @param externalSourceName unique name of the software capability that owns this collection + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + void archiveMetadataElementInStore(String userId, + String externalSourceGUID, + String externalSourceName, + String metadataElementGUID, + ArchiveProperties archiveProperties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to * a metadata element. diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataProperty.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataProperty.java index 226115b40ea..37286ec6529 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataProperty.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataProperty.java @@ -133,24 +133,250 @@ public enum OpenMetadataProperty */ SAMPLING_METHOD ( "samplingMethod", "string", "Description of the technique used to create the sample.", "1cb00437-adde-4b71-a655-f736f2c8989d"), - + /** + * The relationship of element that has been changed to the anchor. + */ CHANGE_TARGET ( "changeTarget", "LatestChangeTarget", "The relationship of element that has been changed to the anchor.", "b3a4c3c0-f17f-4380-848a-6c6d985c2dd3"), + + /** + * The type of change. + */ CHANGE_ACTION ( "changeAction", "LatestChangeAction", "The type of change.", "365c4667-b86a-445f-860b-dc35eac917f2"), + + /** + * The name of the associated classification. + */ CLASSIFICATION_NAME ( "classificationName", "string", "The name of the associated classification.", "ef2169c4-c8f3-48b0-9051-cfb2bbb1e5f2"), + + /** + * Name of the property in the classification where this value is used. + */ CLASSIFICATION_PROPERTY_NAME ( "classificationPropertyName", "string", "Name of the property in the classification where this value is used.", "5471ec69-a23d-4d89-b134-b30a8a01f435"), + + /** + * If an attached entity or relationship to it changed, this is its unique identifier. + */ ATTACHMENT_GUID ( "attachmentGUID", "string", "If an attached entity or relationship to it changed, this is its unique identifier.", "74d62753-fd42-47c5-a804-29334f394728"), + + /** + * If an attached entity or relationship to changed, this is its unique type name. + */ ATTACHMENT_TYPE ( "attachmentType", "string", "If an attached entity or relationship to changed, this is its unique type name.", "b7f9f49a-e227-44d8-ae26-7e9c4f552379"), + + /** + * If an attached entity or relationship to changed, this is its unique type name of the relationship. + */ RELATIONSHIP_TYPE ( "relationshipType", "string", "If an attached entity or relationship to changed, this is its unique type name of the relationship.", "afa67874-fa00-422e-8902-69e5e3cc9e43"), - USER ( "user", "string", "The user identifier for the person/system making the change.", "1afa1bb1-a9f0-4739-a45a-ff0d01b867f5"), - ACTION_DESCRIPTION ( "actionDescription", "string", "Description of the activity.", "2f0a4467-7b72-4dba-a345-d80959d8a3d5"), + /** + * The user identifier for the person/system executing the request. + */ + USER ( "user", "string", "The user identifier for the person/system executing the request.", "1afa1bb1-a9f0-4739-a45a-ff0d01b867f5"), + + /** + * Description of the activity. + */ + ACTION_DESCRIPTION ( "actionDescription", "string", "Description of the activity.", "2f0a4467-7b72-4dba-a345-d80959d8a3d5"), + /** + * The display name for the template to help requester choose the template to use. + */ TEMPLATE_NAME( "templateName" , "string", "The display name for the template to help requester choose the template to use.", "32c4a43e-cc81-4d85-af2e-97bd492a8893"), + + /** + * The description of the template to help requester choose the template to use. + */ TEMPLATE_DESCRIPTION ("templateDescription", "string","The description of the template to help requester choose the template to use.", "1c537e66-a43e-42bc-94f7-055af7696c86" ), + + /** + * Map of attribute names to values that should be replaced in the template. These attributes map to the root entity of the template, or, the first occurrence of the attribute in attached relationships, classifications or entities. + */ REPLACEMENT_PROPERTIES ( "replacementProperties", "map", "Map of attribute names to values that should be replaced in the template. These attributes map to the root entity of the template, or, the first occurrence of the attribute in attached relationships, classifications or entities.", "e4bc87ae-b15d-4fd6-ba33-2ed85f699244"), + + /** + * Map of placeholder names to values that should be replaced in the template. + */ PLACEHOLDER_PROPERTIES( "placeholderProperties", "map", "Map of placeholder names to values that should be replaced in the template.", "f16227bb-61d7-4ea9-947c-a0415b541542"), - SOURCE_VERSION_NUMBER ( "sourceVersionNumber", "long", "The version number of the template element when the copy was created.", null ), + /** + * The version number of the template element when the copy was created. + */ + SOURCE_VERSION_NUMBER ( "sourceVersionNumber", "long", "The version number of the template element when the copy was created.", "4729488f-2e42-4801-bc17-9dfad508c1fa" ), + + /** + * The fully qualified physical location of the data store. + */ + PATH_NAME("pathName", "string", "The fully qualified physical location of the data store.", "34d24b66-12f1-437c-afd3-1f1ab3377472"), + + /** + * File type descriptor (or logical file type) typically extracted from the file name. + */ + FILE_TYPE("fileType", "string", "File type descriptor (or logical file type) typically extracted from the file name.", "f180c49b-2de6-4657-bdf7-069747bc612d"), + + /** + * The name of the file with extension. + */ + FILE_NAME("fileName", "string", "The name of the file with extension.", "f22d0164-3790-42c3-aacb-154ccee7fbb6"), + + /** + * The file extension used at the end of the file's name. This identifies the format of the file. + */ + FILE_EXTENSION("fileExtension", "string", "The file extension used at the end of the file's name. This identifies the format of the file.", "62b00622-fa2c-4ee0-be60-3f15b1cb3dd6"), + + /** + * The request type used to call the service. + */ + REQUEST_TYPE ("requestType", "string", "The request type used to call the service.", "be22cf20-f704-459e-823f-bdd8f7ef003b"), + + /** + * Properties that configure the governance service for this type of request. + */ + REQUEST_PARAMETERS("requestParameters", "map", "Properties that configure the governance service for this type of request.", "882a5a30-3724-41ea-90ff-667cb7627bde"), + + /** + * Request type supported by the governance service (overrides requestType on call to governance service if specified) + */ + SERVICE_REQUEST_TYPE("serviceRequestType", "string", "Request type supported by the governance service (overrides requestType on call to governance service if specified).", "63238bb7-e935-4c38-8d0a-61917f01a31d"), + + /** + * Unique name of the link type that connects the edge to the vertex. + */ + LINK_TYPE_NAME( "linkTypeName", "string","Unique name of the link type that connects the edge to the vertex.","4f275bc0-3a33-4f6a-96ee-cd7bd13ba579"), + + /** + * If the end of a relationship is significant set to 1 or 2 to indicated the end; otherwise use 0. + */ + RELATIONSHIP_END ("relationshipEnd", "int", "If the end of a relationship is significant set to 1 or 2 to indicated the end; otherwise use 0.", "8b53224f-e330-4ded-9d18-da6517094994"), + + /** + * Display name for the relationship end. + */ + RELATIONSHIP_END_NAME ("relationshipEndName", "string", "Display name for the relationship end.", "e98f95e3-316b-4200-b608-57d7836d8901"), + + /** + * Open metadata type name for the associated schema type. + */ + SCHEMA_TYPE_NAME ("schemaTypeName", "string", "Open metadata type name for the associated schema type.", "4948ea82-387c-4a82-99ad-3e94bb5253b7"), + + /** + * The name of a primitive data type. + */ + DATA_TYPE ("dataType", "string", "The name of a primitive data type.", "50e73f9f-10a0-4b41-9cb6-bf55630f3734"), + + /** + * Position of the element in a collection of relationships. + */ + POSITION ("position", "int", "Position of the element in a collection of relationships.", "2fd62293-99e3-48f9-825f-e9b22d8470ae"), + + /** + * Minimum number of allowed instances. + */ + MIN_CARDINALITY ("minCardinality", "int", "Minimum number of allowed instances.", "d3e13cd5-414f-4c82-94b8-e61dad64f7c3"), + + /** + * Maximum number of allowed instances. + */ + MAX_CARDINALITY ("maxCardinality", "int", "Maximum number of allowed instances.", "5caa1b1a-590f-4a2e-85ad-260b64f4bbc1"), + + /** + * Provides additional reasons, or expectations from the results. + */ + PURPOSE ("purpose", "string", "Provides additional reasons, or expectations from the results.", "be802acc-3324-4c32-9b4a-69746a9b3018"), + + /** + * Name of the type of annotation. + */ + ANNOTATION_TYPE ("annotationType", "string", "Name of the type of annotation.", "be802acc-3324-4c32-9b4a-69746a9b3018"), + + /** + * Short description for summary tables. + */ + SUMMARY ("summary", "string", "Short description for summary tables.", "30719554-1a97-424f-ac05-f4e4e67bd278"), + + /** + * Level of certainty in the accuracy of the results. + */ + CONFIDENCE_LEVEL ("confidenceLevel", "int", "Level of certainty in the accuracy of the results.", "29372374-38bb-472d-9d6e-529b68aed1e0"), + + /** + * Expression used to create the annotation. + */ + EXPRESSION ("expression", "string", "Expression used to create the annotation.", "e130bc01-7c58-4799-8d8a-ae3ec659a064"), + + /** + * Explanation of the analysis. + */ + EXPLANATION ("explanation", "string", "Explanation of the analysis.", "9445c89d-250f-464c-bb9c-744f25b7b7e1"), + + /** + * Additional request parameters passed to the service. + */ + ANALYSIS_PARAMETERS ("analysisParameters", "map", "Additional request parameters passed to the service.", "b3eb6d7f-9c52-44f0-99c3-359f52218c7e"), + + /** + * The step in the analysis that produced the annotation. + */ + ANALYSIS_STEP ("analysisStep", "string", "The step in the analysis that produced the annotation.", "0b8d13b5-39eb-46d1-9ab0-1cc192697ff7"), + + /** + * Additional properties used in the request. + */ + JSON_PROPERTIES ("jsonProperties", "map", "Additional properties used in the specification.", "fe0c84c7-6f19-4c36-897f-9067447d0d9a"), + + /** + * Date of the review. + */ + REVIEW_DATE ("reviewDate", "date", "Date of the review.", "7c19aa3a-5fbe-4455-928d-3330b21b22dd"), + + /** + * User identifier for the steward performing the review. + */ + STEWARD ( "Steward", "string", "User identifier for the steward performing the review.", "6777fa1e-3289-4896-a032-1097b4ad78b2"), + + /** + * Notes provided by the steward. + */ + COMMENT ("comment", "string", "Notes provided by the steward.", "bb38c0ab-de6c-47d6-ae3a-d4848fd79c58"), + + /** + * Status of the processing as a result of the annotation. + */ + ANNOTATION_STATUS ("annotationStatus","AnnotationStatus", "Status of the processing as a result of the annotation.", "d36618bf-99fc-474f-a958-e8c64cd715ee"), + + /** + * The status of the work on this element. + */ + STATUS ("status", "ToDoStatus", "The status of the work on this element.", "bcd570a4-03af-4569-ba34-72b823ba01c5"), + + /** + * Date/time that work started on this element. + */ + START_DATE ("startDate", "date", "Date/time that work started on this element.", "e3e374cc-0f9d-45f6-ae74-7d7a438b17bf"), + + /** + * Date/time that work stopped on this element. + */ + COMPLETION_DATE ( "completionDate", "date", "Date/time that work stopped on this element.", "28585eb7-ca9f-4149-b51f-ad29bbfe3f7c"), + + /** + * The name to identify the action target to the actor that processes it. + */ + ACTION_TARGET_NAME ( "actionTargetName", "string", "The name to identify the action target to the actor that processes it.", "3a5d325f-267c-4821-beb2-2c59d89891ed"), + + /** + * Message to provide additional information on the results of acting on the target by the actor or the reasons for any failures. + */ + COMPLETION_MESSAGE ( "completionMessage", "string", "Message to provide additional information on the results of acting on the target by the actor or the reasons for any failures.", "f7633bda-9a90-4561-8d5a-356126a855ea"), + + /** + * Display name for the discovered schema. + */ + SCHEMA_NAME("schemaName", "string", "Display name for the discovered schema.", "c6011a00-b9c0-45d9-a525-88014aa3546f"), + + /** + * Type name for the discovered schema. + */ + SCHEMA_TYPE("schemaType", "string", "Type name for the discovered schema.", "6a68d174-fd29-49ef-aa4b-26205dbebb58"), ; diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataType.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataType.java index 9fba343853e..2198bbc97c7 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataType.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataType.java @@ -140,8 +140,293 @@ public enum OpenMetadataType OpenMetadataWikiPages.MODEL_0011_MANAGING_REFERENCEABLES, "e5794f9e-adf0-461d-bee2-7ba807dc1511", "Defines source of the information for a referenceable that was created by copying from a template."), + + /* ============================================================================================================================*/ + /* Area 4 - Governance */ + /* ============================================================================================================================*/ + + /** + * A collection of related governance services of the same type. + */ + GOVERNANCE_ENGINE ("3fa23d4a-aceb-422f-9301-04ed474c6f74", + "GovernanceEngine", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "11b96995-f6f1-46e6-abee-846a2f77f2a8", + "A collection of related governance services of the same type."), + + /** + * A connector that performs some governance operation. + */ + GOVERNANCE_SERVICE ("191d870c-26f4-4310-a021-b8ca8772719d", + "GovernanceService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "e091225c-1092-4f28-b7e1-bf53456f9705", + "A connector that performs some governance operation."), + + /** + * A collection of related governance services of the same type from the Governance Action Framework (GAF). + */ + GOVERNANCE_ACTION_ENGINE ("5d74250a-57ca-4197-9475-8911f620a94e", + "GovernanceActionEngine", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "a8f14964-5028-4269-81be-5d23757c9caa", + "A collection of related governance services of the same type from the Governance Action Framework (GAF)."), + + /** + * A governance service that conforms to the Governance Action Framework (GAF). + */ + GOVERNANCE_ACTION_SERVICE ("ececb378-31ac-4cc3-99b4-1c44e5fbc4d9", + "GovernanceActionService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "c927dcac-3481-4246-98ec-e0662e5e3a77", + "A governance service that conforms to the Governance Action Framework (GAF)."), + + /** + * A governance engine for managing context events and associated actions. + */ + EVENT_ACTION_ENGINE ("796f6493-3c3e-4091-8b21-46ea4e54d011", + "EventActionEngine", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "cebad26a-08f6-40b7-a0e0-4f9b1b439992", + "A governance engine for managing context events and associated actions."), + + /** + * A governance service for managing context events and associated actions. + */ + EVENT_ACTION_SERVICE ("464bb4d8-f865-4b9d-a06e-7ed19518ff13", + "EventActionService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "6e030483-39ff-4b1b-bd50-1faa64e44690", + "A governance service for managing context events and associated actions."), + + /** + * A governance engine for managing the surveying of real-world resources and capturing the results in survey report attached to the associated asset. + */ + SURVEY_ACTION_ENGINE ("9a6f3982-ebc0-4002-8762-21d415a0c21d", + "SurveyActionEngine", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "325b61dd-4d43-4bd7-bcf9-af5f20b77d05", + "A governance engine for managing the surveying of real-world resources and capturing the results in survey report attached to the associated asset."), + + /** + * A governance service for managing the surveying of real-world resources and capturing the results in survey report attached to the associated asset. + */ + SURVEY_ACTION_SERVICE ("f387389b-77c0-4386-b169-fc701919460a", + "SurveyActionService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "16009219-1913-466c-994b-853e0c5c961b", + "A governance service for managing the surveying of real-world resources and capturing the results in survey report attached to the associated asset."), + + /** + * A server capability for running open discovery services. + */ + OPEN_DISCOVERY_ENGINE ("be650674-790b-487a-a619-0a9002488055", + "OpenDiscoveryEngine", + OpenMetadataWikiPages.MODEL_0601_DISCOVERY_ENGINES, + "bde9e812-35a0-49fb-b5ed-9cb1ffa48d60", + "A server capability for running open discovery services."), + + /** + * A pluggable component for discovering properties about an asset. + */ + OPEN_DISCOVERY_SERVICE ("2f278dfc-4640-4714-b34b-303e84e4fc40", + "OpenDiscoveryService", + OpenMetadataWikiPages.MODEL_0601_DISCOVERY_ENGINES, + "38b8d73d-3c60-4e86-8561-256c77e10c16", + "A pluggable component for discovering properties about an asset."), + + /** + * A pluggable component that calls multiple discovery services. + */ + OPEN_DISCOVERY_PIPELINE ("081abe00-740e-4143-b0d5-a1f55450fc22", + "OpenDiscoveryPipeline", + OpenMetadataWikiPages.MODEL_0601_DISCOVERY_ENGINES, + "85a985ab-2f07-4ffc-99d5-d423d787c51e", + "A pluggable component that calls multiple discovery services."), + + /** + * A governance engine for open metadata repositories. + */ + REPOSITORY_GOVERNANCE_ENGINE ("2b3bed05-c227-47d7-87a3-139ab0568361", + "RepositoryGovernanceEngine", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "c283bb2c-f007-485c-b90f-cb81194d4c25", + "A governance engine for open metadata repositories."), + + /** + * A governance service for open metadata repositories. + */ + REPOSITORY_GOVERNANCE_SERVICE ("978e7674-8231-4158-a4e3-a5ccdbcad60e", + "RepositoryGovernanceService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "30671690-f94e-440b-abdb-2384ed36d8bf", + "A governance service for open metadata repositories."), + + /** + * Link between a governance engine and one of its services. + */ + SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP ("2726df0e-4f3a-44e1-8433-4ca5301457fd", + "SupportedGovernanceService", + OpenMetadataWikiPages.MODEL_0461_GOVERNANCE_ENGINES, + "346ca38f-287d-401f-bbe9-375ecd2b938f", + "Link between a governance engine and one of its services."), + + /* ============================================================================================================================*/ + /* Area 5 - Schemas */ + /* ============================================================================================================================*/ + + /** + * The root of a complex schema - normally attaches to an asset or port. + */ + ROOT_SCHEMA_TYPE ("126962bf-dd26-4fcf-97d8-d0ad1fdd2d50", + "RootSchemaType", + OpenMetadataWikiPages.MODEL_0530_TABULAR_SCHEMAS, + "3e788ad5-4cad-4790-8744-0ad6674cb7b4", + "The root of a complex schema - normally attaches to an asset or port."), + + /** + * A schema type for a graph data structure. + */ + GRAPH_SCHEMA_TYPE( "983c5e72-801b-4e42-bc51-f109527f2317", + "GraphSchemaType", + OpenMetadataWikiPages.MODEL_0533_GRAPH_SCHEMAS, + "f5200884-ff02-4f25-bf3b-2f7ca24a074d", + "A schema type for a graph data structure."), + + /** + * A schema attribute for a node in a graph data structure. + */ + GRAPH_VERTEX( "1252ce12-540c-4724-ad70-f70940956de0", + "GraphVertex", + OpenMetadataWikiPages.MODEL_0533_GRAPH_SCHEMAS, + "f5a74d2d-7d8e-4e42-9187-7e10d0979256", + "A schema attribute for a node in a graph data structure."), + + /** + * A schema attribute for a relationship in graph data structure. + */ + GRAPH_EDGE( "d4104eb3-4f2d-4d83-aca7-e58dd8d5e0b1", + "GraphEdge", + OpenMetadataWikiPages.MODEL_0533_GRAPH_SCHEMAS, + "b39112b8-e22d-4510-9420-1ef72f84b8e9", + "A schema attribute for a relationship in graph data structure."), + + /** + * A link between a graph edge and a vertex. Each edge should have two of these relationships. + */ + GRAPH_EDGE_LINK_RELATIONSHIP( "503b4221-71c8-4ba9-8f3d-6a035b27971c", + "GraphEdgeLink", + OpenMetadataWikiPages.MODEL_0533_GRAPH_SCHEMAS, + "15c806cf-c51e-4ab8-991b-0bf45bd0a96a", + "A link between a graph edge and a vertex. Each edge should have two of these relationships."), + + + /* ============================================================================================================================*/ + /* Area 6 - Metadata Surveys */ + /* ============================================================================================================================*/ + + /** + * A set of results describing the analysis from the execution of a survey action service. + */ + SURVEY_REPORT ("db9d02a6-11f1-4b6e-86ce-95df2352c3a2", + "SurveyReport", + OpenMetadataWikiPages.MODEL_0603_SURVEY_REPORTS, + "97b45655-4393-499b-a997-589015342284", + "A set of results describing the analysis from the execution of a survey action service."), + + /** + * Link between an Asset and a SurveyReport generated against its associated resource. + */ + ASSET_SURVEY_REPORT_RELATIONSHIP ("0a5572d4-71fe-4a13-beba-e6ece5104799", + "AssetSurveyReport", + OpenMetadataWikiPages.MODEL_0603_SURVEY_REPORTS, + "4b76f90e-3222-480e-9ee3-845f93c72e4f", + "Link between an Asset and a SurveyReport generated against its associated resource."), + + /** + * Link to a SurveyReport from the EngineAction that initiated the request. + */ + ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP ("9ee592d0-ee01-4e47-a7b9-fa97ad9f395e", + "EngineActionSurveyReport", + OpenMetadataWikiPages.MODEL_0603_SURVEY_REPORTS, + "efc672a1-4b8f-4197-9038-5eb6ebd7a075", + "Link to a SurveyReport from the EngineAction that initiated the request."), + + /** + * Link between a SurveyReport and an Annotation generated from the same run of a survey action service. + */ + REPORTED_ANNOTATION_RELATIONSHIP ("3af278ed-f4e8-4afc-851b-a5b0908ba06f", + "ReportedAnnotation", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "69b91341-3f40-4e0a-a78d-cc6ff0aa524a", + "Link between a SurveyReport and an Annotation generated from the same run of a survey action service."), + + /** + * Link between an element and an Annotation that describes a characteristic of its associated real-world counterpart. + */ + ASSOCIATED_ANNOTATION_RELATIONSHIP ("5d4ec403-7417-4146-99da-dd9ea34d4f0a", + "AssociatedAnnotation", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "09b7622e-e0ea-4197-8f82-83fe69fb70de", + "Link between an element and an Annotation that describes a characteristic of its associated real-world counterpart."), + + /** + * A set of results from specific analysis of a resource by a survey action service. + */ + ANNOTATION ("6cea5b53-558c-48f1-8191-11d48db29fb4", + "Annotation", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "42de3ec5-b76f-45b7-98b3-7b09d3d4e76a", + "A set of results from specific analysis of a resource by a survey action service."), + + /** + * A collection of properties about a data field, or number of data fields, in an Asset. + */ + DATA_FIELD_ANNOTATION ( "72ed6de6-79d9-4e7d-aefc-b969382fc4b0", + "DataFieldAnnotation", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "772b7c96-0838-4b96-8547-6e581b93e8d2", + "A collection of properties about a data field, or number of data fields, in an Asset."), + + /** + * Additional information to augment an annotation. + */ + ANNOTATION_EXTENSION_RELATIONSHIP ("605aaa6d-682e-405c-964b-ca6aaa94be1b", + "AnnotationExtension", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "8b4fd712-505a-4d9c-a39d-3e23e0cbcd0e", + "Additional information to augment an annotation."), + + /** + * The results of a stewardship review of an annotation. + */ + ANNOTATION_REVIEW ( "b893d6fc-642a-454b-beaf-809ee4dd876a", + "AnnotationReview", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "0b625826-4663-44a0-b524-b04e1eddd7d0", + "The results of a stewardship review of an annotation."), + + /** + * Review results for an annotation. + */ + ANNOTATION_REVIEW_LINK_RELATIONSHIP ( "5d3c2fb7-fa04-4d77-83cb-fd9216a07769", + "AnnotationReviewLink", + OpenMetadataWikiPages.MODEL_0610_ANNOTATIONS, + "d6e66e06-5f3f-45cc-b6eb-f951b423603b", + "Review results for an annotation."), + + /** + * A description of the internal structure of an Asset. + */ + SCHEMA_ANALYSIS_ANNOTATION( "3c5aa68b-d562-4b04-b189-c7b7f0bf2ced", + "SchemaAnalysisAnnotation", + OpenMetadataWikiPages.MODEL_0615_SCHEMA_EXTRACTION, + "32dde7be-5c68-41ea-89f4-31b53fa2e9f2", + "A description of the internal structure of an Asset."), + ; - + + public final String typeGUID; public final String typeName; public final String wikiURL; @@ -1904,9 +2189,9 @@ public enum OpenMetadataType public static final String EXPECTED_DATA_FORMAT_PROPERTY_NAME = "expectedDataFormat"; /** - * connectorFrameworkNameName + * connectorFrameworkName */ - public static final String CONNECTOR_FRAMEWORK_PROPERTY_NAME = "connectorFrameworkNameName"; + public static final String CONNECTOR_FRAMEWORK_PROPERTY_NAME = "connectorFrameworkName"; /** * connectorInterfaceLanguage @@ -2083,6 +2368,10 @@ public enum OpenMetadataType */ public static final String ASSET_TO_CONNECTION_TYPE_NAME = "ConnectionToAsset"; + public static final String CONNECTION_TO_ASSET_TYPE_GUID = "e777d660-8dbe-453e-8b83-903771f054c0"; + public static final String CONNECTION_TO_ASSET_TYPE_NAME = "ConnectionToAsset"; + /* End1 = Connection; End 2 = Asset */ + /** * assetSummary */ @@ -2098,11 +2387,6 @@ public enum OpenMetadataType */ public static final String DATA_STORE_TYPE_NAME = "DataStore"; - /** - * pathName - */ - public static final String PATH_NAME_PROPERTY_NAME = "pathName"; /* from DataStore entity */ - /** * storeCreateTime */ @@ -2365,21 +2649,6 @@ public enum OpenMetadataType */ public static final String PARQUET_FILE_TYPE_NAME = "ParquetFile"; - /** - * fileName - */ - public static final String FILE_NAME_PROPERTY_NAME = "fileName"; /* from DataFile entity */ - - /** - * fileType - */ - public static final String FILE_TYPE_PROPERTY_NAME = "fileType"; /* from DataFile entity */ - - /** - * fileExtension - */ - public static final String FILE_EXTENSION_PROPERTY_NAME = "fileExtension"; /* from DataFile entity */ - /** * c5ce5499-9582-42ea-936c-9771fbd475f8 @@ -3635,56 +3904,6 @@ public enum OpenMetadataType public static final String POINT_TYPE_PROPERTY_NAME = "pointType"; /* from Area 4 */ - public static final String GOVERNANCE_ENGINE_TYPE_GUID = "3fa23d4a-aceb-422f-9301-04ed474c6f74"; - public static final String GOVERNANCE_ENGINE_TYPE_NAME = "GovernanceEngine"; - /* SoftwareServerCapability */ - - public static final String GOVERNANCE_SERVICE_TYPE_GUID = "191d870c-26f4-4310-a021-b8ca8772719d"; - public static final String GOVERNANCE_SERVICE_TYPE_NAME = "GovernanceService"; - /* DeployedConnector */ - - public static final String GOVERNANCE_ACTION_ENGINE_TYPE_GUID = "5d74250a-57ca-4197-9475-8911f620a94e"; - public static final String GOVERNANCE_ACTION_ENGINE_TYPE_NAME = "GovernanceActionEngine"; - /* GovernanceEngine */ - - public static final String GOVERNANCE_ACTION_SERVICE_TYPE_GUID = "ececb378-31ac-4cc3-99b4-1c44e5fbc4d9"; - public static final String GOVERNANCE_ACTION_SERVICE_TYPE_NAME = "GovernanceActionService"; - /* DeployedConnector */ - - public static final String EVENT_ACTION_ENGINE_TYPE_GUID = "796f6493-3c3e-4091-8b21-46ea4e54d011"; - public static final String EVENT_ACTION_ENGINE_TYPE_NAME = "EventActionEngine"; - /* GovernanceEngine */ - - public static final String EVENT_ACTION_SERVICE_TYPE_GUID = "464bb4d8-f865-4b9d-a06e-7ed19518ff13"; - public static final String EVENT_ACTION_SERVICE_TYPE_NAME = "EventActionService"; - /* DeployedConnector */ - - public static final String OPEN_DISCOVERY_ENGINE_TYPE_GUID = "be650674-790b-487a-a619-0a9002488055"; - public static final String OPEN_DISCOVERY_ENGINE_TYPE_NAME = "OpenDiscoveryEngine"; - /* GovernanceEngine */ - - public static final String OPEN_DISCOVERY_SERVICE_TYPE_GUID = "2f278dfc-4640-4714-b34b-303e84e4fc40"; - public static final String OPEN_DISCOVERY_SERVICE_TYPE_NAME = "OpenDiscoveryService"; - /* DeployedConnector */ - - - public static final String REPOSITORY_GOVERNANCE_ENGINE_TYPE_GUID = "2b3bed05-c227-47d7-87a3-139ab0568361"; - public static final String REPOSITORY_GOVERNANCE_ENGINE_TYPE_NAME = "RepositoryGovernanceEngine"; - /* GovernanceEngine */ - - public static final String REPOSITORY_GOVERNANCE_SERVICE_TYPE_GUID = "978e7674-8231-4158-a4e3-a5ccdbcad60e"; - public static final String REPOSITORY_GOVERNANCE_SERVICE_TYPE_NAME = "RepositoryGovernanceService"; - /* DeployedConnector */ - - - public static final String SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID = "2726df0e-4f3a-44e1-8433-4ca5301457fd"; - public static final String SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME = "SupportedGovernanceService"; - /* End1 = GovernanceEngine; End 2 = GovernanceService */ - - public static final String REQUEST_TYPE_PROPERTY_NAME = "requestType"; /* from SupportedGovernanceService relationship */ - public static final String SERVICE_REQUEST_TYPE_PROPERTY_NAME = "serviceRequestType"; /* from SupportedGovernanceService relationship */ - public static final String REQUEST_PARAMETERS_PROPERTY_NAME = "requestParameters"; /* from SupportedGovernanceService relationship */ - public static final String GOVERNANCE_ACTION_PROCESS_TYPE_GUID = "4d3a2b8d-9e2e-4832-b338-21c74e45b238"; public static final String GOVERNANCE_ACTION_PROCESS_TYPE_NAME = "GovernanceActionProcess"; /* Process */ @@ -4141,23 +4360,6 @@ public enum OpenMetadataType public static final String OBJECT_SCHEMA_ATTRIBUTE_TYPE_NAME = "ObjectSchemaAttribute"; /* SchemaAttribute */ - public static final String GRAPH_SCHEMA_TYPE_TYPE_GUID = "983c5e72-801b-4e42-bc51-f109527f2317"; /* from Area 5 */ - public static final String GRAPH_SCHEMA_TYPE_TYPE_NAME = "GraphSchemaType"; - /* ComplexSchemaType */ - - public static final String GRAPH_VERTEX_TYPE_GUID = "1252ce12-540c-4724-ad70-f70940956de0"; /* from Area 5 */ - public static final String GRAPH_VERTEX_TYPE_NAME = "GraphVertex"; - /* SchemaAttribute */ - - public static final String GRAPH_EDGE_TYPE_GUID = "d4104eb3-4f2d-4d83-aca7-e58dd8d5e0b1"; /* from Area 5 */ - public static final String GRAPH_EDGE_TYPE_NAME = "GraphEdge"; - /* SchemaAttribute */ - - /* For Graph Edge/Vertex */ - public static final String GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_GUID = "503b4221-71c8-4ba9-8f3d-6a035b27971c"; /* from Area 5 */ - public static final String GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_NAME = "GraphEdgeLink"; - /* End1 = GraphEdge; End 2 = GraphVertex */ - public static final String RELATIONAL_DB_SCHEMA_TYPE_TYPE_GUID = "f20f5f45-1afb-41c1-9a09-34d8812626a4"; /* from Area 5 */ public static final String RELATIONAL_DB_SCHEMA_TYPE_TYPE_NAME = "RelationalDBSchemaType"; /* ComplexSchemaType */ @@ -4478,7 +4680,7 @@ public enum OpenMetadataType public static final String CONCEPT_BEAD_COVERAGE_CATEGORY_PROPERTY_NAME = "coverageCategory"; public static final String UNIQUE_VALUES_PROPERTY_NAME = "uniqueValues"; - public static final String NAVIGABLE_PROPERTY_NAME = "naviagable"; + public static final String NAVIGABLE_PROPERTY_NAME = "navigable"; public static final String DECORATION_PROPERTY_NAME = "decoration"; @@ -4486,77 +4688,7 @@ public enum OpenMetadataType /* Area 6 - Discovery */ /* ============================================================================================================================*/ - public static final String DISCOVERY_ENGINE_TYPE_GUID = "be650674-790b-487a-a619-0a9002488055"; - public static final String DISCOVERY_ENGINE_TYPE_NAME = "OpenDiscoveryEngine"; - /* GovernanceEngine */ - - public static final String DISCOVERY_SERVICE_TYPE_GUID = "2f278dfc-4640-4714-b34b-303e84e4fc40"; - public static final String DISCOVERY_SERVICE_TYPE_NAME = "OpenDiscoveryService"; - /* GovernanceService */ - - public static final String DISCOVERY_PIPELINE_TYPE_GUID = "081abe00-740e-4143-b0d5-a1f55450fc22"; - public static final String DISCOVERY_PIPELINE_TYPE_NAME = "OpenDiscoveryPipeline"; - /* GovernanceService */ - - public static final String CONNECTION_TO_ASSET_TYPE_GUID = "e777d660-8dbe-453e-8b83-903771f054c0"; - public static final String CONNECTION_TO_ASSET_TYPE_NAME = "ConnectionToAsset"; - /* End1 = Connection; End 2 = Asset */ - - public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_GUID = "acc7cbc8-09c3-472b-87dd-f78459323dcb"; - public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_NAME = "OpenDiscoveryAnalysisReport"; - /* Referenceable */ - public static final String EXECUTION_DATE_PROPERTY_NAME = "executionDate"; /* from OpenDiscoveryAnalysisReport entity */ - public static final String ANALYSIS_PARAMS_PROPERTY_NAME = "analysisParameters"; /* from OpenDiscoveryAnalysisReport entity */ - public static final String ANALYSIS_STEP_PROPERTY_NAME = "discoveryRequestStep"; /* from OpenDiscoveryAnalysisReport entity */ - public static final String DISCOVERY_SERVICE_STATUS_PROPERTY_NAME = "discoveryServiceStatus"; /* from OpenDiscoveryAnalysisReport entity */ - - public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_GUID = "b2fdeddd-24eb-4e9c-a2a4-2693828d4a69"; - public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_NAME = "DiscoveryServiceRequestStatus"; - - public static final String REPORT_TO_ASSET_TYPE_GUID = "7eded424-f176-4258-9ae6-138a46b2845f"; /* from Area 6 */ - public static final String REPORT_TO_ASSET_TYPE_NAME = "AssetDiscoveryReport"; - /* End1 = Asset; End 2 = OpenDiscoveryAnalysisReport */ - - public static final String REPORT_TO_ENGINE_TYPE_GUID = "2c318c3a-5dc2-42cd-a933-0087d852f67f"; /* from Area 6 */ - public static final String REPORT_TO_ENGINE_TYPE_NAME = "DiscoveryEngineReport"; - /* End1 = OpenDiscoveryEngine; End 2 = OpenDiscoveryAnalysisReport */ - - public static final String REPORT_TO_SERVICE_TYPE_GUID = "1744d72b-903d-4273-9229-de20372a17e2"; /* from Area 6 */ - public static final String REPORT_TO_SERVICE_TYPE_NAME = "DiscoveryInvocationReport"; - /* End1 = OpenDiscoveryService; End 2 = OpenDiscoveryAnalysisReport */ - - public static final String REPORT_TO_ANNOTATIONS_TYPE_GUID = "51d386a3-3857-42e3-a3df-14a6cad08b93"; /* from Area 6 */ - public static final String REPORT_TO_ANNOTATIONS_TYPE_NAME = "DiscoveredAnnotation"; - /* End1 = Annotation; End 2 = OpenDiscoveryAnalysisReport */ - - - public static final String ANNOTATION_TYPE_GUID = "6cea5b53-558c-48f1-8191-11d48db29fb4"; - public static final String ANNOTATION_TYPE_NAME = "Annotation"; - - public static final String ANNOTATION_TYPE_PROPERTY_NAME = "annotationType"; /* from Annotation entity */ - public static final String CONFIDENCE_LEVEL_PROPERTY_NAME = "confidenceLevel"; /* from Annotation entity */ - public static final String EXPLANATION_PROPERTY_NAME = "explanation"; /* from Annotation entity */ - public static final String JSON_PROPERTIES_PROPERTY_NAME = "jsonProperties"; /* from Annotation entity */ - - public static final String ANNOTATION_TO_EXTENSION_TYPE_GUID = "605aaa6d-682e-405c-964b-ca6aaa94be1b"; /* from Area 6 */ - public static final String ANNOTATION_TO_EXTENSION_TYPE_NAME = "Annotation"; - /* End1 = (extended)Annotation; End 2 = Annotation(Extension) */ - - /* For AnnotationReview entity */ - public static final String ANNOTATION_REVIEW_TYPE_GUID = "b893d6fc-642a-454b-beaf-809ee4dd876a"; - public static final String ANNOTATION_REVIEW_TYPE_NAME = "AnnotationReview"; - - public static final String REVIEW_DATE_PROPERTY_NAME = "reviewDate"; /* from AnnotationReview entity */ - public static final String COMMENT_PROPERTY_NAME = "comment"; /* from AnnotationReview entity */ - - /* For AnnotationReviewLink relationship */ - public static final String ANNOTATION_REVIEW_LINK_TYPE_GUID = "5d3c2fb7-fa04-4d77-83cb-fd9216a07769"; - public static final String ANNOTATION_REVIEW_LINK_TYPE_NAME = "AnnotationReviewLink"; - /* End1 = Annotation; End 2 = AnnotationReview */ - - public static final String ANNOTATION_STATUS_PROPERTY_NAME = "annotationStatus"; /* from AnnotationReviewLink relationship */ - /* Enum Type AnnotationStatus */ /* For SchemaAnalysisAnnotation entity */ public static final String SCHEMA_ANALYSIS_ANNOTATION_TYPE_GUID = "3c5aa68b-d562-4b04-b189-c7b7f0bf2ced"; @@ -4565,36 +4697,6 @@ public enum OpenMetadataType public static final String SCHEMA_NAME_PROPERTY_NAME = "schemaName"; /* from SchemaAnalysisAnnotation entity */ public static final String SCHEMA_TYPE_PROPERTY_NAME = "schemaType"; /* from SchemaAnalysisAnnotation entity */ - /* For DataField entity */ - public static final String DATA_FIELD_TYPE_GUID = "3c5bbc8b-d562-4b04-b189-c7b7f0bf2cea"; - public static final String DATA_FIELD_TYPE_NAME = "DataField"; - - public static final String DATA_FIELD_NAME_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ - public static final String DATA_FIELD_TYPE_PROPERTY_NAME = "dataFieldType"; /* from DataField entity */ - public static final String DATA_FIELD_DESCRIPTION_PROPERTY_NAME = "dataFieldDescription"; /* from DataField entity */ - public static final String DATA_FIELD_ALIASES_PROPERTY_NAME = "dataFieldAliases"; /* from DataField entity */ - public static final String DATA_FIELD_NAMESPACE_PROPERTY_NAME = "dataFieldNamespace"; /* from DataField entity */ - public static final String VERSION_PROPERTY_NAME = "version"; /* from DataField entity */ - public static final String DATA_FIELD_SORT_ORDER_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ - - /* For DiscoveredDataField relationship */ - public static final String DISCOVERED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e22222cd54"; - public static final String DISCOVERED_DATA_FIELD_TYPE_NAME = "DiscoveredDataField"; - /* End1 = SchemaAnalysisAnnotation; End 2 = DataField */ - - /* For DiscoveredDataField relationship */ - public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e12356cd54"; - public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_NAME = "DiscoveredNestedDataField"; - /* End1 = (parent)DataField; End 2 = DataField */ - - public static final String DISCOVERED_LINKED_DATA_FIELD_TYPE_GUID = "cca4b116-4490-44c4-84e1-535231ae46a1"; - public static final String DISCOVERED_LINKED_DATA_FIELD_TYPE_NAME = "DiscoveredLinkedDataField"; - /* End1 = (parent)DataField; End 2 = DataField */ - - public static final String DATA_FIELD_POSITION_PROPERTY_NAME = "dataFieldPosition"; /* from DiscoveredDataField and - DiscoveredNestedDataField relationship */ - public static final String RELATIONSHIP_TYPE_NAME_PROPERTY_NAME = "relationshipTypeName"; /* from DiscoveredLinkedDataField relationship and - RelationshipAdviceAnnotation entity */ public static final String RELATIONSHIP_END_PROPERTY_NAME = "relationshipEnd"; /* from DiscoveredLinkedDataField relationship */ /* For DataFieldAnnotation entity */ @@ -4674,71 +4776,17 @@ public enum OpenMetadataType public static final String RELATIONSHIP_ADVICE_ANNOTATION_TYPE_GUID = "740f07dc-4ee8-4c2a-baba-efb55c73eb68"; public static final String RELATIONSHIP_ADVICE_ANNOTATION_TYPE_NAME = "RelationshipAdviceAnnotation"; /* DataFieldAnnotation */ + public static final String RELATIONSHIP_TYPE_NAME_PROPERTY_NAME = "relationshipTypeName"; public static final String RELATED_ENTITY_GUID_PROPERTY_NAME = "relatedEntityGUID"; /* from RelationshipAdviceAnnotation entity */ public static final String RELATIONSHIP_PROPERTIES_PROPERTY_NAME = "relationshipProperties"; /* from RelationshipAdviceAnnotation entity */ - /* For SuspectDuplicateAnnotation entity */ - public static final String SUSPECT_DUPLICATE_ANNOTATION_TYPE_GUID = "f703a621-4078-4c07-ab22-e7c334b94235"; - public static final String SUSPECT_DUPLICATE_ANNOTATION_TYPE_NAME = "SuspectDuplicateAnnotation"; - /* plus Annotation */ - public static final String DUPLICATE_ANCHOR_GUIDS_PROPERTY_NAME = "duplicateAnchorGUIDs"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_PROPERTY_NAMES_PROPERTY_NAME = "matchingPropertyNames"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_CLASSIFICATION_NAMES_PROPERTY_NAME = "matchingClassificationNames"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_ATTACHMENT_GUIDS_PROPERTY_NAME = "matchingAttachmentGUIDS"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_RELATIONSHIP_GUIDS_PROPERTY_NAME = "matchingRelationshipGUIDs"; /* from SuspectDuplicateAnnotation entity */ - /* For DivergentDuplicateAnnotation entity */ - public static final String DIVERGENT_DUPLICATE_ANNOTATION_TYPE_GUID = "251e443c-dee0-47fa-8a73-1a9d511915a0"; - public static final String DIVERGENT_DUPLICATE_ANNOTATION_TYPE_NAME = "DivergentDuplicateAnnotation"; - /* plus Annotation */ - - /* For DivergentValueAnnotation entity */ - public static final String DIVERGENT_VALUE_ANNOTATION_TYPE_GUID = "b86cdded-1078-4e42-b6ba-a718c2c67f62"; - public static final String DIVERGENT_VALUE_ANNOTATION_TYPE_NAME = "DivergentValueAnnotation"; - /* plus DivergentDuplicateAnnotation */ - - /* For DivergentClassificationAnnotation entity */ - public static final String DIVERGENT_CLASSIFICATION_ANNOTATION_TYPE_GUID = "8efd6257-a53e-451d-abfc-8e4899c38b1f"; - public static final String DIVERGENT_CLASSIFICATION_ANNOTATION_TYPE_NAME = "DivergentClassificationAnnotation"; - /* plus DivergentDuplicateAnnotation */ - - /* For DivergentRelationshipAnnotation entity */ - public static final String DIVERGENT_RELATIONSHIP_ANNOTATION_TYPE_GUID = "b6c6938a-fdc9-438f-893c-0b5b1d4a5bb3"; - public static final String DIVERGENT_RELATIONSHIP_ANNOTATION_TYPE_NAME = "DivergentRelationshipAnnotation"; - /* plus DivergentDuplicateAnnotation */ - - /* For DivergentAttachmentAnnotation entity */ - public static final String DIVERGENT_ATTACHMENT_ANNOTATION_TYPE_GUID = "f3ed48bc-b0ea-4e1f-a8ab-75f9f3cf87a6"; - public static final String DIVERGENT_ATTACHMENT_ANNOTATION_TYPE_NAME = "DivergentAttachmentAnnotation"; - /* plus DivergentDuplicateAnnotation */ - - /* For DivergentAttachmentValueAnnotation entity */ - public static final String DIVERGENT_ATTACHMENT_VALUE_ANNOTATION_TYPE_GUID = "e22a1ffe-bd90-4faf-b6a1-13fafb7948a2"; - public static final String DIVERGENT_ATTACHMENT_VALUE_ANNOTATION_TYPE_NAME = "DivergentAttachmentValueAnnotation"; - /* plus DivergentAttachmentAnnotation */ - - /* For DivergentAttachmentClassificationAnnotation entity */ - public static final String DIVERGENT_ATTACHMENT_CLASS_ANNOTATION_TYPE_GUID = "a2a5cb74-f8e0-470f-be71-26b7e32166a6"; - public static final String DIVERGENT_ATTACHMENT_CLASS_ANNOTATION_TYPE_NAME = "DivergentAttachmentClassificationAnnotation"; - /* plus DivergentAttachmentAnnotation */ - - /* For DivergentAttachmentRelationshipAnnotation entity */ - public static final String DIVERGENT_ATTACHMENT_REL_ANNOTATION_TYPE_GUID = "5613677a-865f-474e-8044-4167fa5a31b9"; - public static final String DIVERGENT_ATTACHMENT_REL_ANNOTATION_TYPE_NAME = "DivergentAttachmentRelationshipAnnotation"; - /* plus DivergentAttachmentAnnotation */ - - /* for divergent annotations */ - public static final String DUPLICATE_ANCHOR_GUID_PROPERTY_NAME = "duplicateAnchorGUID"; - // public static final String ATTACHMENT_GUID_PROPERTY_NAME = "attachmentGUID"; - public static final String DUPLICATE_ATTACHMENT_GUID_PROPERTY_NAME = "duplicateAttachmentGUID"; - public static final String DIVERGENT_PROPERTY_NAMES_PROPERTY_NAME = "divergentPropertyNames"; - public static final String DIVERGENT_CLASSIFICATION_NAME_PROPERTY_NAME = "divergentClassificationName"; - public static final String DIVERGENT_CLASSIFICATION_PROPERTY_NAMES_PROPERTY_NAME = "divergentClassificationPropertyNames"; - public static final String DIVERGENT_RELATIONSHIP_GUID_PROPERTY_NAME = "divergentRelationshipGUID"; - public static final String DIVERGENT_RELATIONSHIP_PROPERTY_NAMES_PROPERTY_NAME = "divergentRelationshipPropertyNames"; - /* For DataSourceMeasurementAnnotation entity */ public static final String DATA_SOURCE_MEASUREMENT_ANNOTATION_TYPE_GUID = "c85bea73-d7af-46d7-8a7e-cb745910b1d"; public static final String DATA_SOURCE_MEASUREMENT_ANNOTATION_TYPE_NAME = "DataSourceMeasurementAnnotation"; @@ -4764,14 +4812,10 @@ public enum OpenMetadataType public static final String REQUEST_FOR_ACTION_ANNOTATION_TYPE_NAME = "RequestForActionAnnotation"; /* plus DataFieldAnnotation */ - public static final String DISCOVERY_ACTIVITY_PROPERTY_NAME = "discoveryActivity"; /* from RequestForActionAnnotation entity */ - public static final String ACTION_REQUESTED_PROPERTY_NAME = "actionRequested"; /* from RequestForActionAnnotation entity */ - public static final String ACTION_PROPERTIES_PROPERTY_NAME = "actionProperties"; /* from RequestForActionAnnotation entity */ + public static final String ACTION_SOURCE_NAME = "actionSourceName"; /* from RequestForActionAnnotation entity */ + public static final String ACTION_REQUESTED_PROPERTY_NAME = "actionRequested"; /* from RequestForActionAnnotation entity */ + public static final String ACTION_PROPERTIES_PROPERTY_NAME = "actionProperties"; /* from RequestForActionAnnotation entity */ - /* For Discovery Activity relationship */ - public static final String DISCOVERY_ACTIVITY_TYPE_GUID = "6cea5b53-558c-48f1-8191-11d48db29fb4"; - public static final String DISCOVERY_ACTIVITY_TYPE_NAME = "DiscoveryActivity"; - /* End1 = RequestForActionAnnotation; End 2 = RequestForAction */ /* ============================================================================================================================*/ /* Area 7 - Lineage */ @@ -4838,6 +4882,68 @@ public enum OpenMetadataType public static final String PROCESSING_STATE_CLASSIFICATION_TYPE_GUID = "261fb0aa-b884-4ee8-87ea-a60510e9751d"; public static final String PROCESSING_STATE_CLASSIFICATION_TYPE_NAME = "ProcessingState"; + + /* ============================================================================================================================*/ + /* Deprecated Types */ + /* ============================================================================================================================*/ + + + public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_GUID = "acc7cbc8-09c3-472b-87dd-f78459323dcb"; + public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_NAME = "OpenDiscoveryAnalysisReport"; + /* Referenceable */ + + public static final String EXECUTION_DATE_PROPERTY_NAME = "executionDate"; /* from OpenDiscoveryAnalysisReport entity */ + public static final String DISCOVERY_SERVICE_STATUS_PROPERTY_NAME = "discoveryServiceStatus"; /* from OpenDiscoveryAnalysisReport entity */ + + public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_GUID = "b2fdeddd-24eb-4e9c-a2a4-2693828d4a69"; + public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_NAME = "DiscoveryServiceRequestStatus"; + + public static final String REPORT_TO_ASSET_TYPE_GUID = "7eded424-f176-4258-9ae6-138a46b2845f"; /* from Area 6 */ + public static final String REPORT_TO_ASSET_TYPE_NAME = "AssetDiscoveryReport"; + /* End1 = Asset; End 2 = OpenDiscoveryAnalysisReport */ + + public static final String REPORT_TO_ENGINE_TYPE_GUID = "2c318c3a-5dc2-42cd-a933-0087d852f67f"; /* from Area 6 */ + public static final String REPORT_TO_ENGINE_TYPE_NAME = "DiscoveryEngineReport"; + /* End1 = OpenDiscoveryEngine; End 2 = OpenDiscoveryAnalysisReport */ + + public static final String REPORT_TO_SERVICE_TYPE_GUID = "1744d72b-903d-4273-9229-de20372a17e2"; /* from Area 6 */ + public static final String REPORT_TO_SERVICE_TYPE_NAME = "DiscoveryInvocationReport"; + /* End1 = OpenDiscoveryService; End 2 = OpenDiscoveryAnalysisReport */ + + public static final String REPORT_TO_ANNOTATIONS_TYPE_GUID = "51d386a3-3857-42e3-a3df-14a6cad08b93"; /* from Area 6 */ + public static final String REPORT_TO_ANNOTATIONS_TYPE_NAME = "DiscoveredAnnotation"; + /* End1 = Annotation; End 2 = OpenDiscoveryAnalysisReport */ + + + /* For DataField entity */ + public static final String DATA_FIELD_TYPE_GUID = "3c5bbc8b-d562-4b04-b189-c7b7f0bf2cea"; + public static final String DATA_FIELD_TYPE_NAME = "DataField"; + + public static final String DATA_FIELD_NAME_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ + public static final String DATA_FIELD_TYPE_PROPERTY_NAME = "dataFieldType"; /* from DataField entity */ + public static final String DATA_FIELD_DESCRIPTION_PROPERTY_NAME = "dataFieldDescription"; /* from DataField entity */ + public static final String DATA_FIELD_ALIASES_PROPERTY_NAME = "dataFieldAliases"; /* from DataField entity */ + public static final String DATA_FIELD_NAMESPACE_PROPERTY_NAME = "dataFieldNamespace"; /* from DataField entity */ + public static final String VERSION_PROPERTY_NAME = "version"; /* from DataField entity */ + public static final String DATA_FIELD_SORT_ORDER_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ + + /* For DiscoveredDataField relationship */ + public static final String DISCOVERED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e22222cd54"; + public static final String DISCOVERED_DATA_FIELD_TYPE_NAME = "DiscoveredDataField"; + /* End1 = SchemaAnalysisAnnotation; End 2 = DataField */ + + /* For DiscoveredDataField relationship */ + public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e12356cd54"; + public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_NAME = "DiscoveredNestedDataField"; + /* End1 = (parent)DataField; End 2 = DataField */ + + public static final String DISCOVERED_LINKED_DATA_FIELD_TYPE_GUID = "cca4b116-4490-44c4-84e1-535231ae46a1"; + public static final String DISCOVERED_LINKED_DATA_FIELD_TYPE_NAME = "DiscoveredLinkedDataField"; + /* End1 = (parent)DataField; End 2 = DataField */ + + public static final String DATA_FIELD_POSITION_PROPERTY_NAME = "dataFieldPosition"; + + /* ============================================================================================================================*/ /* Enums */ /* ============================================================================================================================*/ @@ -4861,4 +4967,10 @@ public enum OpenMetadataType public static final int UPDATED_LATEST_CHANGE_ACTION_ORDINAL = 1; public static final int DELETED_LATEST_CHANGE_ACTION_ORDINAL = 2; public static final int OTHER_LATEST_CHANGE_ACTION_ORDINAL = 99; + + + + public static final String ANNOTATION_STATUS_ENUM_TYPE_GUID = "71187df6-ef66-4f88-bc03-cd3c7f925165"; + public static final String ANNOTATION_STATUS_ENUM_TYPE_NAME = "AnnotationStatus"; + } diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataWikiPages.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataWikiPages.java index fb2293cfd0c..9d131b4a68c 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataWikiPages.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/mapper/OpenMetadataWikiPages.java @@ -644,6 +644,11 @@ public class OpenMetadataWikiPages */ public static final String MODEL_0601_DISCOVERY_ENGINES = "https://egeria-project.org/types/6/0601-Open-Discovery-Engine/"; + /** + * ... + */ + public static final String MODEL_0603_SURVEY_REPORTS = "https://egeria-project.org/types/6/0603-Survey-Reports/"; + /** * ... */ diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ArchiveProperties.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ArchiveProperties.java new file mode 100644 index 00000000000..020eae060b8 --- /dev/null +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/properties/ArchiveProperties.java @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.frameworks.governanceaction.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ArchiveProperties defined the properties that are stored when a data source is archived or deleted. This + * allows the Asset to remain in the metadata repository after the real-world artifact has gone. This is important + * to prevent lineage graphs from becoming fragmented. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class ArchiveProperties implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private Date archiveDate = null; + private String archiveProcess = null; + private Map archiveProperties = null; + + + /** + * Default constructor + */ + public ArchiveProperties() + { + super(); + } + + + /** + * Copy/clone constructor for the template properties. + * + * @param template template object to copy. + */ + public ArchiveProperties(ArchiveProperties template) + { + if (template != null) + { + archiveDate = template.getArchiveDate(); + archiveProcess = template.getArchiveProcess(); + archiveProperties = template.getArchiveProperties(); + } + } + + + /** + * Returns the date when the data source was archived (or discovered missing). Null means "now". + * + * @return date of archive + */ + public Date getArchiveDate() + { + return archiveDate; + } + + + /** + * Set up the date when the data source was archived (or discovered missing). Null means "now". + * + * @param archiveDate date of archive + */ + public void setArchiveDate(Date archiveDate) + { + this.archiveDate = archiveDate; + } + + + /** + * Returns the name of the process that either performed the archive or detected the missing data source. + * + * @return String name + */ + public String getArchiveProcess() + { + return archiveProcess; + } + + + /** + * Set up the name of the process that either performed the archive or detected the missing data source. + * + * @param archiveProcess String name + */ + public void setArchiveProcess(String archiveProcess) + { + this.archiveProcess = archiveProcess; + } + + + /** + * Return the properties that characterize where the data source was archived to. + * + * @return map of name value pairs, all strings + */ + public Map getArchiveProperties() + { + if (archiveProperties == null) + { + return null; + } + else if (archiveProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(archiveProperties); + } + } + + + /** + * Set up the properties that characterize where the data source was archived to. + * + * @param archiveProperties map of name value pairs, all strings + */ + public void setArchiveProperties(Map archiveProperties) + { + this.archiveProperties = archiveProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "ArchiveProperties{" + + "archiveDate=" + archiveDate + + ", archiveProcess='" + archiveProcess + '\'' + + ", archiveProperties='" + archiveProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ArchiveProperties that = (ArchiveProperties) objectToCompare; + return Objects.equals(archiveDate, that.archiveDate) && + Objects.equals(archiveProcess, that.archiveProcess) && + Objects.equals(archiveProperties, that.archiveProperties); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(archiveDate, archiveProcess, archiveProperties); + } +} diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/refdata/DeployedImplementationType.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/refdata/DeployedImplementationType.java index bc9055e4dbb..05c37764ade 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/refdata/DeployedImplementationType.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/refdata/DeployedImplementationType.java @@ -139,7 +139,7 @@ public enum DeployedImplementationType * Open Discovery Service - A connector that analyzing the contents of a digital resource. */ OPEN_DISCOVERY_SERVICE_CONNECTOR("Open Discovery Service", - OpenMetadataType.DISCOVERY_SERVICE_TYPE_NAME, + OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName, "A connector that analyzing the contents of a digital resource and produces a discovery analysis report.", "https://egeria-project.org/concepts/open-discovery-service/"), @@ -147,7 +147,7 @@ public enum DeployedImplementationType * Open Discovery Engine - A governance engine that runs open discovery services. */ OPEN_DISCOVERY_ENGINE("Open Discovery Engine", - OpenMetadataType.DISCOVERY_ENGINE_TYPE_NAME, + OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeName, "A governance engine that runs open discovery services.", "https://egeria-project.org/concepts/open-discovery-engine/"), @@ -155,7 +155,7 @@ public enum DeployedImplementationType * Governance Action Service - A connector that coordinates governance of digital resources and metadata. */ GOVERNANCE_ACTION_SERVICE_CONNECTOR("Governance Action Service", - OpenMetadataType.GOVERNANCE_ACTION_SERVICE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName, "A connector that coordinates governance of digital resources and metadata.", "https://egeria-project.org/concepts/governance-action-service/"), @@ -164,7 +164,7 @@ public enum DeployedImplementationType * Governance Action Engine - A governance engine that runs governance action services. */ GOVERNANCE_ACTION_ENGINE("Governance Action Engine", - OpenMetadataType.GOVERNANCE_ACTION_ENGINE_TYPE_NAME, + OpenMetadataType.GOVERNANCE_ACTION_ENGINE.typeName, "A governance engine that runs governance action services.", "https://egeria-project.org/concepts/governance-action-engine/"), @@ -173,7 +173,7 @@ public enum DeployedImplementationType * Event Action Service - A connector that coordinates governance of context events. */ EVENT_ACTION_SERVICE_CONNECTOR("Event Action Service", - OpenMetadataType.EVENT_ACTION_SERVICE_TYPE_NAME, + OpenMetadataType.EVENT_ACTION_SERVICE.typeName, "A connector that coordinates governance of context events.", "https://egeria-project.org/concepts/event-action-service/"), @@ -182,16 +182,33 @@ public enum DeployedImplementationType * Event Action Engine - A governance engine that runs event action services. */ EVENT_ACTION_ENGINE("Event Action Engine", - OpenMetadataType.EVENT_ACTION_ENGINE_TYPE_NAME, + OpenMetadataType.EVENT_ACTION_ENGINE.typeName, "A governance engine that runs event action services.", "https://egeria-project.org/concepts/event-action-engine/"), + /** + * Event Action Service - A connector that coordinates asset surveys. + */ + SURVEY_ACTION_SERVICE_CONNECTOR("Survey Action Service", + OpenMetadataType.SURVEY_ACTION_SERVICE.typeName, + "A connector that coordinates asset surveys.", + "https://egeria-project.org/concepts/survey-action-service/"), + + + /** + * Event Action Engine - A governance engine that runs survey action services. + */ + SURVEY_ACTION_ENGINE("Survey Action Engine", + OpenMetadataType.SURVEY_ACTION_ENGINE.typeName, + "A governance engine that runs survey action services.", + "https://egeria-project.org/concepts/survey-action-engine/"), + /** * Repository Governance Service - A connector that dynamically governs the activity of the open metadata repositories. */ REPOSITORY_GOVERNANCE_SERVICE_CONNECTOR("Repository Governance Service Connector", - OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE_TYPE_NAME, + OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.typeName, "A connector that dynamically governs the activity of the open metadata repositories.", "https://egeria-project.org/concepts/repository-governance-service"), @@ -199,7 +216,7 @@ public enum DeployedImplementationType * A governance engine that runs repository governance services. */ REPOSITORY_GOVERNANCE_ENGINE("Repository Governance Engine", - OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE_TYPE_NAME, + OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.typeName, "A governance engine that runs repository governance services.", "https://egeria-project.org/concepts/repository-governance-engine/"), diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java index e0e50246168..55d2ec1d6a0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetDetail.java @@ -5,6 +5,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset; import org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaType; +import java.io.Serial; import java.util.Objects; /** @@ -23,7 +24,8 @@ */ public class AssetDetail extends AssetSummary { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; protected ExternalIdentifiers externalIdentifiers = null; protected RelatedMediaReferences relatedMediaReferences = null; @@ -104,7 +106,8 @@ public AssetDetail(AssetDetail templateAssetDetail) if (templateAssetDetail != null) { - schema = templateAssetDetail.getSchema(); + schema = templateAssetDetail.getRootSchemaType(); + ExternalIdentifiers templateExternalIdentifiers = templateAssetDetail.getExternalIdentifiers(); RelatedMediaReferences templateRelatedMediaReferences = templateAssetDetail.getRelatedMediaReferences(); NoteLogs templateNoteLogs = templateAssetDetail.getNoteLogs(); @@ -276,7 +279,7 @@ public Certifications getCertifications() * * @return SchemaElement schema object to query the schema associated with the connected asset. */ - public SchemaType getSchema() + public SchemaType getRootSchemaType() { return schema; } diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSummary.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSummary.java index 5d304c2d674..7079e0507d5 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSummary.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetSummary.java @@ -4,6 +4,8 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset; +import java.io.Serial; + /** * AssetSummary holds asset properties that are used for displaying details of @@ -36,7 +38,8 @@ */ public class AssetSummary extends Asset { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /** * Default constructor only for subclasses diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetUniverse.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetUniverse.java index c1081133d0f..20f26fae05d 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetUniverse.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/AssetUniverse.java @@ -6,6 +6,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Meaning; import org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaType; +import java.io.Serial; import java.util.List; import java.util.Objects; @@ -24,7 +25,8 @@ */ public class AssetUniverse extends AssetDetail { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; protected List meanings = null; protected AssetFeedback feedback = null; @@ -254,7 +256,7 @@ public String toString() ", connections=" + getConnections() + ", licenses=" + getLicenses() + ", certifications=" + getCertifications() + - ", schema=" + getSchema() + + ", schema=" + getRootSchemaType() + ", meanings=" + meanings + ", feedback=" + feedback + ", knownLocations=" + knownLocations + diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/NestedSchemaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/NestedSchemaType.java index 9ae47dbbd68..610dcad1c7c 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/NestedSchemaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/NestedSchemaType.java @@ -5,6 +5,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.ComplexSchemaType; +import java.io.Serial; import java.util.Objects; /** @@ -13,7 +14,8 @@ */ public class NestedSchemaType extends ComplexSchemaType { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; protected SchemaAttributes schemaAttributes = null; diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java index bd18cc36591..8e6891b7c29 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetUniverse.java @@ -193,7 +193,7 @@ private AssetDetail getAnotherDifferentObject() relatedAssets); assertTrue(testObject.getMeanings() == null); - assertTrue(testObject.getSchema() == null); + assertTrue(testObject.getRootSchemaType() == null); assertTrue(testObject.getFeedback() == null); assertTrue(testObject.getKnownLocations() == null); assertTrue(testObject.getLineage() == null); @@ -236,7 +236,7 @@ private AssetDetail getAnotherDifferentObject() relatedAssets); assertTrue(testObject.getMeanings() == null); - assertTrue(testObject.getSchema() != null); + assertTrue(testObject.getRootSchemaType() != null); assertTrue(testObject.getFeedback() != null); assertTrue(testObject.getKnownLocations() != null); assertTrue(testObject.getLineage() != null); diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/Annotation.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/Annotation.java index 3bfb5ab4469..0f438fb7149 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/Annotation.java +++ b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/Annotation.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.*; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -23,11 +24,11 @@ @JsonSubTypes.Type(value = SchemaAnalysisAnnotation.class, name = "SchemaAnalysisAnnotation"), @JsonSubTypes.Type(value = DataSourceMeasurementAnnotation.class, name = "DataSourceMeasurementAnnotation"), @JsonSubTypes.Type(value = DataFieldAnnotation.class, name = "DataFieldAnnotation"), - @JsonSubTypes.Type(value = SuspectDuplicateAnnotation.class, name = "SuspectDuplicateAnnotation"), }) public class Annotation extends PropertyBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String annotationType = null; private String summary = null; diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentClassificationAnnotation.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentClassificationAnnotation.java deleted file mode 100644 index adef1d02764..00000000000 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentClassificationAnnotation.java +++ /dev/null @@ -1,182 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * DivergentAttachmentClassificationAnnotation identifies a classification and its properties that are diverging in an attachment for - * 2 assets that are linked as duplicates. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentAttachmentClassificationAnnotation extends DivergentAttachmentAnnotation -{ - private static final long serialVersionUID = 1L; - - private String divergentClassificationName = null; - private List divergentClassificationPropertyNames = null; - - - /** - * Default constructor - */ - public DivergentAttachmentClassificationAnnotation() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public DivergentAttachmentClassificationAnnotation(DivergentAttachmentClassificationAnnotation template) - { - super(template); - - if (template != null) - { - divergentClassificationName = template.getDivergentClassificationName(); - divergentClassificationPropertyNames = template.getDivergentClassificationPropertyNames(); - } - } - - - /** - * Return the name of the classification that is diverging. - * - * @return name of classification - */ - public String getDivergentClassificationName() - { - return divergentClassificationName; - } - - - /** - * Set up the name of the classification that is diverging. - * - * @param divergentClassificationName name of classification - */ - public void setDivergentClassificationName(String divergentClassificationName) - { - this.divergentClassificationName = divergentClassificationName; - } - - - /** - * Return the properties that are diverging. - * - * @return list of property names - */ - public List getDivergentClassificationPropertyNames() - { - if (divergentClassificationPropertyNames == null) - { - return null; - } - else if (divergentClassificationPropertyNames.isEmpty()) - { - return null; - } - - return divergentClassificationPropertyNames; - } - - - /** - * Set up the properties that are diverging. - * - * @param divergentClassificationPropertyNames list of property names - */ - public void setDivergentClassificationPropertyNames(List divergentClassificationPropertyNames) - { - this.divergentClassificationPropertyNames = divergentClassificationPropertyNames; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "DivergentAttachmentClassificationAnnotation{" + - "divergentClassificationName='" + divergentClassificationName + '\'' + - ", divergentClassificationPropertyNames=" + divergentClassificationPropertyNames + - ", attachmentGUID='" + getAttachmentGUID() + '\'' + - ", duplicateAttachmentGUID='" + getDuplicateAttachmentGUID() + '\'' + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + - ", annotationType='" + getAnnotationType() + '\'' + - ", summary='" + getSummary() + '\'' + - ", confidenceLevel=" + getConfidenceLevel() + - ", expression='" + getExpression() + '\'' + - ", explanation='" + getExplanation() + '\'' + - ", analysisStep='" + getAnalysisStep() + '\'' + - ", jsonProperties='" + getJsonProperties() + '\'' + - ", annotationStatus=" + getAnnotationStatus() + - ", numAttachedAnnotations=" + getNumAttachedAnnotations() + - ", reviewDate=" + getReviewDate() + - ", steward='" + getSteward() + '\'' + - ", reviewComment='" + getReviewComment() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", headerVersion=" + getHeaderVersion() + - ", elementHeader=" + getElementHeader() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * Compare the values of the supplied object with those stored in the current object. - * - * @param objectToCompare supplied object - * @return boolean result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - DivergentAttachmentClassificationAnnotation that = (DivergentAttachmentClassificationAnnotation) objectToCompare; - return Objects.equals(divergentClassificationName, that.divergentClassificationName) && - Objects.equals(divergentClassificationPropertyNames, that.divergentClassificationPropertyNames); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), divergentClassificationName, divergentClassificationPropertyNames); - } -} diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java b/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java deleted file mode 100644 index 0c0b1cb5b1c..00000000000 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/SuspectDuplicateAnnotation.java +++ /dev/null @@ -1,294 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.List; -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * SuspectDuplicateAnnotation is the annotation used to record details of an asset that seems to be a duplicate of the asset being - * analysed by a discovery service. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SuspectDuplicateAnnotation extends Annotation -{ - private static final long serialVersionUID = 1L; - - private List duplicateAnchorGUIDs = null; - private List matchingPropertyNames = null; - private List matchingClassificationNames = null; - private List matchingAttachmentGUIDs = null; - private List matchingRelationshipGUIDs = null; - - - /** - * Default constructor - */ - public SuspectDuplicateAnnotation() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public SuspectDuplicateAnnotation(SuspectDuplicateAnnotation template) - { - super(template); - - if (template != null) - { - duplicateAnchorGUIDs = template.getDuplicateAnchorGUIDs(); - matchingPropertyNames = template.getMatchingPropertyNames(); - matchingClassificationNames = template.getMatchingClassificationNames(); - matchingAttachmentGUIDs = template.getMatchingAttachmentGUIDs(); - matchingRelationshipGUIDs = template.getMatchingRelationshipGUIDs(); - } - } - - - /** - * Return the list of unique identifiers for the Assets that are identified as duplicate suspects. - * - * @return list of string guids - */ - public List getDuplicateAnchorGUIDs() - { - if (duplicateAnchorGUIDs == null) - { - return null; - } - else if (duplicateAnchorGUIDs.isEmpty()) - { - return null; - } - - return duplicateAnchorGUIDs; - } - - - /** - * Set up the list of unique identifiers for the Assets that are identified as duplicate suspects. - * - * @param duplicateAnchorGUIDs list of string guids - */ - public void setDuplicateAnchorGUIDs(List duplicateAnchorGUIDs) - { - this.duplicateAnchorGUIDs = duplicateAnchorGUIDs; - } - - - /** - * Return the list of property names whose values match in all the duplicate suspects. - * - * @return list of property names - */ - public List getMatchingPropertyNames() - { - if (matchingPropertyNames == null) - { - return null; - } - else if (matchingPropertyNames.isEmpty()) - { - return null; - } - - return matchingPropertyNames; - } - - - /** - * Set up the list of property names whose values match in all the duplicate suspects. - * - * @param matchingPropertyNames list of property names - */ - public void setMatchingPropertyNames(List matchingPropertyNames) - { - this.matchingPropertyNames = matchingPropertyNames; - } - - - /** - * Return the list of classifications that match in all the duplicate suspects. - * - * @return list of classification names - */ - public List getMatchingClassificationNames() - { - if (matchingClassificationNames == null) - { - return null; - } - else if (matchingClassificationNames.isEmpty()) - { - return null; - } - - return matchingClassificationNames; - } - - - /** - * Set up the list of classifications that match in all the duplicate suspects. - * - * @param matchingClassificationNames list of classification names - */ - public void setMatchingClassificationNames(List matchingClassificationNames) - { - this.matchingClassificationNames = matchingClassificationNames; - } - - - /** - * Return the list of unique identifiers for attachments that match in all the duplicate suspects. - * - * @return list of string guids - */ - public List getMatchingAttachmentGUIDs() - { - if (matchingAttachmentGUIDs == null) - { - return null; - } - else if (matchingAttachmentGUIDs.isEmpty()) - { - return null; - } - - return matchingAttachmentGUIDs; - } - - - /** - * Set up the list of unique identifiers for attachments that match in all the duplicate suspects. - * - * @param matchingAttachmentGUIDs list of string guids - */ - public void setMatchingAttachmentGUIDs(List matchingAttachmentGUIDs) - { - this.matchingAttachmentGUIDs = matchingAttachmentGUIDs; - } - - - /** - * Return the list of relationships that are common across all the duplicate suspects. - * - * @return list of string guids - */ - public List getMatchingRelationshipGUIDs() - { - if (matchingRelationshipGUIDs == null) - { - return null; - } - else if (matchingRelationshipGUIDs.isEmpty()) - { - return null; - } - - return matchingRelationshipGUIDs; - } - - - /** - * Set up the list of relationships that are common across all the duplicate suspects. - * - * @param matchingRelationshipGUIDs list of string guids - */ - public void setMatchingRelationshipGUIDs(List matchingRelationshipGUIDs) - { - this.matchingRelationshipGUIDs = matchingRelationshipGUIDs; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SuspectDuplicateAnnotation{" + - "duplicateAnchorGUIDs=" + duplicateAnchorGUIDs + - ", matchingPropertyNames=" + matchingPropertyNames + - ", matchingClassificationNames=" + matchingClassificationNames + - ", matchingAttachmentGUIDs=" + matchingAttachmentGUIDs + - ", matchingRelationshipGUIDs=" + matchingRelationshipGUIDs + - ", annotationType='" + getAnnotationType() + '\'' + - ", summary='" + getSummary() + '\'' + - ", confidenceLevel=" + getConfidenceLevel() + - ", expression='" + getExpression() + '\'' + - ", explanation='" + getExplanation() + '\'' + - ", analysisStep='" + getAnalysisStep() + '\'' + - ", jsonProperties='" + getJsonProperties() + '\'' + - ", annotationStatus=" + getAnnotationStatus() + - ", numAttachedAnnotations=" + getNumAttachedAnnotations() + - ", reviewDate=" + getReviewDate() + - ", steward='" + getSteward() + '\'' + - ", reviewComment='" + getReviewComment() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", headerVersion=" + getHeaderVersion() + - ", elementHeader=" + getElementHeader() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * Compare the values of the supplied object with those stored in the current object. - * - * @param objectToCompare supplied object - * @return boolean result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - SuspectDuplicateAnnotation that = (SuspectDuplicateAnnotation) objectToCompare; - return Objects.equals(duplicateAnchorGUIDs, that.duplicateAnchorGUIDs) && - Objects.equals(matchingPropertyNames, that.matchingPropertyNames) && - Objects.equals(matchingClassificationNames, that.matchingClassificationNames) && - Objects.equals(matchingAttachmentGUIDs, that.matchingAttachmentGUIDs) && - Objects.equals(matchingRelationshipGUIDs, that.matchingRelationshipGUIDs); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), duplicateAnchorGUIDs, matchingPropertyNames, matchingClassificationNames, - matchingAttachmentGUIDs, matchingRelationshipGUIDs); - } -} diff --git a/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/OpenMetadataAccess.java b/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/OpenMetadataAccess.java index b99d2368192..e57fca31d5a 100644 --- a/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/OpenMetadataAccess.java +++ b/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/OpenMetadataAccess.java @@ -7,14 +7,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; import org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataAttributeTypeDef; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataAttributeTypeDefCategory; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataElement; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataTypeDef; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataTypeDefCategory; -import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataTypeDefGallery; -import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElement; -import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElements; +import org.odpi.openmetadata.frameworks.governanceaction.properties.*; import org.odpi.openmetadata.frameworks.governanceaction.search.ElementProperties; import org.odpi.openmetadata.frameworks.governanceaction.search.SearchClassifications; import org.odpi.openmetadata.frameworks.governanceaction.search.SearchProperties; @@ -827,7 +820,7 @@ public void updateMetadataElementEffectivityInStore(String metadataElemen /** * Delete a specific metadata element. * - * @param metadataElementGUID unique identifier of the metadata element to update + * @param metadataElementGUID unique identifier of the metadata element to delete * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) @@ -858,6 +851,43 @@ public void deleteMetadataElementInStore(String metadataElementGUID, } + /** + * Archive a specific metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to archive + * @param archiveProperties details of the archive process + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to archive this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void archiveMetadataElementInStore(String metadataElementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ArchiveProperties archiveProperties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.archiveMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + archiveProperties, + forLineage, + forDuplicateProcessing, + effectiveTime); + + if (reportWriter != null) + { + reportWriter.reportElementDelete(metadataElementGUID); + } + } + + /** * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to * a metadata element. diff --git a/open-metadata-implementation/frameworks/survey-action-framework/README.md b/open-metadata-implementation/frameworks/survey-action-framework/README.md new file mode 100644 index 00000000000..056d1e359e2 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/README.md @@ -0,0 +1,28 @@ + + + +![TechPreview](../../../images/egeria-content-status-tech-preview.png#pagewidth) + +# Survey Action Framework (SAF) + +The Survey Action Framework (SAF) enables +[metadata survey tools](https://egeria-project.org/features/discovery-and-stewardship/overview) +to integrate with open metadata repositories by defining the interfaces +for the surveyor components (called open survey services) to: + +* Access the required configuration for the survey. +* Search for assets in the metadata repository. +* Extract all of the metadata known about a specific asset. +* Record the results of the analysis in the open metadata repository and attach it to the + asset's metadata for later processing. + +More information is available on Egeria's [documentation site](https://egeria-project.org/frameworks/saf/overview/). + + +---- +Return to [frameworks](..). + + +---- +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/frameworks/survey-action-framework/build.gradle b/open-metadata-implementation/frameworks/survey-action-framework/build.gradle new file mode 100644 index 00000000000..a1c88cb3ff5 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/build.gradle @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Contributors to the ODPi Egeria project. + */ + + +dependencies { + implementation 'com.fasterxml.jackson.core:jackson-databind' + compileOnly 'com.fasterxml.jackson.core:jackson-annotations' + implementation project(':open-metadata-implementation:frameworks:audit-log-framework') + implementation project(':open-metadata-implementation:frameworks:open-connector-framework') + implementation project(':open-metadata-implementation:frameworks:governance-action-framework') + testImplementation 'org.testng:testng' +} + +description = 'Survey Action Framework (SAF)' + +java { + withJavadocJar() +} + +test { + useTestNG() + // This will default to standard search pattern - see https://docs.gradle.org/current/userguide/java_testing.html#sec:test_detection + scanForTestClasses = false +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/AnnotationStore.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/AnnotationStore.java new file mode 100644 index 00000000000..a7a2afb1f34 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/AnnotationStore.java @@ -0,0 +1,211 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.surveyaction.properties.Annotation; +import org.odpi.openmetadata.frameworks.surveyaction.properties.AnnotationStatus; + +import java.util.List; +import java.util.Map; + +/** + * The AnnotationStore provides the interface used by a survey action service to + * store annotations in the open metadata repositories. + */ +public abstract class AnnotationStore +{ + protected String userId; + + + /** + * Constructor sets up the key parameters for accessing the annotations store. + * + * @param userId calling user + */ + public AnnotationStore(String userId) + { + this.userId = userId; + } + + + /** + * Return the annotation subtype names. + * + * @return list of type names that are subtypes of annotation + * @throws InvalidParameterException full path or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public abstract List getTypesOfAnnotation() throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the annotation subtype names mapped to their descriptions. + * + * @return map of type names that are subtypes of annotation + * @throws InvalidParameterException full path or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public abstract Map getTypesOfAnnotationWithDescriptions() throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of Annotations created for the element by previous runs of the survey action service. + * + * @param elementGUID unique identifier of the element to query + * @param startingFrom starting position in the list. + * @param maximumResults maximum number of elements that can be returned + * @return list of annotation (or null if none are registered) + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem retrieving annotations from the annotation store. + */ + public abstract List getPreviousAnnotationsForElement(String elementGUID, + int startingFrom, + int maximumResults) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of annotations from previous runs of the survey action service that are set to a specific status. + * If status is null then annotations that have been reviewed, approved and/or actioned are returned from + * survey reports that are not waiting or in progress. + * + * @param elementGUID unique identifier of the element to query + * @param status status value to use on the query + * @param startingFrom starting position in the list. + * @param maximumResults maximum number of elements that can be returned + * @return list of annotation (or null if none are registered) + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem retrieving annotations from the annotation store. + */ + public abstract List getPreviousAnnotationsForElement(String elementGUID, + AnnotationStatus status, + int startingFrom, + int maximumResults) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the current list of annotations for this survey run. + * + * @param elementGUID unique identifier of the element to query + * @param startingFrom starting position in the list. + * @param maximumResults maximum number of elements that can be returned + * @return list of annotation (or null if none are registered) + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem retrieving annotations from the annotation store. + */ + public abstract List getNewAnnotationsForElement(String elementGUID, + int startingFrom, + int maximumResults) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return any annotations attached to this annotation. + * + * @param annotationGUID parent annotation + * @param startingFrom starting position in the list + * @param maximumResults maximum number of annotations that can be returned. + * + * @return list of Annotation objects + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws UserNotAuthorizedException user not authorized to issue this request. + * @throws PropertyServerException there was a problem that occurred within the property server. + */ + public abstract List getExtendedAnnotations(String annotationGUID, + int startingFrom, + int maximumResults) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return a specific annotation stored in the annotation store (previous or new). + * + * @param annotationGUID unique identifier of the annotation + * @return annotation object + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem retrieving the annotation from the annotation store. + */ + public abstract Annotation getAnnotation(String annotationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add a new annotation to the annotation store as a top level annotation linked directly off of the report. + * + * @param annotation annotation object + * @param associatedElementGUID unique identifier of the element to associate this annotation with + * (it is associated with the survey report automatically). + * This value may be null to indicate that it is only to be linked to the report. + * @return unique identifier of new annotation + * @throws InvalidParameterException the annotation is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem adding the annotation to the annotation store. + */ + public abstract String addAnnotation(Annotation annotation, + String associatedElementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add a new annotation and link it to an existing annotation. + * + * @param parentAnnotationGUID unique identifier of the annotation that this new one is to be attached to + * @param annotation annotation object + * @return unique identifier of new annotation + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem saving annotations in the annotation store. + */ + public abstract String addAnnotationExtension(String parentAnnotationGUID, + Annotation annotation) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Replace the current properties of an annotation. + * + * @param annotation new properties + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem updating the annotation in the annotation store. + */ + public abstract void updateAnnotation(Annotation annotation) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove an annotation from the annotation store. + * + * @param annotationGUID unique identifier of the annotation + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user id not authorized to issue this request + * @throws PropertyServerException there was a problem deleting the annotation from the annotation store. + */ + public abstract void deleteAnnotation(String annotationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/DiscoveryAssetCatalogStore.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/DiscoveryAssetCatalogStore.java new file mode 100644 index 00000000000..131a535be1a --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/DiscoveryAssetCatalogStore.java @@ -0,0 +1,136 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * DiscoveryAssetCatalogStore provides access to the asset catalog to enable it to step through the + * assets available in the asset catalog. + */ +public abstract class DiscoveryAssetCatalogStore +{ + protected String userId; + protected int maxPageSize; + + /** + * Constructor sets the max page size which is used by the caller to ensure they + * do not ask for too many assets at once. + * + * @param userId calling user + * @param maxPageSize maximum number of assets that can be returned on a single request. + */ + public DiscoveryAssetCatalogStore(String userId, + int maxPageSize) + { + this.userId = userId; + this.maxPageSize = maxPageSize; + } + + + /** + * Return the maximum number of assets that can be returned by getAssets(). + * + * @return integer + */ + public int getMaxPageSize() + { + return maxPageSize; + } + + + /** + * Return the next set of assets to process. + * + * @param startFrom starting point of the query + * @param pageSize maximum number of results to return + * @return list of unique identifiers for matching assets + * @throws InvalidParameterException one of the parameters is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public abstract List getAssets(int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the assets with the same qualified name. If all is well there should be only one + * returned. + * + * @param name the qualified name to query on + * @param startFrom place to start in query + * @param pageSize number of results to return + * @return list of unique identifiers for matching assets + * @throws InvalidParameterException one of the parameters is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public abstract List getAssetsByQualifiedName(String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of matching assets that have the supplied name as either the + * qualified name or display name. This is an exact match retrieval. + * + * @param name name to query for + * @param startFrom place to start in query + * @param pageSize number of results to return + * @return list of unique identifiers for matching assets + * @throws InvalidParameterException one of the parameters is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public abstract List getAssetsByName(String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of assets that have the search string somewhere in their properties. + * The search string may be a regular expression. + * + * @param searchString value to search for + * @param startFrom place to start in query + * @param pageSize number of results to return + * @return list of unique identifiers for matching assets + * @throws InvalidParameterException one of the parameters is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public abstract List findAssets(String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of assets that have the same endpoint address. + * + * @param networkAddress address to query on + * @param startFrom place to start in query + * @param pageSize number of results to return + * @return list of unique identifiers for matching assets + * @throws InvalidParameterException one of the parameters is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public abstract List getAssetsByEndpoint(String networkAddress, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionPipelineConnector.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionPipelineConnector.java new file mode 100644 index 00000000000..15533cebf40 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionPipelineConnector.java @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.surveyaction.ffdc.SAFErrorCode; + +import java.util.List; + +/** + * DiscoveryPipeline is a discovery service that is responsible for choreographing the discovery services + * passed on initializeEmbeddedConnectors. + */ +public abstract class SurveyActionPipelineConnector extends SurveyActionServiceConnector implements VirtualConnectorExtension +{ + protected List embeddedSurveyActionServices = null; + + + /** + * Start the pipeline. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + @Override + public void start() throws ConnectorCheckedException + { + final String methodName = "start"; + + /* + * Check that the discovery context is not null and anything else is set up correctly + */ + super.start(); + + embeddedSurveyActionServices = getEmbeddedDiscoveryServices(); + + if (embeddedSurveyActionServices == null) + { + throw new ConnectorCheckedException(SAFErrorCode.NO_EMBEDDED_SURVEY_ACTION_SERVICES.getMessageDefinition(surveyActionServiceName), + this.getClass().getName(), + methodName); + } + + runSurveyPipeline(); + } + + + /** + * This implementation provides an inline sequential invocation of the supplied discovery services. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + protected abstract void runSurveyPipeline() throws ConnectorCheckedException; + + + /** + * Free up any resources held since the connector is no longer needed. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public synchronized void disconnect() throws ConnectorCheckedException + { + super.disconnect(); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionService.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionService.java new file mode 100644 index 00000000000..6aabe3072e1 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionService.java @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +/** + * A marker interface to identify the service that this connector works with. + */ +public interface SurveyActionService +{ +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceConnector.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceConnector.java new file mode 100644 index 00000000000..bb49b2e8ae5 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceConnector.java @@ -0,0 +1,216 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent; +import org.odpi.openmetadata.frameworks.auditlog.ComponentDescription; +import org.odpi.openmetadata.frameworks.connectors.Connector; +import org.odpi.openmetadata.frameworks.connectors.ConnectorBase; +import org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.surveyaction.ffdc.SAFErrorCode; + +import java.util.ArrayList; +import java.util.List; + + +/** + * SurveyActionServiceConnector describes a specific type of connector that is responsible for analyzing the content + * of a specific asset. Information about the asset to analyze is passed in the survey context. + * The returned discovery context also contains the results. + * Some discovery services manage the invocation of other discovery services. These discovery services are called + * discovery pipelines. + */ +public abstract class SurveyActionServiceConnector extends ConnectorBase implements SurveyActionService, + AuditLoggingComponent, + VirtualConnectorExtension +{ + protected String surveyActionServiceName = ""; + protected SurveyContext surveyContext = null; + protected AuditLog auditLog = null; + protected List embeddedConnectors = null; + + + /** + * Receive an audit log object that can be used to record audit log messages. The caller has initialized it + * with the correct component description and log destinations. + * + * @param auditLog audit log object + */ + @Override + public void setAuditLog(AuditLog auditLog) + { + this.auditLog = auditLog; + } + + + /** + * Return the component description that is used by this connector in the audit log. + * + * @return id, name, description, wiki page URL. + */ + @Override + public ComponentDescription getConnectorComponentDescription() + { + if ((this.auditLog != null) && (this.auditLog.getReport() != null)) + { + return auditLog.getReport().getReportingComponent(); + } + + return null; + } + + + /** + * Set up the list of discovery services connectors that will be invoked as part of this discovery pipeline. + * The connectors are initialized waiting to start. After start() is called on the + * discovery pipeline, it will choreograph the invocation of its embedded discovery services by calling + * start() to each of them when they are to run. Similar processing is needed for the disconnect() method. + * + * @param embeddedConnectors list of embedded connectors that are hopefully discovery services + */ + @Override + public void initializeEmbeddedConnectors(List embeddedConnectors) + { + this.embeddedConnectors = embeddedConnectors; + } + + + /** + * Set up details of the asset to analyze and the results of any previous analysis. + * + * @param surveyContext information about the asset to analyze and the results of analysis of + * other discovery service request. Partial results from other discovery + * services run as part of the same discovery service request may also be + * stored in the newAnnotations list. + */ + public synchronized void setSurveyContext(SurveyContext surveyContext) + { + this.surveyContext = surveyContext; + } + + + /** + * Set up the survey action service name. This is used in error messages. + * + * @param surveyActionServiceName name of the survey action service + */ + public void setSurveyActionServiceName(String surveyActionServiceName) + { + this.surveyActionServiceName = surveyActionServiceName; + } + + + /** + * Return the survey context for this survey action service. This is typically called after the disconnect() + * method is called. If called before disconnect(), it may only contain partial results. + * + * @return discovery context containing the results discovered (so far) by the discovery service. + */ + public synchronized SurveyContext getSurveyContext() + { + return surveyContext; + } + + + /** + * Retrieve and validate the list of embedded connectors and cast them to discovery service connector. + * This is used by DiscoveryPipelines and DiscoveryScanningServices. + * + * @return list of discovery service connectors + * + * @throws ConnectorCheckedException one of the embedded connectors is not a discovery service + */ + protected List getEmbeddedDiscoveryServices() throws ConnectorCheckedException + { + final String methodName = "getEmbeddedSurveyActionServices"; + + List surveyActionServiceConnectors = null; + + if (embeddedConnectors != null) + { + surveyActionServiceConnectors = new ArrayList<>(); + + for (Connector embeddedConnector : embeddedConnectors) + { + if (embeddedConnector != null) + { + if (embeddedConnector instanceof SurveyActionServiceConnector) + { + surveyActionServiceConnectors.add((SurveyActionServiceConnector)embeddedConnector); + } + else + { + throw new ConnectorCheckedException(SAFErrorCode.INVALID_EMBEDDED_SURVEY_ACTION_SERVICE.getMessageDefinition(surveyActionServiceName), + this.getClass().getName(), + methodName); + } + } + } + + if (surveyActionServiceConnectors.isEmpty()) + { + surveyActionServiceConnectors = null; + } + } + + return surveyActionServiceConnectors; + } + + + /** + * Indicates that the discovery service is completely configured and can begin processing. + * This is where the function of the discovery service is implemented. + * This is a standard method from the Open Connector Framework (OCF) so + * be sure to call super.start() in your version. + * + * @throws ConnectorCheckedException there is a problem within the discovery service. + */ + @Override + public void start() throws ConnectorCheckedException + { + super.start(); + + final String methodName = "start"; + + if (surveyContext == null) + { + throw new ConnectorCheckedException(SAFErrorCode.NULL_SURVEY_CONTEXT.getMessageDefinition(surveyActionServiceName), + this.getClass().getName(), + methodName); + } + } + + + /** + * Provide a common exception for unexpected errors. + * + * @param methodName calling method + * @param error caught exception + * @throws ConnectorCheckedException wrapped exception + */ + protected void handleUnexpectedException(String methodName, + Throwable error) throws ConnectorCheckedException + { + throw new ConnectorCheckedException(SAFErrorCode.UNEXPECTED_EXCEPTION.getMessageDefinition(surveyActionServiceName, + error.getClass().getName(), + methodName, + error.getMessage()), + this.getClass().getName(), + methodName); + } + + + /** + * Free up any resources held since the connector is no longer needed. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public synchronized void disconnect() throws ConnectorCheckedException + { + super.disconnectConnectors(this.embeddedConnectors); + super.disconnect(); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceProvider.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceProvider.java new file mode 100644 index 00000000000..79b56b1d3b1 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyActionServiceProvider.java @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.ConnectorProviderBase; + +import java.util.List; + +/** + * SurveyActionServiceProvider implements the base class for the connector provider for a survey action service. + */ +public abstract class SurveyActionServiceProvider extends ConnectorProviderBase +{ + /* + * The type name of the asset that this connector supports. + */ + protected static final String supportedAssetTypeName = "SurveyActionService"; + + /* + * Additional configuration to aid choreographing this service in a Governance Action Process. + */ + protected List supportedRequestTypes = null; + protected List supportedRequestParameters = null; + protected List supportedRequestSourceNames = null; + protected List supportedTargetActionNames = null; + protected List supportedGuards = null; + + + /** + * The request types returned are those that affect the survey action service's behaviour. Other request types may be used + * to call the survey action service, but they result in default behaviour. + * + * @return list of request types + */ + public List supportedRequestTypes() + { + return supportedRequestTypes; + } + + + /** + * The request parameters returned are used by the survey action service to control its behaviour. + * + * @return list of parameter names used if the connector is provisioning + */ + public List supportedRequestParameters() + { + return supportedRequestParameters; + } + + + /** + * The request source names returned are the request source names that affect the survey action service's behaviour. Other request + * source names may be used in a call the survey action service, but they result in default behaviour. + * + * @return list of request sources with special meaning + */ + public List supportedRequestSourceNames() + { + return supportedRequestSourceNames; + } + + + /** + * The action target names returned are those that affect the survey action service's behaviour. Other action target names may be used + * in a call the survey action service, but they result in default behaviour. + * + * @return list of action target names with special meaning + */ + public List supportedActionTargetNames() + { + return supportedTargetActionNames; + } + + + /** + * The guards describe the output assessment from the survey action service. The list returned is the complete list of + * guards to expect from the survey action service. They are used when defining survey action processes that choreograph + * the execution of survey action services using the guards to determine the path in the process to take. + * + * @return list of guards + */ + public List supportedGuards() + { + return supportedGuards; + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyAssetStore.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyAssetStore.java new file mode 100644 index 00000000000..f6d9109d645 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyAssetStore.java @@ -0,0 +1,135 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.Connector; +import org.odpi.openmetadata.frameworks.connectors.ffdc.*; +import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; +import org.odpi.openmetadata.frameworks.connectors.properties.SchemaAttributes; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; + +/** + * SurveyAssetStore defines the interface to a connector broker backed by a open metadata repository that returns + * information about the Asset that a survey action service is to analyze. It is built around the Open Connector + * Framework (OCF) services and Governance Action Framework (GAF). + */ +public abstract class SurveyAssetStore +{ + protected String assetGUID; + protected String userId; + protected Connection assetConnection = null; + + + + /** + * Constructor sets up the key parameters for accessing the asset store. + * + * @param userId calling user + * @param assetGUID unique identifier of the asset that the annotations should be attached to + */ + public SurveyAssetStore(String assetGUID, + String userId) + { + this.assetGUID = assetGUID; + this.userId = userId; + } + + + /** + * Return the unique identifier for the asset. + * + * @return guid + */ + public String getAssetGUID() + { + return assetGUID; + } + + + /** + * Returns the connector corresponding to the supplied connection. + * + * @param connection the connection object that contains the properties needed to create the connection. + * + * @return Connector connector instance + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + */ + protected abstract Connector getConnectorByConnection(Connection connection) throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException; + + + /** + * Return the connection information for the asset. This is used to create the connector. The connector + * is an Open Connector Framework (OCF) connector that provides access to the asset's data and metadata properties. + * + * @return Connection bean + * @throws InvalidParameterException the asset guid is not recognized + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + protected abstract Connection getConnectionForAsset() throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Returns a comprehensive collection of properties about the requested asset. + * + * @return a comprehensive collection of properties about the asset. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public abstract AssetUniverse getAssetProperties() throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Log an audit message about this asset. + * + * @param surveyService name of survey service + * @param message message to log + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public abstract void logAssetAuditMessage(String surveyService, + String message) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the connector to the requested asset. + * + * @return Open Connector Framework (OCF) connector + * @throws InvalidParameterException the asset guid is not recognized or the userId is null + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + * @throws UserNotAuthorizedException the user is not authorized to access the asset and/or connection needed to + * create the connector. + * @throws PropertyServerException there was a problem in the store whether the asset/connection properties are kept. + */ + public Connector getConnectorToAsset() throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException, + UserNotAuthorizedException, + PropertyServerException + { + if (assetConnection == null) + { + assetConnection = getConnectionForAsset(); + } + + return this.getConnectorByConnection(assetConnection); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyContext.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyContext.java new file mode 100644 index 00000000000..541e0123b7c --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyContext.java @@ -0,0 +1,287 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import java.util.Date; +import java.util.Map; +import java.util.Objects; + + +/** + * SurveyContext provides a survey action service with access to information about + * the survey request along with access to the open metadata repository interfaces. + */ +public class SurveyContext +{ + private final String userId; + protected String surveyReportGUID = null; + protected String reportQualifiedName = null; + protected String reportDisplayName = null; + protected String reportDescription = null; + protected Date creationDate = new Date(); + protected String analysisStep = null; + private final String assetGUID; + private final Map requestParameters; + private final SurveyAssetStore assetStore; + private final AnnotationStore annotationStore; + private final SurveyOpenMetadataStore openMetadataStore; + + + /** + * Constructor sets up the key parameters for using the context. + * + * @param userId calling user + * @param assetGUID unique identifier of the asset that the annotations should be attached to + * @param requestParameters name-value properties to control the survey action service + * @param assetStore survey asset store for the survey action service + * @param annotationStore annotation store for the survey action service + * @param openMetadataStore generic metadata API from the Governance Action Framework (GAF) + */ + public SurveyContext(String userId, + String assetGUID, + Map requestParameters, + SurveyAssetStore assetStore, + AnnotationStore annotationStore, + SurveyOpenMetadataStore openMetadataStore) + { + this.userId = userId; + this.assetGUID = assetGUID; + this.requestParameters = requestParameters; + this.assetStore = assetStore; + this.annotationStore = annotationStore; + this.openMetadataStore = openMetadataStore; + } + + + /** + * Return the report identifier for this survey context. Any new annotations added to this survey context + * will be linked to this report. + * + * @return unique identifier (guid) of the new survey report. + */ + public String getSurveyReportGUID() + { + return surveyReportGUID; + } + + + /** + * Return the locally defined analysis step. This value is used in annotations generated in this phase. + * + * @return name of analysis step + */ + public String getAnalysisStep() + { + return analysisStep; + } + + + /** + * Set up the name of the current analysis step. + * + * @param analysisStep name + */ + public void setAnalysisStep(String analysisStep) + { + this.analysisStep = analysisStep; + } + + + /** + * Return the unique name of the survey report that will result from this survey request. + * + * @return String report name + */ + public String getReportQualifiedName() + { + return reportQualifiedName; + } + + + /** + * Set up the unique name of the survey report that will result from this survey request. + * The survey action engine will set up a default fully-qualified name. This method enables it to be overridden. + * + * @param reportName String report name + */ + public void setReportQualifiedName(String reportName) + { + this.reportQualifiedName = reportName; + } + + + /** + * Return the display name of the survey report that will result from this survey request. + * + * @return String report name + */ + public String getReportDisplayName() + { + return reportDisplayName; + } + + + /** + * Set up the display name of the survey report that will result from this survey request. + * The default name is null. + * + * @param reportName String report name + */ + public void setReportDisplayName(String reportName) + { + this.reportDisplayName = reportName; + } + + + /** + * Return the description for the survey report that will result from this survey request. + * The default value is null. + * + * @return String report description + */ + public String getReportDescription() + { + return reportDescription; + } + + + /** + * Set up the description for the survey report that will result from this survey request. + * + * @param reportDescription String report description + */ + public void setReportDescription(String reportDescription) + { + this.reportDescription = reportDescription; + } + + + /** + * Return the creation date for the survey report that will result from this survey request. + * + * @return Date that the report was created. + */ + public Date getReportCreationDate() { + return creationDate; + } + + + /** + * Return the unique identifier of the asset being discovered. + * + * @return string guid + */ + public String getAssetGUID() + { + return assetGUID; + } + + + /** + * Return the properties that hold the parameters used to drive the survey action service's analysis. + * + * @return AdditionalProperties object storing the analysis parameters + */ + public Map getRequestParameters() + { + return requestParameters; + } + + + /** + * Return the asset store for the survey action service. This is able to provide a connector to the asset + * configured with the properties of the asset from a property server. + * + * @return asset store + */ + public SurveyAssetStore getAssetStore() + { + return assetStore; + } + + + /** + * Return the annotation store for the survey action service. This is where the annotations are stored and + * retrieved from. + * + * @return annotation store + */ + public AnnotationStore getAnnotationStore() + { + return annotationStore; + } + + + /** + * Return a generic interface for accessing and updating open metadata elements, classifications and relationships. + * + * @return open metadata store + */ + public SurveyOpenMetadataStore getOpenMetadataStore() + { + return openMetadataStore; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "SurveyContext{" + + "userId='" + userId + '\'' + + ", surveyReportGUID='" + surveyReportGUID + '\'' + + ", reportQualifiedName='" + reportQualifiedName + '\'' + + ", reportDisplayName='" + reportDisplayName + '\'' + + ", reportDescription='" + reportDescription + '\'' + + ", creationDate=" + creationDate + + ", analysisStep='" + analysisStep + '\'' + + ", assetGUID='" + assetGUID + '\'' + + ", requestParameters=" + requestParameters + + ", assetStore=" + assetStore + + ", annotationStore=" + annotationStore + + ", openMetadataStore=" + openMetadataStore + + '}'; + } + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) return true; + if (objectToCompare == null || getClass() != objectToCompare.getClass()) return false; + SurveyContext that = (SurveyContext) objectToCompare; + return Objects.equals(userId, that.userId) && + Objects.equals(surveyReportGUID, that.surveyReportGUID) && + Objects.equals(reportQualifiedName, that.reportQualifiedName) && + Objects.equals(reportDisplayName, that.reportDisplayName) && + Objects.equals(reportDescription, that.reportDescription) && + Objects.equals(creationDate, that.creationDate) && + Objects.equals(analysisStep, that.analysisStep) && + Objects.equals(assetGUID, that.assetGUID) && + Objects.equals(requestParameters, that.requestParameters) && + Objects.equals(assetStore, that.assetStore) && + Objects.equals(annotationStore, that.annotationStore) && + Objects.equals(openMetadataStore, that.openMetadataStore); + } + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(userId, surveyReportGUID, reportQualifiedName, reportDisplayName, reportDescription, + creationDate, analysisStep, assetGUID, requestParameters, assetStore, annotationStore, openMetadataStore); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyOpenMetadataStore.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyOpenMetadataStore.java new file mode 100644 index 00000000000..58c5f4deb8c --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/SurveyOpenMetadataStore.java @@ -0,0 +1,1594 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient; +import org.odpi.openmetadata.frameworks.governanceaction.properties.*; +import org.odpi.openmetadata.frameworks.governanceaction.search.ElementProperties; +import org.odpi.openmetadata.frameworks.governanceaction.search.SearchClassifications; +import org.odpi.openmetadata.frameworks.governanceaction.search.SearchProperties; +import org.odpi.openmetadata.frameworks.governanceaction.search.SequencingOrder; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * SurveyOpenMetadataStore provides an interface to the open metadata store. This is part of the Governance Action Framework (GAF) + * and provides a comprehensive interface for working with all types of metadata, subject to the user's security permissions. + * The interface supports search, maintenance of metadata elements, classifications and relationships. + */ +public class SurveyOpenMetadataStore +{ + private final OpenMetadataClient openMetadataStore; + private final String userId; + private final String externalSourceGUID; + private final String externalSourceName; + + private boolean forLineage = false; + private boolean forDuplicateProcessing = false; + private boolean useCurrentEffectiveTime = false; + + /** + * The constructor needs an implementation of the open metadata store. + * + * @param openMetadataStore client implementation + * @param userId calling user + * @param externalSourceGUID unique identifier for external source (or null) + * @param externalSourceName unique name for external source (or null) + */ + public SurveyOpenMetadataStore(OpenMetadataClient openMetadataStore, + String userId, + String externalSourceGUID, + String externalSourceName) + { + this.openMetadataStore = openMetadataStore; + this.userId = userId; + this.externalSourceGUID = externalSourceGUID; + this.externalSourceName = externalSourceName; + } + + + /** + * Return the forLineage setting. + * + * @return boolean + */ + public boolean isForLineage() + { + return forLineage; + } + + + /** + * Set up the forLineage setting. + * + * @param forLineage boolean + */ + public void setForLineage(boolean forLineage) + { + this.forLineage = forLineage; + } + + + /** + * Return the forDuplicateProcessing setting. + * + * @return boolean + */ + public boolean isForDuplicateProcessing() + { + return forDuplicateProcessing; + } + + + /** + * Set up the forDuplicateProcessing setting. + * + * @param forDuplicateProcessing boolean + */ + public void setForDuplicateProcessing(boolean forDuplicateProcessing) + { + this.forDuplicateProcessing = forDuplicateProcessing; + } + + + /** + * Return the boolean setting for whether the current time for requests or null. + * + * @return boolean + */ + public boolean isUseCurrentEffectiveTime() + { + return useCurrentEffectiveTime; + } + + + /** + * Set up the boolean setting for whether the current time for requests or null. + * + * @param useCurrentEffectiveTime boolean + */ + public void setUseCurrentEffectiveTime(boolean useCurrentEffectiveTime) + { + this.useCurrentEffectiveTime = useCurrentEffectiveTime; + } + + + /** + * Return the appropriate effectiveTime for a request. + * + * @return date + */ + private Date getEffectiveTime() + { + if (useCurrentEffectiveTime) + { + return new Date(); + } + + return null; + } + + + /** + * Returns the list of different types of metadata organized into two groups. The first are the + * attribute type definitions (AttributeTypeDefs). These provide types for properties in full + * type definitions. Full type definitions (TypeDefs) describe types for entities, relationships + * and classifications. + * + * @return TypeDefGallery List of different categories of type definitions. + * + * @throws InvalidParameterException the userId is null + * @throws PropertyServerException there is a problem communicating with the metadata repository. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public OpenMetadataTypeDefGallery getAllTypes() throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.getAllTypes(userId); + } + + + /** + * Returns all the TypeDefs for a specific category. + * + * @param category enum value for the category of TypeDef to return. + * + * @return TypeDefs list. + * + * @throws InvalidParameterException the TypeDefCategory is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public List findTypeDefsByCategory(OpenMetadataTypeDefCategory category) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.findTypeDefsByCategory(userId, category); + } + + + /** + * Returns all the AttributeTypeDefs for a specific category. + * + * @param category enum value for the category of an AttributeTypeDef to return. + * + * @return AttributeTypeDefs list. + * + * @throws InvalidParameterException the TypeDefCategory is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public List findAttributeTypeDefsByCategory(OpenMetadataAttributeTypeDefCategory category) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.findAttributeTypeDefsByCategory(userId, category); + } + + + /** + * Return the types that are linked to the elements from the specified standard. + * + * @param standard name of the standard null means any. + * @param organization name of the organization null means any. + * @param identifier identifier of the element in the standard null means any. + * + * @return TypeDefs list each entry in the list contains a TypeDef. This is a structure + * describing the category and properties of a TypeDef. + * + * @throws InvalidParameterException all attributes of the external id are null. + * @throws PropertyServerException there is a problem communicating with the metadata repository. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public List findTypesByExternalID(String standard, + String organization, + String identifier) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.findTypesByExternalId(userId, standard, organization, identifier); + } + + + /** + * Return the TypeDef identified by the GUID. + * + * @param guid String unique id of the TypeDef + * + * @return TypeDef structure describing its category and properties. + * + * @throws InvalidParameterException the guid is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository where + * the metadata collection is stored. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public OpenMetadataTypeDef getTypeDefByGUID(String guid) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.getTypeDefByGUID(userId, guid); + } + + + /** + * Return the AttributeTypeDef identified by the GUID. + * + * @param guid String unique id of the TypeDef + * + * @return TypeDef structure describing its category and properties. + * + * @throws InvalidParameterException the guid is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository where + * the metadata collection is stored. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public OpenMetadataAttributeTypeDef getAttributeTypeDefByGUID(String guid) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.getAttributeTypeDefByGUID(userId, guid); + } + + + /** + * Return the TypeDef identified by the unique name. + * + * @param name String name of the TypeDef. + * + * @return TypeDef structure describing its category and properties. + * + * @throws InvalidParameterException the name is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository where + * the metadata collection is stored. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public OpenMetadataTypeDef getTypeDefByName(String name) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.getTypeDefByName(userId, name); + } + + + /** + * Return the AttributeTypeDef identified by the unique name. + * + * @param name String name of the TypeDef. + * + * @return TypeDef structure describing its category and properties. + * + * @throws InvalidParameterException the name is null. + * @throws PropertyServerException there is a problem communicating with the metadata repository where + * the metadata collection is stored. + * @throws UserNotAuthorizedException the userId is not permitted to perform this operation. + */ + public OpenMetadataAttributeTypeDef getAttributeTypeDefByName(String name) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return openMetadataStore.getAttributeTypeDefByName(userId, name); + } + + + /** + * Retrieve the metadata element using its unique identifier. + * + * @param elementGUID unique identifier for the metadata element + * + * @return metadata element properties + * @throws InvalidParameterException the unique identifier is null or not known. + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public OpenMetadataElement getMetadataElementByGUID(String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getMetadataElementByGUID(userId, elementGUID, forLineage, forDuplicateProcessing, getEffectiveTime()); + } + + + /** + * Retrieve the metadata element using its unique name (typically the qualified name). + * + * @param uniqueName unique name for the metadata element + * @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used + * @param forLineage the retrieved element is for lineage processing so include archived elements + * @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates. + * + * @return metadata element properties + * @throws InvalidParameterException the unique identifier is null or not known. + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public OpenMetadataElement getMetadataElementByUniqueName(String uniqueName, + String uniquePropertyName, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getMetadataElementByUniqueName(userId, + uniqueName, + uniquePropertyName, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name). + * + * @param uniqueName unique name for the metadata element + * @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used + * + * @return metadata element unique identifier (guid) + * @throws InvalidParameterException the unique identifier is null or not known. + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public String getMetadataElementGUIDByUniqueName(String uniqueName, + String uniquePropertyName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getMetadataElementGUIDByUniqueName(userId, + uniqueName, + uniquePropertyName, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Retrieve the metadata elements that contain the requested string. + * + * @param searchString name to retrieve + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements (or null if no elements match the name) + * @throws InvalidParameterException the qualified name is null + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List findMetadataElementsWithString(String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.findMetadataElementsWithString(userId, + searchString, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Retrieve the metadata elements of the requested type that contain the requested string. + * + * @param searchString name to retrieve + * @param typeName name of the type to limit the results to (maybe null to mean all types) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements (or null if no elements match the name) + * @throws InvalidParameterException the qualified name is null + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List findMetadataElementsWithString(String searchString, + String typeName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.findMetadataElementsWithString(userId, + searchString, + typeName, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Retrieve the metadata elements connected to the supplied element. + * + * @param elementGUID unique identifier for the starting metadata element + * @param startingAtEnd indicates which end to retrieve from (0 is "either end"; 1 is end1; 2 is end 2) + * @param relationshipTypeName type name of relationships to follow (or null for all) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of related elements + * @throws InvalidParameterException the unique identifier is null or not known; the relationship type is invalid + * @throws UserNotAuthorizedException the governance action service is not able to access the elements + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List getRelatedMetadataElements(String elementGUID, + int startingAtEnd, + String relationshipTypeName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getRelatedMetadataElements(userId, + elementGUID, + startingAtEnd, + relationshipTypeName, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Retrieve the relationships linking to the supplied elements. + * + * @param metadataElementAtEnd1GUID unique identifier of the metadata element at end 1 of the relationship + * @param metadataElementAtEnd2GUID unique identifier of the metadata element at end 2 of the relationship + * @param relationshipTypeName type name of relationships to follow (or null for all) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of related elements + * @throws InvalidParameterException the unique identifier is null or not known; the relationship type is invalid + * @throws UserNotAuthorizedException the governance action service is not able to access the elements + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List getMetadataElementRelationships(String metadataElementAtEnd1GUID, + String metadataElementAtEnd2GUID, + String relationshipTypeName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getMetadataElementRelationships(userId, + metadataElementAtEnd1GUID, + metadataElementAtEnd2GUID, + relationshipTypeName, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Return a list of metadata elements that match the supplied criteria. The results can be returned over many pages. + * + * @param metadataElementTypeName type of interest (null means any element type) + * @param metadataElementSubtypeNames optional list of the subtypes of the metadataElementTypeName to + * include in the search results. Null means all subtypes. + * @param searchProperties Optional list of entity property conditions to match. + * @param limitResultsByStatus By default, entities in all statuses (other than DELETE) are returned. However, it is possible + * to specify a list of statuses (e.g. ACTIVE) to restrict the results to. Null means all status values. + * @param matchClassifications Optional list of classifications to match. + * @param sequencingProperty String name of the property that is to be used to sequence the results. + * Null means do not sequence on a property name (see SequencingOrder). + * @param sequencingOrder Enum defining how the results should be ordered. + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return a list of elements matching the supplied criteria; null means no matching elements in the metadata store. + * @throws InvalidParameterException one of the search parameters are is invalid + * @throws UserNotAuthorizedException the governance action service is not able to access the elements + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List findMetadataElements(String metadataElementTypeName, + List metadataElementSubtypeNames, + SearchProperties searchProperties, + List limitResultsByStatus, + SearchClassifications matchClassifications, + String sequencingProperty, + SequencingOrder sequencingOrder, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.findMetadataElements(userId, + metadataElementTypeName, + metadataElementSubtypeNames, + searchProperties, + limitResultsByStatus, + matchClassifications, + sequencingProperty, + sequencingOrder, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Return a list of relationships that match the requested conditions. The results can be received as a series of pages. + * + * @param relationshipTypeName relationship's type. Null means all types + * (but may be slow so not recommended). + * @param searchProperties Optional list of relationship property conditions to match. + * @param sequencingProperty String name of the property that is to be used to sequence the results. + * Null means do not sequence on a property name (see SequencingOrder). + * @param sequencingOrder Enum defining how the results should be ordered. + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return a list of relationships. Null means no matching relationships. + * @throws InvalidParameterException one of the search parameters are is invalid + * @throws UserNotAuthorizedException the governance action service is not able to access the elements + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List findRelationshipsBetweenMetadataElements(String relationshipTypeName, + SearchProperties searchProperties, + String sequencingProperty, + SequencingOrder sequencingOrder, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.findRelationshipsBetweenMetadataElements(userId, + relationshipTypeName, + searchProperties, + sequencingProperty, + sequencingOrder, + forLineage, + forDuplicateProcessing, + getEffectiveTime(), + startFrom, + pageSize); + } + + + /** + * Retrieve the relationship using its unique identifier. + * + * @param relationshipGUID unique identifier for the relationship + * + * @return relationship properties + * @throws InvalidParameterException the unique identifier is null or not known. + * @throws UserNotAuthorizedException the governance action service is not able to access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public RelatedMetadataElements getRelationshipByGUID(String relationshipGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getRelationshipByGUID(userId, relationshipGUID, forLineage, forDuplicateProcessing, getEffectiveTime()); + } + + + /** + * Create a new metadata element in the metadata store. The type name comes from the open metadata types. + * The selected type also controls the names and types of the properties that are allowed. + * This version of the method allows access to advanced features such as multiple states and + * effectivity dates. + * + * @param metadataElementTypeName type name of the new metadata element + * @param initialStatus initial status of the metadata element + * @param properties properties of the new metadata element + * @param templateGUID the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema + * connection etc) + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException the type name, status or one of the properties is invalid + * @throws UserNotAuthorizedException the governance action service is not authorized to create this type of element + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createMetadataElementInStore(String metadataElementTypeName, + ElementStatus initialStatus, + ElementProperties properties, + String templateGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementTypeName, + initialStatus, + null, + null, + properties, + templateGUID); + } + + + /** + * Create a new metadata element in the metadata store. The type name comes from the open metadata types. + * The selected type also controls the names and types of the properties that are allowed. + * This version of the method allows access to advanced features such as multiple states and + * effectivity dates. + * + * @param metadataElementTypeName type name of the new metadata element + * @param initialStatus initial status of the metadata element + * @param effectiveFrom the date when this element is active - null for active on creation + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * @param properties properties of the new metadata element + * @param templateGUID the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema + * connection etc) + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException the type name, status or one of the properties is invalid + * @throws UserNotAuthorizedException the governance action service is not authorized to create this type of element + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createMetadataElementInStore(String metadataElementTypeName, + ElementStatus initialStatus, + Date effectiveFrom, + Date effectiveTo, + ElementProperties properties, + String templateGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementTypeName, + initialStatus, + effectiveFrom, + effectiveTo, + properties, + templateGUID); + } + + + /** + * Create a new metadata element in the metadata store. The type name comes from the open metadata types. + * The selected type also controls the names and types of the properties that are allowed. + * This version of the method allows access to advanced features such as multiple states and + * effectivity dates. + * + * @param metadataElementTypeName type name of the new metadata element + * @param initialStatus initial status of the metadata element + * @param initialClassifications map of classification names to classification properties to include in the entity creation request + * @param anchorGUID unique identifier of the element that should be the anchor for the new element. Set to null if no anchor, + * or the Anchors classification is included in the initial classifications. + * @param effectiveFrom the date when this element is active - null for active on creation + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * @param properties properties of the new metadata element + * @param templateGUID the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema + * connection etc) + * @param parentGUID unique identifier of optional parent entity + * @param parentRelationshipTypeName type of relationship to connect the new element to the parent + * @param parentRelationshipProperties properties to include in parent relationship + * @param parentAtEnd1 which end should the parent GUID go in the relationship + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException the type name, status or one of the properties is invalid + * @throws UserNotAuthorizedException the governance action service is not authorized to create this type of element + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createMetadataElementInStore(String metadataElementTypeName, + ElementStatus initialStatus, + Map initialClassifications, + String anchorGUID, + Date effectiveFrom, + Date effectiveTo, + ElementProperties properties, + String templateGUID, + String parentGUID, + String parentRelationshipTypeName, + ElementProperties parentRelationshipProperties, + boolean parentAtEnd1) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementTypeName, + initialStatus, + initialClassifications, + anchorGUID, + effectiveFrom, + effectiveTo, + properties, + templateGUID, + parentGUID, + parentRelationshipTypeName, + parentRelationshipProperties, + parentAtEnd1); + } + + + /** + * Update the properties of a specific metadata element. The properties must match the type definition associated with the + * metadata element when it was created. However, it is possible to update a few properties, or replace all them by + * the value used in the replaceProperties flag. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param replaceProperties flag to indicate whether to completely replace the existing properties with the new properties, or just update + * the individual properties specified on the request. + * @param properties new properties for the metadata element + * + * @throws InvalidParameterException either the unique identifier or the properties are invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateMetadataElementInStore(String metadataElementGUID, + boolean replaceProperties, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + replaceProperties, + forLineage, + forDuplicateProcessing, + properties, + getEffectiveTime()); + } + + + /** + * Update the status of specific metadata element. The new status must match a status value that is defined for the element's type + * assigned when it was created. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param newElementStatus new status value - or null to leave as is + * + * @throws InvalidParameterException either the unique identifier or the status are invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateMetadataElementStatusInStore(String metadataElementGUID, + ElementStatus newElementStatus) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateMetadataElementStatusInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + forLineage, + forDuplicateProcessing, + newElementStatus, + getEffectiveTime()); + } + + + + /** + * Update the effectivity dates control the visibility of the element through specific APIs. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveFrom the date when this element is active - null for active now + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * @param effectiveTime only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now. + * + * @throws InvalidParameterException either the unique identifier or the status are invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateMetadataElementEffectivityInStore(String metadataElementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateMetadataElementEffectivityInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + forLineage, + forDuplicateProcessing, + effectiveFrom, + effectiveTo, + effectiveTime); + } + + + /** + * Delete a specific metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to delete this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void deleteMetadataElementInStore(String metadataElementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.deleteMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Archive a specific metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param archiveProperties description of the archiving process + * + * @throws InvalidParameterException the unique identifier is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to delete this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void archiveMetadataElementInStore(String metadataElementGUID, + ArchiveProperties archiveProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.archiveMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + archiveProperties, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to + * a metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param classificationName name of the classification to add (if the classification is already present then use reclassify) + * @param properties properties to store in the new classification. These must conform to the valid properties associated with the + * classification name + * + * @throws InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the + * valid properties associated with the classification's type definition + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void classifyMetadataElementInStore(String metadataElementGUID, + String classificationName, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.classifyMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + classificationName, + forLineage, + forDuplicateProcessing, + null, + null, + properties, + getEffectiveTime()); + } + + + /** + * Add a new classification to the metadata element. Note that only one classification with the same name can be attached to + * a metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param classificationName name of the classification to add (if the classification is already present then use reclassify) + * @param effectiveFrom the date when this classification is active - null for active now + * @param effectiveTo the date when this classification becomes inactive - null for active until deleted + * @param properties properties to store in the new classification. These must conform to the valid properties associated with the + * classification name + * + * @throws InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the + * valid properties associated with the classification's type definition + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void classifyMetadataElementInStore(String metadataElementGUID, + String classificationName, + Date effectiveFrom, + Date effectiveTo, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.classifyMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + classificationName, + forLineage, + forDuplicateProcessing, + effectiveFrom, + effectiveTo, + properties, + getEffectiveTime()); + } + + + /** + * Update the properties of a classification that is currently attached to a specific metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param classificationName unique name of the classification to update + * @param replaceProperties flag to indicate whether to completely replace the existing properties with the new properties, or just update + * the individual properties specified on the request. + * @param properties new properties for the classification + * + * @throws InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the + * valid properties associated with the classification's type definition + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element/classification + * @throws PropertyServerException there is a problem with the metadata store + */ + public void reclassifyMetadataElementInStore(String metadataElementGUID, + String classificationName, + boolean replaceProperties, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.reclassifyMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + classificationName, + replaceProperties, + forLineage, + forDuplicateProcessing, + properties, + getEffectiveTime()); + } + + + /** + * Update the effectivity dates of a specific classification attached to a metadata element. + * The effectivity dates control the visibility of the classification through specific APIs. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param classificationName unique name of the classification to update + * @param effectiveFrom the date when this element is active - null for active now + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * + * @throws InvalidParameterException either the unique identifier or the status are invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateClassificationEffectivityInStore(String metadataElementGUID, + String classificationName, + Date effectiveFrom, + Date effectiveTo) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateClassificationEffectivityInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + classificationName, + forLineage, + forDuplicateProcessing, + effectiveFrom, + effectiveTo, + getEffectiveTime()); + } + + + /** + * Remove the named classification from a specific metadata element. + * + * @param metadataElementGUID unique identifier of the metadata element to update + * @param classificationName unique name of the classification to remove + * + * @throws InvalidParameterException the unique identifier or classification name is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to remove this classification + * @throws PropertyServerException there is a problem with the metadata store + */ + public void declassifyMetadataElementInStore(String metadataElementGUID, + String classificationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.declassifyMetadataElementInStore(userId, + externalSourceGUID, + externalSourceName, + metadataElementGUID, + classificationName, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Create a relationship between two metadata elements. It is important to put the right element at each end of the relationship + * according to the type definition since this will affect how the relationship is interpreted. + * + * @param relationshipTypeName name of the type of relationship to create. This will determine the types of metadata elements that can be + * related and the properties that can be associated with this relationship. + * @param metadataElement1GUID unique identifier of the metadata element at end 1 of the relationship + * @param metadataElement2GUID unique identifier of the metadata element at end 2 of the relationship + * @param effectiveFrom the date when this element is active - null for active now + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * @param properties the properties of the relationship + * + * @return unique identifier of the new relationship + * + * @throws InvalidParameterException the unique identifier's of the metadata elements are null or invalid in some way; the properties are + * not valid for this type of relationship + * @throws UserNotAuthorizedException the governance action service is not authorized to create this type of relationship + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createRelatedElementsInStore(String relationshipTypeName, + String metadataElement1GUID, + String metadataElement2GUID, + Date effectiveFrom, + Date effectiveTo, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createRelatedElementsInStore(userId, + externalSourceGUID, + externalSourceName, + relationshipTypeName, + metadataElement1GUID, + metadataElement2GUID, + forLineage, + forDuplicateProcessing, + effectiveFrom, + effectiveTo, + properties, + getEffectiveTime()); + } + + + /** + * Update the properties associated with a relationship. + * + * @param relationshipGUID unique identifier of the relationship to update + * @param replaceProperties flag to indicate whether to completely replace the existing properties with the new properties, or just update + * the individual properties specified on the request. + * @param properties new properties for the relationship + * + * @throws InvalidParameterException the unique identifier of the relationship is null or invalid in some way; the properties are + * not valid for this type of relationship + * @throws UserNotAuthorizedException the governance action service is not authorized to update this relationship + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateRelatedElementsInStore(String relationshipGUID, + boolean replaceProperties, + ElementProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateRelatedElementsInStore(userId, + externalSourceGUID, + externalSourceName, + relationshipGUID, + replaceProperties, + forLineage, + forDuplicateProcessing, + properties, + getEffectiveTime()); + } + + + + /** + * Update the effectivity dates of a specific relationship between metadata elements. + * The effectivity dates control the visibility of the classification through specific APIs. + * + * @param relationshipGUID unique identifier of the relationship to update + * @param effectiveFrom the date when this element is active - null for active now + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * + * @throws InvalidParameterException either the unique identifier or the status are invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to update this element + * @throws PropertyServerException there is a problem with the metadata store + */ + public void updateRelatedElementsEffectivityInStore(String relationshipGUID, + Date effectiveFrom, + Date effectiveTo) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.updateRelatedElementsEffectivityInStore(userId, + externalSourceGUID, + externalSourceName, + relationshipGUID, + forLineage, + forDuplicateProcessing, + effectiveFrom, + effectiveTo, + getEffectiveTime()); + } + + + /** + * Delete a relationship between two metadata elements. + * + * @param relationshipGUID unique identifier of the relationship to delete + * + * @throws InvalidParameterException the unique identifier of the relationship is null or invalid in some way + * @throws UserNotAuthorizedException the governance action service is not authorized to delete this relationship + * @throws PropertyServerException there is a problem with the metadata store + */ + public void deleteRelatedElementsInStore(String relationshipGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.deleteRelatedElementsInStore(userId, + externalSourceGUID, + externalSourceName, + relationshipGUID, + forLineage, + forDuplicateProcessing, + getEffectiveTime()); + } + + + /** + * Create an incident report to capture the situation detected by this governance action service. + * This incident report will be processed by other governance activities. + * + * @param qualifiedName unique identifier to give this new incident report + * @param domainIdentifier governance domain associated with this action (0=ALL) + * @param background description of the situation + * @param impactedResources details of the resources impacted by this situation + * @param previousIncidents links to previous incident reports covering this situation + * @param incidentClassifiers initial classifiers for the incident report + * @param additionalProperties additional arbitrary properties for the incident reports + * @param originatorGUID the unique identifier of the person or process that created the incident + * + * @return unique identifier of the resulting incident report + * @throws InvalidParameterException null or non-unique qualified name for the incident report + * @throws UserNotAuthorizedException this governance action service is not authorized to create an incident report + * @throws PropertyServerException there is a problem with the metadata store + */ + public String createIncidentReport(String qualifiedName, + int domainIdentifier, + String background, + List impactedResources, + List previousIncidents, + Map incidentClassifiers, + Map additionalProperties, + String originatorGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.createIncidentReport(userId, + qualifiedName, + domainIdentifier, + background, + impactedResources, + previousIncidents, + incidentClassifiers, + additionalProperties, + originatorGUID); + } + + + /** + * Create a "To Do" request for someone to work on. + * + * @param qualifiedName unique name for the to do. (Could be the engine name and a guid?) + * @param title short meaningful phrase for the person receiving the request + * @param instructions further details on what to do + * @param todoCategory a category of to dos (for example, "data error", "access request") + * @param priority priority value (based on organization's scale) + * @param dueDate date/time this needs to be completed + * @param additionalProperties additional arbitrary properties for the incident reports + * @param assignTo qualified name of the Actor element for the recipient + * @param causeGUID unique identifier of the element that describes the rule, project that this is on behalf of + * @param actionTargets the list of elements that should be acted upon + * + * @return unique identifier of new to do element + * + * @throws InvalidParameterException either todoQualifiedName or assignedTo are null or not recognized + * @throws UserNotAuthorizedException the governance action service is not authorized to create a "to do" entity + * @throws PropertyServerException there is a problem connecting to (or inside) the metadata store + */ + public String openToDo(String qualifiedName, + String title, + String instructions, + String todoCategory, + int priority, + Date dueDate, + Map additionalProperties, + String assignTo, + String causeGUID, + List actionTargets) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.openToDo(userId, qualifiedName, title, instructions, todoCategory, priority, dueDate, additionalProperties, assignTo, causeGUID, actionTargets); + } + + + /** + * Create or update the valid value for a particular open metadata property name. If the typeName is null, this valid value + * applies to properties of this name from all types. The valid value is stored in the preferredValue property. If a valid value is + * already set up for this property (with overlapping effective dates) then the valid value is updated. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param validMetadataValue preferred value to use in the open metadata types plus additional descriptive values. + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void setUpValidMetadataValue(String typeName, + String propertyName, + ValidMetadataValue validMetadataValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.setUpValidMetadataValue(userId, typeName, propertyName, validMetadataValue); + } + + + /** + * Create or update the valid value for a name that can be stored in a particular open metadata property name. + * This property is of type map from name to string. + * The valid value is stored in the preferredValue property of validMetadataValue. + * If the typeName is null, this valid value applies to properties of this name from any open metadata type. + * If a valid value is already set up for this property (with overlapping effective dates) then the valid value is updated. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param validMetadataValue preferred value to use in the open metadata types plus additional descriptive values. + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void setUpValidMetadataMapName(String typeName, + String propertyName, + ValidMetadataValue validMetadataValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.setUpValidMetadataMapName(userId, typeName, propertyName, validMetadataValue); + } + + + /** + * Create or update the valid value for a name that can be stored in a particular open metadata property name. + * This property is of type map from name to string. + * The valid value is stored in the preferredValue property of validMetadataValue. + * + * If the typeName is null, this valid value applies to properties of this name from any open metadata type. + * If a valid value is already set up for this property (with overlapping effective dates) then the valid value is updated. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param mapName name in the map that this valid value applies. If null then the value can be used for any name in the map. + * @param validMetadataValue preferred value to use in the open metadata types plus additional descriptive values. + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void setUpValidMetadataMapValue(String typeName, + String propertyName, + String mapName, + ValidMetadataValue validMetadataValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.setUpValidMetadataMapValue(userId, typeName, propertyName, mapName, validMetadataValue); + } + + + /** + * Remove a valid value for a property. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param preferredValue specific valid value to remove + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void clearValidMetadataValue(String typeName, + String propertyName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.clearValidMetadataValue(userId, typeName, propertyName, preferredValue); + } + + + /** + * Remove a valid map name value for a property. The match is done on preferred name. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param preferredValue specific valid value to remove + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void clearValidMetadataMapName(String typeName, + String propertyName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.clearValidMetadataMapName(userId, typeName, propertyName, preferredValue); + } + + + /** + * Remove a valid map name value for a property. The match is done on preferred name. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param mapName name in the map that this valid value applies. If null then the value can be used for any name in the map. + * @param preferredValue specific valid value to remove + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public void clearValidMetadataMapValue(String typeName, + String propertyName, + String mapName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + openMetadataStore.clearValidMetadataMapValue(userId, typeName, propertyName, mapName, preferredValue); + } + + + /** + * Validate whether the value found in an open metadata property is valid. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param actualValue value stored in the property - if this is null, true is only returned if null is set up as a valid value. + * + * @return boolean flag - true if the value is one of the defined valid values or there are no valid values set up for the property (and so any value is value). + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public boolean validateMetadataValue(String typeName, + String propertyName, + String actualValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.validateMetadataValue(userId, typeName, propertyName, actualValue); + } + + + /** + * Validate whether the name found in an open metadata map property is valid. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param actualValue value stored in the property - if this is null, true is only returned if null is set up as a valid value. + * + * @return boolean flag - true if the value is one of the defined valid values or there are no valid values set up for the property (and so any value is value). + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public boolean validateMetadataMapName(String typeName, + String propertyName, + String actualValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.validateMetadataMapName(userId, typeName, propertyName, actualValue); + } + + + /** + * Validate whether the name found in an open metadata map property is valid. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param mapName name in the map that this valid value applies. If null then the value can be used for any name in the map. + * @param actualValue value stored in the property - if this is null, true is only returned if null is set up as a valid value. + * + * @return boolean flag - true if the value is one of the defined valid values or there are no valid values set up for the property (and so any value is value). + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public boolean validateMetadataMapValue(String typeName, + String propertyName, + String mapName, + String actualValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.validateMetadataMapValue(userId, typeName, propertyName, mapName, actualValue); + } + + + /** + * Retrieve details of a specific valid value for a property. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param preferredValue valid value to match + * + * @return specific valid value definition or none if there is no definition stored + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public ValidMetadataValue getValidMetadataValue(String typeName, + String propertyName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getValidMetadataValue(userId, typeName, propertyName, preferredValue); + } + + + /** + * Retrieve details of a specific valid name for a map property. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param preferredValue valid value to match + * + * @return specific valid value definition or none if there is no definition stored + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public ValidMetadataValue getValidMetadataMapName(String typeName, + String propertyName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getValidMetadataMapName(userId, typeName, propertyName, preferredValue); + } + + + /** + * Retrieve details of a specific valid value for a map name. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param mapName name in the map that this valid value applies. If null then the value can be used for any name in the map. + * @param preferredValue valid value to match + * + * @return specific valid value definition or none if there is no definition stored + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public ValidMetadataValue getValidMetadataMapValue(String typeName, + String propertyName, + String mapName, + String preferredValue) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getValidMetadataMapValue(userId, typeName, propertyName, mapName, preferredValue); + } + + + /** + * Retrieve all the valid values for the requested property. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of valid values defined for the property + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List getValidMetadataValues(String typeName, + String propertyName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getValidMetadataValues(userId, typeName, propertyName, startFrom, pageSize); + } + + + + /** + * Retrieve all the consistent valid values for the requested property. + * + * @param typeName type name if this is valid value is specific for a type, or null if this valid value if for the property name for all types + * @param propertyName name of property that this valid value applies + * @param mapName optional name of map key that this valid value applies + * @param preferredValue the value to match against + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of valid values defined for the property + * + * @throws InvalidParameterException the property name is null or not known. + * @throws UserNotAuthorizedException the service is not able to create/access the element + * @throws PropertyServerException there is a problem accessing the metadata store + */ + public List getConsistentMetadataValues(String typeName, + String propertyName, + String mapName, + String preferredValue, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return openMetadataStore.getConsistentMetadataValues(userId, typeName, propertyName, mapName, preferredValue, startFrom, pageSize); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/ffdc/SAFErrorCode.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/ffdc/SAFErrorCode.java new file mode 100644 index 00000000000..8714f3c43ea --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/ffdc/SAFErrorCode.java @@ -0,0 +1,141 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.ffdc; + + +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageDefinition; +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageSet; + + +/** + * The SAF error code is used to define first failure data capture (FFDC) for errors that occur when working with + * SAF Discovery Services. It is used in conjunction with all SAF Exceptions, both Checked and Runtime (unchecked). + * The 5 fields in the enum are: + *
    + *
  • HTTP Error Code for translating between REST and JAVA - Typically the numbers used are:
  • + *
    • + *
    • 500 - internal error
    • + *
    • 400 - invalid parameters
    • + *
    • 404 - not found
    • + *
    • 409 - data conflict errors - eg item already defined
    • + *
  • + *
  • Error Message Identifier - to uniquely identify the message
  • + *
  • Error Message Text - includes placeholder to allow additional values to be captured
  • + *
  • SystemAction - describes the result of the error
  • + *
  • UserAction - describes how a user should correct the error
  • + *
+ */ +public enum SAFErrorCode implements ExceptionMessageSet +{ + /** + * SAF-SURVEY-ACTION-SERVICE-400-001 - No discovery context supplied to the discovery service {0} + */ + NULL_SURVEY_CONTEXT(400, "SAF-SURVEY-ACTION-SERVICE-400-001", + "No discovery context supplied to the discovery service {0}", + "The discovery service is not able to determine which asset to analyze.", + "This may be a configuration or a code error. Look for other error messages and review the code of the discovery service. Once the cause is resolved, retry the discovery request."), + + /** + * SAF-SURVEY-ACTION-SERVICE-400-002 - No embedded discovery services supplied to the discovery pipeline {0} + */ + NO_EMBEDDED_SURVEY_ACTION_SERVICES(400, "SAF-SURVEY-ACTION-SERVICE-400-002", + "No embedded discovery services supplied to the discovery pipeline {0}", + "The discovery pipeline is not able to discovery which discovery services to run.", + "This may be a configuration or a code error. Look for other error messages and review the code of the discovery pipeline service. Once the cause is resolved, retry the discovery request."), + + /** + * SAF-SURVEY-ACTION-SERVICE-400-003 - No embedded discovery services supplied to the discovery pipeline {0} + */ + INVALID_EMBEDDED_SURVEY_ACTION_SERVICE(400, "SAF-SURVEY-ACTION-SERVICE-400-003", + "No embedded discovery services supplied to the discovery pipeline {0}", + "The discovery pipeline is not able to discover which discovery services to run.", + "This may be a configuration or a code error. Look for other error messages and review the code of the discovery pipeline service or the associated open discovery engine. Once the cause is resolved, retry the discovery request."), + + /** + * SAF-SURVEY-ACTION-SERVICE-500-001 - Unexpected exception in discovery service {0} of type {1} detected by method {2}. The error message was {3} + */ + UNEXPECTED_EXCEPTION(500, "SAF-SURVEY-ACTION-SERVICE-500-001", + "Unexpected exception in discovery service {0} of type {1} detected by method {2}. The error message was {3}", + "The discovery service failed during its operation.", + "This may be a configuration or a code error. Look for other error messages and review the code of the discovery service. Once the cause is resolved, retry the discovery request."), + ; + + private final int httpErrorCode; + private final String errorMessageId; + private final String errorMessage; + private final String systemAction; + private final String userAction; + + /** + * The constructor for SAFErrorCode expects to be passed one of the enumeration rows defined above. + * + * @param httpErrorCode error code to use over REST calls + * @param errorMessageId unique id for the message + * @param errorMessage text for the message + * @param systemAction description of the action taken by the system when the error condition happened + * @param userAction instructions for resolving the error + */ + SAFErrorCode(int httpErrorCode, String errorMessageId, String errorMessage, String systemAction, String userAction) + { + this.httpErrorCode = httpErrorCode; + this.errorMessageId = errorMessageId; + this.errorMessage = errorMessage; + this.systemAction = systemAction; + this.userAction = userAction; + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are no message inserts. + * + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition() + { + return new ExceptionMessageDefinition(httpErrorCode, + errorMessageId, + errorMessage, + systemAction, + userAction); + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are values to be inserted into the message. + * + * @param params array of parameters (all strings). They are inserted into the message according to the numbering in the message text. + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition(String... params) + { + ExceptionMessageDefinition messageDefinition = new ExceptionMessageDefinition(httpErrorCode, + errorMessageId, + errorMessage, + systemAction, + userAction); + + messageDefinition.setMessageParameters(params); + + return messageDefinition; + } + + + /** + * JSON-style toString + * + * @return string of property names and values for this enum + */ + @Override + public String toString() + { + return "SAFErrorCode{" + + "httpErrorCode=" + httpErrorCode + + ", errorMessageId='" + errorMessageId + '\'' + + ", errorMessage='" + errorMessage + '\'' + + ", systemAction='" + systemAction + '\'' + + ", userAction='" + userAction + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/Annotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/Annotation.java new file mode 100644 index 00000000000..77ebb23b00a --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/Annotation.java @@ -0,0 +1,457 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; + +import java.io.Serial; +import java.util.*; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * Annotation is used to record information gleaned from a survey action service. The subtypes contain more detail. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = SchemaAnalysisAnnotation.class, name = "SchemaAnalysisAnnotation"), + @JsonSubTypes.Type(value = DataSourceMeasurementAnnotation.class, name = "DataSourceMeasurementAnnotation"), + @JsonSubTypes.Type(value = DataFieldAnnotation.class, name = "DataFieldAnnotation"), + }) +public class Annotation extends PropertyBase +{ + @Serial + private static final long serialVersionUID = 1L; + + private String annotationType = null; + private String summary = null; + private int confidenceLevel = 0; + private String expression = null; + private String explanation = null; + private String analysisStep = null; + private String jsonProperties = null; + + /* + * Details of Annotations attached to this Annotation + */ + private int numAttachedAnnotations = 0; + + /* + * Details from the latest AnnotationReview entity. + */ + private AnnotationStatus annotationStatus = null; + private Date reviewDate = null; + private String steward = null; + private String reviewComment = null; + + + private Map additionalProperties = null; + + + + /** + * Default constructor used by subclasses + */ + public Annotation() + { + super(); + } + + + /** + * Copy/clone Constructor + * + * @param template template object to copy. + */ + public Annotation(Annotation template) + { + super(template); + + if (template != null) + { + this.annotationType = template.getAnnotationType(); + this.summary = template.getSummary(); + this.confidenceLevel = template.getConfidenceLevel(); + this.expression = template.getExpression(); + this.explanation = template.getExplanation(); + this.analysisStep = template.getAnalysisStep(); + this.jsonProperties = template.getJsonProperties(); + this.numAttachedAnnotations = template.getNumAttachedAnnotations(); + this.annotationStatus = template.getAnnotationStatus(); + this.reviewDate = template.getReviewDate(); + this.steward = template.getSteward(); + this.reviewComment = template.getReviewComment(); + this.additionalProperties = template.getAdditionalProperties(); + } + } + + + + + /** + * Return the informal name for the type of annotation. + * + * @return String annotation type + */ + public String getAnnotationType() + { + return annotationType; + } + + + /** + * Set up the informal name for the type of annotation. + * + * @param annotationType String annotation type + */ + public void setAnnotationType(String annotationType) + { + this.annotationType = annotationType; + } + + + /** + * Return the summary description for the annotation. + * + * @return String summary of annotation + */ + public String getSummary() + { + return summary; + } + + + /** + * Set up the summary description for the annotation. + * + * @param summary String summary of annotation + */ + public void setSummary(String summary) + { + this.summary = summary; + } + + + /** + * Return the confidence level of the survey action service that the annotation is correct. + * + * @return int confidence level + */ + public int getConfidenceLevel() + { + return confidenceLevel; + } + + + /** + * Set up the confidence level of the survey action service that the annotation is correct. + * + * @param confidenceLevel int confidence level + */ + public void setConfidenceLevel(int confidenceLevel) + { + this.confidenceLevel = confidenceLevel; + } + + + /** + * Return the expression that represent the relationship between the annotation and the asset. + * + * @return String expression + */ + public String getExpression() + { + return expression; + } + + + /** + * Set up the expression that represent the relationship between the annotation and the asset. + * + * @param expression String expression + */ + public void setExpression(String expression) + { + this.expression = expression; + } + + + /** + * Return the explanation for the annotation. + * + * @return String explanation + */ + public String getExplanation() { + return explanation; + } + + + /** + * Set up the explanation for the annotation. + * + * @param explanation explanation + */ + public void setExplanation(String explanation) + { + this.explanation = explanation; + } + + + /** + * Return a description of the analysis step that the survey action service was in when it created the annotation. + * + * @return String analysis step + */ + public String getAnalysisStep() + { + return analysisStep; + } + + + /** + * Set up a description of the analysis step that the survey action service was in when it created the annotation. + * + * @param analysisStep analysis step + */ + public void setAnalysisStep(String analysisStep) + { + this.analysisStep = analysisStep; + } + + + /** + * Return the JSON properties associated with the annotation. + * + * @return String JSON properties of annotation + */ + public String getJsonProperties() + { + return jsonProperties; + } + + + /** + * Set up the JSON properties associated with the annotation. + * + * @param jsonProperties JSON properties of annotation + */ + public void setJsonProperties(String jsonProperties) + { + this.jsonProperties = jsonProperties; + } + + + /** + * Return the current status of the annotation. + * + * @return AnnotationStatus current status of annotation + */ + public AnnotationStatus getAnnotationStatus() + { + return annotationStatus; + } + + + /** + * Set up the current status of the annotation. + * + * @param annotationStatus current status of annotation + */ + public void setAnnotationStatus(AnnotationStatus annotationStatus) + { + this.annotationStatus = annotationStatus; + } + + + /** + * Return the number of annotations attached to the this annotation. These generally add further information. + * + * @return number of annotations + */ + public int getNumAttachedAnnotations() + { + return numAttachedAnnotations; + } + + + /** + * Set up the number of annotations attached to the this annotation. These generally add further information. + * + * @param number number of annotations + */ + public void setNumAttachedAnnotations(int number) + { + this.numAttachedAnnotations = number; + } + + + /** + * Return the date that this annotation was reviewed. If no review has taken place then this property is null. + * + * @return Date review date + */ + public Date getReviewDate() + { + return reviewDate; + } + + + /** + * Set up the date that this annotation was reviewed. If no review has taken place then this property is null. + * + * @param reviewDate review date + */ + public void setReviewDate(Date reviewDate) + { + this.reviewDate = reviewDate; + } + + + /** + * Return the name of the steward that reviewed the annotation. + * + * @return String steward's name. + */ + public String getSteward() + { + return steward; + } + + + /** + * Set up the name of the steward that reviewed the annotation. + * + * @param steward steward's name. + */ + public void setSteward(String steward) + { + this.steward = steward; + } + + + /** + * Return any comments made by the steward during the review. + * + * @return String review comment + */ + public String getReviewComment() + { + return reviewComment; + } + + + /** + * Set up any comments made by the steward during the review. + * + * @param reviewComment review comment + */ + public void setReviewComment(String reviewComment) + { + this.reviewComment = reviewComment; + } + + + /** + * Return the additional properties for the Annotation. + * + * @return properties map + */ + public Map getAdditionalProperties() + { + return additionalProperties; + } + + + /** + * Set up the additional properties for the Annotation. + * + * @param additionalProperties properties map + */ + public void setAdditionalProperties(Map additionalProperties) + { + this.additionalProperties = additionalProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "Annotation{" + + "annotationType='" + annotationType + '\'' + + ", summary='" + summary + '\'' + + ", confidenceLevel=" + confidenceLevel + + ", expression='" + expression + '\'' + + ", explanation='" + explanation + '\'' + + ", analysisStep='" + analysisStep + '\'' + + ", jsonProperties='" + jsonProperties + '\'' + + ", numAttachedAnnotations=" + numAttachedAnnotations + + ", annotationStatus=" + annotationStatus + + ", reviewDate=" + reviewDate + + ", steward='" + steward + '\'' + + ", reviewComment='" + reviewComment + '\'' + + ", additionalProperties=" + additionalProperties + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + Annotation that = (Annotation) objectToCompare; + return confidenceLevel == that.confidenceLevel && + numAttachedAnnotations == that.numAttachedAnnotations && + Objects.equals(annotationType, that.annotationType) && + Objects.equals(summary, that.summary) && + Objects.equals(expression, that.expression) && + Objects.equals(explanation, that.explanation) && + Objects.equals(analysisStep, that.analysisStep) && + Objects.equals(jsonProperties, that.jsonProperties) && + annotationStatus == that.annotationStatus && + Objects.equals(reviewDate, that.reviewDate) && + Objects.equals(steward, that.steward) && + Objects.equals(reviewComment, that.reviewComment) && + Objects.equals(additionalProperties, that.additionalProperties); + } + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(annotationType, summary, confidenceLevel, expression, explanation, analysisStep, jsonProperties, numAttachedAnnotations + , annotationStatus, reviewDate, steward, reviewComment, additionalProperties); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatus.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatus.java new file mode 100644 index 00000000000..a26ad4dcaa2 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatus.java @@ -0,0 +1,169 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * An AnnotationStatus defines the current status for an annotation plus some default descriptive text. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum AnnotationStatus implements Serializable +{ + /** + * Annotation has been created but not reviewed. + */ + NEW_ANNOTATION (0, 0, "New", "Annotation has been created but not reviewed"), + + /** + * Annotation has been reviewed by no decision has been made. + */ + REVIEWED_ANNOTATION (1, 1, "Reviewed", "Annotation has been reviewed by no decision has been made"), + + /** + * Annotation has been approved. + */ + APPROVED_ANNOTATION (2, 2, "Approved", "Annotation has been approved"), + + /** + * Annotation has been approved and insight has been added to Asset's metadata. + */ + ACTIONED_ANNOTATION (3, 3, "Actioned", "Annotation has been approved and insight has been added to Asset's metadata"), + + /** + * Annotation has been reviewed and declared invalid. + */ + INVALID_ANNOTATION (4, 4, "Invalid", "Annotation has been reviewed and declared invalid"), + + /** + * Annotation is invalid and should be ignored. + */ + IGNORE_ANNOTATION (5, 5, "Ignore", "Annotation is invalid and should be ignored"), + + /** + * Annotation's status stored in additional properties + */ + OTHER_STATUS (98, 99, "Other", "Annotation's status stored in additional properties"), + + /** + * Annotation has not had a status assigned + */ + UNKNOWN_STATUS (99, 0, "Unknown", "Annotation has not had a status assigned"); + + private static final long serialVersionUID = 1L; + + private static final String ENUM_TYPE_GUID = "71187df6-ef66-4f88-bc03-cd3c7f925165"; + private static final String ENUM_TYPE_NAME = "AnnotationStatus"; + + private final int statusCode; + private final int openTypeOrdinal; + private final String statusName; + private final String statusDescription; + + + /** + * Typical Constructor + * + * @param statusCode ordinal + * @param openTypeOrdinal code number from the equivalent Enum Type + * @param statusName short name + * @param statusDescription longer explanation + */ + AnnotationStatus(int statusCode, + int openTypeOrdinal, + String statusName, + String statusDescription) + { + this.statusCode = statusCode; + this.openTypeOrdinal = openTypeOrdinal; + this.statusName = statusName; + this.statusDescription = statusDescription; + } + + + /** + * Return the status code for this enum instance + * + * @return int status code + */ + public int getOrdinal() + { + return statusCode; + } + + + /** + * Return the default name for the status for this enum instance. + * + * @return String default status name + */ + public String getName() + { + return statusName; + } + + + /** + * Return the default description for the status for this enum instance. + * + * @return String default status description + */ + public String getDescription() + { + return statusDescription; + } + + + + /** + * Return the code for this enum that comes from the Open Metadata Type that this enum represents. + * + * @return int code number + */ + public int getOpenTypeOrdinal() + { + return openTypeOrdinal; + } + + + /** + * Return the unique identifier for the open metadata enum type that this enum class represents. + * + * @return string guid + */ + public String getOpenTypeGUID() { return ENUM_TYPE_GUID; } + + + /** + * Return the unique name for the open metadata enum type that this enum class represents. + * + * @return string name + */ + public String getOpenTypeName() { return ENUM_TYPE_NAME; } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "AnnotationStatus{" + + "statusCode=" + statusCode + + ", openTypeOrdinal=" + openTypeOrdinal + + ", statusName='" + statusName + '\'' + + ", statusDescription='" + statusDescription + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentValueAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/ClassificationAnnotation.java similarity index 60% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentValueAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/ClassificationAnnotation.java index e7789a1ecbc..1b884730f62 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentValueAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/ClassificationAnnotation.java @@ -1,88 +1,78 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; +import java.io.Serial; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentValueAnnotation lists the name of the properties that are diverging in 2 assets that are linked as - * duplicates. + * ClassificationAnnotation recommends classifications for either an asset or a data field. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentAttachmentValueAnnotation extends DivergentAttachmentAnnotation + +public class ClassificationAnnotation extends DataFieldAnnotation { + @Serial private static final long serialVersionUID = 1L; - private List divergentPropertyNames = null; - + private Map candidateClassifications = null; /** * Default constructor */ - public DivergentAttachmentValueAnnotation() + public ClassificationAnnotation() { - super(); } /** - * Copy/clone constructor. + * Copy clone constructor * * @param template object to copy */ - public DivergentAttachmentValueAnnotation(DivergentAttachmentValueAnnotation template) + public ClassificationAnnotation(ClassificationAnnotation template) { super(template); if (template != null) { - divergentPropertyNames = template.getDivergentPropertyNames(); + candidateClassifications = template.getCandidateClassifications(); } } /** - * Return the properties of the Asset that are diverging from the duplicate. + * Return a map of candidate classification names to additional characteristics * - * @return list of property names + * @return map of classification names to string */ - public List getDivergentPropertyNames() + public Map getCandidateClassifications() { - if (divergentPropertyNames == null) - { - return null; - } - else if (divergentPropertyNames.isEmpty()) - { - return null; - } - return divergentPropertyNames; + return candidateClassifications; } /** - * Set up the unique identifier for the attachment to the Asset that is diverging. + * Set up a map of candidate classification names to additional characteristics. * - * @param divergentPropertyNames list of property names + * @param candidateClassifications map of classification names to string */ - public void setDivergentPropertyNames(List divergentPropertyNames) + public void setCandidateClassifications(Map candidateClassifications) { - this.divergentPropertyNames = divergentPropertyNames; + this.candidateClassifications = candidateClassifications; } - /** * Standard toString method. * @@ -91,11 +81,8 @@ public void setDivergentPropertyNames(List divergentPropertyNames) @Override public String toString() { - return "DivergentAttachmentValueAnnotation{" + - "divergentPropertyNames=" + divergentPropertyNames + - ", attachmentGUID='" + getAttachmentGUID() + '\'' + - ", duplicateAttachmentGUID='" + getDuplicateAttachmentGUID() + '\'' + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "ClassificationAnnotation{" + + "candidateClassifications=" + candidateClassifications + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -138,12 +125,11 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentAttachmentValueAnnotation that = (DivergentAttachmentValueAnnotation) objectToCompare; - return Objects.equals(divergentPropertyNames, that.divergentPropertyNames); + ClassificationAnnotation that = (ClassificationAnnotation) objectToCompare; + return Objects.equals(candidateClassifications, that.candidateClassifications); } - /** * Create a hash code for this element type. * @@ -152,6 +138,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), divergentPropertyNames); + return Objects.hash(super.hashCode(), candidateClassifications); } } diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataClassAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataClassAnnotation.java new file mode 100644 index 00000000000..775b7b1cd1d --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataClassAnnotation.java @@ -0,0 +1,193 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; + +import java.io.Serial; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * DataClassAnnotation recommends a data class that potentially matches this data field. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class DataClassAnnotation extends DataFieldAnnotation +{ + @Serial + private static final long serialVersionUID = 1L; + + private List candidateDataClassGUIDs = null; + private long matchingValues = 0L; + private long nonMatchingValues = 0L; + + + /** + * Default constructor + */ + public DataClassAnnotation() + { + } + + + /** + * Copy clone constructor + * + * @param template object to copy + */ + public DataClassAnnotation(DataClassAnnotation template) + { + super(template); + + if (template != null) + { + candidateDataClassGUIDs = template.getCandidateDataClassGUIDs(); + matchingValues = template.getMatchingValues(); + nonMatchingValues = template.getNonMatchingValues(); + } + } + + + /** + * Return the identifiers of data classes that seem to match the values in this data field. + * + * @return list of unique identifiers for data classes + */ + public List getCandidateDataClassGUIDs() + { + return candidateDataClassGUIDs; + } + + + /** + * Set up the identifiers of data classes that seem to match the values in this data field. + * + * @param candidateDataClassGUIDs list of guids + */ + public void setCandidateDataClassGUIDs(List candidateDataClassGUIDs) + { + this.candidateDataClassGUIDs = candidateDataClassGUIDs; + } + + + /** + * Return the count of matching values that match the specification of these data classes. + * + * @return long + */ + public long getMatchingValues() + { + return matchingValues; + } + + + /** + * Set up the count of matching values that match the specification of these data classes. + * + * @param matchingValues long + */ + public void setMatchingValues(long matchingValues) + { + this.matchingValues = matchingValues; + } + + + /** + * Return the count of values that do not match the specification of these data classes. + * + * @return long + */ + public long getNonMatchingValues() + { + return nonMatchingValues; + } + + + /** + * Set up the count of values that do not match the specification of these data classes. + * + * @param nonMatchingValues long + */ + public void setNonMatchingValues(long nonMatchingValues) + { + this.nonMatchingValues = nonMatchingValues; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "DataClassAnnotation{" + + "candidateDataClassGUIDs=" + candidateDataClassGUIDs + + ", matchingValues=" + matchingValues + + ", nonMatchingValues=" + nonMatchingValues + + ", annotationType='" + getAnnotationType() + '\'' + + ", summary='" + getSummary() + '\'' + + ", confidenceLevel=" + getConfidenceLevel() + + ", expression='" + getExpression() + '\'' + + ", explanation='" + getExplanation() + '\'' + + ", analysisStep='" + getAnalysisStep() + '\'' + + ", jsonProperties='" + getJsonProperties() + '\'' + + ", annotationStatus=" + getAnnotationStatus() + + ", numAttachedAnnotations=" + getNumAttachedAnnotations() + + ", reviewDate=" + getReviewDate() + + ", steward='" + getSteward() + '\'' + + ", reviewComment='" + getReviewComment() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + DataClassAnnotation that = (DataClassAnnotation) objectToCompare; + return matchingValues == that.matchingValues && + nonMatchingValues == that.nonMatchingValues && + Objects.equals(candidateDataClassGUIDs, that.candidateDataClassGUIDs); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), candidateDataClassGUIDs, matchingValues, nonMatchingValues); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataFieldAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataFieldAnnotation.java new file mode 100644 index 00000000000..ae00d26a91d --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataFieldAnnotation.java @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; + +import java.io.Serial; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * DataFieldAnnotation is a common base class for annotations that are attached to a data field. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = ClassificationAnnotation.class, name = "ClassificationAnnotation"), + @JsonSubTypes.Type(value = DataClassAnnotation.class, name = "DataClassAnnotation"), + @JsonSubTypes.Type(value = DataProfileAnnotation.class, name = "DataProfileAnnotation"), + @JsonSubTypes.Type(value = DataProfileLogAnnotation.class, name = "DataProfileLogAnnotation"), + @JsonSubTypes.Type(value = QualityAnnotation.class, name = "QualityAnnotation"), + @JsonSubTypes.Type(value = RelationshipAdviceAnnotation.class, name = "RelationshipAdviceAnnotation"), + @JsonSubTypes.Type(value = RequestForActionAnnotation.class, name = "RequestForActionAnnotation"), + @JsonSubTypes.Type(value = SemanticAnnotation.class, name = "SemanticAnnotation"), + }) +public abstract class DataFieldAnnotation extends Annotation +{ + @Serial + private static final long serialVersionUID = 1L; + + /** + * Default constructor + */ + public DataFieldAnnotation() + { + } + + + /** + * Copy clone constructor + * + * @param template object to copy + */ + public DataFieldAnnotation(DataFieldAnnotation template) + { + super(template); + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "DataFieldAnnotation{" + + "annotationType='" + getAnnotationType() + '\'' + + ", summary='" + getSummary() + '\'' + + ", confidenceLevel=" + getConfidenceLevel() + + ", expression='" + getExpression() + '\'' + + ", explanation='" + getExplanation() + '\'' + + ", analysisStep='" + getAnalysisStep() + '\'' + + ", jsonProperties='" + getJsonProperties() + '\'' + + ", annotationStatus=" + getAnnotationStatus() + + ", numAttachedAnnotations=" + getNumAttachedAnnotations() + + ", reviewDate=" + getReviewDate() + + ", steward='" + getSteward() + '\'' + + ", reviewComment='" + getReviewComment() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileAnnotation.java new file mode 100644 index 00000000000..98e9c385a3e --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileAnnotation.java @@ -0,0 +1,524 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; + +import java.io.Serial; +import java.util.*; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * DataProfileAnnotation holds properties that describe the characteristics of a specific field within a data source. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class DataProfileAnnotation extends DataFieldAnnotation +{ + @Serial + private static final long serialVersionUID = 1L; + + private int length = 0; + private String inferredDataType = null; + private String inferredFormat = null; + private int inferredLength = 0; + private int inferredPrecision = 0; + private int inferredScale = 0; + private Map profileProperties = null; + private Map profileFlags = null; + private Map profileCounts = null; + private List valueList = null; + private Map valueCount = null; + private String valueRangeFrom = null; + private String valueRangeTo = null; + private String averageValue = null; + + + /** + * Default constructor + */ + public DataProfileAnnotation() + { + } + + + /** + * Copy clone constructor + * + * @param template object to copy + */ + public DataProfileAnnotation(DataProfileAnnotation template) + { + super(template); + + if (template != null) + { + length = template.getLength(); + inferredDataType = template.getInferredDataType(); + inferredFormat = template.getInferredFormat(); + inferredLength = template.getInferredLength(); + inferredPrecision = template.getInferredPrecision(); + inferredScale = template.getInferredScale(); + profileProperties = template.getProfileProperties(); + profileFlags = template.getProfileFlags(); + profileCounts = template.getProfileCounts(); + valueList = template.getValueList(); + valueCount = template.getValueCount(); + valueRangeFrom = template.getValueRangeFrom(); + valueRangeTo = template.getValueRangeTo(); + averageValue = template.getAverageValue(); + } + } + + + /** + * Return the length of the data field. Assumes static predefined lengths. + * + * @return integer + */ + public int getLength() + { + return length; + } + + + /** + * Set up the length of the data field. Assumes static predefined lengths. + * + * @param length integer + */ + public void setLength(int length) + { + this.length = length; + } + + + /** + * Return the name of the data type that the discovery service believes the field is. + * + * @return string name + */ + public String getInferredDataType() + { + return inferredDataType; + } + + + /** + * Set up the name of the data type that the discovery service believes the field is. + * + * @param inferredDataType string name + */ + public void setInferredDataType(String inferredDataType) + { + this.inferredDataType = inferredDataType; + } + + + /** + * Return the name of the data format that the discovery service believes the field is. + * + * @return string name + */ + public String getInferredFormat() + { + return inferredFormat; + } + + + /** + * Set up the name of the data format that the discovery service believes the field is. + * + * @param inferredFormat string name + */ + public void setInferredFormat(String inferredFormat) + { + this.inferredFormat = inferredFormat; + } + + + /** + * Return the length of the data field that has been deduced from the data stored. + * + * @return integer + */ + public int getInferredLength() + { + return inferredLength; + } + + + /** + * Set up the length of the data field that has been deduced from the data stored. + * + * @param inferredLength integer + */ + public void setInferredLength(int inferredLength) + { + this.inferredLength = inferredLength; + } + + + /** + * Return the precision of the data field that has been deduced from the data stored. + * + * @return integer + */ + public int getInferredPrecision() + { + return inferredPrecision; + } + + + /** + * Set up the precision of the data field that has been deduced from the data stored. + * + * @param inferredPrecision integer + */ + public void setInferredPrecision(int inferredPrecision) + { + this.inferredPrecision = inferredPrecision; + } + + + /** + * Return the inferred scale used in other properties. + * + * @return integer + */ + public int getInferredScale() + { + return inferredScale; + } + + + /** + * Set up the inferred scale used in other properties. + * + * @param inferredScale integer + */ + public void setInferredScale(int inferredScale) + { + this.inferredScale = inferredScale; + } + + + /** + * Return the map of properties that make up the profile. + * + * @return property map + */ + public Map getProfileProperties() + { + if (profileProperties == null) + { + return null; + } + else if (profileProperties.isEmpty()) + { + return null; + } + + return new HashMap<>(profileProperties); + } + + + /** + * Set up the map of properties that make up the profile. + * + * @param profileProperties property map + */ + public void setProfileProperties(Map profileProperties) + { + this.profileProperties = profileProperties; + } + + + /** + * Return a set of boolean flags describing different aspects of the data. + * + * @return map of flag names to flag values + */ + public Map getProfileFlags() + { + if (profileFlags == null) + { + return null; + } + else if (profileFlags.isEmpty()) + { + return null; + } + + return new HashMap<>(profileFlags); + } + + + /** + * Set up a set of boolean flags describing different aspects of the data. + * + * @param profileFlags map of flag names to flag values + */ + public void setProfileFlags(Map profileFlags) + { + this.profileFlags = profileFlags; + } + + + /** + * Return the map of different profiling counts that have been calculated. + * + * @return map of count name to count value + */ + public Map getProfileCounts() + { + if (profileCounts == null) + { + return null; + } + else if (profileCounts.isEmpty()) + { + return null; + } + + return new HashMap<>(profileCounts); + } + + + /** + * Set up the map of different profiling counts that have been calculated. + * + * @param profileCounts map of count name to count value + */ + public void setProfileCounts(Map profileCounts) + { + this.profileCounts = profileCounts; + } + + + /** + * Return the list of values found in the data field. + * + * @return list of values + */ + public List getValueList() + { + if (valueList == null) + { + return null; + } + else if (valueList.isEmpty()) + { + return null; + } + + return new ArrayList<>(valueList); + } + + + /** + * Set up the list of values found in the data field. + * + * @param valueList list of values + */ + public void setValueList(List valueList) + { + this.valueList = valueList; + } + + + /** + * Return a map of values to value count for the data field. + * + * @return map of values to value count + */ + public Map getValueCount() + { + if (valueCount == null) + { + return null; + } + else if (valueCount.isEmpty()) + { + return null; + } + + return new HashMap<>(valueCount); + } + + + /** + * Set up a map of values to value count for the data field. + * + * @param valueCount map of values to value count + */ + public void setValueCount(Map valueCount) + { + this.valueCount = valueCount; + } + + + /** + * Return the lowest value of the data stored in this data field. + * + * @return string version of the value. + */ + public String getValueRangeFrom() + { + return valueRangeFrom; + } + + + /** + * Set up the lowest value of the data stored in this data field. + * + * @param valueRangeFrom string version of the value. + */ + public void setValueRangeFrom(String valueRangeFrom) + { + this.valueRangeFrom = valueRangeFrom; + } + + + /** + * Return the upper value of the data stored in this data field. + * + * @return string version of the value. + */ + public String getValueRangeTo() + { + return valueRangeTo; + } + + + /** + * Set up the upper value of the data stored in this data field. + * + * @param valueRangeTo string version of the value. + */ + public void setValueRangeTo(String valueRangeTo) + { + this.valueRangeTo = valueRangeTo; + } + + + /** + * Return the average (mean) value of the values stored in the data field. + * + * @return string version of the value. + */ + public String getAverageValue() + { + return averageValue; + } + + + /** + * Set up the average (mean) value of the values stored in the data field. + * + * @param averageValue string version of the value. + */ + public void setAverageValue(String averageValue) + { + this.averageValue = averageValue; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "DataProfileAnnotation{" + + "length=" + length + + ", inferredDataType='" + inferredDataType + '\'' + + ", inferredFormat='" + inferredFormat + '\'' + + ", inferredLength=" + inferredLength + + ", inferredPrecision=" + inferredPrecision + + ", inferredScale=" + inferredScale + + ", profileProperties=" + profileProperties + + ", profileFlags=" + profileFlags + + ", profileCounts=" + profileCounts + + ", valueList=" + valueList + + ", valueCount=" + valueCount + + ", valueRangeFrom='" + valueRangeFrom + '\'' + + ", valueRangeTo='" + valueRangeTo + '\'' + + ", averageValue='" + averageValue + '\'' + + ", annotationType='" + getAnnotationType() + '\'' + + ", summary='" + getSummary() + '\'' + + ", confidenceLevel=" + getConfidenceLevel() + + ", expression='" + getExpression() + '\'' + + ", explanation='" + getExplanation() + '\'' + + ", analysisStep='" + getAnalysisStep() + '\'' + + ", jsonProperties='" + getJsonProperties() + '\'' + + ", annotationStatus=" + getAnnotationStatus() + + ", numAttachedAnnotations=" + getNumAttachedAnnotations() + + ", reviewDate=" + getReviewDate() + + ", steward='" + getSteward() + '\'' + + ", reviewComment='" + getReviewComment() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + DataProfileAnnotation that = (DataProfileAnnotation) objectToCompare; + return length == that.length && + inferredLength == that.inferredLength && + inferredPrecision == that.inferredPrecision && + inferredScale == that.inferredScale && + Objects.equals(inferredDataType, that.inferredDataType) && + Objects.equals(inferredFormat, that.inferredFormat) && + Objects.equals(profileProperties, that.profileProperties) && + Objects.equals(profileFlags, that.profileFlags) && + Objects.equals(profileCounts, that.profileCounts) && + Objects.equals(valueList, that.valueList) && + Objects.equals(valueCount, that.valueCount) && + Objects.equals(valueRangeFrom, that.valueRangeFrom) && + Objects.equals(valueRangeTo, that.valueRangeTo) && + Objects.equals(averageValue, that.averageValue); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), length, inferredDataType, inferredFormat, inferredLength, inferredPrecision, inferredScale, + profileProperties, profileFlags, profileCounts, valueList, valueCount, valueRangeFrom, valueRangeTo, averageValue); + } +} diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentValueAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileLogAnnotation.java similarity index 65% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentValueAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileLogAnnotation.java index b8140e12692..1429a6d77d2 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentValueAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataProfileLogAnnotation.java @@ -1,10 +1,10 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.List; import java.util.Objects; @@ -12,75 +12,74 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentValueAnnotation lists the name of the properties that are diverging in 2 assets that are linked as - * duplicates. + * DataProfileLogAnnotation is an annotation that is used when the profile data generated is too big to store in the metadata server + * and has been located in log files instead. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentValueAnnotation extends DivergentDuplicateAnnotation +public class DataProfileLogAnnotation extends DataFieldAnnotation { + @Serial private static final long serialVersionUID = 1L; - private List divergentPropertyNames = null; - + private List dataProfileLogFileNames = null; /** * Default constructor */ - public DivergentValueAnnotation() + public DataProfileLogAnnotation() { - super(); } /** - * Copy/clone constructor. + * Copy clone constructor * * @param template object to copy */ - public DivergentValueAnnotation(DivergentValueAnnotation template) + public DataProfileLogAnnotation(DataProfileLogAnnotation template) { super(template); if (template != null) { - divergentPropertyNames = template.getDivergentPropertyNames(); + dataProfileLogFileNames = template.getDataProfileLogFileNames(); } } /** - * Return the properties of the Asset that are diverging from the duplicate. + * Return the names of the log files used to store the profile data. * - * @return list of property names + * @return list of names of log files */ - public List getDivergentPropertyNames() + public List getDataProfileLogFileNames() { - if (divergentPropertyNames == null) + if (dataProfileLogFileNames == null) { return null; } - else if (divergentPropertyNames.isEmpty()) + else if (dataProfileLogFileNames.isEmpty()) { return null; } - return divergentPropertyNames; + + return dataProfileLogFileNames; } /** - * Set up the unique identifier for the attachment to the Asset that is diverging. + * Set up the names of the log files used to store the profile data. * - * @param divergentPropertyNames list of property names + * @param dataProfileLogFileNames list of names of log files */ - public void setDivergentPropertyNames(List divergentPropertyNames) + public void setDataProfileLogFileNames(List dataProfileLogFileNames) { - this.divergentPropertyNames = divergentPropertyNames; + this.dataProfileLogFileNames = dataProfileLogFileNames; } - /** * Standard toString method. * @@ -89,9 +88,8 @@ public void setDivergentPropertyNames(List divergentPropertyNames) @Override public String toString() { - return "DivergentValueAnnotation{" + - "divergentPropertyNames=" + divergentPropertyNames + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "DataProfileLogAnnotation{" + + "dataProfileLogFileNames=" + dataProfileLogFileNames + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -134,8 +132,8 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentValueAnnotation that = (DivergentValueAnnotation) objectToCompare; - return Objects.equals(divergentPropertyNames, that.divergentPropertyNames); + DataProfileLogAnnotation that = (DataProfileLogAnnotation) objectToCompare; + return Objects.equals(dataProfileLogFileNames, that.dataProfileLogFileNames); } @@ -147,6 +145,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), divergentPropertyNames); + return Objects.hash(super.hashCode(), dataProfileLogFileNames); } } diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentDuplicateAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourceMeasurementAnnotation.java similarity index 51% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentDuplicateAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourceMeasurementAnnotation.java index e055cbc6ceb..b726bddcbbb 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentDuplicateAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourceMeasurementAnnotation.java @@ -1,89 +1,92 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.*; +import java.io.Serial; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentDuplicateAnnotation is the annotation used to record details of an asset has been identified as a duplicate because it originally - * had very similar values. This annotation records the differences. As these asset diverge, it may cause updates to be made to the other copies, - * or the assets may eventually be separated because they actually represent different assets now. There are many subclasses of this - * annotation that allow additional information to be logged on exactly what is changing. An asset may have multiple divergent duplicate - * annotations - even for the same duplicate. + * DataSourceMeasurementAnnotation describes properties that describe the characteristics of the data source as a whole. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "class") + include = JsonTypeInfo.As.PROPERTY, + property = "class") @JsonSubTypes( { - @JsonSubTypes.Type(value = DivergentAttachmentAnnotation.class, name = "DivergentAttachmentAnnotation"), - @JsonSubTypes.Type(value = DivergentValueAnnotation.class, name = "DivergentValueAnnotation"), - @JsonSubTypes.Type(value = DivergentClassificationAnnotation.class, name = "DivergentClassificationAnnotation"), - @JsonSubTypes.Type(value = DataProfileLogAnnotation.class, name = "DataProfileLogAnnotation"), - @JsonSubTypes.Type(value = QualityAnnotation.class, name = "QualityAnnotation"), - @JsonSubTypes.Type(value = RelationshipAdviceAnnotation.class, name = "RelationshipAdviceAnnotation"), - @JsonSubTypes.Type(value = SemanticAnnotation.class, name = "SemanticAnnotation"), + @JsonSubTypes.Type(value = DataSourcePhysicalStatusAnnotation.class, name = "DataSourcePhysicalStatusAnnotation") }) -public class DivergentDuplicateAnnotation extends Annotation +public class DataSourceMeasurementAnnotation extends Annotation { + @Serial private static final long serialVersionUID = 1L; - private String duplicateAnchorGUID = null; + private Map dataSourceProperties = null; /** * Default constructor */ - public DivergentDuplicateAnnotation() + public DataSourceMeasurementAnnotation() { - super(); } /** - * Copy/clone constructor. + * Copy clone constructor * * @param template object to copy */ - public DivergentDuplicateAnnotation(DivergentDuplicateAnnotation template) + public DataSourceMeasurementAnnotation(DataSourceMeasurementAnnotation template) { super(template); if (template != null) { - duplicateAnchorGUID = template.getDuplicateAnchorGUID(); + dataSourceProperties = template.getDataSourceProperties(); } } /** - * Return the unique identifier for the Asset that is a confirmed duplicate that is diverging. + * Return the properties of the data source. * - * @return string guid + * @return date time */ - public String getDuplicateAnchorGUID() + public Map getDataSourceProperties() { - return duplicateAnchorGUID; + if (dataSourceProperties == null) + { + return null; + } + else if (dataSourceProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(dataSourceProperties); + } } /** - * Set up he unique identifier for the Asset that is a confirmed duplicate that is diverging. + * Set up the properties of the data source. * - * @param duplicateAnchorGUID string guid + * @param dataSourceProperties date time */ - public void setDuplicateAnchorGUID(String duplicateAnchorGUID) + public void setDataSourceProperties(Map dataSourceProperties) { - this.duplicateAnchorGUID = duplicateAnchorGUID; + this.dataSourceProperties = dataSourceProperties; } @@ -95,8 +98,8 @@ public void setDuplicateAnchorGUID(String duplicateAnchorGUID) @Override public String toString() { - return "DivergentDuplicateAnnotation{" + - "duplicateAnchorGUID='" + duplicateAnchorGUID + '\'' + + return "DataSourceMeasurementAnnotation{" + + "dataSourceProperties=" + dataSourceProperties + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -139,8 +142,8 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentDuplicateAnnotation that = (DivergentDuplicateAnnotation) objectToCompare; - return Objects.equals(duplicateAnchorGUID, that.duplicateAnchorGUID); + DataSourceMeasurementAnnotation that = (DataSourceMeasurementAnnotation) objectToCompare; + return Objects.equals(getDataSourceProperties(), that.getDataSourceProperties()); } @@ -152,6 +155,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), duplicateAnchorGUID); + return Objects.hash(super.hashCode(), getDataSourceProperties()); } } diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentClassificationAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourcePhysicalStatusAnnotation.java similarity index 50% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentClassificationAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourcePhysicalStatusAnnotation.java index 5e7a273db42..263e3df0104 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentClassificationAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/DataSourcePhysicalStatusAnnotation.java @@ -1,109 +1,147 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; +import java.io.Serial; +import java.util.Date; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentClassificationAnnotation identifies a classification and its properties that are diverging in 2 assets that are linked as - * duplicates. + * DataSourceMeasurementAnnotation describes properties that describe the physical characteristics of a data source. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentClassificationAnnotation extends DivergentDuplicateAnnotation +public class DataSourcePhysicalStatusAnnotation extends DataSourceMeasurementAnnotation { + @Serial private static final long serialVersionUID = 1L; - private String divergentClassificationName = null; - private List divergentClassificationPropertyNames = null; + private Date createTime = null; + private Date modifiedTime = null; + private int size = 0; + private String encoding = null; /** * Default constructor */ - public DivergentClassificationAnnotation() + public DataSourcePhysicalStatusAnnotation() { - super(); } /** - * Copy/clone constructor. + * Copy clone constructor * * @param template object to copy */ - public DivergentClassificationAnnotation(DivergentClassificationAnnotation template) + public DataSourcePhysicalStatusAnnotation(DataSourcePhysicalStatusAnnotation template) { super(template); if (template != null) { - divergentClassificationName = template.getDivergentClassificationName(); - divergentClassificationPropertyNames = template.getDivergentClassificationPropertyNames(); + createTime = template.getCreateTime(); + modifiedTime = template.getModifiedTime(); + size = template.getSize(); + encoding = template.getEncoding(); } } /** - * Return the name of the classification that is diverging. + * Return the date and time that the data source was created. * - * @return name of classification + * @return date time */ - public String getDivergentClassificationName() + public Date getCreateTime() { - return divergentClassificationName; + return createTime; } /** - * Set up the name of the classification that is diverging. + * Set up the date and time that the data source was created. * - * @param divergentClassificationName name of classification + * @param createTime date time */ - public void setDivergentClassificationName(String divergentClassificationName) + public void setCreateTime(Date createTime) { - this.divergentClassificationName = divergentClassificationName; + this.createTime = createTime; } /** - * Return the properties that are diverging. + * Return the time that the file was last modified. * - * @return list of property names + * @return userId */ - public List getDivergentClassificationPropertyNames() + public Date getModifiedTime() { - if (divergentClassificationPropertyNames == null) - { - return null; - } - else if (divergentClassificationPropertyNames.isEmpty()) - { - return null; - } + return modifiedTime; + } + - return divergentClassificationPropertyNames; + /** + * Set up the time that the file was last modified. + * + * @param modifiedTime date time + */ + public void setModifiedTime(Date modifiedTime) + { + this.modifiedTime = modifiedTime; } /** - * Set up the properties that are diverging. + * Return the size in bytes of the data source. * - * @param divergentClassificationPropertyNames list of property names + * @return int */ - public void setDivergentClassificationPropertyNames(List divergentClassificationPropertyNames) + public int getSize() { - this.divergentClassificationPropertyNames = divergentClassificationPropertyNames; + return size; + } + + + /** + * Set up the size in bytes of the data source. + * + * @param size int + */ + public void setSize(int size) + { + this.size = size; + } + + + /** + * Return the encoding of the data source. + * + * @return encoding format description + */ + public String getEncoding() + { + return encoding; + } + + + /** + * Set up the encoding of the data source. + * + * @param encoding encoding format description + */ + public void setEncoding(String encoding) + { + this.encoding = encoding; } @@ -115,10 +153,12 @@ public void setDivergentClassificationPropertyNames(List divergentClassi @Override public String toString() { - return "DivergentClassificationAnnotation{" + - "divergentClassificationName='" + divergentClassificationName + '\'' + - ", divergentClassificationPropertyNames=" + divergentClassificationPropertyNames + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "DataSourcePhysicalStatusAnnotation{" + + "createTime=" + createTime + + ", modifiedTime=" + modifiedTime + + ", size=" + size + + ", encoding='" + encoding + '\'' + + ", dataSourceProperties=" + getDataSourceProperties() + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -161,12 +201,15 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentClassificationAnnotation that = (DivergentClassificationAnnotation) objectToCompare; - return Objects.equals(divergentClassificationName, that.divergentClassificationName) && - Objects.equals(divergentClassificationPropertyNames, that.divergentClassificationPropertyNames); + DataSourcePhysicalStatusAnnotation that = (DataSourcePhysicalStatusAnnotation) objectToCompare; + return getSize() == that.getSize() && + Objects.equals(getCreateTime(), that.getCreateTime()) && + Objects.equals(getModifiedTime(), that.getModifiedTime()) && + Objects.equals(getEncoding(), that.getEncoding()); } + /** * Create a hash code for this element type. * @@ -175,6 +218,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), divergentClassificationName, divergentClassificationPropertyNames); + return Objects.hash(super.hashCode(), getCreateTime(), getModifiedTime(), getSize(), getEncoding()); } } diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/PropertyBase.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/PropertyBase.java new file mode 100644 index 00000000000..c8c03f6cf94 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/PropertyBase.java @@ -0,0 +1,193 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; + +import java.io.Serial; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * This property header implements any common mechanisms that all property objects need. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = Annotation.class, name = "Annotation"), + @JsonSubTypes.Type(value = SurveyReport.class, name = "DiscoveryAnalysisReport"), + }) +public abstract class PropertyBase implements Serializable +{ + /** + * Header version for this implementation + */ + public static final long CURRENT_AUDIT_HEADER_VERSION = 1; + + @Serial + private static final long serialVersionUID = 1L; + + /* + * The Element header is only set when items are retrieved from the metadata repositories. + */ + private ElementHeader elementHeader = null; + + + /* + * The typeName and extendedProperties are used to identify subtypes and any properties their type definition supports. + */ + private String typeName = null; + private Map extendedProperties = null; + + + /* + * Version number for this header. This is used to ensure that all the critical header information + * in read in a back-level version of the ODF. The default is 0 to indicate that the instance came from + * a version of the OCF that does not have a version number encoded. + */ + private long headerVersion = 0; + + /** + * Typical Constructor + */ + public PropertyBase() + { + } + + + /** + * Copy/clone Constructor the resulting object will return true if tested with this.equals(template) as + * long as the template object is not null; + * + * @param template object being copied + */ + public PropertyBase(PropertyBase template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + typeName = template.getTypeName(); + extendedProperties = template.getExtendedProperties(); + headerVersion = template.getHeaderVersion(); + } + } + + + /** + * Return the version of this header. This is used by the OMAS to determine if it is back level and + * should not process events from a source that is more advanced because it does not have the ability + * to receive all the header properties. + * + * @return long version number - the value is incremented each time a new non-informational field is added + * to the audit header. + */ + public long getHeaderVersion() + { + return headerVersion; + } + + + /** + * Return the version of this header. This is used by the OMAS to determine if it is back level and + * should not process events from a source that is more advanced because it does not have the ability + * to receive all the header properties. + * + * @param headerVersion long version number - the value is incremented each time a new non-informational field is added + * to the audit header. + */ + public void setHeaderVersion(long headerVersion) + { + this.headerVersion = headerVersion; + } + + + /** + * The element header is setup when an element is retrieved from the repository. It contains the control information and + * classifications for the object. It does not need to be filled out for create and update requests. + * + * @return element header + */ + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * The element header is setup when an element is retrieved from the repository. It contains the control information and + * classifications for the object. It does not need to be filled out for create and update requests. + * + * @param elementHeader control header + */ + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the name of the type of annotation - default is "Annotation". + * + * @return unique open metadata type name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the name of the type of annotation - default is "Annotation". + * + * @param typeName unique open metadata type name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } +} \ No newline at end of file diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/QualityAnnotation.java similarity index 52% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/QualityAnnotation.java index 06c8ded477c..9aafe5d61b8 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/QualityAnnotation.java @@ -1,105 +1,103 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; -package org.odpi.openmetadata.frameworks.discovery.properties; - -import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentAttachmentAnnotation is the annotation used to record details attachments to an asset whose values are diverging from the values of a - * similar attachment in an asset that has been linked as a duplicate. + * QualityAnnotation records a quality assessment of the data. It can be attached to the whole asset or a + * specific data field. Since there are different aspects of quality, the quality dimension characterizes the + * type of quality it is measuring. Then there is a score. This is an integer and can be used as needed. + * However, a suggestion is to use it as a percentage score - so a number between 0 and 100 where 100 + * is the best. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "class") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = DivergentAttachmentValueAnnotation.class, name = "DivergentAttachmentValueAnnotation"), - @JsonSubTypes.Type(value = DivergentAttachmentClassificationAnnotation.class, name = "DivergentAttachmentClassificationAnnotation"), - }) -public class DivergentAttachmentAnnotation extends DivergentDuplicateAnnotation + +public class QualityAnnotation extends DataFieldAnnotation { + @Serial private static final long serialVersionUID = 1L; - private String attachmentGUID = null; - private String duplicateAttachmentGUID = null; + private String qualityDimension = null; + private int qualityScore = 0; /** * Default constructor */ - public DivergentAttachmentAnnotation() + public QualityAnnotation() { - super(); } /** - * Copy/clone constructor. + * Copy clone constructor * * @param template object to copy */ - public DivergentAttachmentAnnotation(DivergentAttachmentAnnotation template) + public QualityAnnotation(QualityAnnotation template) { super(template); if (template != null) { - attachmentGUID = template.getAttachmentGUID(); - duplicateAttachmentGUID = template.getDuplicateAttachmentGUID(); + qualityDimension = template.getQualityDimension(); + qualityScore = template.getQualityScore(); } } /** - * Return the unique identifier for the attachment to the Asset that is diverging. + * Return the type of quality being measured. * - * @return string guid + * @return string name */ - public String getAttachmentGUID() + public String getQualityDimension() { - return attachmentGUID; + return qualityDimension; } /** - * Set up the unique identifier for the attachment to the Asset that is diverging. + * Set up the type of quality being measured. * - * @param attachmentGUID string guid + * @param qualityDimension string name */ - public void setAttachmentGUID(String attachmentGUID) + public void setQualityDimension(String qualityDimension) { - this.attachmentGUID = attachmentGUID; + this.qualityDimension = qualityDimension; } /** - * Return the unique identifier for the attachment of the other Asset that is diverging. + * Return a quality score between 0 and 100 - 100 is the best. * - * @return string guid + * @return int */ - public String getDuplicateAttachmentGUID() + public int getQualityScore() { - return duplicateAttachmentGUID; + return qualityScore; } /** - * Set up the unique identifier for the attachment of the other Asset that is diverging. + * Set up a quality score between 0 and 100 - 100 is the best. * - * @param duplicateAttachmentGUID string guid + * @param qualityScore int */ - public void setDuplicateAttachmentGUID(String duplicateAttachmentGUID) + public void setQualityScore(int qualityScore) { - this.duplicateAttachmentGUID = duplicateAttachmentGUID; + this.qualityScore = qualityScore; } @@ -111,10 +109,9 @@ public void setDuplicateAttachmentGUID(String duplicateAttachmentGUID) @Override public String toString() { - return "DivergentAttachmentAnnotation{" + - "attachmentGUID='" + attachmentGUID + '\'' + - ", duplicateAttachmentGUID='" + duplicateAttachmentGUID + '\'' + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "QualityAnnotation{" + + "qualityDimension='" + qualityDimension + '\'' + + ", qualityScore=" + qualityScore + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -157,13 +154,12 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentAttachmentAnnotation that = (DivergentAttachmentAnnotation) objectToCompare; - return Objects.equals(attachmentGUID, that.attachmentGUID) && - Objects.equals(duplicateAttachmentGUID, that.duplicateAttachmentGUID); + QualityAnnotation that = (QualityAnnotation) objectToCompare; + return qualityScore == that.qualityScore && + Objects.equals(qualityDimension, that.qualityDimension); } - /** * Create a hash code for this element type. * @@ -172,6 +168,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), attachmentGUID, duplicateAttachmentGUID); + return Objects.hash(super.hashCode(), qualityDimension, qualityScore); } } diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentRelationshipAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RelationshipAdviceAnnotation.java similarity index 51% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentRelationshipAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RelationshipAdviceAnnotation.java index eda8e9196fd..85b4811d8cb 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentAttachmentRelationshipAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RelationshipAdviceAnnotation.java @@ -1,109 +1,135 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; +import java.io.Serial; +import java.util.Map; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentAttachmentRelationshipAnnotation identifies a relationship and its properties that are diverging in 2 attachments for assets that are - * linked as duplicates. + * RelationshipAdviceAnnotation is used to record a recommendation that a new relationship should be made from this data field to another + * object in the open metadata types. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentAttachmentRelationshipAnnotation extends DivergentAttachmentAnnotation +public class RelationshipAdviceAnnotation extends DataFieldAnnotation { + @Serial private static final long serialVersionUID = 1L; - private String divergentRelationshipGUID = null; - private List divergentRelationshipPropertyNames = null; + private String relatedEntityGUID = null; + private String relationshipTypeName = null; + private Map relationshipProperties = null; /** * Default constructor */ - public DivergentAttachmentRelationshipAnnotation() + public RelationshipAdviceAnnotation() { super(); } /** - * Copy/clone constructor. + * Copy/clone constructor * * @param template object to copy */ - public DivergentAttachmentRelationshipAnnotation(DivergentAttachmentRelationshipAnnotation template) + public RelationshipAdviceAnnotation(RelationshipAdviceAnnotation template) { super(template); if (template != null) { - divergentRelationshipGUID = template.getDivergentRelationshipGUID(); - divergentRelationshipPropertyNames = template.getDivergentRelationshipPropertyNames(); + relatedEntityGUID = template.getRelatedEntityGUID(); + relationshipTypeName = template.getRelationshipTypeName(); + relationshipProperties = template.getRelationshipProperties(); } } /** - * Return the unique identifier of the relationship that is diverging. + * Return the unique identifier of the object to connect to. * * @return string guid */ - public String getDivergentRelationshipGUID() + public String getRelatedEntityGUID() { - return divergentRelationshipGUID; + return relatedEntityGUID; } /** - * Set up the unique identifier of the relationship that is diverging. + * Set up the unique identifier of the object to connect to. * - * @param divergentRelationshipGUID string guid + * @param relatedEntityGUID string guid */ - public void setDivergentRelationshipGUID(String divergentRelationshipGUID) + public void setRelatedEntityGUID(String relatedEntityGUID) { - this.divergentRelationshipGUID = divergentRelationshipGUID; + this.relatedEntityGUID = relatedEntityGUID; } /** - * Return the properties that are diverging. + * Return the type of relationship to create. * - * @return list of property names + * @return type name */ - public List getDivergentRelationshipPropertyNames() + public String getRelationshipTypeName() { - if (divergentRelationshipPropertyNames == null) + return relationshipTypeName; + } + + + /** + * Set up the type of relationship to create. + * + * @param relationshipTypeName type name + */ + public void setRelationshipTypeName(String relationshipTypeName) + { + this.relationshipTypeName = relationshipTypeName; + } + + + /** + * Return the properties that should be stored in the relationship. + * + * @return map of property names to property values + */ + public Map getRelationshipProperties() + { + if (relationshipProperties == null) { return null; } - else if (divergentRelationshipPropertyNames.isEmpty()) + else if (relationshipProperties.isEmpty()) { return null; } - return divergentRelationshipPropertyNames; + return relationshipProperties; } /** - * Set up the properties that are diverging. + * Set up the properties that should be stored in the relationship. * - * @param divergentRelationshipPropertyNames list of property names + * @param relationshipProperties map of property names to property values */ - public void setDivergentRelationshipPropertyNames(List divergentRelationshipPropertyNames) + public void setRelationshipProperties(Map relationshipProperties) { - this.divergentRelationshipPropertyNames = divergentRelationshipPropertyNames; + this.relationshipProperties = relationshipProperties; } @@ -115,12 +141,10 @@ public void setDivergentRelationshipPropertyNames(List divergentRelation @Override public String toString() { - return "DivergentAttachmentRelationshipAnnotation{" + - "divergentRelationshipGUID='" + divergentRelationshipGUID + '\'' + - ", divergentRelationshipPropertyNames=" + divergentRelationshipPropertyNames + - ", attachmentGUID='" + getAttachmentGUID() + '\'' + - ", duplicateAttachmentGUID='" + getDuplicateAttachmentGUID() + '\'' + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "RelationshipAdviceAnnotation{" + + "relatedEntityGUID='" + relatedEntityGUID + '\'' + + ", relationshipTypeName='" + relationshipTypeName + '\'' + + ", relationshipProperties=" + relationshipProperties + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -163,9 +187,10 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentAttachmentRelationshipAnnotation that = (DivergentAttachmentRelationshipAnnotation) objectToCompare; - return Objects.equals(divergentRelationshipGUID, that.divergentRelationshipGUID) && - Objects.equals(divergentRelationshipPropertyNames, that.divergentRelationshipPropertyNames); + RelationshipAdviceAnnotation that = (RelationshipAdviceAnnotation) objectToCompare; + return Objects.equals(relatedEntityGUID, that.relatedEntityGUID) && + Objects.equals(relationshipTypeName, that.relationshipTypeName) && + Objects.equals(relationshipProperties, that.relationshipProperties); } @@ -177,6 +202,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), divergentRelationshipGUID, divergentRelationshipPropertyNames); + return Objects.hash(super.hashCode(), relatedEntityGUID, relationshipTypeName, relationshipProperties); } } diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RequestForActionAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RequestForActionAnnotation.java new file mode 100644 index 00000000000..0dd1ef4299a --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/RequestForActionAnnotation.java @@ -0,0 +1,211 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RequestForActionAnnotation is used to record an issue that has been discovered. It is typically used when the + * survey action service is running quality rules and data values are discovered that are not correct. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RequestForActionAnnotation extends DataFieldAnnotation +{ + @Serial + private static final long serialVersionUID = 1L; + + private String surveyActivity = null; + private String actionRequested = null; + private Map actionProperties = null; + + + /** + * Default constructor + */ + public RequestForActionAnnotation() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RequestForActionAnnotation(RequestForActionAnnotation template) + { + super(template); + + if (template != null) + { + surveyActivity = template.getSurveyActivity(); + actionRequested = template.getActionRequested(); + actionProperties = template.getActionProperties(); + } + } + + + /** + * Return the unique name of the discovery activity. It should be possible for the stewardship processes to know what + * discovery processing was running for this value. + * + * @return string name + */ + public String getSurveyActivity() + { + return surveyActivity; + } + + + /** + * Set up the unique name of the discovery activity. It should be possible for the stewardship processes to know what + * discovery processing was running for this value. + * + * @param surveyActivity string name + */ + public void setSurveyActivity(String surveyActivity) + { + this.surveyActivity = surveyActivity; + } + + + /** + * Return the identifier of the type of action that needs to be run. It should be possible for the stewardship processes to know what + * to run from this value. + * + * @return string name + */ + public String getActionRequested() + { + return actionRequested; + } + + + /** + * Set up the identifier of the type of action that needs to be run. It should be possible for the stewardship processes to know what + * to run from this value. + * + * @param actionRequested string name + */ + public void setActionRequested(String actionRequested) + { + this.actionRequested = actionRequested; + } + + + /** + * Return the properties that will guide the governance action. + * + * @return map of property names to property values + */ + public Map getActionProperties() + { + if (actionProperties == null) + { + return null; + } + else if (actionProperties.isEmpty()) + { + return null; + } + + return actionProperties; + } + + + /** + * Set up the properties that will guide the remediation action. + * + * @param actionProperties map of property names to property values + */ + public void setActionProperties(Map actionProperties) + { + this.actionProperties = actionProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RequestForActionAnnotation{" + + "discoveryActivity='" + surveyActivity + '\'' + + ", actionRequested='" + actionRequested + '\'' + + ", actionProperties=" + actionProperties + + ", annotationType='" + getAnnotationType() + '\'' + + ", summary='" + getSummary() + '\'' + + ", confidenceLevel=" + getConfidenceLevel() + + ", expression='" + getExpression() + '\'' + + ", explanation='" + getExplanation() + '\'' + + ", analysisStep='" + getAnalysisStep() + '\'' + + ", jsonProperties='" + getJsonProperties() + '\'' + + ", annotationStatus=" + getAnnotationStatus() + + ", numAttachedAnnotations=" + getNumAttachedAnnotations() + + ", reviewDate=" + getReviewDate() + + ", steward='" + getSteward() + '\'' + + ", reviewComment='" + getReviewComment() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RequestForActionAnnotation that = (RequestForActionAnnotation) objectToCompare; + return Objects.equals(surveyActivity, that.surveyActivity) && + Objects.equals(actionRequested, that.actionRequested) && + Objects.equals(actionProperties, that.actionProperties); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), surveyActivity, actionRequested, actionProperties); + } +} diff --git a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentRelationshipAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SchemaAnalysisAnnotation.java similarity index 53% rename from open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentRelationshipAnnotation.java rename to open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SchemaAnalysisAnnotation.java index d6648793e85..358fd20050c 100644 --- a/open-metadata-implementation/frameworks/open-discovery-framework/src/main/java/org/odpi/openmetadata/frameworks/discovery/properties/DivergentRelationshipAnnotation.java +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SchemaAnalysisAnnotation.java @@ -1,109 +1,102 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.frameworks.discovery.properties; +package org.odpi.openmetadata.frameworks.surveyaction.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * DivergentRelationshipAnnotation identifies a relationship and its properties that are diverging in 2 assets that are linked as - * duplicates. + * SchemaAnalysisAnnotation is used to describe the results of reviewing the structure of the content of an asset. + * This structure is expressed as what is called a schema. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class DivergentRelationshipAnnotation extends DivergentDuplicateAnnotation +public class SchemaAnalysisAnnotation extends Annotation { + @Serial private static final long serialVersionUID = 1L; - private String divergentRelationshipGUID = null; - private List divergentRelationshipPropertyNames = null; + private String schemaName = null; + private String schemaTypeName = null; /** * Default constructor */ - public DivergentRelationshipAnnotation() + public SchemaAnalysisAnnotation() { super(); } /** - * Copy/clone constructor. + * Copy/clone constructor * * @param template object to copy */ - public DivergentRelationshipAnnotation(DivergentRelationshipAnnotation template) + public SchemaAnalysisAnnotation(SchemaAnalysisAnnotation template) { super(template); if (template != null) { - divergentRelationshipGUID = template.getDivergentRelationshipGUID(); - divergentRelationshipPropertyNames = template.getDivergentRelationshipPropertyNames(); + this.schemaName = template.getSchemaName(); + this.schemaTypeName = template.getSchemaTypeName(); } } /** - * Return the unique identifier of the relationship that is diverging. + * Return the name of the schema - this will be used in the creation of the schema object and reflects the content + * associated with the asset. The schema that is created/validated is unique to the asset. * - * @return string guid + * @return name of schema */ - public String getDivergentRelationshipGUID() + public String getSchemaName() { - return divergentRelationshipGUID; + return schemaName; } /** - * Set up the unique identifier of the relationship that is diverging. + * Set up the name of the schema - this will be used in the creation of the schema object and reflects the content + * associated with the asset. The schema that is created/validated is unique to the asset. * - * @param divergentRelationshipGUID string guid + * @param schemaName name of schema */ - public void setDivergentRelationshipGUID(String divergentRelationshipGUID) + public void setSchemaName(String schemaName) { - this.divergentRelationshipGUID = divergentRelationshipGUID; + this.schemaName = schemaName; } /** - * Return the properties that are diverging. + * Return the name of the schema type for this asset. * - * @return list of property names + * @return name */ - public List getDivergentRelationshipPropertyNames() + public String getSchemaTypeName() { - if (divergentRelationshipPropertyNames == null) - { - return null; - } - else if (divergentRelationshipPropertyNames.isEmpty()) - { - return null; - } - - return divergentRelationshipPropertyNames; + return schemaTypeName; } /** - * Set up the properties that are diverging. + * Set up the name of the schema type for this asset. * - * @param divergentRelationshipPropertyNames list of property names + * @param schemaTypeName name */ - public void setDivergentRelationshipPropertyNames(List divergentRelationshipPropertyNames) + public void setSchemaTypeName(String schemaTypeName) { - this.divergentRelationshipPropertyNames = divergentRelationshipPropertyNames; + this.schemaTypeName = schemaTypeName; } @@ -115,10 +108,9 @@ public void setDivergentRelationshipPropertyNames(List divergentRelation @Override public String toString() { - return "DivergentRelationshipAnnotation{" + - "divergentRelationshipGUID='" + divergentRelationshipGUID + '\'' + - ", divergentRelationshipPropertyNames=" + divergentRelationshipPropertyNames + - ", duplicateAnchorGUIDs='" + getDuplicateAnchorGUID() + '\'' + + return "SchemaAnalysisAnnotation{" + + "schemaName='" + schemaName + '\'' + + ", schemaTypeName='" + schemaTypeName + '\'' + ", annotationType='" + getAnnotationType() + '\'' + ", summary='" + getSummary() + '\'' + ", confidenceLevel=" + getConfidenceLevel() + @@ -149,6 +141,7 @@ public String toString() @Override public boolean equals(Object objectToCompare) { + if (this == objectToCompare) { return true; @@ -161,9 +154,9 @@ public boolean equals(Object objectToCompare) { return false; } - DivergentRelationshipAnnotation that = (DivergentRelationshipAnnotation) objectToCompare; - return Objects.equals(divergentRelationshipGUID, that.divergentRelationshipGUID) && - Objects.equals(divergentRelationshipPropertyNames, that.divergentRelationshipPropertyNames); + SchemaAnalysisAnnotation that = (SchemaAnalysisAnnotation) objectToCompare; + return Objects.equals(schemaName, that.schemaName) && + Objects.equals(schemaTypeName, that.schemaTypeName); } @@ -175,6 +168,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), divergentRelationshipGUID, divergentRelationshipPropertyNames); + return Objects.hash(super.hashCode(), getSchemaName(), getSchemaTypeName()); } } diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SemanticAnnotation.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SemanticAnnotation.java new file mode 100644 index 00000000000..2a66344b0f7 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SemanticAnnotation.java @@ -0,0 +1,222 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.*; + +import java.io.Serial; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * SemanticAnnotation provides a recommendation as to the likely meaning of data. This can be expressed informally with + * explicit strings, or via lists of GUIDs that match elements in a formal glossary. It can be attached to an asset + * or a data field within an asset. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) + +public class SemanticAnnotation extends DataFieldAnnotation +{ + @Serial + private static final long serialVersionUID = 1L; + + private String informalTerm = null; + private String informalTopic = null; + + private List candidateGlossaryTermGUIDs = null; + private List candidateGlossaryCategoryGUIDs = null; + + /** + * Default constructor + */ + public SemanticAnnotation() + { + } + + + /** + * Copy clone constructor + * + * @param template object to copy + */ + public SemanticAnnotation(SemanticAnnotation template) + { + super(template); + + if (template != null) + { + informalTerm = template.getInformalTerm(); + informalTopic = template.getInformalTopic(); + candidateGlossaryTermGUIDs = template.getCandidateGlossaryTermGUIDs(); + candidateGlossaryCategoryGUIDs = template.getCandidateGlossaryCategoryGUIDs(); + } + } + + + /** + * Return a string that describes the meaning of this data. + * + * @return string name + */ + public String getInformalTerm() + { + return informalTerm; + } + + + /** + * Set up a string that describes the meaning of this data. + * + * @param informalTerm string name + */ + public void setInformalTerm(String informalTerm) + { + this.informalTerm = informalTerm; + } + + + /** + * Return a string that describes the topic that this data is about. + * + * @return string name + */ + public String getInformalTopic() + { + return informalTopic; + } + + + /** + * Set up a string that describes the topic that this data is about. + * + * @param informalTopic string name + */ + public void setInformalTopic(String informalTopic) + { + this.informalTopic = informalTopic; + } + + + /** + * Return a list of unique identifiers of glossary terms that describe the meaning of the data. + * + * @return list of guids + */ + public List getCandidateGlossaryTermGUIDs() + { + return candidateGlossaryTermGUIDs; + } + + + /** + * Set up a list of unique identifiers of glossary terms that describe the meaning of the data. + * + * @param candidateGlossaryTermGUIDs list of guids + */ + public void setCandidateGlossaryTermGUIDs(List candidateGlossaryTermGUIDs) + { + this.candidateGlossaryTermGUIDs = candidateGlossaryTermGUIDs; + } + + + /** + * Return a list of unique identifiers of glossary categories that describe the topic of the data. + * + * @return list of guids + */ + public List getCandidateGlossaryCategoryGUIDs() + { + return candidateGlossaryCategoryGUIDs; + } + + + /** + * Set up a list of unique identifiers of glossary categories that describe the topic of the data. + * + * @param candidateGlossaryCategoryGUIDs list of guids + */ + public void setCandidateGlossaryCategoryGUIDs(List candidateGlossaryCategoryGUIDs) + { + this.candidateGlossaryCategoryGUIDs = candidateGlossaryCategoryGUIDs; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "SemanticAnnotation{" + + "informalTerm='" + informalTerm + '\'' + + ", informalTopic='" + informalTopic + '\'' + + ", candidateGlossaryTermGUIDs=" + candidateGlossaryTermGUIDs + + ", candidateGlossaryCategoryGUIDs=" + candidateGlossaryCategoryGUIDs + + ", annotationType='" + getAnnotationType() + '\'' + + ", summary='" + getSummary() + '\'' + + ", confidenceLevel=" + getConfidenceLevel() + + ", expression='" + getExpression() + '\'' + + ", explanation='" + getExplanation() + '\'' + + ", analysisStep='" + getAnalysisStep() + '\'' + + ", jsonProperties='" + getJsonProperties() + '\'' + + ", annotationStatus=" + getAnnotationStatus() + + ", numAttachedAnnotations=" + getNumAttachedAnnotations() + + ", reviewDate=" + getReviewDate() + + ", steward='" + getSteward() + '\'' + + ", reviewComment='" + getReviewComment() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", headerVersion=" + getHeaderVersion() + + ", elementHeader=" + getElementHeader() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + SemanticAnnotation that = (SemanticAnnotation) objectToCompare; + return Objects.equals(informalTerm, that.informalTerm) && + Objects.equals(informalTopic, that.informalTopic) && + Objects.equals(candidateGlossaryTermGUIDs, that.candidateGlossaryTermGUIDs) && + Objects.equals(candidateGlossaryCategoryGUIDs, that.candidateGlossaryCategoryGUIDs); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), informalTerm, informalTopic, candidateGlossaryTermGUIDs, candidateGlossaryCategoryGUIDs); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SurveyReport.java b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SurveyReport.java new file mode 100644 index 00000000000..75cbd6f471b --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/main/java/org/odpi/openmetadata/frameworks/surveyaction/properties/SurveyReport.java @@ -0,0 +1,396 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * SurveyReport describes the properties for a survey report. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SurveyReport extends PropertyBase +{ + @Serial + private static final long serialVersionUID = 1L; + + private String qualifiedName = null; + private Map additionalProperties = null; + private String displayName = null; + private String description = null; + private Date creationDate = null; + private Map analysisParameters = null; + private String assetGUID = null; + private String governanceEngineGUID = null; + private String governanceServiceGUID = null; + private String engineActionGUID = null; + private String analysisStep = null; + + + /** + * Default constructor + */ + public SurveyReport() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SurveyReport(SurveyReport template) + { + super(template); + + if (template != null) + { + qualifiedName = template.getQualifiedName(); + additionalProperties = template.getAdditionalProperties(); + displayName = template.getDisplayName(); + description = template.getDescription(); + creationDate = template.getCreationDate(); + analysisParameters = template.getAnalysisParameters(); + engineActionGUID = template.getEngineActionGUID(); + assetGUID = template.getAssetGUID(); + governanceEngineGUID = template.getGovernanceEngineGUID(); + governanceServiceGUID = template.getGovernanceServiceGUID(); + analysisStep = template.getAnalysisStep(); + } + } + + + /** + * Set up the fully qualified name. + * + * @param qualifiedName String name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Returns the stored qualified name property for the metadata entity. + * If no qualified name is available then the empty string is returned. + * + * @return qualifiedName + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up additional properties. + * + * @param additionalProperties Additional properties object + */ + public void setAdditionalProperties(Map additionalProperties) + { + this.additionalProperties = additionalProperties; + } + + + /** + * Return a copy of the additional properties. Null means no additional properties are available. + * + * @return AdditionalProperties + */ + public Map getAdditionalProperties() + { + if (additionalProperties == null) + { + return null; + } + else if (additionalProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(additionalProperties); + } + } + + + /** + * Return the display name of the survey report. + * + * @return String report name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the display name of the survey report. + * + * @param reportName String report name + */ + public void setDisplayName(String reportName) + { + this.displayName = reportName; + } + + + /** + * Return the survey report description. + * + * @return String report description + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the survey report description. + * + * @param reportDescription String report description + */ + public void setDescription(String reportDescription) + { + this.description = reportDescription; + } + + + /** + * Return the creation date for the report. If this date is not known then null is returned. + * + * @return Date that the report was created. + */ + public Date getCreationDate() + { + return creationDate; + } + + + /** + * Set up the creation date for the report. If this date is not known then null is returned. + * + * @param creationDate Date that the report was created. + */ + public void setCreationDate(Date creationDate) + { + this.creationDate = creationDate; + } + + + /** + * Return the parameters used to drive the discovery service's analysis. + * + * @return map storing the analysis parameters + */ + public Map getAnalysisParameters() + { + return analysisParameters; + } + + + /** + * Set up the parameters used to drive the discovery service's analysis. + * + * @param analysisParameters map storing the analysis parameters + */ + public void setAnalysisParameters(Map analysisParameters) + { + this.analysisParameters = analysisParameters; + } + + + /** + * Return the unique identifier of the asset that was analyzed. + * + * @return unique identifier (guid) + */ + public String getAssetGUID() + { + return assetGUID; + } + + + /** + * Set up the unique identifier of the asset that was analyzed. + * + * @param assetGUID unique identifier (guid) + */ + public void setAssetGUID(String assetGUID) + { + this.assetGUID = assetGUID; + } + + + /** + * Return the unique identifier of the discovery engine that ran the discovery service. + * + * @return unique identifier (guid) + */ + public String getGovernanceEngineGUID() + { + return governanceEngineGUID; + } + + + /** + * Set up the unique identifier of the discovery engine that ran the discovery service. + * + * @param governanceEngineGUID unique identifier (guid) + */ + public void setGovernanceEngineGUID(String governanceEngineGUID) + { + this.governanceEngineGUID = governanceEngineGUID; + } + + + /** + * Return the unique identifier of the discovery service. + * + * @return unique identifier (guid) + */ + public String getGovernanceServiceGUID() + { + return governanceServiceGUID; + } + + + /** + * Set up the unique identifier of the discovery service. + * + * @param governanceServiceGUID unique identifier (guid) + */ + public void setGovernanceServiceGUID(String governanceServiceGUID) + { + this.governanceServiceGUID = governanceServiceGUID; + } + + + /** + * Return the unique identifier for the engine action associated with this report. + * + * @return guid + */ + public String getEngineActionGUID() + { + return engineActionGUID; + } + + + /** + * Set up the unique identifier for the engine action associated with this report. + * + * @param engineActionGUID guid + */ + public void setEngineActionGUID(String engineActionGUID) + { + this.engineActionGUID = engineActionGUID; + } + + + /** + * Return the locally defined analysis step. This value is used in annotations generated in this phase. + * + * @return name of analysis step + */ + public String getAnalysisStep() + { + return analysisStep; + } + + + /** + * Set up the name of the current analysis step. + * + * @param analysisStep name + */ + public void setAnalysisStep(String analysisStep) + { + this.analysisStep = analysisStep; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "SurveyReport{" + + "qualifiedName='" + qualifiedName + '\'' + + ", additionalProperties=" + additionalProperties + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", creationDate=" + creationDate + + ", analysisParameters=" + analysisParameters + + ", assetGUID='" + assetGUID + '\'' + + ", governanceEngineGUID='" + governanceEngineGUID + '\'' + + ", governanceServiceGUID='" + governanceServiceGUID + '\'' + + ", engineActionGUID='" + engineActionGUID + '\'' + + ", analysisStep='" + analysisStep + '\'' + + '}'; + } + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + SurveyReport that = (SurveyReport) objectToCompare; + return Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(creationDate, that.creationDate) && + Objects.equals(analysisParameters, that.analysisParameters) && + Objects.equals(assetGUID, that.assetGUID) && + Objects.equals(governanceEngineGUID, that.governanceEngineGUID) && + Objects.equals(governanceServiceGUID, that.governanceServiceGUID) && + Objects.equals(engineActionGUID, that.engineActionGUID) && + Objects.equals(analysisStep, that.analysisStep); + } + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(qualifiedName, additionalProperties, displayName, description, creationDate, analysisParameters, + engineActionGUID, assetGUID, governanceEngineGUID, governanceServiceGUID, analysisStep); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatusTest.java b/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatusTest.java new file mode 100644 index 00000000000..3813f77036c --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationStatusTest.java @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.testng.Assert.assertTrue; + +/** + * Verify the AnnotationStatus enum contains unique ordinals, non-null names and descriptions and can be + * serialized to JSON and back again. + */ +public class AnnotationStatusTest +{ + private List existingOrdinals = null; + + /** + * Validate that a supplied ordinal is unique. + * + * @param ordinal value to test + * @return boolean result + */ + private boolean isUniqueOrdinal(int ordinal) + { + Integer newOrdinal = ordinal; + + if (existingOrdinals.contains(newOrdinal)) + { + return false; + } + else + { + existingOrdinals.add(newOrdinal); + return true; + } + } + + + /** + * Validated the values of the enum. + */ + @Test public void testAnnotationStatusValues() + { + existingOrdinals = new ArrayList<>(); + + AnnotationStatus testValue; + + testValue = AnnotationStatus.NEW_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.REVIEWED_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.APPROVED_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.ACTIONED_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.INVALID_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.IGNORE_ANNOTATION; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.OTHER_STATUS; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + + testValue = AnnotationStatus.UNKNOWN_STATUS; + + assertTrue(isUniqueOrdinal(testValue.getOrdinal())); + assertTrue(testValue.getName() != null); + assertTrue(testValue.getDescription() != null); + } + + + /** + * Validate that an object generated from a JSON String has the same content as the object used to + * create the JSON String. + */ + @Test public void testJSON() + { + ObjectMapper objectMapper = new ObjectMapper(); + String jsonString = null; + + try + { + jsonString = objectMapper.writeValueAsString(AnnotationStatus.ACTIONED_ANNOTATION); + } + catch (Throwable exc) + { + assertTrue(false, "Exception: " + exc.getMessage()); + } + + try + { + assertTrue(objectMapper.readValue(jsonString, AnnotationStatus.class) == AnnotationStatus.ACTIONED_ANNOTATION); + } + catch (Throwable exc) + { + assertTrue(false, "Exception: " + exc.getMessage()); + } + } + + + /** + * Test that toString is overridden. + */ + @Test public void testToString() + { + assertTrue(AnnotationStatus.INVALID_ANNOTATION.toString().contains("AnnotationStatus")); + } +} diff --git a/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationTest.java b/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationTest.java new file mode 100644 index 00000000000..383786c3650 --- /dev/null +++ b/open-metadata-implementation/frameworks/survey-action-framework/src/test/java/org/odpi/openmetadata/frameworks/surveyaction/properties/AnnotationTest.java @@ -0,0 +1,193 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.surveyaction.properties; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementClassification; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementType; +import org.testng.annotations.Test; + +import java.util.*; + +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; + +/** + * Validate that the Annotation bean can be cloned, compared, serialized, deserialized and printed as a String. + */ +public class AnnotationTest +{ + private ElementType type = new ElementType(); + private Date creationDate = new Date(27); + private Date reviewDate = new Date(1234); + private List classifications = new ArrayList<>(); + private Map analysisParameters = new HashMap<>(); + private Map additionalProperties = new HashMap<>(); + + + /** + * Default constructor + */ + public AnnotationTest() + { + } + + + /** + * Set up an example object to test. + * + * @return filled in object + */ + private Annotation getTestObject() + { + Annotation testObject = new Annotation(); + + testObject.setAnnotationType("TestAnnotationType"); + testObject.setSummary("TestSummary"); + testObject.setConfidenceLevel(5); + testObject.setExpression("TestExpression"); + testObject.setExplanation("TestExplanation"); + testObject.setAnalysisStep("TestAnalysisStep"); + testObject.setJsonProperties("TestJsonProperties"); + testObject.setAnnotationStatus(AnnotationStatus.UNKNOWN_STATUS); + testObject.setSteward("TestSteward"); + testObject.setReviewComment("TestReviewComment"); + testObject.setAdditionalProperties(additionalProperties); + + return testObject; + } + + + /** + * Validate that the object that comes out of the test has the same content as the original test object. + * + * @param resultObject object returned by the test + */ + private void validateResultObject(Annotation resultObject) + { + assertTrue(resultObject.getAnnotationType().equals("TestAnnotationType")); + assertTrue(resultObject.getSummary().equals("TestSummary")); + assertTrue(resultObject.getConfidenceLevel() == 5); + assertTrue(resultObject.getExpression().equals("TestExpression")); + assertTrue(resultObject.getExplanation().equals("TestExplanation")); + assertTrue(resultObject.getAnalysisStep().equals("TestAnalysisStep")); + assertTrue(resultObject.getJsonProperties().equals("TestJsonProperties")); + assertTrue(resultObject.getAnnotationStatus().equals(AnnotationStatus.UNKNOWN_STATUS)); + assertTrue(resultObject.getSteward().equals("TestSteward")); + assertTrue(resultObject.getReviewComment().equals("TestReviewComment")); + assertTrue(resultObject.getAdditionalProperties().equals(additionalProperties)); + } + + + /** + * Validate that the object is initialized properly + */ + @Test public void testNullObject() + { + Annotation nullObject = new Annotation(); + + assertTrue(nullObject.getAnnotationType() == null); + assertTrue(nullObject.getSummary() == null); + assertTrue(nullObject.getConfidenceLevel() == 0); + assertTrue(nullObject.getExpression() == null); + assertTrue(nullObject.getExplanation() == null); + assertTrue(nullObject.getAnalysisStep() == null); + assertTrue(nullObject.getJsonProperties() == null); + assertTrue(nullObject.getAnnotationStatus() == null); + assertTrue(nullObject.getSteward() == null); + assertTrue(nullObject.getReviewComment() == null); + assertTrue(nullObject.getAdditionalProperties() == null); + + nullObject = new Annotation(null); + + assertTrue(nullObject.getAnnotationType() == null); + assertTrue(nullObject.getSummary() == null); + assertTrue(nullObject.getConfidenceLevel() == 0); + assertTrue(nullObject.getExpression() == null); + assertTrue(nullObject.getExplanation() == null); + assertTrue(nullObject.getAnalysisStep() == null); + assertTrue(nullObject.getJsonProperties() == null); + assertTrue(nullObject.getAnnotationStatus() == null); + assertTrue(nullObject.getSteward() == null); + assertTrue(nullObject.getReviewComment() == null); + assertTrue(nullObject.getAdditionalProperties() == null); + } + + + /** + * Validate that 2 different objects with the same content are evaluated as equal. + * Also that different objects are considered not equal. + */ + @Test public void testEquals() + { + assertFalse(getTestObject().equals(null)); + assertFalse(getTestObject().equals("DummyString")); + assertTrue(getTestObject().equals(getTestObject())); + + Annotation sameObject = getTestObject(); + assertTrue(sameObject.equals(sameObject)); + + Annotation differentObject = getTestObject(); + differentObject.setSteward("Different"); + assertFalse(getTestObject().equals(differentObject)); + } + + + /** + * Validate that 2 different objects with the same content have the same hash code. + */ + @Test public void testHashCode() + { + assertTrue(getTestObject().hashCode() == getTestObject().hashCode()); + } + + + /** + * Validate that an object cloned from another object has the same content as the original + */ + @Test public void testClone() + { + validateResultObject(new Annotation(getTestObject())); + } + + + /** + * Validate that an object generated from a JSON String has the same content as the object used to + * create the JSON String. + */ + @Test public void testJSON() + { + ObjectMapper objectMapper = new ObjectMapper(); + String jsonString = null; + + /* + * This class + */ + try + { + jsonString = objectMapper.writeValueAsString(getTestObject()); + } + catch (Throwable exc) + { + assertTrue(false, "Exception: " + exc.getMessage()); + } + + try + { + validateResultObject(objectMapper.readValue(jsonString, Annotation.class)); + } + catch (Throwable exc) + { + assertTrue(false, "Exception: " + exc.getMessage()); + } + } + + + /** + * Test that toString is overridden. + */ + @Test public void testToString() + { + assertTrue(getTestObject().toString().contains("Annotation")); + } +} diff --git a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/GovernanceArchiveHelper.java b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/GovernanceArchiveHelper.java index ed8b8c5c7de..13558d4ada3 100644 --- a/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/GovernanceArchiveHelper.java +++ b/open-metadata-resources/open-metadata-archives/content-pack-helpers/src/main/java/org/odpi/openmetadata/samples/archiveutilities/GovernanceArchiveHelper.java @@ -124,7 +124,7 @@ public String addGovernanceService(String typeName, Map additionalProperties, Map extendedProperties) { - String serviceTypeName = OpenMetadataType.GOVERNANCE_SERVICE_TYPE_NAME; + String serviceTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; if (typeName != null) { @@ -217,7 +217,7 @@ public String addGovernanceEngine(String typeName, Map additionalProperties, Map extendedProperties) { - String engineTypeName = OpenMetadataType.GOVERNANCE_ENGINE_TYPE_NAME; + String engineTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; if (typeName != null) { @@ -251,11 +251,11 @@ public void addSupportedGovernanceService(String engineGUID, EntityProxy end1 = archiveHelper.getEntityProxy(engineEntity); EntityProxy end2 = archiveHelper.getEntityProxy(serviceEntity); - InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, requestType, methodName); - properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, OpenMetadataType.SERVICE_REQUEST_TYPE_PROPERTY_NAME, serviceRequestType, methodName); - properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, requestParameters, methodName); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, OpenMetadataProperty.REQUEST_TYPE.name, requestType, methodName); + properties = archiveHelper.addStringPropertyToInstance(archiveRootName, properties, OpenMetadataProperty.SERVICE_REQUEST_TYPE.name, serviceRequestType, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, OpenMetadataProperty.REQUEST_PARAMETERS.name, requestParameters, methodName); - archiveBuilder.addRelationship(archiveHelper.getRelationship(OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME, + archiveBuilder.addRelationship(archiveHelper.getRelationship(OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName, idToGUIDMap.getGUID(engineGUID + "_to_" + serviceGUID + "_" + requestType + "_supported_governance_service_relationship"), properties, InstanceStatus.ACTIVE, @@ -462,8 +462,8 @@ public void addGovernanceActionProcessStepExecutor(String governanc EntityProxy end1 = archiveHelper.getEntityProxy(actionTypeEntity); EntityProxy end2 = archiveHelper.getEntityProxy(engineEntity); - InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, OpenMetadataType.REQUEST_TYPE_PROPERTY_NAME, requestType, methodName); - properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, OpenMetadataType.REQUEST_PARAMETERS_PROPERTY_NAME, requestParameters, methodName); + InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, OpenMetadataProperty.REQUEST_TYPE.name, requestType, methodName); + properties = archiveHelper.addStringMapPropertyToInstance(archiveRootName, properties, OpenMetadataProperty.REQUEST_PARAMETERS.name, requestParameters, methodName); archiveBuilder.addRelationship(archiveHelper.getRelationship(OpenMetadataType.GOVERNANCE_ACTION_PROCESS_STEP_EXECUTOR_TYPE_NAME, idToGUIDMap.getGUID(governanceActionProcessStepGUID + "_to_" + governanceEngineGUID + "_governance_action_process_step_executor_relationship"), diff --git a/open-metadata-resources/open-metadata-archives/open-connector-archives/build.gradle b/open-metadata-resources/open-metadata-archives/open-connector-archives/build.gradle index acd2a69ba66..63181830466 100644 --- a/open-metadata-resources/open-metadata-archives/open-connector-archives/build.gradle +++ b/open-metadata-resources/open-metadata-archives/open-connector-archives/build.gradle @@ -37,6 +37,7 @@ dependencies { implementation project(':open-metadata-implementation:adapters:open-connectors:event-bus-connectors:open-metadata-topic-connectors:kafka-open-metadata-topic-connector') implementation project(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors') + implementation project(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:atlas-integration-connector') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:egeria-infrastructure-integration-connector') implementation project(':open-metadata-implementation:adapters:open-connectors:integration-connectors:files-integration-connectors') diff --git a/open-metadata-resources/open-metadata-archives/open-connector-archives/src/main/java/org/odpi/openmetadata/archiveutilities/openconnectors/OpenConnectorArchiveWriter.java b/open-metadata-resources/open-metadata-archives/open-connector-archives/src/main/java/org/odpi/openmetadata/archiveutilities/openconnectors/OpenConnectorArchiveWriter.java index ec5f866fe41..b5e92dea1f8 100644 --- a/open-metadata-resources/open-metadata-archives/open-connector-archives/src/main/java/org/odpi/openmetadata/archiveutilities/openconnectors/OpenConnectorArchiveWriter.java +++ b/open-metadata-resources/open-metadata-archives/open-connector-archives/src/main/java/org/odpi/openmetadata/archiveutilities/openconnectors/OpenConnectorArchiveWriter.java @@ -28,6 +28,8 @@ import org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.ApacheAtlasRESTProvider; import org.odpi.openmetadata.adapters.connectors.resource.jdbc.JDBCResourceConnectorProvider; import org.odpi.openmetadata.adapters.connectors.secretsstore.envar.EnvVarSecretsStoreProvider; +import org.odpi.openmetadata.adapters.connectors.surveyaction.surveycsv.CSVSurveyServiceProvider; +import org.odpi.openmetadata.adapters.connectors.surveyaction.surveyfile.FileSurveyServiceProvider; import org.odpi.openmetadata.adapters.eventbus.topic.kafka.KafkaOpenMetadataTopicProvider; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.adminservices.configuration.registration.CommonServicesDescription; @@ -388,6 +390,9 @@ private OpenMetadataArchive getOpenMetadataArchive() String zonePublisherGUID = this.getZonePublisherGovernanceActionService(); String csvDiscoveryGUID = this.getCSVAssetDiscoveryService(); String atlasDiscoveryGUID = this.getApacheAtlasDiscoveryService(); + String csvSurveyGUID = this.getCSVFileSurveyService(); + String fileSurveyGUID = this.getDataFileSurveyService(); + String folderSurveyGUID = this.getFolderSurveyService(); String fileProvisioningEngineGUID = this.getFileProvisioningEngine(); @@ -409,6 +414,12 @@ private OpenMetadataArchive getOpenMetadataArchive() this.addSmallCSVRequestType(assetDiscoveryEngineGUID, csvDiscoveryGUID); this.addApacheAtlasRequestType(assetDiscoveryEngineGUID, atlasDiscoveryGUID); + String assetSurveyEngineGUID = this.getAssetSurveyEngine(); + + this.addCSVFileRequestType(assetSurveyEngineGUID, csvSurveyGUID); + this.addDataFileRequestType(assetSurveyEngineGUID, fileSurveyGUID); + this.addFolderRequestType(assetSurveyEngineGUID, folderSurveyGUID); + archiveHelper.saveGUIDs(); /* @@ -535,12 +546,12 @@ private void addFileType(String fileTypeName, String description) { String qualifiedName = constructValidValueQualifiedName(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null, fileTypeName); String category = constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null); Map additionalProperties = new HashMap<>(); @@ -562,7 +573,7 @@ private void addFileType(String fileTypeName, } String parentSetGUID = this.getParentSet(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null); this.archiveHelper.addValidValue(parentSetGUID, @@ -588,7 +599,6 @@ private void addFileType(String fileTypeName, deployedImplementationType.getDeployedImplementationType()); this.archiveHelper.addConsistentValidValueRelationship(qualifiedName, deployedImplementationTypeQName); } - } @@ -604,16 +614,16 @@ private void addFileName(String fileName, DeployedImplementationType deployedImplementationType) { String qualifiedName = constructValidValueQualifiedName(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_NAME.name, null, fileName); String category = constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_NAME.name, null); String parentSetGUID = this.getParentSet(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_NAME_PROPERTY_NAME, + OpenMetadataProperty.FILE_NAME.name, null); this.archiveHelper.addValidValue(parentSetGUID, @@ -643,7 +653,7 @@ private void addFileName(String fileName, if (fileType != null) { String fileTypeQName = constructValidValueQualifiedName(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null, fileType.getFileTypeName()); this.archiveHelper.addConsistentValidValueRelationship(qualifiedName, fileTypeQName); @@ -661,16 +671,16 @@ private void addFileExtension(String fileExtension, List fileTypes) { String qualifiedName = constructValidValueQualifiedName(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_EXTENSION_PROPERTY_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, null, fileExtension); String category = constructValidValueCategory(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_EXTENSION_PROPERTY_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, null); String parentSetGUID = this.getParentSet(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_EXTENSION_PROPERTY_NAME, + OpenMetadataProperty.FILE_EXTENSION.name, null); this.archiveHelper.addValidValue(parentSetGUID, @@ -693,7 +703,7 @@ private void addFileExtension(String fileExtension, for (FileType fileType : fileTypes) { String fileTypeQName = constructValidValueQualifiedName(OpenMetadataType.DATA_FILE_TYPE_NAME, - OpenMetadataType.FILE_TYPE_PROPERTY_NAME, + OpenMetadataProperty.FILE_TYPE.name, null, fileType.getFileTypeName()); this.archiveHelper.addConsistentValidValueRelationship(qualifiedName, fileTypeQName); @@ -771,10 +781,10 @@ else if (typeName != null) private String getFileProvisioningEngine() { final String governanceEngineName = "FileProvisioning"; - final String governanceEngineDisplayName = "File Provisioning Governance Action Engine"; + final String governanceEngineDisplayName = "File Provisioning Engine"; final String governanceEngineDescription = "Copies, moves or deletes a file on request."; - return archiveHelper.addGovernanceEngine(OpenMetadataType.GOVERNANCE_ACTION_ENGINE_TYPE_NAME, + return archiveHelper.addGovernanceEngine(OpenMetadataType.GOVERNANCE_ACTION_ENGINE.typeName, governanceEngineName, governanceEngineDisplayName, governanceEngineDescription, @@ -795,10 +805,10 @@ private String getFileProvisioningEngine() private String getAssetGovernanceEngine() { final String assetGovernanceEngineName = "AssetGovernance"; - final String assetGovernanceEngineDisplayName = "AssetGovernance Governance Action Engine"; + final String assetGovernanceEngineDisplayName = "Asset Governance Engine"; final String assetGovernanceEngineDescription = "Monitors, validates and enriches metadata relating to assets."; - return archiveHelper.addGovernanceEngine(OpenMetadataType.GOVERNANCE_ACTION_ENGINE_TYPE_NAME, + return archiveHelper.addGovernanceEngine(OpenMetadataType.GOVERNANCE_ACTION_ENGINE.typeName, assetGovernanceEngineName, assetGovernanceEngineDisplayName, assetGovernanceEngineDescription, @@ -822,7 +832,7 @@ private String getAssetDiscoveryEngine() final String assetDiscoveryEngineDisplayName = "AssetDiscovery Open Discovery Engine"; final String assetDiscoveryEngineDescription = "Extracts metadata about a digital resource and attach it to its asset description."; - return archiveHelper.addGovernanceEngine(OpenMetadataType.OPEN_DISCOVERY_ENGINE_TYPE_NAME, + return archiveHelper.addGovernanceEngine(OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeName, assetDiscoveryEngineName, assetDiscoveryEngineDisplayName, assetDiscoveryEngineDescription, @@ -836,6 +846,31 @@ private String getAssetDiscoveryEngine() + /** + * Create an entity for the AssetSurvey governance engine. + * + * @return unique identifier for the governance engine + */ + private String getAssetSurveyEngine() + { + final String assetSurveyEngineName = "AssetSurvey"; + final String assetSurveyEngineDisplayName = "Asset Survey Engine"; + final String assetSurveyEngineDescription = "Extracts metadata about a digital resource and attach it to its asset description."; + + return archiveHelper.addGovernanceEngine(OpenMetadataType.SURVEY_ACTION_ENGINE.typeName, + assetSurveyEngineName, + assetSurveyEngineDisplayName, + assetSurveyEngineDescription, + null, + null, + null, + null, + null, + null); + } + + + /** * Create an entity for the FileProvisioning governance action service. * @@ -849,7 +884,7 @@ private String getFileProvisioningGovernanceActionService() "The request parameters define the source file and destination, along with lineage options"; final String ftpGovernanceServiceProviderClassName = MoveCopyFileGovernanceActionProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName, ftpGovernanceServiceProviderClassName, null, governanceServiceName, @@ -872,7 +907,7 @@ private String getWatchdogGovernanceActionService() final String governanceServiceDescription = "Initiates a governance action process when a new weekly measurements file arrives."; final String governanceServiceProviderClassName = GenericFolderWatchdogGovernanceActionProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName, governanceServiceProviderClassName, null, governanceServiceName, @@ -896,7 +931,7 @@ private String getZonePublisherGovernanceActionService() final String governanceServiceDescription = "Set up the zone membership for one or more assets supplied as action targets."; final String governanceServiceProviderClassName = ZonePublisherGovernanceActionProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName, governanceServiceProviderClassName, null, governanceServiceName, @@ -919,7 +954,7 @@ private String getOriginSeekerGovernanceActionService() final String governanceServiceDescription = "Navigates back through the lineage relationships to locate the origin classification(s) from the source(s) and sets it on the requested asset if the origin is unique."; final String governanceServiceProviderClassName = OriginSeekerGovernanceActionProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName, governanceServiceProviderClassName, null, governanceServiceName, @@ -1046,9 +1081,9 @@ private void addSetZoneMembershipRequestType(String governanceEngineGUID, /** - * Create an entity for the CSV Asset Discovery governance service. + * Create an entity for the CSV Asset Survey governance service. * - * @return unique identifier for the governance engine + * @return unique identifier for the governance service */ private String getCSVAssetDiscoveryService() { @@ -1057,7 +1092,7 @@ private String getCSVAssetDiscoveryService() final String discoveryServiceDescription = "Discovers columns for CSV Files."; final String discoveryServiceProviderClassName = CSVDiscoveryServiceProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.OPEN_DISCOVERY_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName, discoveryServiceProviderClassName, null, discoveryServiceName, @@ -1069,9 +1104,9 @@ private String getCSVAssetDiscoveryService() /** - * Create an entity for the Apache Atlas Discovery governance service. + * Create an entity for the Apache Atlas Survey governance service. * - * @return unique identifier for the governance engine + * @return unique identifier for the governance service */ private String getApacheAtlasDiscoveryService() { @@ -1080,7 +1115,7 @@ private String getApacheAtlasDiscoveryService() final String discoveryServiceDescription = "Discovers the types and instances found in an Apache Atlas server."; final String discoveryServiceProviderClassName = DiscoverApacheAtlasProvider.class.getName(); - return archiveHelper.addGovernanceService(OpenMetadataType.OPEN_DISCOVERY_SERVICE_TYPE_NAME, + return archiveHelper.addGovernanceService(OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName, discoveryServiceProviderClassName, null, discoveryServiceName, @@ -1091,21 +1126,147 @@ private String getApacheAtlasDiscoveryService() } + /** + * Create the relationship between a governance engine and a governance service that defines the request type. + * + * @param governanceEngineGUID unique identifier of the engine + * @param governanceServiceGUID unique identifier of the service + */ private void addSmallCSVRequestType(String governanceEngineGUID, String governanceServiceGUID) { - final String discoveryServiceRequestType = "small-csv"; + final String serviceRequestType = "small-csv"; - archiveHelper.addSupportedGovernanceService(governanceEngineGUID, discoveryServiceRequestType, null, null, governanceServiceGUID); + archiveHelper.addSupportedGovernanceService(governanceEngineGUID, serviceRequestType, null, null, governanceServiceGUID); } + /** + * Create the relationship between a governance engine and a governance service that defines the request type. + * + * @param governanceEngineGUID unique identifier of the engine + * @param governanceServiceGUID unique identifier of the service + */ private void addApacheAtlasRequestType(String governanceEngineGUID, String governanceServiceGUID) { - final String discoveryServiceRequestType = "apache-atlas"; + final String serviceRequestType = "apache-atlas"; + + archiveHelper.addSupportedGovernanceService(governanceEngineGUID, serviceRequestType, null, null, governanceServiceGUID); + } + + + /** + * Create an entity for the CSV File Survey governance service. + * + * @return unique identifier for the governance service + */ + private String getCSVFileSurveyService() + { + final String discoveryServiceName = "csv-file-survey-service"; + final String discoveryServiceDisplayName = "CSV File Survey Service"; + final String discoveryServiceDescription = "Discovers columns within a CSV File."; + final String discoveryServiceProviderClassName = CSVSurveyServiceProvider.class.getName(); + + return archiveHelper.addGovernanceService(OpenMetadataType.SURVEY_ACTION_SERVICE.typeName, + discoveryServiceProviderClassName, + null, + discoveryServiceName, + discoveryServiceDisplayName, + discoveryServiceDescription, + null, + null); + } + + + /** + * Create an entity for the File Survey governance service. + * + * @return unique identifier for the governance service + */ + private String getDataFileSurveyService() + { + final String discoveryServiceName = "data-file-survey-service"; + final String discoveryServiceDisplayName = "Data File Survey Service"; + final String discoveryServiceDescription = "Discovers the name, extension, file type and other characteristics of a file."; + final String discoveryServiceProviderClassName = FileSurveyServiceProvider.class.getName(); + + return archiveHelper.addGovernanceService(OpenMetadataType.SURVEY_ACTION_SERVICE.typeName, + discoveryServiceProviderClassName, + null, + discoveryServiceName, + discoveryServiceDisplayName, + discoveryServiceDescription, + null, + null); + } + + + /** + * Create an entity for the Folder Survey governance service. + * + * @return unique identifier for the governance service + */ + private String getFolderSurveyService() + { + final String discoveryServiceName = "folder-survey-service"; + final String discoveryServiceDisplayName = "Folder (directory) Survey Service"; + final String discoveryServiceDescription = "Discovers the types of files located within a file system directory (and its sub-directories)."; + final String discoveryServiceProviderClassName = FileSurveyServiceProvider.class.getName(); + + return archiveHelper.addGovernanceService(OpenMetadataType.SURVEY_ACTION_SERVICE.typeName, + discoveryServiceProviderClassName, + null, + discoveryServiceName, + discoveryServiceDisplayName, + discoveryServiceDescription, + null, + null); + } + + + /** + * Create the relationship between a governance engine and a governance service that defines the request type. + * + * @param governanceEngineGUID unique identifier of the engine + * @param governanceServiceGUID unique identifier of the service + */ + private void addCSVFileRequestType(String governanceEngineGUID, + String governanceServiceGUID) + { + final String serviceRequestType = "csv-file"; + + archiveHelper.addSupportedGovernanceService(governanceEngineGUID, serviceRequestType, null, null, governanceServiceGUID); + } + + + /** + * Create the relationship between a governance engine and a governance service that defines the request type. + * + * @param governanceEngineGUID unique identifier of the engine + * @param governanceServiceGUID unique identifier of the service + */ + private void addDataFileRequestType(String governanceEngineGUID, + String governanceServiceGUID) + { + final String serviceRequestType = "data-file"; + + archiveHelper.addSupportedGovernanceService(governanceEngineGUID, serviceRequestType, null, null, governanceServiceGUID); + } + + + /** + * Create the relationship between a governance engine and a governance service that defines the request type. + * + * @param governanceEngineGUID unique identifier of the engine + * @param governanceServiceGUID unique identifier of the service + */ + private void addFolderRequestType(String governanceEngineGUID, + String governanceServiceGUID) + { + final String serviceRequestType = "folder"; - archiveHelper.addSupportedGovernanceService(governanceEngineGUID, discoveryServiceRequestType, null, null, governanceServiceGUID); + archiveHelper.addSupportedGovernanceService(governanceEngineGUID, serviceRequestType, null, null, governanceServiceGUID); } @@ -1148,4 +1309,4 @@ public static void main(String[] args) System.exit(-1); } } -} +} \ No newline at end of file diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java index e8b362b79f6..f761e62b5d5 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java @@ -180,6 +180,7 @@ public void getOriginalTypes() update0461GovernanceEngines(); update0545ReferenceData(); add00475ContextEvents(); + add0603SurveyReports(); update0615SchemaExtraction(); add0755UltimateSourcesDestinations(); } @@ -771,9 +772,9 @@ private TypeDefPatch updateDataFile() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = OpenMetadataType.FILE_EXTENSION_PROPERTY_NAME; - final String attribute1Description = "The file extension used at the end of the file's name. This identifies the format of the file."; - final String attribute1DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.FILE_EXTENSION.name; + final String attribute1Description = OpenMetadataProperty.FILE_EXTENSION.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.FILE_EXTENSION.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, @@ -1437,6 +1438,8 @@ private void update0461GovernanceEngines() { this.archiveBuilder.addEntityDef(getEventActionEngineEntity()); this.archiveBuilder.addEntityDef(getEventActionServiceEntity()); + this.archiveBuilder.addEntityDef(getSurveyActionEngineEntity()); + this.archiveBuilder.addEntityDef(getSurveyActionServiceEntity()); } private EntityDef getEventActionEngineEntity() @@ -1444,17 +1447,20 @@ private EntityDef getEventActionEngineEntity() /* * Build the Entity */ - final String guid = "796f6493-3c3e-4091-8b21-46ea4e54d011"; - final String name = "EventActionEngine"; - final String description = "A governance engine for managing context events and associated actions."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceEngine"; + final String guid = OpenMetadataType.EVENT_ACTION_ENGINE.typeGUID; + final String name = OpenMetadataType.EVENT_ACTION_ENGINE.typeName; + final String description = OpenMetadataType.EVENT_ACTION_ENGINE.description; + final String descriptionGUID = OpenMetadataType.EVENT_ACTION_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.EVENT_ACTION_ENGINE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } @@ -1464,20 +1470,68 @@ private EntityDef getEventActionServiceEntity() /* * Build the Entity */ - final String guid = "464bb4d8-f865-4b9d-a06e-7ed19518ff13"; - final String name = "EventActionService"; - final String description = "A governance service for managing context events and associated actions."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceService"; + final String guid = OpenMetadataType.EVENT_ACTION_SERVICE.typeGUID; + final String name = OpenMetadataType.EVENT_ACTION_SERVICE.typeName; + final String description = OpenMetadataType.EVENT_ACTION_SERVICE.description; + final String descriptionGUID = OpenMetadataType.EVENT_ACTION_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.EVENT_ACTION_SERVICE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } + + + private EntityDef getSurveyActionEngineEntity() + { + /* + * Build the Entity + */ + final String guid = OpenMetadataType.SURVEY_ACTION_ENGINE.typeGUID; + final String name = OpenMetadataType.SURVEY_ACTION_ENGINE.typeName; + final String description = OpenMetadataType.SURVEY_ACTION_ENGINE.description; + final String descriptionGUID = OpenMetadataType.SURVEY_ACTION_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.SURVEY_ACTION_ENGINE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID, + descriptionWiki); + } + + private EntityDef getSurveyActionServiceEntity() + { + /* + * Build the Entity + */ + final String guid = OpenMetadataType.SURVEY_ACTION_SERVICE.typeGUID; + final String name = OpenMetadataType.SURVEY_ACTION_SERVICE.typeName; + final String description = OpenMetadataType.SURVEY_ACTION_SERVICE.description; + final String descriptionGUID = OpenMetadataType.SURVEY_ACTION_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.SURVEY_ACTION_SERVICE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID, + descriptionWiki); + } + + /* * ------------------------------------------------------------------------------------------------------- */ @@ -2334,6 +2388,341 @@ private RelationshipDef getValidValueAssociationRelationship() * ------------------------------------------------------------------------------------------------------- */ + private void add0603SurveyReports() + { + this.archiveBuilder.addEntityDef(addSurveyReportEntity()); + this.archiveBuilder.addRelationshipDef(addAssetSurveyReportRelationship()); + this.archiveBuilder.addRelationshipDef(addEngineActionSurveyReportRelationship()); + this.archiveBuilder.addRelationshipDef(getReportedAnnotationRelationship()); + this.archiveBuilder.addRelationshipDef(getAssociatedAnnotationRelationship()); + } + + private EntityDef addSurveyReportEntity() + { + /* + * Build the Entity + */ + final String guid = OpenMetadataType.SURVEY_REPORT.typeGUID; + final String name = OpenMetadataType.SURVEY_REPORT.typeName; + final String description = OpenMetadataType.SURVEY_REPORT.description; + final String descriptionGUID = OpenMetadataType.SURVEY_REPORT.descriptionGUID; + final String descriptionWiki = OpenMetadataType.SURVEY_REPORT.wikiURL; + + final String superTypeName = OpenMetadataType.REFERENCEABLE.typeName; + + EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID, + descriptionWiki); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = OpenMetadataProperty.DISPLAY_NAME.name; + final String attribute1Description = OpenMetadataProperty.DISPLAY_NAME.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.DISPLAY_NAME.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.DESCRIPTION.name; + final String attribute2Description = OpenMetadataProperty.DESCRIPTION.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.DESCRIPTION.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.PURPOSE.name; + final String attribute3Description = OpenMetadataProperty.PURPOSE.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.PURPOSE.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.ANALYSIS_PARAMETERS.name; + final String attribute4Description = OpenMetadataProperty.ANALYSIS_PARAMETERS.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.ANALYSIS_PARAMETERS.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.ANALYSIS_STEP.name; + final String attribute5Description = OpenMetadataProperty.ANALYSIS_STEP.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.ANALYSIS_STEP.descriptionGUID; + final String attribute6Name = OpenMetadataProperty.START_DATE.name; + final String attribute6Description = OpenMetadataProperty.START_DATE.description; + final String attribute6DescriptionGUID = OpenMetadataProperty.START_DATE.descriptionGUID; + final String attribute7Name = OpenMetadataProperty.COMPLETION_DATE.name; + final String attribute7Description = OpenMetadataProperty.COMPLETION_DATE.description; + final String attribute7DescriptionGUID = OpenMetadataProperty.COMPLETION_DATE.descriptionGUID; + final String attribute8Name = OpenMetadataProperty.COMPLETION_MESSAGE.name; + final String attribute8Description = OpenMetadataProperty.COMPLETION_MESSAGE.description; + final String attribute8DescriptionGUID = OpenMetadataProperty.COMPLETION_MESSAGE.descriptionGUID; + final String attribute9Name = OpenMetadataProperty.USER.name; + final String attribute9Description = OpenMetadataProperty.USER.description; + final String attribute9DescriptionGUID = OpenMetadataProperty.USER.descriptionGUID; + + + + property = archiveHelper.getDateTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute3Name, + attribute3Description, + attribute3DescriptionGUID); + properties.add(property); + property = archiveHelper.getMapStringStringTypeDefAttribute(attribute4Name, + attribute4Description, + attribute4DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute5Name, + attribute5Description, + attribute5DescriptionGUID); + properties.add(property); + property = archiveHelper.getDateTypeDefAttribute(attribute6Name, + attribute6Description, + attribute6DescriptionGUID); + properties.add(property); + property = archiveHelper.getDateTypeDefAttribute(attribute7Name, + attribute7Description, + attribute7DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute8Name, + attribute8Description, + attribute8DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute9Name, + attribute9Description, + attribute9DescriptionGUID); + properties.add(property); + + entityDef.setPropertiesDefinition(properties); + + return entityDef; + } + + private RelationshipDef addAssetSurveyReportRelationship() + { + final String guid = OpenMetadataType.ASSET_SURVEY_REPORT_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.ASSET_SURVEY_REPORT_RELATIONSHIP.typeName; + final String description = OpenMetadataType.ASSET_SURVEY_REPORT_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.ASSET_SURVEY_REPORT_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ASSET_SURVEY_REPORT_RELATIONSHIP.wikiURL; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + descriptionWiki, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = OpenMetadataType.ASSET.typeName; + final String end1AttributeName = "surveyReportTarget"; + final String end1AttributeDescription = "The asset describing the resource that was surveyed."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + + /* + * Set up end 2. + */ + final String end2EntityType = OpenMetadataType.SURVEY_REPORT.typeName; + final String end2AttributeName = "surveyReports"; + final String end2AttributeDescription = "Survey reports for the asset."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + return relationshipDef; + } + + private RelationshipDef addEngineActionSurveyReportRelationship() + { + final String guid = OpenMetadataType.ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP.typeName; + final String description = OpenMetadataType.ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ENGINE_ACTION_SURVEY_REPORT_RELATIONSHIP.wikiURL; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + descriptionWiki, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = OpenMetadataType.ENGINE_ACTION_TYPE_NAME; + final String end1AttributeName = "engineAction"; + final String end1AttributeDescription = "The engine action controlling the survey action service invocation."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + + /* + * Set up end 2. + */ + final String end2EntityType = OpenMetadataType.SURVEY_REPORT.typeName; + final String end2AttributeName = "surveyReport"; + final String end2AttributeDescription = "Survey report generated form the execution of the survey action service. Typically only one unless failures occurred."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + return relationshipDef; + } + + private RelationshipDef getReportedAnnotationRelationship() + { + final String guid = OpenMetadataType.REPORTED_ANNOTATION_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.REPORTED_ANNOTATION_RELATIONSHIP.typeName; + final String description = OpenMetadataType.REPORTED_ANNOTATION_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.REPORTED_ANNOTATION_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.REPORTED_ANNOTATION_RELATIONSHIP.wikiURL; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + descriptionWiki, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = OpenMetadataType.ANNOTATION.typeName; + final String end1AttributeName = "reportedAnnotations"; + final String end1AttributeDescription = "The annotations providing the contents for the report."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + + /* + * Set up end 2. + */ + final String end2EntityType = OpenMetadataType.SURVEY_REPORT.typeName; + final String end2AttributeName = "fromSurveyReport"; + final String end2AttributeDescription = "The report that the annotations belong to."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + return relationshipDef; + } + + private RelationshipDef getAssociatedAnnotationRelationship() + { + final String guid = OpenMetadataType.ASSOCIATED_ANNOTATION_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.ASSOCIATED_ANNOTATION_RELATIONSHIP.typeName; + final String description = OpenMetadataType.ASSOCIATED_ANNOTATION_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.ASSOCIATED_ANNOTATION_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ASSOCIATED_ANNOTATION_RELATIONSHIP.wikiURL; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + descriptionWiki, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = OpenMetadataType.OPEN_METADATA_ROOT.typeName; + final String end1AttributeName = "annotationSubject"; + final String end1AttributeDescription = "The element described in the annotation."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + + /* + * Set up end 2. + */ + final String end2EntityType = OpenMetadataType.ANNOTATION.typeName; + final String end2AttributeName = "associatedAnnotations"; + final String end2AttributeDescription = "The annotations describing the element or its real-world counterpart."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + return relationshipDef; + } + + + /* + * ------------------------------------------------------------------------------------------------------- + */ private void update0615SchemaExtraction() @@ -2553,10 +2942,10 @@ private RelationshipDef getDiscoveredLinkedDataFieldRelationship() } + /* * ------------------------------------------------------------------------------------------------------- */ - private void add0755UltimateSourcesDestinations() { this.archiveBuilder.addRelationshipDef(getUltimateSourceRelationship()); @@ -2720,5 +3109,7 @@ private RelationshipDef getUltimateDestinationRelationship() return relationshipDef; } + + } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java index 6786f0ef85f..b121a9ab6ca 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_2.java @@ -8517,9 +8517,9 @@ private EntityDef getDataFileEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "fileType"; - final String attribute1Description = "File type descriptor typically extracted from the file name."; - final String attribute1DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.FILE_TYPE.name; + final String attribute1Description = OpenMetadataProperty.FILE_TYPE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.FILE_TYPE.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, @@ -19264,61 +19264,68 @@ private void add0533GraphSchemas() private EntityDef getGraphSchemaTypeEntity() { - final String guid = "983c5e72-801b-4e42-bc51-f109527f2317"; - final String name = "GraphSchemaType"; - final String description = "A schema type for a graph data structure."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.GRAPH_SCHEMA_TYPE.typeGUID; + final String name = OpenMetadataType.GRAPH_SCHEMA_TYPE.typeName; + final String description = OpenMetadataType.GRAPH_SCHEMA_TYPE.description; + final String descriptionGUID = OpenMetadataType.GRAPH_SCHEMA_TYPE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GRAPH_SCHEMA_TYPE.wikiURL; - final String superTypeName = "ComplexSchemaType"; + final String superTypeName = OpenMetadataType.SCHEMA_TYPE_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private EntityDef getGraphVertexEntity() { - final String guid = "1252ce12-540c-4724-ad70-f70940956de0"; - final String name = "GraphVertex"; - final String description = "A schema attribute for a graph data structure."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.GRAPH_VERTEX.typeGUID; + final String name = OpenMetadataType.GRAPH_VERTEX.typeName; + final String description = OpenMetadataType.GRAPH_VERTEX.description; + final String descriptionGUID = OpenMetadataType.GRAPH_VERTEX.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GRAPH_VERTEX.wikiURL; - final String superTypeName = "SchemaAttribute"; + final String superTypeName = OpenMetadataType.SCHEMA_ATTRIBUTE_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private EntityDef getGraphEdgeEntity() { - final String guid = "d4104eb3-4f2d-4d83-aca7-e58dd8d5e0b1"; - final String name = "GraphEdge"; - final String description = "A schema attribute for a graph data structure."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.GRAPH_EDGE.typeGUID; + final String name = OpenMetadataType.GRAPH_EDGE.typeName; + final String description = OpenMetadataType.GRAPH_EDGE.description; + final String descriptionGUID = OpenMetadataType.GRAPH_EDGE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GRAPH_EDGE.wikiURL; - final String superTypeName = "SchemaAttribute"; + final String superTypeName = OpenMetadataType.SCHEMA_ATTRIBUTE_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private RelationshipDef getGraphEdgeLinkRelationship() { - final String guid = "503b4221-71c8-4ba9-8f3d-6a035b27971c"; - final String name = "GraphEdgeLink"; - final String description = "A relationship between a graph edge and a vertex."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.typeName; + final String description = OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GRAPH_EDGE_LINK_RELATIONSHIP.wikiURL; final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; @@ -19327,6 +19334,7 @@ private RelationshipDef getGraphEdgeLinkRelationship() null, description, descriptionGUID, + descriptionWiki, classificationPropagationRule); RelationshipEndDef relationshipEndDef; @@ -19334,7 +19342,7 @@ private RelationshipDef getGraphEdgeLinkRelationship() /* * Set up end 1. */ - final String end1EntityType = "GraphEdge"; + final String end1EntityType = OpenMetadataType.GRAPH_EDGE.typeName; final String end1AttributeName = "edges"; final String end1AttributeDescription = "Edges for this vertex."; final String end1AttributeDescriptionGUID = null; @@ -19351,7 +19359,7 @@ private RelationshipDef getGraphEdgeLinkRelationship() /* * Set up end 2. */ - final String end2EntityType = "GraphVertex"; + final String end2EntityType = OpenMetadataType.GRAPH_VERTEX.typeName; final String end2AttributeName = "vertices"; final String end2AttributeDescription = "Vertices for this edge."; final String end2AttributeDescriptionGUID = null; @@ -19364,6 +19372,65 @@ private RelationshipDef getGraphEdgeLinkRelationship() end2Cardinality); relationshipDef.setEndDef2(relationshipEndDef); + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = OpenMetadataProperty.LINK_TYPE_NAME.name; + final String attribute1Description = OpenMetadataProperty.LINK_TYPE_NAME.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.LINK_TYPE_NAME.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.RELATIONSHIP_END.name; + final String attribute2Description = OpenMetadataProperty.RELATIONSHIP_END.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.RELATIONSHIP_END.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.RELATIONSHIP_END_NAME.name; + final String attribute3Description = OpenMetadataProperty.RELATIONSHIP_END_NAME.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.RELATIONSHIP_END_NAME.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.DESCRIPTION.name; + final String attribute4Description = OpenMetadataProperty.DESCRIPTION.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.DESCRIPTION.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.MIN_CARDINALITY.name; + final String attribute5Description = OpenMetadataProperty.MIN_CARDINALITY.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.MIN_CARDINALITY.descriptionGUID; + final String attribute6Name = OpenMetadataProperty.MAX_CARDINALITY.name; + final String attribute6Description = OpenMetadataProperty.MAX_CARDINALITY.description; + final String attribute6DescriptionGUID = OpenMetadataProperty.MAX_CARDINALITY.descriptionGUID; + final String attribute7Name = OpenMetadataProperty.ADDITIONAL_PROPERTIES.name; + final String attribute7Description = OpenMetadataProperty.ADDITIONAL_PROPERTIES.description; + final String attribute7DescriptionGUID = OpenMetadataProperty.ADDITIONAL_PROPERTIES.descriptionGUID; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + property = archiveHelper.getIntTypeDefAttribute(attribute2Name, + attribute2Description, + attribute2DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute3Name, + attribute3Description, + attribute3DescriptionGUID); + properties.add(property); + property = archiveHelper.getStringTypeDefAttribute(attribute4Name, + attribute4Description, + attribute4DescriptionGUID); + properties.add(property); + property = archiveHelper.getIntTypeDefAttribute(attribute5Name, + attribute5Description, + attribute5DescriptionGUID); + properties.add(property); + property = archiveHelper.getIntTypeDefAttribute(attribute6Name, + attribute6Description, + attribute6DescriptionGUID); + properties.add(property); + property = archiveHelper.getMapStringStringTypeDefAttribute(attribute7Name, + attribute7Description, + attribute7DescriptionGUID); + properties.add(property); + + relationshipDef.setPropertiesDefinition(properties); + return relationshipDef; } @@ -22256,19 +22323,20 @@ private void add0601OpenDiscoveryEngine() private EntityDef getOpenDiscoveryEngineEntity() { - final String guid = "be650674-790b-487a-a619-0a9002488055"; + final String guid = OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeGUID; + final String name = OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeName; + final String description = OpenMetadataType.OPEN_DISCOVERY_ENGINE.description; + final String descriptionGUID = OpenMetadataType.OPEN_DISCOVERY_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.OPEN_DISCOVERY_ENGINE.wikiURL; - final String name = "OpenDiscoveryEngine"; - final String description = "A server capability for running open discovery services."; - final String descriptionGUID = null; - - final String superTypeName = "SoftwareServerCapability"; + final String superTypeName = OpenMetadataType.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } @@ -22283,99 +22351,25 @@ private EntityDef getOpenDiscoveryEngineEntity() private void add0602OpenDiscoveryServices() { this.archiveBuilder.addEntityDef(getOpenDiscoveryServiceEntity()); - - this.archiveBuilder.addRelationshipDef(getSupportedDiscoveryServiceRelationship()); } private EntityDef getOpenDiscoveryServiceEntity() { - final String guid = "2f278dfc-4640-4714-b34b-303e84e4fc40"; - - final String name = "OpenDiscoveryService"; - final String description = "A pluggable component for discovering properties about an asset."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeGUID; + final String name = OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName; + final String description = OpenMetadataType.OPEN_DISCOVERY_SERVICE.description; + final String descriptionGUID = OpenMetadataType.OPEN_DISCOVERY_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.OPEN_DISCOVERY_SERVICE.wikiURL; - final String superTypeName = "DeployedSoftwareComponent"; + final String superTypeName = OpenMetadataType.DEPLOYED_SOFTWARE_COMPONENT_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); - } - - - private RelationshipDef getSupportedDiscoveryServiceRelationship() - { - final String guid = "dff45aeb-c65e-428c-9ab3-d756bc5d8dbb"; - - final String name = "SupportedDiscoveryService"; - final String description = "A discovery service that is supported by a discovery engine."; - final String descriptionGUID = null; - - final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; - - RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, - name, - null, - description, - descriptionGUID, - classificationPropagationRule); - - RelationshipEndDef relationshipEndDef; - - /* - * Set up end 1. - */ - final String end1EntityType = "OpenDiscoveryService"; - final String end1AttributeName = "supportedDiscoveryServices"; - final String end1AttributeDescription = "The discovery services supported by a discovery engine."; - final String end1AttributeDescriptionGUID = null; - final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.ANY_NUMBER; - - relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), - end1AttributeName, - end1AttributeDescription, - end1AttributeDescriptionGUID, - end1Cardinality); - relationshipDef.setEndDef1(relationshipEndDef); - - - /* - * Set up end 2. - */ - final String end2EntityType = "OpenDiscoveryEngine"; - final String end2AttributeName = "calledFromDiscoveryEngines"; - final String end2AttributeDescription = "The discovery engines where this service is deployed to."; - final String end2AttributeDescriptionGUID = null; - final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.ANY_NUMBER; - - relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), - end2AttributeName, - end2AttributeDescription, - end2AttributeDescriptionGUID, - end2Cardinality); - relationshipDef.setEndDef2(relationshipEndDef); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "assetTypes"; - final String attribute1Description = "List of asset types that the discovery engine passed to the discovery service to analyze."; - final String attribute1DescriptionGUID = null; - - property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - - relationshipDef.setPropertiesDefinition(properties); - - return relationshipDef; + descriptionGUID, + descriptionWiki); } @@ -22395,19 +22389,20 @@ private void add0603OpenDiscoveryPipelines() private EntityDef getOpenDiscoveryPipelineEntity() { - final String guid = "081abe00-740e-4143-b0d5-a1f55450fc22"; - - final String name = "OpenDiscoveryPipeline"; - final String description = "A pluggable component that calls multiple discovery services."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.OPEN_DISCOVERY_PIPELINE.typeGUID; + final String name = OpenMetadataType.OPEN_DISCOVERY_PIPELINE.typeName; + final String description = OpenMetadataType.OPEN_DISCOVERY_PIPELINE.description; + final String descriptionGUID = OpenMetadataType.OPEN_DISCOVERY_PIPELINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.OPEN_DISCOVERY_PIPELINE.wikiURL; - final String superTypeName = "OpenDiscoveryService"; + final String superTypeName = OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } @@ -22765,17 +22760,18 @@ private void add0610Annotations() private EntityDef getAnnotationEntity() { - final String guid = "6cea5b53-558c-48f1-8191-11d48db29fb4"; - - final String name = "Annotation"; - final String description = "A set of results from a discovery service describing related properties of an Asset."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.ANNOTATION.typeGUID; + final String name = OpenMetadataType.ANNOTATION.typeName; + final String description = OpenMetadataType.ANNOTATION.description; + final String descriptionGUID = OpenMetadataType.ANNOTATION.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ANNOTATION.wikiURL; EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, null, description, - descriptionGUID); + descriptionGUID, + descriptionWiki); /* * Build the attributes @@ -22783,33 +22779,33 @@ private EntityDef getAnnotationEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "annotationType"; - final String attribute1Description = "Name of the type of annotation."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "summary"; - final String attribute2Description = "Description of the findings."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "confidenceLevel"; - final String attribute3Description = "Level of certainty in the accuracy of the results."; - final String attribute3DescriptionGUID = null; - final String attribute4Name = "expression"; - final String attribute4Description = "Expression used to create the annotation."; - final String attribute4DescriptionGUID = null; - final String attribute5Name = "explanation"; - final String attribute5Description = "Explanation of the analysis."; - final String attribute5DescriptionGUID = null; - final String attribute6Name = "analysisStep"; - final String attribute6Description = "The step in the pipeline that produced the annotation."; - final String attribute6DescriptionGUID = null; - final String attribute7Name = "jsonProperties"; - final String attribute7Description = "Additional properties used in the specification."; - final String attribute7DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.ANNOTATION_TYPE.name; + final String attribute1Description = OpenMetadataProperty.ANNOTATION_TYPE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.ANNOTATION_TYPE.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.SUMMARY.name; + final String attribute2Description = OpenMetadataProperty.SUMMARY.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.SUMMARY.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.CONFIDENCE_LEVEL.name; + final String attribute3Description = OpenMetadataProperty.CONFIDENCE_LEVEL.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.CONFIDENCE_LEVEL.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.EXPRESSION.name; + final String attribute4Description = OpenMetadataProperty.EXPRESSION.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.EXPRESSION.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.EXPLANATION.name; + final String attribute5Description = OpenMetadataProperty.EXPLANATION.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.EXPLANATION.descriptionGUID; + final String attribute6Name = OpenMetadataProperty.ANALYSIS_STEP.name; + final String attribute6Description = OpenMetadataProperty.ANALYSIS_STEP.description; + final String attribute6DescriptionGUID = OpenMetadataProperty.ANALYSIS_STEP.descriptionGUID; + final String attribute7Name = OpenMetadataProperty.JSON_PROPERTIES.name; + final String attribute7Description = OpenMetadataProperty.JSON_PROPERTIES.description; + final String attribute7DescriptionGUID = OpenMetadataProperty.JSON_PROPERTIES.descriptionGUID; final String attribute8Name = OpenMetadataProperty.ADDITIONAL_PROPERTIES.name; - final String attribute8Description = "Additional properties discovered during the analysis."; - final String attribute8DescriptionGUID = null; - final String attribute9Name = "anchorGUID"; - final String attribute9Description = "Optional identifier of the asset that this annotation is indirectly connected to."; - final String attribute9DescriptionGUID = null; + final String attribute8Description = OpenMetadataProperty.ADDITIONAL_PROPERTIES.description; + final String attribute8DescriptionGUID = OpenMetadataProperty.ADDITIONAL_PROPERTIES.descriptionGUID; + final String attribute9Name = OpenMetadataProperty.ANCHOR_GUID.name; + final String attribute9Description = OpenMetadataProperty.ANCHOR_GUID.description; + final String attribute9DescriptionGUID = OpenMetadataProperty.ANCHOR_GUID.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, @@ -22856,8 +22852,7 @@ private EntityDef getAnnotationEntity() private RelationshipDef getDiscoveredAnnotationRelationship() { - final String guid = "51d386a3-3857-42e3-a3df-14a6cad08b93"; - + final String guid = "51d386a3-3857-42e3-a3df-14a6cad08b93"; final String name = "DiscoveredAnnotation"; final String description = "The annotations that make up a discovery analysis report."; final String descriptionGUID = null; @@ -22876,7 +22871,7 @@ private RelationshipDef getDiscoveredAnnotationRelationship() /* * Set up end 1. */ - final String end1EntityType = "Annotation"; + final String end1EntityType = OpenMetadataType.ANNOTATION.typeName; final String end1AttributeName = "reportedAnnotations"; final String end1AttributeDescription = "The annotations providing the contents for the report."; final String end1AttributeDescriptionGUID = null; @@ -22912,11 +22907,11 @@ private RelationshipDef getDiscoveredAnnotationRelationship() private RelationshipDef getAnnotationExtensionRelationship() { - final String guid = "605aaa6d-682e-405c-964b-ca6aaa94be1b"; - - final String name = "AnnotationExtension"; - final String description = "Additional information to augment an annotation."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.typeName; + final String description = OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ANNOTATION_EXTENSION_RELATIONSHIP.wikiURL; final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; @@ -22925,6 +22920,7 @@ private RelationshipDef getAnnotationExtensionRelationship() null, description, descriptionGUID, + descriptionWiki, classificationPropagationRule); RelationshipEndDef relationshipEndDef; @@ -22932,7 +22928,7 @@ private RelationshipDef getAnnotationExtensionRelationship() /* * Set up end 1. */ - final String end1EntityType = "Annotation"; + final String end1EntityType = OpenMetadataType.ANNOTATION.typeName; final String end1AttributeName = "extendedAnnotations"; final String end1AttributeDescription = "The annotations being extended."; final String end1AttributeDescriptionGUID = null; @@ -22949,7 +22945,7 @@ private RelationshipDef getAnnotationExtensionRelationship() /* * Set up end 2. */ - final String end2EntityType = "Annotation"; + final String end2EntityType = OpenMetadataType.ANNOTATION.typeName; final String end2AttributeName = "annotationExtensions"; final String end2AttributeDescription = "The annotations providing additional information."; final String end2AttributeDescriptionGUID = null; @@ -22986,8 +22982,8 @@ private void add0612AnnotationReviews() private EnumDef getAnnotationStatusEnum() { - final String guid = "71187df6-ef66-4f88-bc03-cd3c7f925165"; - final String name = "AnnotationStatus"; + final String guid = OpenMetadataType.ANNOTATION_STATUS_ENUM_TYPE_GUID; + final String name = OpenMetadataType.ANNOTATION_STATUS_ENUM_TYPE_NAME; final String description = "Defines the status of an annotation."; final String descriptionGUID = null; @@ -23081,17 +23077,18 @@ private EnumDef getAnnotationStatusEnum() private EntityDef getAnnotationReviewEntity() { - final String guid = "b893d6fc-642a-454b-beaf-809ee4dd876a"; - - final String name = "AnnotationReview"; - final String description = "The results of a stewardship review of an annotation."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.ANNOTATION_REVIEW.typeGUID; + final String name = OpenMetadataType.ANNOTATION_REVIEW.typeName; + final String description = OpenMetadataType.ANNOTATION_REVIEW.description; + final String descriptionGUID = OpenMetadataType.ANNOTATION_REVIEW.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ANNOTATION_REVIEW.wikiURL; EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, null, description, - descriptionGUID); + descriptionGUID, + descriptionWiki); /* * Build the attributes @@ -23099,15 +23096,15 @@ private EntityDef getAnnotationReviewEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "reviewDate"; - final String attribute1Description = "Date of the review."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "Steward"; - final String attribute2Description = "User identifier for the steward performing the review."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "comment"; - final String attribute3Description = "Notes provided by the steward."; - final String attribute3DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.REVIEW_DATE.name; + final String attribute1Description = OpenMetadataProperty.REVIEW_DATE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.REVIEW_DATE.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.STEWARD.name; + final String attribute2Description = OpenMetadataProperty.STEWARD.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.STEWARD.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.COMMENT.name; + final String attribute3Description = OpenMetadataProperty.COMMENT.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.COMMENT.descriptionGUID; property = archiveHelper.getDateTypeDefAttribute(attribute1Name, attribute1Description, @@ -23130,11 +23127,11 @@ private EntityDef getAnnotationReviewEntity() private RelationshipDef getAnnotationReviewLinkRelationship() { - final String guid = "5d3c2fb7-fa04-4d77-83cb-fd9216a07769"; - - final String name = "AnnotationReviewLink"; - final String description = "Review results for an annotation."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.typeName; + final String description = OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ANNOTATION_REVIEW_LINK_RELATIONSHIP.wikiURL; final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; @@ -23143,6 +23140,7 @@ private RelationshipDef getAnnotationReviewLinkRelationship() null, description, descriptionGUID, + descriptionWiki, classificationPropagationRule); RelationshipEndDef relationshipEndDef; @@ -23150,7 +23148,7 @@ private RelationshipDef getAnnotationReviewLinkRelationship() /* * Set up end 1. */ - final String end1EntityType = "Annotation"; + final String end1EntityType = OpenMetadataType.ANNOTATION.typeName; final String end1AttributeName = "reviewedAnnotations"; final String end1AttributeDescription = "The annotations being reviewed."; final String end1AttributeDescriptionGUID = null; @@ -23167,7 +23165,7 @@ private RelationshipDef getAnnotationReviewLinkRelationship() /* * Set up end 2. */ - final String end2EntityType = "AnnotationReview"; + final String end2EntityType = OpenMetadataType.ANNOTATION_REVIEW.typeName; final String end2AttributeName = "annotationReviews"; final String end2AttributeDescription = "The feedback about the annotations."; final String end2AttributeDescriptionGUID = null; @@ -23186,9 +23184,9 @@ private RelationshipDef getAnnotationReviewLinkRelationship() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "annotationStatus"; - final String attribute1Description = "Status of the processing as a result of the annotation."; - final String attribute1DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.ANNOTATION_STATUS.name; + final String attribute1Description = OpenMetadataProperty.ANNOTATION_STATUS.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.ANNOTATION_STATUS.descriptionGUID; property = archiveHelper.getEnumTypeDefAttribute("AnnotationStatus", attribute1Name, @@ -23224,19 +23222,20 @@ private void add0615SchemaExtraction() private EntityDef getSchemaAnalysisAnnotationEntity() { - final String guid = "3c5aa68b-d562-4b04-b189-c7b7f0bf2ced"; + final String guid = OpenMetadataType.SCHEMA_ANALYSIS_ANNOTATION.typeGUID; + final String name = OpenMetadataType.SCHEMA_ANALYSIS_ANNOTATION.typeName; + final String description = OpenMetadataType.SCHEMA_ANALYSIS_ANNOTATION.description; + final String descriptionGUID = OpenMetadataType.SCHEMA_ANALYSIS_ANNOTATION.descriptionGUID; + final String descriptionWiki = OpenMetadataType.SCHEMA_ANALYSIS_ANNOTATION.wikiURL; - final String name = "SchemaAnalysisAnnotation"; - final String description = "A description of the internal structure of an Asset."; - final String descriptionGUID = null; - - final String superTypeName = "Annotation"; + final String superTypeName = OpenMetadataType.ANNOTATION.typeName; EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); /* * Build the attributes @@ -23244,12 +23243,12 @@ private EntityDef getSchemaAnalysisAnnotationEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "schemaName"; - final String attribute1Description = "Display name for the discovered schema."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "schemaType"; - final String attribute2Description = "Type name for the discovered schema."; - final String attribute2DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.SCHEMA_NAME.name(); + final String attribute1Description = OpenMetadataProperty.SCHEMA_NAME.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.SCHEMA_NAME.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.SCHEMA_TYPE.name; + final String attribute2Description = OpenMetadataProperty.SCHEMA_TYPE.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.SCHEMA_TYPE.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, @@ -23698,13 +23697,12 @@ private void add0617DataFieldAnalysis() private EntityDef getDataFieldAnnotationEntity() { - final String guid = "72ed6de6-79d9-4e7d-aefc-b969382fc4b0"; - + final String guid = "72ed6de6-79d9-4e7d-aefc-b969382fc4b0"; final String name = "DataFieldAnnotation"; final String description = "A collection of properties about a data field, or number of data fields, in an Asset."; final String descriptionGUID = null; - final String superTypeName = "Annotation"; + final String superTypeName = OpenMetadataType.ANNOTATION.typeName; return archiveHelper.getDefaultEntityDef(guid, name, @@ -24352,33 +24350,33 @@ private RelationshipDef getRelationshipAnnotationRelationship() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "annotationType"; - final String attribute1Description = "Name of the type of annotation."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "summary"; - final String attribute2Description = "Description of the findings."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "confidenceLevel"; - final String attribute3Description = "Level of certainty in the accuracy of the results."; - final String attribute3DescriptionGUID = null; - final String attribute4Name = "expression"; - final String attribute4Description = "Expression used to create the annotation."; - final String attribute4DescriptionGUID = null; - final String attribute5Name = "explanation"; - final String attribute5Description = "Explanation of the analysis."; - final String attribute5DescriptionGUID = null; - final String attribute6Name = "analysisStep"; - final String attribute6Description = "The step in the pipeline that produced the annotation."; - final String attribute6DescriptionGUID = null; - final String attribute7Name = "jsonProperties"; - final String attribute7Description = "Additional properties used in the specification."; - final String attribute7DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.ANNOTATION_TYPE.name; + final String attribute1Description = OpenMetadataProperty.ANNOTATION_TYPE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.ANNOTATION_TYPE.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.SUMMARY.name; + final String attribute2Description = OpenMetadataProperty.SUMMARY.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.SUMMARY.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.CONFIDENCE_LEVEL.name; + final String attribute3Description = OpenMetadataProperty.CONFIDENCE_LEVEL.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.CONFIDENCE_LEVEL.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.EXPRESSION.name; + final String attribute4Description = OpenMetadataProperty.EXPRESSION.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.EXPRESSION.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.EXPLANATION.name; + final String attribute5Description = OpenMetadataProperty.EXPLANATION.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.EXPLANATION.descriptionGUID; + final String attribute6Name = OpenMetadataProperty.ANALYSIS_STEP.name; + final String attribute6Description = OpenMetadataProperty.ANALYSIS_STEP.description; + final String attribute6DescriptionGUID = OpenMetadataProperty.ANALYSIS_STEP.descriptionGUID; + final String attribute7Name = OpenMetadataProperty.JSON_PROPERTIES.name; + final String attribute7Description = OpenMetadataProperty.JSON_PROPERTIES.description; + final String attribute7DescriptionGUID = OpenMetadataProperty.JSON_PROPERTIES.descriptionGUID; final String attribute8Name = OpenMetadataProperty.ADDITIONAL_PROPERTIES.name; - final String attribute8Description = "Additional properties discovered during the analysis."; - final String attribute8DescriptionGUID = null; - final String attribute9Name = "annotationStatus"; - final String attribute9Description = "Status of the processing as a result of the annotation."; - final String attribute9DescriptionGUID = null; + final String attribute8Description = OpenMetadataProperty.ADDITIONAL_PROPERTIES.description; + final String attribute8DescriptionGUID = OpenMetadataProperty.ADDITIONAL_PROPERTIES.descriptionGUID; + final String attribute9Name = OpenMetadataProperty.ANNOTATION_STATUS.name; + final String attribute9Description = OpenMetadataProperty.ANNOTATION_STATUS.description; + final String attribute9DescriptionGUID = OpenMetadataProperty.ANNOTATION_STATUS.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, @@ -24448,7 +24446,7 @@ private EntityDef getDataSourceMeasurementAnnotationEntity() final String description = "A summary set of measurements for an Asset."; final String descriptionGUID = null; - final String superTypeName = "Annotation"; + final String superTypeName = OpenMetadataType.ANNOTATION.typeName; EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, @@ -24570,8 +24568,8 @@ private EntityDef getRequestForActionAnnotationEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "discoveryActivity"; - final String attribute1Description = "Description of the discovery activity that revealed the need for action."; + final String attribute1Name = "actionSourceName"; + final String attribute1Description = "Name of the activity that revealed the need for action."; final String attribute1DescriptionGUID = null; final String attribute2Name = "actionRequested"; final String attribute2Description = "What needs to be done."; diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_3.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_3.java index 2a0810ff5d4..ae46783e28a 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_3.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_3.java @@ -48,8 +48,8 @@ public class OpenMetadataTypesArchive1_3 private static final long versionNumber = 1L; private static final String versionName = "1.0"; - private OMRSArchiveBuilder archiveBuilder; - private OMRSArchiveHelper archiveHelper; + private final OMRSArchiveBuilder archiveBuilder; + private final OMRSArchiveHelper archiveHelper; /** * Default constructor sets up the archive builder. This in turn sets up the header for the archive. @@ -154,7 +154,6 @@ public void getOriginalTypes() this.update0205ConnectionLinkage(); this.update0605OpenDiscoveryAnalysisReports(); - this.add0655AssetDeduplication(); } /** @@ -213,7 +212,7 @@ private void update0605OpenDiscoveryAnalysisReports() /** - * 0605 Add discovery request step for long running discovery services + * 0605 Add discovery request step for long-running discovery services */ private TypeDefPatch updateOpenDiscoveryAnalysisReport() { @@ -247,432 +246,5 @@ private TypeDefPatch updateOpenDiscoveryAnalysisReport() return typeDefPatch; } - - /** - * 580 Solution Blueprints enable the recording of solution component models - */ - private void add0655AssetDeduplication() - { - this.archiveBuilder.addEntityDef(getSuspectDuplicateAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentDuplicateAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentValueAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentClassificationAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentRelationshipAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentAttachmentAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentAttachmentValueAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentAttachmentClassificationAnnotationEntity()); - this.archiveBuilder.addEntityDef(getDivergentAttachmentRelationshipAnnotationEntity()); - } - - - private EntityDef getSuspectDuplicateAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "f703a621-4078-4c07-ab22-e7c334b94235"; - final String name = "SuspectDuplicateAnnotation"; - final String description = "Annotation linking referenceables that are suspected of being duplicates."; - final String descriptionGUID = null; - final String superTypeName = "Annotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "duplicateAnchorGUIDs"; - final String attribute1Description = "List of unique identifiers for the suspects."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "matchingPropertyNames"; - final String attribute2Description = "List of properties that are the same in the suspects."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "matchingClassificationNames"; - final String attribute3Description = "List of classifications that are the same in the suspects."; - final String attribute3DescriptionGUID = null; - final String attribute4Name = "matchingAttachmentGUIDs"; - final String attribute4Description = "List of attachments that are the same in the suspects."; - final String attribute4DescriptionGUID = null; - final String attribute5Name = "matchingRelationshipGUIDs"; - final String attribute5Description = "List of direct relationships that are the same in the suspects."; - final String attribute5DescriptionGUID = null; - - property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute3Name, - attribute3Description, - attribute3DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute4Name, - attribute4Description, - attribute4DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute5Name, - attribute5Description, - attribute5DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentDuplicateAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "251e443c-dee0-47fa-8a73-1a9d511915a0"; - final String name = "DivergentDuplicateAnnotation"; - final String description = "Annotation documenting differences in the values of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "Annotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "duplicateAnchorGUID"; - final String attribute1Description = "Unique identifier of the duplicate where the differences have been found."; - final String attribute1DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentValueAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "b86cdded-1078-4e42-b6ba-a718c2c67f62"; - final String name = "DivergentValueAnnotation"; - final String description = "Annotation documenting differences in the property values of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentDuplicateAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentPropertyNames"; - final String attribute1Description = "Names of the properties where a difference has been found."; - final String attribute1DescriptionGUID = null; - - property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentClassificationAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "8efd6257-a53e-451d-abfc-8e4899c38b1f"; - final String name = "DivergentClassificationAnnotation"; - final String description = "Annotation documenting differences in a classification of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentDuplicateAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentClassificationName"; - final String attribute1Description = "Name of the classification where a difference has been found."; - final String attribute1DescriptionGUID = null; - - final String attribute2Name = "divergentClassificationPropertyNames"; - final String attribute2Description = "Names of the properties where a difference has been found."; - final String attribute2DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentRelationshipAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "b6c6938a-fdc9-438f-893c-0b5b1d4a5bb3"; - final String name = "DivergentRelationshipAnnotation"; - final String description = "Annotation documenting differences in a relationships of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentDuplicateAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentRelationshipGUID"; - final String attribute1Description = "Unique identifier of the relationship where a difference has been found."; - final String attribute1DescriptionGUID = null; - - final String attribute2Name = "divergentRelationshipPropertyNames"; - final String attribute2Description = "Names of the properties where a difference has been found."; - final String attribute2DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - - private EntityDef getDivergentAttachmentAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "f3ed48bc-b0ea-4e1f-a8ab-75f9f3cf87a6"; - final String name = "DivergentAttachmentAnnotation"; - final String description = "Annotation documenting differences in the attachments of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentDuplicateAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "attachmentGUID"; - final String attribute1Description = "Unique identifier of the attachment where the differences have been found."; - final String attribute1DescriptionGUID = null; - - final String attribute2Name = "duplicateAttachmentGUID"; - final String attribute2Description = "Unique identifier of the attachment in the duplicate where the differences have been found."; - final String attribute2DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentAttachmentValueAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "e22a1ffe-bd90-4faf-b6a1-13fafb7948a2"; - final String name = "DivergentAttachmentValueAnnotation"; - final String description = "Annotation documenting differences in the property values in attachments of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentAttachmentAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentPropertyNames"; - final String attribute1Description = "Names of the properties where a difference has been found."; - final String attribute1DescriptionGUID = null; - - property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentAttachmentClassificationAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "a2a5cb74-f8e0-470f-be71-26b7e32166a6"; - final String name = "DivergentAttachmentClassificationAnnotation"; - final String description = "Annotation documenting differences in a classification of an attachment of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentAttachmentAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentClassificationName"; - final String attribute1Description = "Name of the classification where a difference has been found."; - final String attribute1DescriptionGUID = null; - - final String attribute2Name = "divergentClassificationPropertyNames"; - final String attribute2Description = "Names of the properties where a difference has been found."; - final String attribute2DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } - - - private EntityDef getDivergentAttachmentRelationshipAnnotationEntity() - { - /* - * Build the Entity - */ - final String guid = "5613677a-865f-474e-8044-4167fa5a31b9"; - final String name = "DivergentAttachmentRelationshipAnnotation"; - final String description = "Annotation documenting differences in a relationships of an attachment of acknowledged duplicates."; - final String descriptionGUID = null; - final String superTypeName = "DivergentAttachmentAnnotation"; - - EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "divergentRelationshipGUID"; - final String attribute1Description = "Unique identifier of the relationship where a difference has been found."; - final String attribute1DescriptionGUID = null; - - final String attribute2Name = "divergentRelationshipPropertyNames"; - final String attribute2Description = "Names of the properties where a difference has been found."; - final String attribute2DescriptionGUID = null; - - property = archiveHelper.getStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - - entityDef.setPropertiesDefinition(properties); - - return entityDef; - } } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_5.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_5.java index a298239c6be..88d4591839c 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_5.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive1_5.java @@ -156,7 +156,6 @@ public void getOriginalTypes() update0298LineageRelationships(); update0501SchemaElements(); - update0602OpenDiscoveryServices(); update0605OpenDiscoveryAnalysisReports(); update0650RelationshipDiscovery(); } @@ -347,65 +346,6 @@ private TypeDefPatch updateSchemaElementEntity() } - private void update0602OpenDiscoveryServices() - { - this.archiveBuilder.addTypeDefPatch(updateSupportedDiscoveryRelationship()); - } - - - /** - * 0602 SupportedDiscoveryRelationship - replacing assetTypes with discoveryRequestTypes and - * adding defaultAnalysisParameters - */ - private TypeDefPatch updateSupportedDiscoveryRelationship() - { - /* - * Create the Patch - */ - final String typeName = "SupportedDiscoveryService"; - - TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); - - typeDefPatch.setUpdatedBy(originatorName); - typeDefPatch.setUpdateTime(creationDate); - - /* - * Build the attributes - */ - List properties = new ArrayList<>(); - TypeDefAttribute property; - - final String attribute1Name = "assetTypes"; - final String attribute1Description = "Deprecated property."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "discoveryRequestTypes"; - final String attribute2Description = "Types of discovery request that links to the discovery service."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "defaultAnalysisParameters"; - final String attribute3Description = "Map of parameter name to value that is passed to the discovery service by default."; - final String attribute3DescriptionGUID = null; - - property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, - attribute1Description, - attribute1DescriptionGUID); - property.setReplacedByAttribute(attribute2Name); - property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE); - properties.add(property); - property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, - attribute2Description, - attribute2DescriptionGUID); - properties.add(property); - property = archiveHelper.getMapStringStringTypeDefAttribute(attribute3Name, - attribute3Description, - attribute3DescriptionGUID); - properties.add(property); - - typeDefPatch.setPropertyDefinitions(properties); - - return typeDefPatch; - } - - private void update0605OpenDiscoveryAnalysisReports() { this.archiveBuilder.addEnumDef(getDiscoveryServiceRequestStatusEnum()); diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_4.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_4.java index f4152412a7b..0d790e643f7 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_4.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_4.java @@ -18,7 +18,7 @@ import java.util.List; /** - * OpenMetadataTypesArchive builds an open metadata archive containing all of the standard open metadata types. + * OpenMetadataTypesArchive builds an open metadata archive containing all the standard open metadata types. * These types have hardcoded dates and guids so that however many times this archive is rebuilt, it will * produce the same content. *

@@ -108,7 +108,7 @@ public String getArchiveGUID() /** - * Returns the open metadata type archive containing all of the standard open metadata types. + * Returns the open metadata type archive containing all the standard open metadata types. * * @return populated open metadata archive object */ @@ -407,40 +407,40 @@ private ClassificationDef addLatestChangeClassification() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "changeTarget"; - final String attribute1Description = "The relationship of element that has been changed to the anchor."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "changeAction"; - final String attribute2Description = "The type of change."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "classificationName"; - final String attribute3Description = "If a classification name changed, this is its name."; - final String attribute3DescriptionGUID = null; - final String attribute4Name = "attachmentGUID"; - final String attribute4Description = "If an attached entity or relationship to it changed, this is its unique identifier of the entity."; - final String attribute4DescriptionGUID = null; - final String attribute5Name = "attachmentType"; - final String attribute5Description = "If an attached entity or relationship to changed, this is its unique type name of the entity."; - final String attribute5DescriptionGUID = null; - final String attribute6Name = "relationshipType"; - final String attribute6Description = "If an attached entity or relationship to changed, this is its unique type name of the relationship."; - final String attribute6DescriptionGUID = null; - final String attribute7Name = "user"; - final String attribute7Description = "The user identifier for the person/system making the change."; - final String attribute7DescriptionGUID = null; - final String attribute8Name = "description"; - final String attribute8Description = "Description of the change. Also known as the actionDescription."; - final String attribute8DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.CHANGE_TARGET.name; + final String attribute1Description = OpenMetadataProperty.CHANGE_TARGET.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.CHANGE_TARGET.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.CHANGE_ACTION.name; + final String attribute2Description = OpenMetadataProperty.CHANGE_ACTION.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.CHANGE_ACTION.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.CLASSIFICATION_NAME.name; + final String attribute3Description = OpenMetadataProperty.CLASSIFICATION_NAME.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.CLASSIFICATION_NAME.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.ATTACHMENT_GUID.name; + final String attribute4Description = OpenMetadataProperty.ATTACHMENT_GUID.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.ATTACHMENT_GUID.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.ATTACHMENT_TYPE.name; + final String attribute5Description = OpenMetadataProperty.ATTACHMENT_TYPE.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.ATTACHMENT_TYPE.descriptionGUID; + final String attribute6Name = OpenMetadataProperty.RELATIONSHIP_TYPE.name; + final String attribute6Description = OpenMetadataProperty.RELATIONSHIP_TYPE.description; + final String attribute6DescriptionGUID = OpenMetadataProperty.RELATIONSHIP_TYPE.descriptionGUID; + final String attribute7Name = OpenMetadataProperty.USER.name; + final String attribute7Description = OpenMetadataProperty.USER.description; + final String attribute7DescriptionGUID = OpenMetadataProperty.USER.descriptionGUID; + final String attribute8Name = OpenMetadataProperty.ACTION_DESCRIPTION.name; + final String attribute8Description = OpenMetadataProperty.ACTION_DESCRIPTION.description; + final String attribute8DescriptionGUID = OpenMetadataProperty.ACTION_DESCRIPTION.descriptionGUID; property = archiveHelper.getEnumTypeDefAttribute("LatestChangeTarget", attribute1Name, attribute1Description, - attribute1DescriptionGUID);; + attribute1DescriptionGUID); properties.add(property); property = archiveHelper.getEnumTypeDefAttribute("LatestChangeAction", attribute2Name, attribute2Description, - attribute2DescriptionGUID);; + attribute2DescriptionGUID); properties.add(property); property = archiveHelper.getStringTypeDefAttribute(attribute3Name, attribute3Description, @@ -483,8 +483,8 @@ private ClassificationDef addAnchorsClassification() final List linkedToEntities = new ArrayList<>(); linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.REFERENCEABLE.typeName)); - linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.ANNOTATION_TYPE_NAME)); - linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.ANNOTATION_REVIEW_TYPE_NAME)); + linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.ANNOTATION.typeName)); + linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.ANNOTATION_REVIEW.typeName)); linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.DATA_FIELD_TYPE_NAME)); linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.LIKE_TYPE_NAME)); linkedToEntities.add(this.archiveBuilder.getEntityDef(OpenMetadataType.RATING_TYPE_NAME)); @@ -2370,7 +2370,7 @@ private TypeDefPatch updateAnnotationEntity() /* * Create the Patch */ - final String typeName = "Annotation"; + final String typeName = OpenMetadataType.ANNOTATION.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_5.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_5.java index b5123d49142..3666aa29137 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_5.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_5.java @@ -313,7 +313,7 @@ private TypeDefPatch updateAnnotation() /* * Create the Patch */ - final String typeName = "Annotation"; + final String typeName = OpenMetadataType.ANNOTATION.typeName; final String superTypeName = OpenMetadataType.OPEN_METADATA_ROOT.typeName; diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_6.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_6.java index 18ea070731d..4259020759a 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_6.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive2_6.java @@ -825,17 +825,20 @@ private EntityDef addGovernanceEngineEntity() /* * Build the Entity */ - final String guid = "3fa23d4a-aceb-422f-9301-04ed474c6f74"; - final String name = "GovernanceEngine"; - final String description = "A collection of related governance services of the same type."; - final String descriptionGUID = null; - final String superTypeName = "SoftwareServerCapability"; + final String guid = OpenMetadataType.GOVERNANCE_ENGINE.typeGUID; + final String name = OpenMetadataType.GOVERNANCE_ENGINE.typeName; + final String description = OpenMetadataType.GOVERNANCE_ENGINE.description; + final String descriptionGUID = OpenMetadataType.GOVERNANCE_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GOVERNANCE_ENGINE.wikiURL; + + final String superTypeName = OpenMetadataType.SOFTWARE_SERVER_CAPABILITY_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private EntityDef addGovernanceServiceEntity() @@ -843,17 +846,20 @@ private EntityDef addGovernanceServiceEntity() /* * Build the Entity */ - final String guid = "191d870c-26f4-4310-a021-b8ca8772719d"; - final String name = "GovernanceService"; - final String description = "A connector that performs some governance operation."; - final String descriptionGUID = null; - final String superTypeName = "DeployedConnector"; + final String guid = OpenMetadataType.GOVERNANCE_SERVICE.typeGUID; + final String name = OpenMetadataType.GOVERNANCE_SERVICE.typeName; + final String description = OpenMetadataType.GOVERNANCE_SERVICE.description; + final String descriptionGUID = OpenMetadataType.GOVERNANCE_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GOVERNANCE_SERVICE.wikiURL; + + final String superTypeName = OpenMetadataType.DEPLOYED_CONNECTOR_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private EntityDef addGovernanceActionEngineEntity() @@ -861,17 +867,20 @@ private EntityDef addGovernanceActionEngineEntity() /* * Build the Entity */ - final String guid = "5d74250a-57ca-4197-9475-8911f620a94e"; - final String name = "GovernanceActionEngine"; - final String description = "A collection of related governance services of the same type from the Governance Action Framework (GAF)."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceEngine"; + final String guid = OpenMetadataType.GOVERNANCE_ACTION_ENGINE.typeGUID; + final String name = OpenMetadataType.GOVERNANCE_ACTION_ENGINE.typeName; + final String description = OpenMetadataType.GOVERNANCE_ACTION_ENGINE.description; + final String descriptionGUID = OpenMetadataType.GOVERNANCE_ACTION_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GOVERNANCE_ACTION_ENGINE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private EntityDef addGovernanceActionServiceEntity() @@ -879,25 +888,29 @@ private EntityDef addGovernanceActionServiceEntity() /* * Build the Entity */ - final String guid = "ececb378-31ac-4cc3-99b4-1c44e5fbc4d9"; - final String name = "GovernanceActionService"; - final String description = "A governance service that conforms to the Governance Action Framework (GAF)."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceService"; + final String guid = OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeGUID; + final String name = OpenMetadataType.GOVERNANCE_ACTION_SERVICE.typeName; + final String description = OpenMetadataType.GOVERNANCE_ACTION_SERVICE.description; + final String descriptionGUID = OpenMetadataType.GOVERNANCE_ACTION_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.GOVERNANCE_ACTION_SERVICE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } private RelationshipDef addSupportedGovernanceServiceRelationship() { - final String guid = "2726df0e-4f3a-44e1-8433-4ca5301457fd"; - final String name = "SupportedGovernanceService"; - final String description = "Link between a governance engine and one of its services."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeGUID; + final String name = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName; + final String description = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.description; + final String descriptionGUID = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.descriptionGUID; + final String descriptionWiki = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.wikiURL; final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; @@ -906,6 +919,7 @@ private RelationshipDef addSupportedGovernanceServiceRelationship() null, description, descriptionGUID, + descriptionWiki, classificationPropagationRule); RelationshipEndDef relationshipEndDef; @@ -913,7 +927,7 @@ private RelationshipDef addSupportedGovernanceServiceRelationship() /* * Set up end 1. */ - final String end1EntityType = "GovernanceEngine"; + final String end1EntityType = OpenMetadataType.GOVERNANCE_ENGINE.typeName; final String end1AttributeName = "calledFromGovernanceEngines"; final String end1AttributeDescription = "Governance Engine making use of the governance service."; final String end1AttributeDescriptionGUID = null; @@ -930,7 +944,7 @@ private RelationshipDef addSupportedGovernanceServiceRelationship() /* * Set up end 2. */ - final String end2EntityType = "GovernanceService"; + final String end2EntityType = OpenMetadataType.GOVERNANCE_SERVICE.typeName; final String end2AttributeName = "supportedGovernanceServices"; final String end2AttributeDescription = "Governance service that is part of the governance engine."; final String end2AttributeDescriptionGUID = null; @@ -949,12 +963,12 @@ private RelationshipDef addSupportedGovernanceServiceRelationship() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "requestType"; - final String attribute1Description = "The request type used to call the service."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "requestParameters"; - final String attribute2Description = "Properties that configure the governance service for this type of request."; - final String attribute2DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.REQUEST_TYPE.name; + final String attribute1Description = OpenMetadataProperty.REQUEST_TYPE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.REQUEST_TYPE.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.REQUEST_PARAMETERS.name; + final String attribute2Description = OpenMetadataProperty.REQUEST_PARAMETERS.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.REQUEST_PARAMETERS.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, @@ -2674,15 +2688,14 @@ private void update06xxDiscoveryEnginesAndServices() { this.archiveBuilder.addTypeDefPatch(updateOpenDiscoveryEngine()); this.archiveBuilder.addTypeDefPatch(updateOpenDiscoveryService()); - this.archiveBuilder.addTypeDefPatch(deprecateSupportedDiscoveryService()); } private TypeDefPatch updateOpenDiscoveryEngine() { - final String typeName = "OpenDiscoveryEngine"; + final String typeName = OpenMetadataType.OPEN_DISCOVERY_ENGINE.typeName; - final String superTypeName = "GovernanceEngine"; + final String superTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -2696,9 +2709,9 @@ private TypeDefPatch updateOpenDiscoveryEngine() private TypeDefPatch updateOpenDiscoveryService() { - final String typeName = "OpenDiscoveryService"; + final String typeName = OpenMetadataType.OPEN_DISCOVERY_SERVICE.typeName; - final String superTypeName = "GovernanceService"; + final String superTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -2710,22 +2723,6 @@ private TypeDefPatch updateOpenDiscoveryService() } - private TypeDefPatch deprecateSupportedDiscoveryService() - { - final String typeName = "SupportedDiscoveryService"; - - TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); - - typeDefPatch.setUpdatedBy(originatorName); - typeDefPatch.setUpdateTime(creationDate); - typeDefPatch.setTypeDefStatus(TypeDefStatus.DEPRECATED_TYPEDEF); - - return typeDefPatch; - } - - - - /* * ------------------------------------------------------------------------------------------------------- */ diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_12.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_12.java index 365195bf3cd..0383d78f022 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_12.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_12.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.opentypes; +import org.odpi.openmetadata.frameworks.governanceaction.mapper.OpenMetadataType; import org.odpi.openmetadata.repositoryservices.archiveutilities.OMRSArchiveBuilder; import org.odpi.openmetadata.repositoryservices.archiveutilities.OMRSArchiveHelper; import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.properties.OpenMetadataArchive; @@ -160,8 +161,6 @@ public void getOriginalTypes() */ add0053XRootSchemaType(); add0042ProcessingStateClassification(); - - } @@ -233,23 +232,26 @@ private void add0053XRootSchemaType() this.archiveBuilder.addTypeDefPatch(updateAPISchemaType()); this.archiveBuilder.addTypeDefPatch(updateDisplayDataSchemaType()); this.archiveBuilder.addTypeDefPatch(updateQuerySchemaType()); + this.archiveBuilder.addTypeDefPatch(updateGraphSchemaType()); } private EntityDef getRootSchemaTypeEntity() { - final String guid = "126962bf-dd26-4fcf-97d8-d0ad1fdd2d50"; - final String name = "RootSchemaType"; - final String description = "The root of a complex schema - normally attaches to an asset or port."; - final String descriptionGUID = null; + final String guid = OpenMetadataType.ROOT_SCHEMA_TYPE.typeGUID; + final String name = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; + final String description = OpenMetadataType.ROOT_SCHEMA_TYPE.description; + final String descriptionGUID = OpenMetadataType.ROOT_SCHEMA_TYPE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.ROOT_SCHEMA_TYPE.wikiURL; - final String superTypeName = "ComplexSchemaType"; + final String superTypeName = OpenMetadataType.COMPLEX_SCHEMA_TYPE_TYPE_NAME; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } @@ -258,9 +260,9 @@ private TypeDefPatch updateTabularSchemaType() /* * Create the Patch */ - final String typeName = "TabularSchemaType"; + final String typeName = OpenMetadataType.TABULAR_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -277,9 +279,9 @@ private TypeDefPatch updateDocumentSchemaType() /* * Create the Patch */ - final String typeName = "DocumentSchemaType"; + final String typeName = OpenMetadataType.DOCUMENT_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -296,9 +298,9 @@ private TypeDefPatch updateObjectSchemaType() /* * Create the Patch */ - final String typeName = "ObjectSchemaType"; + final String typeName = OpenMetadataType.OBJECT_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -316,9 +318,9 @@ private TypeDefPatch updateEventType() /* * Create the Patch */ - final String typeName = "EventType"; + final String typeName = OpenMetadataType.EVENT_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -335,9 +337,9 @@ private TypeDefPatch updateRelationalDBSchemaType() /* * Create the Patch */ - final String typeName = "RelationalDBSchemaType"; + final String typeName = OpenMetadataType.RELATIONAL_DB_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -354,9 +356,9 @@ private TypeDefPatch updateAPISchemaType() /* * Create the Patch */ - final String typeName = "APISchemaType"; + final String typeName = OpenMetadataType.API_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -373,9 +375,9 @@ private TypeDefPatch updateDisplayDataSchemaType() /* * Create the Patch */ - final String typeName = "DisplayDataSchemaType"; + final String typeName = OpenMetadataType.DISPLAY_DATA_SCHEMA_TYPE_TYPE_NAME; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -392,9 +394,28 @@ private TypeDefPatch updateQuerySchemaType() /* * Create the Patch */ - final String typeName = "QuerySchemaType"; + final String typeName = OpenMetadataType.QUERY_SCHEMA_TYPE_TYPE_NAME; + + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + typeDefPatch.setSuperType(this.archiveBuilder.getEntityDef(superTypeName)); + + return typeDefPatch; + } + + + private TypeDefPatch updateGraphSchemaType() + { + /* + * Create the Patch + */ + final String typeName = OpenMetadataType.GRAPH_SCHEMA_TYPE.typeName; - final String superTypeName = "RootSchemaType"; + final String superTypeName = OpenMetadataType.ROOT_SCHEMA_TYPE.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_13.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_13.java index 13c9ff81061..b07277d0cb5 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_13.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_13.java @@ -522,9 +522,9 @@ private TypeDefPatch updateDataFileEntity() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = OpenMetadataType.FILE_NAME_PROPERTY_NAME; - final String attribute1Description = "The name of the file with extension."; - final String attribute1DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.FILE_NAME.name; + final String attribute1Description = OpenMetadataProperty.FILE_NAME.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.FILE_NAME.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_15.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_15.java index 3d82d9d06f6..3adf1fe043d 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_15.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_15.java @@ -191,7 +191,7 @@ private TypeDefPatch updateSupportedGovernanceServiceRelationship() /* * Create the Patch */ - final String typeName = "SupportedGovernanceService"; + final String typeName = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -204,9 +204,9 @@ private TypeDefPatch updateSupportedGovernanceServiceRelationship() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "serviceRequestType"; - final String attribute1Description = "Request type supported by the governance service (overrides requestType on call to governance service if specified)."; - final String attribute1DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.SERVICE_REQUEST_TYPE.name; + final String attribute1Description = OpenMetadataProperty.SERVICE_REQUEST_TYPE.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.SERVICE_REQUEST_TYPE.descriptionGUID; property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_5.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_5.java index c8d522680cb..3b6820e11b8 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_5.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_5.java @@ -171,7 +171,6 @@ public void getOriginalTypes() extend0112Person(); update0130Projects(); update0140Communities(); - update0461GovernanceEngines(); } @@ -1188,51 +1187,5 @@ private TypeDefPatch updateCommunityMembershipRelationship() * ------------------------------------------------------------------------------------------------------- */ - - /** - * 0461 Add Archive Engines and Services - */ - private void update0461GovernanceEngines() - { - this.archiveBuilder.addEntityDef(addArchiveEngineEntity()); - this.archiveBuilder.addEntityDef(addArchiveServiceEntity()); - } - - - private EntityDef addArchiveEngineEntity() - { - /* - * Build the Entity - */ - final String guid = "773298be-68ab-4b99-99ab-19eaa886261e"; - final String name = "ArchiveEngine"; - final String description = "A collection of related archive services."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceEngine"; - - return archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - } - - private EntityDef addArchiveServiceEntity() - { - /* - * Build the Entity - */ - final String guid = "e6c049e2-56aa-4512-a634-20cd7085e534"; - final String name = "ArchiveService"; - final String description = "A governance service that maintains open metadata archives."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceService"; - - return archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - } } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_8.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_8.java index 21841bfd3dc..ca3c1ca6756 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_8.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive3_8.java @@ -620,15 +620,12 @@ private TypeDefPatch updateNoteLogAuthorshipRelationship() /** * Make supported governance service multi-link and add support for RepositoryGovernanceEngine and RepositoryGovernanceService. - * ArchiveEngine and ArchiveService are deprecated in favour of these new entity types */ private void update0461GovernanceEngines() { this.archiveBuilder.addEntityDef(getRepositoryGovernanceEngineEntity()); this.archiveBuilder.addEntityDef(getRepositoryGovernanceServiceEntity()); this.archiveBuilder.addTypeDefPatch(updateSupportedGovernanceServiceRelationship()); - this.archiveBuilder.addTypeDefPatch(deprecateArchiveEngine()); - this.archiveBuilder.addTypeDefPatch(deprecateArchiveService()); } @@ -637,7 +634,7 @@ private TypeDefPatch updateSupportedGovernanceServiceRelationship() /* * Create the Patch */ - final String typeName = "SupportedGovernanceService"; + final String typeName = OpenMetadataType.SUPPORTED_GOVERNANCE_SERVICE_RELATIONSHIP.typeName; TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); @@ -650,60 +647,25 @@ private TypeDefPatch updateSupportedGovernanceServiceRelationship() } - private TypeDefPatch deprecateArchiveEngine() - { - /* - * Create the Patch - the super type is updated so that existing archive engines will run in the repository governance OMES - */ - final String typeName = "ArchiveEngine"; - final String superTypeName = "RepositoryGovernanceEngine"; - - TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); - - typeDefPatch.setSuperType(this.archiveBuilder.getEntityDef(superTypeName)); - typeDefPatch.setUpdatedBy(originatorName); - typeDefPatch.setUpdateTime(creationDate); - typeDefPatch.setTypeDefStatus(TypeDefStatus.DEPRECATED_TYPEDEF); - - return typeDefPatch; - } - - - private TypeDefPatch deprecateArchiveService() - { - /* - * Create the Patch - the super type is updated so that existing archive services will run in the repository governance OMES - */ - final String typeName = "ArchiveService"; - final String superTypeName = "RepositoryGovernanceService"; - - TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); - - typeDefPatch.setSuperType(this.archiveBuilder.getEntityDef(superTypeName)); - typeDefPatch.setUpdatedBy(originatorName); - typeDefPatch.setUpdateTime(creationDate); - typeDefPatch.setTypeDefStatus(TypeDefStatus.DEPRECATED_TYPEDEF); - - return typeDefPatch; - } - - private EntityDef getRepositoryGovernanceEngineEntity() { /* * Build the Entity */ - final String guid = "2b3bed05-c227-47d7-87a3-139ab0568361"; - final String name = "RepositoryGovernanceEngine"; - final String description = "A governance engine for open metadata repositories."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceEngine"; + final String guid = OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.typeGUID; + final String name = OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.typeName; + final String description = OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.description; + final String descriptionGUID = OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.REPOSITORY_GOVERNANCE_ENGINE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_ENGINE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } @@ -713,17 +675,20 @@ private EntityDef getRepositoryGovernanceServiceEntity() /* * Build the Entity */ - final String guid = "978e7674-8231-4158-a4e3-a5ccdbcad60e"; - final String name = "RepositoryGovernanceService"; - final String description = "A governance service for open metadata repositories."; - final String descriptionGUID = null; - final String superTypeName = "GovernanceService"; + final String guid = OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.typeGUID; + final String name = OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.typeName; + final String description = OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.description; + final String descriptionGUID = OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.descriptionGUID; + final String descriptionWiki = OpenMetadataType.REPOSITORY_GOVERNANCE_SERVICE.wikiURL; + + final String superTypeName = OpenMetadataType.GOVERNANCE_SERVICE.typeName; return archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef(superTypeName), description, - descriptionGUID); + descriptionGUID, + descriptionWiki); } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive4_0.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive4_0.java index a6b7ac922cb..4d90d49e48a 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive4_0.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive4_0.java @@ -523,21 +523,21 @@ private TypeDefPatch updateActionTargetRelationship() List properties = new ArrayList<>(); TypeDefAttribute property; - final String attribute1Name = "status"; - final String attribute1Description = "The status of the work on this element."; - final String attribute1DescriptionGUID = null; - final String attribute2Name = "startDate"; - final String attribute2Description = "Date/time that work started on this element."; - final String attribute2DescriptionGUID = null; - final String attribute3Name = "completionDate"; - final String attribute3Description = "Date/time that work stopped on this element."; - final String attribute3DescriptionGUID = null; - final String attribute4Name = "actionTargetName"; - final String attribute4Description = "The name to identify the action target to the actor that processes it."; - final String attribute4DescriptionGUID = null; - final String attribute5Name = "completionMessage"; - final String attribute5Description = "Message to provide additional information on the results of acting on the target by the actor or the reasons for any failures."; - final String attribute5DescriptionGUID = null; + final String attribute1Name = OpenMetadataProperty.STATUS.name; + final String attribute1Description = OpenMetadataProperty.STATUS.description; + final String attribute1DescriptionGUID = OpenMetadataProperty.STATUS.descriptionGUID; + final String attribute2Name = OpenMetadataProperty.START_DATE.name; + final String attribute2Description = OpenMetadataProperty.START_DATE.description; + final String attribute2DescriptionGUID = OpenMetadataProperty.START_DATE.descriptionGUID; + final String attribute3Name = OpenMetadataProperty.COMPLETION_DATE.name; + final String attribute3Description = OpenMetadataProperty.COMPLETION_DATE.description; + final String attribute3DescriptionGUID = OpenMetadataProperty.COMPLETION_DATE.descriptionGUID; + final String attribute4Name = OpenMetadataProperty.ACTION_TARGET_NAME.name; + final String attribute4Description = OpenMetadataProperty.ACTION_TARGET_NAME.description; + final String attribute4DescriptionGUID = OpenMetadataProperty.ACTION_TARGET_NAME.descriptionGUID; + final String attribute5Name = OpenMetadataProperty.COMPLETION_MESSAGE.name; + final String attribute5Description = OpenMetadataProperty.COMPLETION_MESSAGE.description; + final String attribute5DescriptionGUID = OpenMetadataProperty.COMPLETION_MESSAGE.descriptionGUID; property = archiveHelper.getEnumTypeDefAttribute("ToDoStatus", attribute1Name, diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-look-up-sample/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/samples/assetlookup/AssetLookUp.java b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-look-up-sample/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/samples/assetlookup/AssetLookUp.java index cdfc4d8b333..8ee7fb05ae3 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-look-up-sample/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/samples/assetlookup/AssetLookUp.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-look-up-sample/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/samples/assetlookup/AssetLookUp.java @@ -466,7 +466,7 @@ private void displayAsset(String assetGUID) } } - SchemaType schemaType = assetUniverse.getSchema(); + SchemaType schemaType = assetUniverse.getRootSchemaType(); if (schemaType != null) { System.out.println(" schema: " + schemaType.getDisplayName()); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/assets/CreateAssetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/assets/CreateAssetTest.java index bbd8119f61c..0aa5f6c6c40 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/assets/CreateAssetTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/assets/CreateAssetTest.java @@ -710,7 +710,7 @@ private String getSchemaType(AssetOwner client, throw new FVTUnexpectedCondition(testCaseName, activityName + "(no asset universe for CreateSchemaType)"); } - SchemaType schemaType = assetUniverse.getSchema(); + SchemaType schemaType = assetUniverse.getRootSchemaType(); if (schemaType == null) { diff --git a/settings.gradle b/settings.gradle index e4592c28986..dfd5488dd91 100644 --- a/settings.gradle +++ b/settings.gradle @@ -37,6 +37,7 @@ include(':open-metadata-implementation:frameworks:open-connector-framework') include(':open-metadata-implementation:frameworks:open-integration-framework') include(':open-metadata-implementation:frameworks:open-discovery-framework') include(':open-metadata-implementation:frameworks:governance-action-framework') +include(':open-metadata-implementation:frameworks:survey-action-framework') include(':open-metadata-implementation:adapters:open-connectors:event-bus-connectors:open-metadata-topic-connectors:kafka-open-metadata-topic-connector') include(':open-metadata-implementation:adapters:open-connectors:event-bus-connectors:open-metadata-topic-connectors:inmemory-open-metadata-topic-connector') include(':open-metadata-implementation:adapters:open-connectors:repository-services-connectors:audit-log-connectors:audit-log-console-connector') @@ -67,6 +68,7 @@ include(':open-metadata-implementation:adapters:open-connectors:integration-conn include(':open-metadata-implementation:adapters:open-connectors:integration-connectors:elasticsearch-integration-connector') include(':open-metadata-implementation:adapters:open-connectors:governance-daemon-connectors:open-lineage-connectors:open-lineage-janus-connector') include(':open-metadata-implementation:adapters:open-connectors:discovery-service-connectors') +include(':open-metadata-implementation:adapters:open-connectors:survey-action-connectors') include(':open-metadata-implementation:adapters:open-connectors:dynamic-archiver-connectors') include(':open-metadata-implementation:adapters:open-connectors:governance-action-connectors') include(':open-metadata-implementation:adapters:open-connectors:configuration-store-connectors:configuration-file-store-connector')