From 8850577a4bb3e4d85e27f7e06f9462615ef7b339 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 16 Feb 2022 07:58:50 +0000 Subject: [PATCH 1/6] Update my email Signed-off-by: Mandy Chessell --- MAINTAINERS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index f115d92a9b1..b1198af0ae1 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -14,14 +14,12 @@ The current Egeria maintainers are: | Name | Email | | -------------- | ----------------- -| Mandy Chessell | mandy_chessell@uk.ibm.com | +| Mandy Chessell | mandy.e.chessell@gmail.com | | Nigel Jones | jonesn@uk.ibm.com | | David Radley | david_radley@uk.ibm.com | -| Graham Wallis | graham_wallis@uk.ibm.com | | Maryna Strelchuk | maryna.strelchuk@gmail.com | | Bogdan Sava | bogdan.sava@gmail.com | | Chris Replogle | chris.replogle@gmail.com | -| Daniela Valentina Otelea | daniela-valentina.otelea@ing.com | | Chris Grote | chris@thegrotes.net | | Raluca Popa | raluca.popa2@ing.com | | Chris Replogle | Chris.Replogle@sas.com | @@ -43,6 +41,8 @@ contributions, we have a strong foundation to build on. | Name | Email | | -------------- | ----------------- +| Graham Wallis | graham_wallis@uk.ibm.com | +| Daniela Valentina Otelea | daniela-valentina.otelea@ing.com | | Kees van de Fliert | keesvandefliert@gmail.com | | Ruxandra Gabriela Rosu | ruxandra-gabriela.rosu@ing.com | | Cong Chen | cong.chen@ing.com | From 68b96f63775ec9cbd61da240f8fe269fcc5e565f Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 16 Feb 2022 22:35:33 +0000 Subject: [PATCH 2/6] New sample data Signed-off-by: Mandy Chessell --- .../week1.csv | 14 +++++++++++++- .../week2.csv | 14 +++++++++++++- .../week3.csv | 14 +++++++++++++- .../week4.csv | 14 +++++++++++++- .../week5.csv | 14 +++++++++++++- .../week6.csv | 14 +++++++++++++- .../week7.csv | 14 +++++++++++++- .../week8.csv | 14 +++++++++++++- .../week9.csv | 14 +++++++++++++- .../week1.csv | 14 +++++++++++++- .../week2.csv | 14 +++++++++++++- .../week3.csv | 13 ++++++++++++- .../week4.csv | 14 +++++++++++++- .../week5.csv | 14 +++++++++++++- .../week6.csv | 14 +++++++++++++- .../week7.csv | 14 +++++++++++++- .../week8.csv | 14 +++++++++++++- .../week9.csv | 14 +++++++++++++- 18 files changed, 233 insertions(+), 18 deletions(-) diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week1.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week1.csv index 3ab252de7d5..8bf8bf862d2 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week1.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week1.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-05-31,86,70 +2,2021-05-31,88,86 +3,2021-05-31,30,80 +4,2021-05-31,90,75 +5,2021-05-31,88,84 +6,2021-05-31,60,80 +7,2021-05-31,66,73 +8,2021-05-31,81,86 +9,2021-05-31,39,84 +10,2021-05-31,56,71 +11,2021-05-31,88,76 +12,2021-05-31,60,70 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week2.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week2.csv index 3ab252de7d5..03da43e3183 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week2.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week2.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-06-07,85,70 +2,2021-06-07,88,86 +3,2021-06-07,30,80 +4,2021-06-07,90,70 +5,2021-06-07,88,84 +6,2021-06-07,59,80 +7,2021-06-07,66,71 +8,2021-06-07,81,86 +9,2021-06-07,39,84 +10,2021-06-07,55,71 +11,2021-06-07,88,76 +12,2021-06-07,60,70 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week3.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week3.csv index 3ab252de7d5..f4614b13252 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week3.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week3.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-06-14,85,69 +2,2021-06-14,88,86 +3,2021-06-14,27,80 +4,2021-06-14,90,70 +5,2021-06-14,88,84 +6,2021-06-14,51,80 +7,2021-06-14,66,71 +8,2021-06-14,81,84 +9,2021-06-14,34,84 +10,2021-06-14,55,71 +11,2021-06-14,88,76 +12,2021-06-14,59,65 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week4.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week4.csv index 3ab252de7d5..215e5fc5f9c 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week4.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week4.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-06-21,85,69 +2,2021-06-21,88,85 +3,2021-06-21,27,80 +4,2021-06-21,88,70 +5,2021-06-21,88,84 +6,2021-06-21,45,80 +7,2021-06-21,66,71 +8,2021-06-21,76,84 +9,2021-06-21,34,80 +10,2021-06-21,55,71 +11,2021-06-21,84,76 +12,2021-06-21,56,63 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week5.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week5.csv index 3ab252de7d5..b2d5aa17569 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week5.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week5.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-06-28,84,65 +2,2021-06-28,88,85 +3,2021-06-28,23,76 +4,2021-06-28,88,70 +5,2021-06-28,84,84 +6,2021-06-28,45,76 +7,2021-06-28,65,71 +8,2021-06-28,76,83 +9,2021-06-28,34,79 +10,2021-06-28,54,71 +11,2021-06-28,84,75 +12,2021-06-28,55,63 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week6.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week6.csv index 3ab252de7d5..c5a07088dc6 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week6.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week6.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-07-05,84,65 +2,2021-07-05,88,85 +3,2021-07-05,23,76 +4,2021-07-05,87,70 +5,2021-07-05,84,84 +6,2021-07-05,45,76 +7,2021-07-05,65,71 +8,2021-07-05,76,83 +9,2021-07-05,33,79 +10,2021-07-05,54,71 +11,2021-07-05,84,75 +12,2021-07-05,54,62 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week7.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week7.csv index 3ab252de7d5..ce3b1ffd4ea 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week7.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week7.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-07-12,84,65 +2,2021-07-12,85,84 +3,2021-07-12,23,76 +4,2021-07-12,87,70 +5,2021-07-12,84,84 +6,2021-07-12,44,76 +7,2021-07-12,65,71 +8,2021-07-12,76,83 +9,2021-07-12,33,79 +10,2021-07-12,54,71 +11,2021-07-12,84,75 +12,2021-07-12,53,62 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week8.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week8.csv index 3ab252de7d5..ba46124a7a6 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week8.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week8.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-07-19,84,65 +2,2021-07-19,85,84 +3,2021-07-19,23,76 +4,2021-07-19,87,70 +5,2021-07-19,84,84 +6,2021-07-19,44,76 +7,2021-07-19,65,71 +8,2021-07-19,76,83 +9,2021-07-19,33,79 +10,2021-07-19,54,71 +11,2021-07-19,84,75 +12,2021-07-19,53,62 \ No newline at end of file diff --git a/sample-data/oak-dene-drop-foot-weekly-measurements/week9.csv b/sample-data/oak-dene-drop-foot-weekly-measurements/week9.csv index 3ab252de7d5..9e5192b69cf 100644 --- a/sample-data/oak-dene-drop-foot-weekly-measurements/week9.csv +++ b/sample-data/oak-dene-drop-foot-weekly-measurements/week9.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +1,2021-07-26,84,65 +2,2021-07-26,85,84 +3,2021-07-26,23,76 +4,2021-07-26,87,70 +5,2021-07-26,84,84 +6,2021-07-26,44,76 +7,2021-07-26,65,71 +8,2021-07-26,76,83 +9,2021-07-26,33,79 +10,2021-07-26,54,71 +11,2021-07-26,84,75 +12,2021-07-26,53,62 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week1.csv b/sample-data/old-market-drop-foot-weekly-measurements/week1.csv index 3ab252de7d5..cd611486f20 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week1.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week1.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-05-31,86,70 +22,2021-05-31,88,86 +23,2021-05-31,80,80 +24,2021-05-31,90,75 +25,2021-05-31,88,84 +26,2021-05-31,60,80 +27,2021-05-31,66,73 +28,2021-05-31,81,85 +29,2021-05-31,79,84 +30,2021-05-31,66,70 +31,2021-05-31,88,76 +32,2021-05-31,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week2.csv b/sample-data/old-market-drop-foot-weekly-measurements/week2.csv index 3ab252de7d5..4867d5fb71f 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week2.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week2.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-06-07,86,70 +22,2021-06-07,88,86 +23,2021-06-07,75,80 +24,2021-06-07,90,70 +25,2021-06-07,88,84 +26,2021-06-07,60,80 +27,2021-06-07,66,73 +28,2021-06-07,80,85 +29,2021-06-07,79,84 +30,2021-06-07,66,67 +31,2021-06-07,80,76 +32,2021-06-07,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week3.csv b/sample-data/old-market-drop-foot-weekly-measurements/week3.csv index 3ab252de7d5..19135989183 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week3.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week3.csv @@ -1 +1,12 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-06-14,86,70 +22,2021-06-14,86,86 +23,2021-06-14,75,80 +24,2021-06-14,90,70 +25,2021-06-14,85,84 +27,2021-06-14,62,73 +28,2021-06-14,80,85 +29,2021-06-14,79,84 +30,2021-06-14,66,67 +31,2021-06-14,80,74 +32,2021-06-14,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week4.csv b/sample-data/old-market-drop-foot-weekly-measurements/week4.csv index 3ab252de7d5..ed12196de7f 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week4.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week4.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-06-21,86,66 +22,2021-06-21,84,86 +23,2021-06-21,75,80 +24,2021-06-21,90,70 +25,2021-06-21,85,84 +26,2021-06-21,60,76 +27,2021-06-21,62,73 +28,2021-06-21,80,85 +29,2021-06-21,74,84 +30,2021-06-21,64,67 +31,2021-06-21,80,74 +32,2021-06-21,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week5.csv b/sample-data/old-market-drop-foot-weekly-measurements/week5.csv index 3ab252de7d5..b314539c50d 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week5.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week5.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-06-28,86,66 +22,2021-06-28,84,86 +23,2021-06-28,75,80 +24,2021-06-28,90,70 +25,2021-06-28,85,84 +26,2021-06-28,60,76 +27,2021-06-28,62,73 +28,2021-06-28,80,85 +29,2021-06-28,74,84 +30,2021-06-28,64,67 +31,2021-06-28,80,74 +32,2021-06-28,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week6.csv b/sample-data/old-market-drop-foot-weekly-measurements/week6.csv index 3ab252de7d5..88013599a28 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week6.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week6.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-07-05,86,66 +22,2021-07-05,84,86 +23,2021-07-05,75,80 +24,2021-07-05,90,70 +25,2021-07-05,85,84 +26,2021-07-05,60,76 +27,2021-07-05,62,73 +28,2021-07-05,80,85 +29,2021-07-05,74,84 +30,2021-07-05,64,67 +31,2021-07-05,80,74 +32,2021-07-05,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week7.csv b/sample-data/old-market-drop-foot-weekly-measurements/week7.csv index 3ab252de7d5..48953d3e0d9 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week7.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week7.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-07-12,86,66 +22,2021-07-12,84,86 +23,2021-07-12,75,80 +24,2021-07-12,90,70 +25,2021-07-12,85,84 +26,2021-07-12,60,76 +27,2021-07-12,62,73 +28,2021-07-12,80,85 +29,2021-07-12,74,84 +30,2021-07-12,64,67 +31,2021-07-12,80,74 +32,2021-07-12,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week8.csv b/sample-data/old-market-drop-foot-weekly-measurements/week8.csv index 3ab252de7d5..5284ac1cfdf 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week8.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week8.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-07-19,86,66 +22,2021-07-19,84,84 +23,2021-07-19,75,80 +24,2021-07-19,90,68 +25,2021-07-19,82,84 +26,2021-07-19,60,76 +27,2021-07-19,60,73 +28,2021-07-19,78,85 +29,2021-07-19,74,82 +30,2021-07-19,64,67 +31,2021-07-19,78,74 +32,2021-07-19,60,70 \ No newline at end of file diff --git a/sample-data/old-market-drop-foot-weekly-measurements/week9.csv b/sample-data/old-market-drop-foot-weekly-measurements/week9.csv index 3ab252de7d5..e9fc5291ca3 100644 --- a/sample-data/old-market-drop-foot-weekly-measurements/week9.csv +++ b/sample-data/old-market-drop-foot-weekly-measurements/week9.csv @@ -1 +1,13 @@ -PatientId,Date,Angle \ No newline at end of file +PatientId,Date,AngleLeft,AngleRight +21,2021-07-26,90,90 +22,2021-07-26,90,90 +23,2021-07-26,90,90 +24,2021-07-26,90,90 +25,2021-07-26,90,90 +26,2021-07-26,90,90 +27,2021-07-26,90,90 +28,2021-07-26,90,90 +29,2021-07-26,90,90 +30,2021-07-26,90,90 +31,2021-07-26,90,90 +32,2021-07-26,90,90 \ No newline at end of file From a8fba90c516e193f390fc55ccd731dc2c5d11930 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 16 Feb 2022 22:36:09 +0000 Subject: [PATCH 3/6] Allow npa to operate in the data lake Signed-off-by: Mandy Chessell --- .../samples/CocoPharmaServerSecurityConnector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/src/main/java/org/odpi/openmetadata/metadatasecurity/samples/CocoPharmaServerSecurityConnector.java b/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/src/main/java/org/odpi/openmetadata/metadatasecurity/samples/CocoPharmaServerSecurityConnector.java index 57b612d8dbe..aaacf387d9f 100644 --- a/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/src/main/java/org/odpi/openmetadata/metadatasecurity/samples/CocoPharmaServerSecurityConnector.java +++ b/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/src/main/java/org/odpi/openmetadata/metadatasecurity/samples/CocoPharmaServerSecurityConnector.java @@ -277,7 +277,7 @@ public CocoPharmaServerSecurityConnector() zoneAccess.put(trashCanZoneName, npaAccounts); zoneAccess.put(personalFilesZoneName, allEmployees); zoneAccess.put(quarantineZoneName, assetOnboarding); - zoneAccess.put(dataLakeZoneName, allEmployees); + zoneAccess.put(dataLakeZoneName, allUsers); zoneAccess.put(externalAccessZoneName, externalUsers); zoneSetUp.add(callieQuartileUserId); From 2b86e56a0f46b4833d8bda353e568e9a00e1f452 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Wed, 16 Feb 2022 23:19:18 +0000 Subject: [PATCH 4/6] Fix classification events Signed-off-by: Mandy Chessell --- .../AssetCatalogOMRSTopicListener.java | 4 +- .../assetconsumer/client/AssetConsumer.java | 61 +++++--- .../admin/AssetConsumerAdmin.java | 4 +- .../AssetConsumerOMRSTopicListener.java | 98 ++++++++---- .../server/AssetConsumerServicesInstance.java | 2 +- .../AssetLineageOMRSTopicListener.java | 12 +- .../OMRSRepositoryEventBuilder.java | 5 +- .../OMRSRepositoryEventManager.java | 106 +++++++++++++ .../LocalOMRSMetadataCollection.java | 141 +++++++++--------- 9 files changed, 308 insertions(+), 125 deletions(-) diff --git a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/listenenrs/AssetCatalogOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/listenenrs/AssetCatalogOMRSTopicListener.java index 427d7eb4dad..84e83efc8b8 100644 --- a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/listenenrs/AssetCatalogOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-server/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/listenenrs/AssetCatalogOMRSTopicListener.java @@ -99,7 +99,9 @@ public void processInstanceEvent(OMRSInstanceEvent instanceEvent) case CLASSIFIED_ENTITY_EVENT: case RECLASSIFIED_ENTITY_EVENT: case DECLASSIFIED_ENTITY_EVENT: - processEntityDetail(entityDetail); + if (entityDetail != null) { + processEntityDetail(entityDetail); + } break; case NEW_RELATIONSHIP_EVENT : case UPDATED_RELATIONSHIP_EVENT: diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java index 8893cd950a1..3cffc380abe 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java @@ -439,7 +439,7 @@ public List getAssetsByToken(String userId, * @param userId userId of user making request. * @param connectionName this may be the qualifiedName or displayName of the connection. * - * @return Connector connector instance. + * @return Connector connector instance - or null if there is no connection * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -456,17 +456,24 @@ public Connector getConnectorByName(String userId, PropertyServerException, UserNotAuthorizedException { - final String methodName = "getConnectorByName"; - final String nameParameter = "connectionName"; + final String methodName = "getConnectorByName"; + final String nameParameter = "connectionName"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(connectionName, nameParameter, methodName); - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - super.getConnectionByName(restClient, serviceURLName, userId, connectionName), - methodName); + Connection connection = super.getConnectionByName(restClient, serviceURLName, userId, connectionName); + + if (connection != null) + { + return this.getConnectorForConnection(restClient, + serviceURLName, + userId, + connection, + methodName); + } + + return null; } @@ -476,7 +483,7 @@ public Connector getConnectorByName(String userId, * @param userId userId of user making request. * @param assetGUID the unique id for the asset within the metadata repository. * - * @return Connector connector instance. + * @return Connector connector instance - or null if there is no connection * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -499,11 +506,18 @@ public Connector getConnectorForAsset(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - this.getConnectionForAsset(restClient, serviceURLName, userId, assetGUID), - methodName); + Connection connection = this.getConnectionForAsset(restClient, serviceURLName, userId, assetGUID); + + if (connection != null) + { + return this.getConnectorForConnection(restClient, + serviceURLName, + userId, + connection, + methodName); + } + + return null; } @@ -513,7 +527,7 @@ public Connector getConnectorForAsset(String userId, * @param userId userId of user making request. * @param connectionGUID the unique id for the connection within the metadata repository. * - * @return Connector connector instance. + * @return Connector connector instance - or null if there is no connection * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -536,11 +550,18 @@ public Connector getConnectorByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - super.getConnectionByGUID(restClient, serviceURLName, userId, connectionGUID), - methodName); + Connection connection = super.getConnectionByGUID(restClient, serviceURLName, userId, connectionGUID); + + if (connection != null) + { + return this.getConnectorForConnection(restClient, + serviceURLName, + userId, + connection, + methodName); + } + + return null; } diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/admin/AssetConsumerAdmin.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/admin/AssetConsumerAdmin.java index 3b452dc55e0..b32d15f2786 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/admin/AssetConsumerAdmin.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/admin/AssetConsumerAdmin.java @@ -97,11 +97,13 @@ public void initialize(AccessServiceConfig accessServiceConfig, this.registerWithEnterpriseTopic(AccessServiceDescription.ASSET_CONSUMER_OMAS.getAccessServiceFullName(), serverName, omrsTopicConnector, - new AssetConsumerOMRSTopicListener(eventPublisher, + new AssetConsumerOMRSTopicListener(instance.getAssetHandler(), + eventPublisher, repositoryConnector.getRepositoryHelper(), repositoryConnector.getRepositoryValidator(), accessServiceConfig.getAccessServiceName(), serverName, + serverUserName, supportedZones, auditLog), auditLog); diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/listener/AssetConsumerOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/listener/AssetConsumerOMRSTopicListener.java index fafd069d4da..bd9c4dccb59 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/listener/AssetConsumerOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/listener/AssetConsumerOMRSTopicListener.java @@ -2,9 +2,12 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetconsumer.listener; +import org.odpi.openmetadata.accessservices.assetconsumer.elements.AssetElement; import org.odpi.openmetadata.accessservices.assetconsumer.events.AssetConsumerEventType; import org.odpi.openmetadata.accessservices.assetconsumer.events.NewAssetEvent; import org.odpi.openmetadata.accessservices.assetconsumer.events.UpdatedAssetEvent; +import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.converters.AssetConverter; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset; @@ -27,37 +30,43 @@ */ public class AssetConsumerOMRSTopicListener extends OMRSTopicListenerBase { - private static final String assetTypeName = "Asset"; + private static final String assetTypeName = "Asset"; private static final Logger log = LoggerFactory.getLogger(AssetConsumerOMRSTopicListener.class); - private OMRSRepositoryHelper repositoryHelper; - private OMRSRepositoryValidator repositoryValidator; - private String componentName; - private String serverName; - private List supportedZones; - private AssetConsumerPublisher publisher; + private OMRSRepositoryHelper repositoryHelper; + private OMRSRepositoryValidator repositoryValidator; + private String componentName; + private String serverName; + private String serverUserId; + private List supportedZones; + private AssetHandler assetHandler; + private AssetConsumerPublisher publisher; /** * The constructor is given the connection to the out topic for Asset Consumer OMAS * along with classes for testing and manipulating instances. * + * @param assetHandler provides access to assets * @param eventPublisher publisher for the out topic * @param repositoryHelper provides methods for working with metadata instances * @param repositoryValidator provides validation of metadata instance * @param componentName name of component * @param serverName local server name + * @param serverUserId userId for this server * @param supportedZones list of zones covered by this instance of the access service. * @param auditLog log for errors and information messages */ - public AssetConsumerOMRSTopicListener(AssetConsumerPublisher eventPublisher, - OMRSRepositoryHelper repositoryHelper, - OMRSRepositoryValidator repositoryValidator, - String componentName, - String serverName, - List supportedZones, - AuditLog auditLog) + public AssetConsumerOMRSTopicListener(AssetHandler assetHandler, + AssetConsumerPublisher eventPublisher, + OMRSRepositoryHelper repositoryHelper, + OMRSRepositoryValidator repositoryValidator, + String componentName, + String serverName, + String serverUserId, + List supportedZones, + AuditLog auditLog) { super(componentName, auditLog); @@ -65,9 +74,10 @@ public AssetConsumerOMRSTopicListener(AssetConsumerPublisher eventPublisher, this.repositoryValidator = repositoryValidator; this.componentName = componentName; this.serverName = serverName; + this.serverUserId = serverUserId; this.supportedZones = supportedZones; - - publisher = eventPublisher; + this.assetHandler = assetHandler; + this.publisher = eventPublisher; } /** @@ -78,6 +88,8 @@ public AssetConsumerOMRSTopicListener(AssetConsumerPublisher eventPublisher, @Override public void processInstanceEvent(OMRSInstanceEvent instanceEvent) { + final String methodName = "processInstanceEvent"; + log.debug("Processing instance event: " + instanceEvent); if (instanceEvent == null) @@ -100,15 +112,41 @@ else if (instanceEventType == OMRSInstanceEventType.UPDATED_ENTITY_EVENT) this.processUpdatedEntity(instanceEvent.getEntity(), instanceEvent.getOriginalEntity()); } - else if (instanceEventType == OMRSInstanceEventType.CLASSIFIED_ENTITY_EVENT) - { - this.processUpdatedEntity(instanceEvent.getEntity(), - instanceEvent.getOriginalEntity()); - } - else if (instanceEventType == OMRSInstanceEventType.RECLASSIFIED_ENTITY_EVENT) + else if ((instanceEventType == OMRSInstanceEventType.CLASSIFIED_ENTITY_EVENT) || + (instanceEventType == OMRSInstanceEventType.RECLASSIFIED_ENTITY_EVENT)) { - this.processUpdatedEntity(instanceEvent.getEntity(), - instanceEvent.getOriginalEntity()); + if (instanceEvent.getEntity() != null) + { + this.processUpdatedEntity(instanceEvent.getEntity(), null); + } + else if (instanceEvent.getEntityProxy() != null) + { + final String parameterName = "entityProxy.getGUID"; + + try + { + EntityDetail entity = assetHandler.getEntityFromRepository(serverUserId, + instanceEvent.getEntityProxy().getGUID(), + parameterName, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + null, + null, + false, + false, + supportedZones, + null, + methodName); + + if (entity != null) + { + this.processUpdatedEntity(entity, null); + } + } + catch (Exception error) + { + log.debug("No access to asset - probably belongs to another cohort"); + } + } } } else @@ -181,7 +219,17 @@ private void processUpdatedEntity(EntityDetail entity, event.setEventType(AssetConsumerEventType.UPDATED_ASSET_EVENT); event.setAsset(assetBean); event.setOriginalAsset(assetConverterForOriginal.getAssetBean()); - event.setUpdateTime(entity.getUpdateTime()); + if (entity.getUpdateTime() != null) + { + event.setUpdateTime(entity.getUpdateTime()); + } + else + { + /* + * A classification was updated - need a dedicated classification message + */ + event.setUpdateTime(entity.getCreateTime()); + } publisher.publishUpdatedAssetEvent(event); } diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerServicesInstance.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerServicesInstance.java index 7cb24ea6de3..49dbad53770 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerServicesInstance.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerServicesInstance.java @@ -231,7 +231,7 @@ LoggingHandler getLoggingHandler() * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - AssetHandler getAssetHandler() throws PropertyServerException + public AssetHandler getAssetHandler() throws PropertyServerException { final String methodName = "getAssetHandler"; diff --git a/open-metadata-implementation/access-services/asset-lineage/asset-lineage-server/src/main/java/org/odpi/openmetadata/accessservices/assetlineage/listeners/AssetLineageOMRSTopicListener.java b/open-metadata-implementation/access-services/asset-lineage/asset-lineage-server/src/main/java/org/odpi/openmetadata/accessservices/assetlineage/listeners/AssetLineageOMRSTopicListener.java index b51cffe5829..8ea87bf5cfd 100644 --- a/open-metadata-implementation/access-services/asset-lineage/asset-lineage-server/src/main/java/org/odpi/openmetadata/accessservices/assetlineage/listeners/AssetLineageOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/asset-lineage/asset-lineage-server/src/main/java/org/odpi/openmetadata/accessservices/assetlineage/listeners/AssetLineageOMRSTopicListener.java @@ -126,13 +126,19 @@ public void processInstanceEvent(OMRSInstanceEvent instanceEvent) { processDeletedEntity(entityDetail); break; case CLASSIFIED_ENTITY_EVENT: - processClassifiedEntityEvent(entityDetail); + if (entityDetail != null) { + processClassifiedEntityEvent(entityDetail); + } break; case RECLASSIFIED_ENTITY_EVENT: - processReclassifiedEntityEvent(entityDetail); + if (entityDetail != null) { + processReclassifiedEntityEvent(entityDetail); + } break; case DECLASSIFIED_ENTITY_EVENT: - processDeclassifiedEntityEvent(entityDetail); + if (entityDetail != null) { + processDeclassifiedEntityEvent(entityDetail); + } break; case NEW_RELATIONSHIP_EVENT: processNewRelationshipEvent(relationship); diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java index 625f57d0521..a1ac028c5b8 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventBuilder.java @@ -14,7 +14,8 @@ /** * OMRSRepositoryEventBuilder creates OMRS Events ready to be distributed. */ -public abstract class OMRSRepositoryEventBuilder extends OMRSRepositoryEventProcessor +public abstract class OMRSRepositoryEventBuilder extends OMRSRepositoryEventProcessor implements + OMRSInstanceEventProcessorClassificationExtension { /** * Constructor to update the event processor name. @@ -757,7 +758,7 @@ public void processReclassifiedEntityEvent(String sourceName, String originatorServerName, String originatorServerType, String originatorOrganizationName, - EntityProxy entity, + EntityProxy entity, Classification originalClassification, Classification classification) { diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java index bfd958871f0..aeca060445f 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/eventmanagement/OMRSRepositoryEventManager.java @@ -533,6 +533,40 @@ public void processClassifiedEntityEvent(String sourceName, } + /** + * A new classification has been added to an entity. + * + * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the + * local repository, or event mapper name. + * @param originatorMetadataCollectionId unique identifier for the metadata collection hosted by the server that + * sent the event. + * @param originatorServerName name of the server that the event came from. + * @param originatorServerType type of server that the event came from. + * @param originatorOrganizationName name of the organization that owns the server that sent the event. + * @param entity details of the entity with the new classification added. + * @param classification new classification + */ + public void processClassifiedEntityEvent(String sourceName, + String originatorMetadataCollectionId, + String originatorServerName, + String originatorServerType, + String originatorOrganizationName, + EntityProxy entity, + Classification classification) + { + if (repositoryValidator.validEntity(sourceName, entity)) + { + super.processClassifiedEntityEvent(sourceName, + originatorMetadataCollectionId, + originatorServerName, + originatorServerType, + originatorOrganizationName, + entity, + classification); + } + } + + /** * A classification has been removed from an entity. * @@ -567,6 +601,41 @@ public void processDeclassifiedEntityEvent(String sourceName, } + + /** + * A classification has been removed from an entity. + * + * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the + * local repository, or event mapper name. + * @param originatorMetadataCollectionId unique identifier for the metadata collection hosted by the server that + * sent the event. + * @param originatorServerName name of the server that the event came from. + * @param originatorServerType type of server that the event came from. + * @param originatorOrganizationName name of the organization that owns the server that sent the event. + * @param entity details of the entity after the classification has been removed. + * @param originalClassification classification that was removed + */ + public void processDeclassifiedEntityEvent(String sourceName, + String originatorMetadataCollectionId, + String originatorServerName, + String originatorServerType, + String originatorOrganizationName, + EntityProxy entity, + Classification originalClassification) + { + if (repositoryValidator.validEntity(sourceName, entity)) + { + super.processDeclassifiedEntityEvent(sourceName, + originatorMetadataCollectionId, + originatorServerName, + originatorServerType, + originatorOrganizationName, + entity, + originalClassification); + } + } + + /** * An existing classification has been changed on an entity. * @@ -604,6 +673,43 @@ public void processReclassifiedEntityEvent(String sourceName, } + /** + * An existing classification has been changed on an entity. + * + * @param sourceName name of the source of the event. It may be the cohort name for incoming events or the + * local repository, or event mapper name. + * @param originatorMetadataCollectionId unique identifier for the metadata collection hosted by the server that + * sent the event. + * @param originatorServerName name of the server that the event came from. + * @param originatorServerType type of server that the event came from. + * @param originatorOrganizationName name of the organization that owns the server that sent the event. + * @param entity details of the entity after the classification has been changed. + * @param originalClassification classification that was changed + * @param classification new classification + */ + public void processReclassifiedEntityEvent(String sourceName, + String originatorMetadataCollectionId, + String originatorServerName, + String originatorServerType, + String originatorOrganizationName, + EntityProxy entity, + Classification originalClassification, + Classification classification) + { + if (repositoryValidator.validEntity(sourceName, entity)) + { + super.processReclassifiedEntityEvent(sourceName, + originatorMetadataCollectionId, + originatorServerName, + originatorServerType, + originatorOrganizationName, + entity, + originalClassification, + classification); + } + } + + /** * An existing entity has been deleted. This is a soft delete. This means it is still in the repository * but it is no longer returned on queries. diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java index 762e26b9835..e39f9227559 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java @@ -8,6 +8,7 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties; +import org.odpi.openmetadata.repositoryservices.eventmanagement.OMRSRepositoryEventManager; import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.OMRSMetadataCollection; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.MatchCriteria; @@ -16,7 +17,6 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.*; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryValidator; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryeventmapper.OMRSRepositoryEventProcessor; import org.odpi.openmetadata.repositoryservices.ffdc.exception.*; import org.odpi.openmetadata.repositoryservices.localrepository.repositorycontentmanager.OMRSTypeDefManager; @@ -30,13 +30,13 @@ */ public class LocalOMRSMetadataCollection extends OMRSMetadataCollectionBase { - private OMRSMetadataCollection realMetadataCollection; - private String localServerName; - private String localServerType; - private String localOrganizationName; - private boolean produceEventsForRealConnector; - private OMRSRepositoryEventProcessor outboundRepositoryEventProcessor; - private OMRSTypeDefManager localTypeDefManager; + private OMRSMetadataCollection realMetadataCollection; + private String localServerName; + private String localServerType; + private String localOrganizationName; + private boolean produceEventsForRealConnector; + private OMRSRepositoryEventManager outboundRepositoryEventProcessor; + private OMRSTypeDefManager localTypeDefManager; /* * The security verifier is initialized with a null security verifier. @@ -72,7 +72,7 @@ public class LocalOMRSMetadataCollection extends OMRSMetadataCollectionBase String localServerType, String localOrganizationName, OMRSMetadataCollection realMetadataCollection, - OMRSRepositoryEventProcessor outboundRepositoryEventProcessor, + OMRSRepositoryEventManager outboundRepositoryEventProcessor, boolean produceEventsForRealConnector, OMRSTypeDefManager typeDefManager) { @@ -4548,8 +4548,8 @@ public Classification classifyEntity(String userId, if (! repositoryValidator.isActiveType(repositoryName, typeDef.getGUID(), typeDef.getName())) { throw new ClassificationErrorException(OMRSErrorCode.UNSUPPORTED_CLASSIFICATION.getMessageDefinition(repositoryName, classificationName), - this.getClass().getName(), - methodName); + this.getClass().getName(), + methodName); } /* @@ -4576,25 +4576,24 @@ public Classification classifyEntity(String userId, classificationName, classificationProperties); - // TODO add classify events -// if (entity != null) -// { -// -// /* -// * OK to send out -// */ -// if (produceEventsForRealConnector) -// { -// -// outboundRepositoryEventProcessor.processClassifiedEntityEvent(repositoryName, -// metadataCollectionId, -// localServerName, -// localServerType, -// localOrganizationName, -// entity, -// newClassification); -// } -// } + if (classification != null) + { + setLocalProvenance(classification); + + /* + * OK to send out + */ + if (produceEventsForRealConnector) + { + outboundRepositoryEventProcessor.processClassifiedEntityEvent(repositoryName, + metadataCollectionId, + localServerName, + localServerType, + localOrganizationName, + entityProxy, + classification); + } + } return classification; } @@ -4761,8 +4760,8 @@ public Classification classifyEntity(String userId, if (! repositoryValidator.isActiveType(repositoryName, typeDef.getGUID(), typeDef.getName())) { throw new ClassificationErrorException(OMRSErrorCode.UNSUPPORTED_CLASSIFICATION.getMessageDefinition(repositoryName, classificationName), - this.getClass().getName(), - methodName); + this.getClass().getName(), + methodName); } /* @@ -4793,23 +4792,29 @@ public Classification classifyEntity(String userId, classificationOriginGUID, classificationProperties); - // TODO add classify events -// if (entity != null) -// { -// /* -// * OK to send out -// */ -// if (produceEventsForRealConnector) -// { -// outboundRepositoryEventProcessor.processClassifiedEntityEvent(repositoryName, -// metadataCollectionId, -// localServerName, -// localServerType, -// localOrganizationName, -// entity, -// newClassification); -// } -// } + if (classification != null) + { + setLocalProvenance(classification); + + /* + * OK to send out + */ + if (produceEventsForRealConnector) + { + Classification newClassification = repositoryHelper.getClassificationFromEntity(repositoryName, + entityProxy, + classificationName, + methodName); + + outboundRepositoryEventProcessor.processClassifiedEntityEvent(repositoryName, + metadataCollectionId, + localServerName, + localServerType, + localOrganizationName, + entityProxy, + newClassification); + } + } return classification; } @@ -4956,29 +4961,21 @@ public Classification declassifyEntity(String userId, entityProxy, classificationName); - // TODO removed classification events -// if (entity != null) -// { -// setLocalProvenanceThroughoutEntity(entity); -// -// /* -// * OK to send out -// */ -// if (produceEventsForRealConnector) -// { -// Classification currentClassification = repositoryHelper.getClassificationFromEntity(repositoryName, -// entityProxy, -// classificationName, -// methodName); -// outboundRepositoryEventProcessor.processDeclassifiedEntityEvent(repositoryName, -// metadataCollectionId, -// localServerName, -// localServerType, -// localOrganizationName, -// entity, -// currentClassification); -// } -// } + setLocalProvenance(removedClassification); + + /* + * OK to send out + */ + if (produceEventsForRealConnector) + { + outboundRepositoryEventProcessor.processDeclassifiedEntityEvent(repositoryName, + metadataCollectionId, + localServerName, + localServerType, + localOrganizationName, + entityProxy, + removedClassification); + } return removedClassification; } From 15580f933e312d70c0aa9ae70a79a9045b72515f Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 17 Feb 2022 04:48:49 +0000 Subject: [PATCH 5/6] Use returned classification in event Signed-off-by: Mandy Chessell --- .../repositoryconnector/LocalOMRSMetadataCollection.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java index e39f9227559..7b0be67be86 100644 --- a/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java +++ b/open-metadata-implementation/repository-services/repository-services-implementation/src/main/java/org/odpi/openmetadata/repositoryservices/localrepository/repositoryconnector/LocalOMRSMetadataCollection.java @@ -4801,18 +4801,13 @@ public Classification classifyEntity(String userId, */ if (produceEventsForRealConnector) { - Classification newClassification = repositoryHelper.getClassificationFromEntity(repositoryName, - entityProxy, - classificationName, - methodName); - outboundRepositoryEventProcessor.processClassifiedEntityEvent(repositoryName, metadataCollectionId, localServerName, localServerType, localOrganizationName, entityProxy, - newClassification); + classification); } } From c7790a5b01b4c46d6ac994cb5e33d90eccb4a5ef Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 17 Feb 2022 05:16:08 +0000 Subject: [PATCH 6/6] Add new addAsset variations for classifications Signed-off-by: Mandy Chessell --- .../repositoryservices/archiveutilities/OMRSArchiveHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java index ddac43b7770..70401df8bc8 100644 --- a/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java +++ b/open-metadata-implementation/repository-services/repository-services-archive-utilities/src/main/java/org/odpi/openmetadata/repositoryservices/archiveutilities/OMRSArchiveHelper.java @@ -1354,6 +1354,7 @@ public Classification getClassification(String typeName, { Classification classification = new Classification(); InstanceType type = this.getInstanceType(typeName); + classification.setName(typeName); this.setInstanceAuditHeader(classification, type, status); classification.setProperties(properties);