Tomek OsiĆski | e9ccf41 | 2018-01-13 19:44:11 +0100 | [diff] [blame^] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.xmpp.core; |
| 18 | |
| 19 | /** |
| 20 | * Abstraction of a XMPP controller. Serves as a one stop |
| 21 | * shop for obtaining XMPP devices and (un)register listeners |
| 22 | * on XMPP events |
| 23 | */ |
| 24 | public interface XmppController { |
| 25 | |
| 26 | /** |
| 27 | * Method allows to retrieve XMPP device for given XmppDeviceId, if one exists. |
| 28 | * |
| 29 | * @param xmppDeviceId the device to retrieve |
| 30 | * @return the interface to XMPP Device |
| 31 | */ |
| 32 | XmppDevice getDevice(XmppDeviceId xmppDeviceId); |
| 33 | |
| 34 | /** |
| 35 | * Register a listener for device events. |
| 36 | * |
| 37 | * @param deviceListener the listener to notify |
| 38 | */ |
| 39 | void addXmppDeviceListener(XmppDeviceListener deviceListener); |
| 40 | |
| 41 | /** |
| 42 | * Unregister a listener for device events. |
| 43 | * |
| 44 | * @param deviceListener the listener to unregister |
| 45 | */ |
| 46 | void removeXmppDeviceListener(XmppDeviceListener deviceListener); |
| 47 | |
| 48 | /** |
| 49 | * Register a listener for IQ stanza of XMPP protocol. |
| 50 | * |
| 51 | * @param iqListener the listener to notify |
| 52 | */ |
| 53 | void addXmppIqListener(XmppIqListener iqListener); |
| 54 | |
| 55 | /** |
| 56 | * Unregister a listener for IQ stanza of XMPP protocol. |
| 57 | * |
| 58 | * @param iqListener the listener to unregister |
| 59 | */ |
| 60 | void removeXmppIqListener(XmppIqListener iqListener); |
| 61 | |
| 62 | /** |
| 63 | * Register a listener for Message stanza of XMPP protocol. |
| 64 | * |
| 65 | * @param messageListener the listener to notify |
| 66 | */ |
| 67 | void addXmppMessageListener(XmppMessageListener messageListener); |
| 68 | |
| 69 | /** |
| 70 | * Unregister a listener for Message stanza of XMPP protocol. |
| 71 | * |
| 72 | * @param messageListener the listener to unregister |
| 73 | */ |
| 74 | void removeXmppMessageListener(XmppMessageListener messageListener); |
| 75 | |
| 76 | /** |
| 77 | * Register a listener for Presence stanza of XMPP protocol. |
| 78 | * |
| 79 | * @param presenceListener the listener to notify |
| 80 | */ |
| 81 | void addXmppPresenceListener(XmppPresenceListener presenceListener); |
| 82 | |
| 83 | /** |
| 84 | * Unregister a listener for Presence stanza of XMPP protocol. |
| 85 | * |
| 86 | * @param presenceListener the listener to unregister |
| 87 | */ |
| 88 | void removeXmppPresenceListener(XmppPresenceListener presenceListener); |
| 89 | |
| 90 | } |