f93b599bf4db820978cb5d4dba7e6f09db308232
[ccsdk/features.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
32 /**
33  * Interface used for publishing VES messages to the VES Collector
34  *
35  * @author ravi
36  *
37  */
38 public interface VESCollectorService extends DeviceManagerService {
39
40     /**
41      * Gets the VES Collector configuration from etc/devicemanager.properties configuration file
42      */
43     VESCollectorCfgService getConfig();
44
45     /**
46      * publishes a VES message to the VES Collector by sending a REST request
47      * @param vesMsg
48      * @return
49      */
50     boolean publishVESMessage(VESMessage vesMsg);
51
52     /**
53      *  clients interested in VES Collector configuration changes can call the registerForChanges method so as to be notified when configuration changes are made
54      */
55     void registerForChanges(VESCollectorConfigChangeListener o);
56
57     /**
58      *  de-registering clients as part of cleanup
59      * @param o
60      */
61     void deregister(VESCollectorConfigChangeListener o);
62
63     /**
64      * Get a parser to parse {@link #org.opendaylight.yangtools.yang.binding.Notification } messages
65      * @return NotificationProxyParser object
66      */
67     @NonNull
68     NotificationProxyParser getNotificationProxyParser();
69
70     /**
71      * Generates VES Event JSON containing commonEventHeader and notificationFields fields
72      *
73      * @param commonEventHeader
74      * @param notifFields
75      * @return VESMessage - representing the VESEvent JSON
76      * @throws JsonProcessingException
77      */
78     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESNotificationFieldsPOJO notifFields) throws JsonProcessingException;
79
80     /**
81      * Generates VES Event JSON containing commonEventHeader and faultFields fields
82      *
83      * @param commonEventHeader
84      * @param faultFields
85      * @return VESMessage - representing the VES Event JSON
86      * @throws JsonProcessingException
87      */
88     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESFaultFieldsPOJO faultFields) throws JsonProcessingException;
89
90     /**
91      * Generates VES Event JSON containing commonEventHeader and pnfRegistration fields
92      *
93      * @param commonEventHeader
94      * @param faultFields
95      * @return VESMessage - representing the VES Event JSON
96      * @throws JsonProcessingException
97      */
98     VESMessage generateVESEvent(VESCommonEventHeaderPOJO commonEventHeader, VESPNFRegistrationFieldsPOJO faultFields) throws JsonProcessingException;
99
100 }