ab016f74f394127169926d6eecb571b0098c1204
[oam/oam-controller.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.service;
23
24 import com.fasterxml.jackson.core.JsonProcessingException;
25 import org.eclipse.jdt.annotation.NonNull;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESCommonEventHeaderPOJO;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESFaultFieldsPOJO;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESMessage;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESNotificationFieldsPOJO;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESPNFRegistrationFieldsPOJO;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESStndDefinedFieldsPOJO;
32
33 /**
34  * Interface used for publishing VES messages to the VES Collector
35  *
36  * @author ravi
37  *
38  */
39 public interface VESCollectorService extends DeviceManagerService {
40
41     /**
42      * Gets the VES Collector configuration from etc/devicemanager.properties configuration file
43      */
44     VESCollectorCfgService getConfig();
45
46     /**
47      * publishes a VES message to the VES Collector by sending a REST request
48      * @param vesMsg
49      * @return
50      */
51     boolean publishVESMessage(VESMessage vesMsg);
52
53     /**
54      *  clients interested in VES Collector configuration changes can call the registerForChanges method so as to be notified when configuration changes are made
55      */
56     void registerForChanges(VESCollectorConfigChangeListener o);
57
58     /**
59      *  de-registering clients as part of cleanup
60      * @param o
61      */
62     void deregister(VESCollectorConfigChangeListener o);
63
64     /**
65      * Get a parser to parse {@link #org.opendaylight.yangtools.yang.binding.Notification } messages
66      * @return NotificationProxyParser object
67      */
68     @NonNull
69     NotificationProxyParser getNotificationProxyParser();
70
71     /**
72      * Generates VES Event JSON containing commonEventHeader and notificationFields fields
73      *
74      * @param commonEventHeader
75      * @param notifFields
76      * @return VESMessage - representing the VESEvent JSON
77      * @throws JsonProcessingException
78      */
79     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESNotificationFieldsPOJO notifFields) throws JsonProcessingException;
80
81     /**
82      * Generates VES Event JSON containing commonEventHeader and faultFields fields
83      *
84      * @param commonEventHeader
85      * @param faultFields
86      * @return VESMessage - representing the VES Event JSON
87      * @throws JsonProcessingException
88      */
89     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESFaultFieldsPOJO faultFields) throws JsonProcessingException;
90
91     /**
92      * Generates VES Event JSON containing commonEventHeader and pnfRegistration fields
93      *
94      * @param commonEventHeader
95      * @param faultFields
96      * @return VESMessage - representing the VES Event JSON
97      * @throws JsonProcessingException
98      */
99     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESPNFRegistrationFieldsPOJO faultFields) throws JsonProcessingException;
100
101     /**
102      * Generates VES Event JSON containing commonEventHeader and stndDefined fields
103      *
104      * @param commonEventHeader
105      * @param stndDefinedFields
106      * @return VESMessage - representing the VES Event JSON
107      * @throws JsonProcessingException
108      */
109     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESStndDefinedFieldsPOJO stndDefinedFields) throws JsonProcessingException;
110     
111 }