diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2023-10-20 14:30:41 +0530 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2023-10-20 14:31:01 +0530 |
commit | ea5ba02bdfd1ed6e16683b01f1f499cb2473e37e (patch) | |
tree | a12785119b185c6ec3777ad7826dc4c27f0c26ef /sdnr/wt/devicemanager-core | |
parent | 70cc4c4295376e4af9cb9009a6ee5ddc389d61d9 (diff) |
Support multiple YANG revisions
Provide o-ran-supervision messages to VES collector
Issue-ID: CCSDK-3948
Change-Id: I16cb880414dde00a48fa59d8b90251beedae2c0e
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-core')
3 files changed, 85 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/VESCollectorService.java b/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/VESCollectorService.java index f93b599bf..ab016f74f 100644 --- a/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/VESCollectorService.java +++ b/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/VESCollectorService.java @@ -28,6 +28,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESFaultFieldsPOJO; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESMessage; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESNotificationFieldsPOJO; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESPNFRegistrationFieldsPOJO; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESStndDefinedFieldsPOJO; /** * Interface used for publishing VES messages to the VES Collector @@ -97,4 +98,14 @@ public interface VESCollectorService extends DeviceManagerService { */ VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESPNFRegistrationFieldsPOJO faultFields) throws JsonProcessingException; + /** + * Generates VES Event JSON containing commonEventHeader and stndDefined fields + * + * @param commonEventHeader + * @param stndDefinedFields + * @return VESMessage - representing the VES Event JSON + * @throws JsonProcessingException + */ + VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESStndDefinedFieldsPOJO stndDefinedFields) throws JsonProcessingException; + } diff --git a/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/VESStndDefinedFieldsPOJO.java b/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/VESStndDefinedFieldsPOJO.java new file mode 100644 index 000000000..65bb48302 --- /dev/null +++ b/sdnr/wt/devicemanager-core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/VESStndDefinedFieldsPOJO.java @@ -0,0 +1,54 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2023 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.types; + +public class VESStndDefinedFieldsPOJO { + + private String schemaReference; + private String stndDefinedFieldsVersion = "1.0"; + private Object data; + + public String getSchemaReference() { + return schemaReference; + } + + public void setSchemaReference(String schemaReference) { + this.schemaReference = schemaReference; + } + + public String getStndDefinedFieldsVersion() { + return stndDefinedFieldsVersion; + } + + public void setStndDefinedFieldsVersion(String stndDefinedFieldsVersion) { + this.stndDefinedFieldsVersion = stndDefinedFieldsVersion; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + +} diff --git a/sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/vescollectorconnector/impl/VESCollectorServiceImpl.java b/sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/vescollectorconnector/impl/VESCollectorServiceImpl.java index 945d42550..a2e6c9a13 100644 --- a/sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/vescollectorconnector/impl/VESCollectorServiceImpl.java +++ b/sdnr/wt/devicemanager-core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/vescollectorconnector/impl/VESCollectorServiceImpl.java @@ -44,6 +44,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESFaultFieldsPOJO; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESMessage; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESNotificationFieldsPOJO; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESPNFRegistrationFieldsPOJO; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESStndDefinedFieldsPOJO; import org.onap.ccsdk.features.sdnr.wt.devicemanager.vescollectorconnector.impl.config.VESCollectorCfgImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -204,4 +205,23 @@ public class VESCollectorServiceImpl implements VESCollectorService, IConfigChan return new VESMessage(objMapper.writeValueAsString(outerEvent)); } + /** + * Generates VES Event JSON containing commonEventHeader and stndDefined fields + * + * @param commonEventHeader + * @param stndDefinedFields + * @return VESMessage - representing the VES Event JSON + * @throws JsonProcessingException + */ + @Override + public VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, + VESStndDefinedFieldsPOJO stndDefinedFields) throws JsonProcessingException { + Map<String, Object> innerEvent = new HashMap<String, Object>(); + innerEvent.put("commonEventHeader", commonEventHeader); + innerEvent.put("stndDefinedFields", stndDefinedFields); + + Map<String, Object> outerEvent = new HashMap<String, Object>(); + outerEvent.put("event", innerEvent); + return new VESMessage(objMapper.writeValueAsString(outerEvent)); + } } |