Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 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 | package org.opencord.cordvtn.api.node; |
| 17 | |
| 18 | import org.onosproject.net.Device; |
| 19 | import org.onosproject.net.Port; |
| 20 | |
| 21 | /** |
| 22 | * Entity capable of handling a device state updates. |
| 23 | */ |
| 24 | public interface DeviceHandler { |
| 25 | |
| 26 | /** |
| 27 | * Processes the connected device. |
| 28 | * |
| 29 | * @param device device |
| 30 | */ |
| 31 | void connected(Device device); |
| 32 | |
| 33 | /** |
| 34 | * Processes the disconnected device. |
| 35 | * |
| 36 | * @param device device. |
| 37 | */ |
| 38 | void disconnected(Device device); |
| 39 | |
| 40 | /** |
| 41 | * Processes newly added port. |
| 42 | * |
| 43 | * @param port port |
| 44 | */ |
| 45 | default void portAdded(Port port) { |
| 46 | // do nothing by default |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Processes the updated port. |
| 51 | * |
| 52 | * @param port port |
| 53 | */ |
| 54 | default void portUpdated(Port port) { |
| 55 | // do nothing by default |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Processes the removed port. |
| 60 | * |
| 61 | * @param port port |
| 62 | */ |
| 63 | default void portRemoved(Port port) { |
| 64 | // do nothing by default |
| 65 | } |
| 66 | } |