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 | import org.xmpp.packet.Packet; |
| 20 | |
| 21 | /** |
| 22 | * Responsible for keeping track of the current set of devices |
| 23 | * connected to the system. As well as notifying Xmpp Stanza listeners. |
| 24 | * |
| 25 | */ |
| 26 | public interface XmppDeviceAgent { |
| 27 | |
| 28 | /** |
| 29 | * Add a device that has just connected to the system. |
| 30 | * @param deviceId the identifier of device to add. |
| 31 | * @param device the actual device object. |
| 32 | * @return true if added, false otherwise. |
| 33 | */ |
| 34 | boolean addConnectedDevice(XmppDeviceId deviceId, XmppDevice device); |
| 35 | |
| 36 | /** |
| 37 | * Remove a device from a local repository that has been disconnected |
| 38 | * from the local controller. Notify device listeners. |
| 39 | * @param deviceId the identifier of device to remove. |
| 40 | */ |
| 41 | void removeConnectedDevice(XmppDeviceId deviceId); |
| 42 | |
| 43 | /** |
| 44 | * Returns XMPP device object that is stored in the local repository |
| 45 | * containing already connected devices. |
| 46 | * @param deviceId the identifier of device |
| 47 | * @return the XMPP device object |
| 48 | */ |
| 49 | XmppDevice getDevice(XmppDeviceId deviceId); |
| 50 | |
| 51 | /** |
| 52 | * Process an event (incoming Packet) coming from a device. |
| 53 | * @param deviceId the identifier of device the packet came on. |
| 54 | * @param packet the packet to process |
| 55 | */ |
| 56 | void processUpstreamEvent(XmppDeviceId deviceId, Packet packet); |
| 57 | |
| 58 | } |
| 59 | |