diff options
author | 2025-01-16 13:38:52 +0000 | |
---|---|---|
committer | 2025-02-25 16:35:56 +0000 | |
commit | f234c53a2bc18d74c3176377098369a51bba0b3a (patch) | |
tree | db1df619ec3a3b1e8c0615d0a626690c3bc7312e /cps-ncmp-events/src | |
parent | e3f1a24a575e5e7a49d11a83563ca742b593c0c1 (diff) |
Event data schemas for NCMP
- Updated the schema id as NCMP has a master copy of all the schemas
that are used
- Introduced an enum to keep track of the dataschemas at a single place.
- Refactored NcmpEvent builder class to take type and dataschema as a
parameter
- Cleaned up dependencies
- Refactored testware to prove the changes
- Changes are according to the decisions recorded here https://lf-onap.atlassian.net/wiki/spaces/DW/pages/16554840/CPS-2425+Event+Schemas+in+ONAP#Agreed-Event-Schema-Names
Issue-ID: CPS-2425
Change-Id: Icbda1aa20e3c4b0f2b6797d25b59e52cf9237c92
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-events/src')
6 files changed, 46 insertions, 5 deletions
diff --git a/cps-ncmp-events/src/main/java/org/onap/cps/ncmp/events/NcmpEventDataSchema.java b/cps-ncmp-events/src/main/java/org/onap/cps/ncmp/events/NcmpEventDataSchema.java new file mode 100644 index 0000000000..9cdb6d76ee --- /dev/null +++ b/cps-ncmp-events/src/main/java/org/onap/cps/ncmp/events/NcmpEventDataSchema.java @@ -0,0 +1,41 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.cps.ncmp.events; + +import lombok.Getter; + +@Getter +public enum NcmpEventDataSchema { + + BATCH_RESPONSE_V1("urn:cps:org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent:1.0.0"), + SUBSCRIPTIONS_V1("urn:cps:org.onap.ncmp.events.subscription:1.0.0"), + MOI_CHANGES_V1("urn:cps:org.onap.cps.ncmp.events.moi-changes:1.0.0"), + INVENTORY_EVENTS_V1("urn:cps:org.onap.cps.ncmp.events:inventory-event:1.0.0"), + CM_HANDLE_TRUST_LEVEL_V1("urn:cps:org.onap.cps.ncmp.dmi.events:cm-handle-trust-level:1.0.0"); + + private final String dataSchema; + + NcmpEventDataSchema(final String dataSchema) { + this.dataSchema = dataSchema; + } + + +} diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json index d24ec2c737..5094e1808f 100644 --- a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:avc-event-schema:1.0.0", + "$id": "urn:cps:org.onap.cps.ncmp.events.inventory-event-schema:1.0.0", "$ref": "#/definitions/AvcEvent", "definitions": { "AvcEvent": { diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json index 93ec216e3d..fb86c5ddb4 100644 --- a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:cm-notification-subscription-dmi-in-event-schema:1.0.0", + "$id": "urn:cps:org.onap.ncmp.events.subscription:1.0.0", "$ref": "#/definitions/DmiInEvent", "definitions": { "DmiInEvent": { diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json index 0910de1529..b47a70cd90 100644 --- a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:cm-notification-subscription-dmi-out-event-schema:1.0.0", + "$id": "urn:cps:org.onap.ncmp.events.subscription:1.0.0", "$ref": "#/definitions/DmiOutEvent", "definitions": { "DmiOutEvent": { diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json index f8b6c2e680..d4e8519956 100644 --- a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json @@ -1,5 +1,5 @@ { - "$id": "urn:cps:org.onap.cps.ncmp.events:cm-notification-subscription-ncmp-in-event:1.0.0", + "$id": "urn:cps:org.onap.ncmp.events.subscription:1.0.0", "$ref": "#/definitions/NcmpInEvent", "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json index 11dc4e1114..466ce04a0f 100644 --- a/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:cm-notification-subscription-ncmp-out-event-schema:1.0.0", + "$id": "urn:cps:org.onap.ncmp.events.subscription:1.0.0", "$ref": "#/definitions/NcmpOutEvent", "definitions": { "NcmpOutEvent": { |