blob: ee6e3408363b30ef314be1b23d9344fbcdf5659f [file] [log] [blame]
Tomek OsiƄski7a1db182018-02-03 17:15:06 +01001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.xmpp.pubsub;
18
19import org.onosproject.net.DeviceId;
20import org.onosproject.xmpp.pubsub.model.XmppEventNotification;
21import org.onosproject.xmpp.pubsub.model.XmppPubSubError;
22
23/**
24 * Responsible for controlling Publish/Subscribe functionality of XMPP.
25 */
26public interface XmppPubSubController {
27
28 /**
29 * Method allows to send event notification to XMPP device.
30 *
31 * @param deviceId identifier of underlaying device
32 * @param eventNotification payload of event notification
33 */
34 void notify(DeviceId deviceId, XmppEventNotification eventNotification);
35
36 /**
37 * Method allows to send error notification to XMPP device.
38 *
39 * @param deviceId identifier of underlaying device
40 * @param error payload of error notification
41 */
42 void notifyError(DeviceId deviceId, XmppPubSubError error);
43
44 /**
45 * Register listener for Publish/Retract events.
46 *
47 * @param xmppPublishEventsListener listener to notify
48 */
49 void addXmppPublishEventsListener(XmppPublishEventsListener xmppPublishEventsListener);
50
51 /**
52 * Unregister listener for Publish/Retract events.
53 *
54 * @param xmppPublishEventsListener listener to unregister
55 */
56 void removeXmppPublishEventsListener(XmppPublishEventsListener xmppPublishEventsListener);
57
58 /**
59 * Register listener for Subscribe/Unsubscribe events.
60 *
61 * @param xmppSubscribeEventsListener listener to notify
62 */
63 void addXmppSubscribeEventsListener(XmppSubscribeEventsListener xmppSubscribeEventsListener);
64
65 /**
66 * Unregister listener for Subscribe/Unsubscribe events.
67 *
68 * @param xmppSubscribeEventsListener listener to unregister
69 */
70 void removeXmppSubscribeEventsListener(XmppSubscribeEventsListener xmppSubscribeEventsListener);
71
72}