Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 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.onosproject.ospf.controller; |
| 17 | |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 18 | import com.fasterxml.jackson.databind.JsonNode; |
| 19 | |
Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 20 | import java.util.List; |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Abstraction of an OSPF controller. |
| 25 | * Serves as a one stop shop for obtaining OSPF devices and (un)register listeners on OSPF events. |
| 26 | */ |
| 27 | public interface OspfController { |
| 28 | |
| 29 | /** |
| 30 | * Registers a listener for router meta events. |
| 31 | * |
| 32 | * @param listener the listener to notify |
| 33 | */ |
| 34 | void addRouterListener(OspfRouterListener listener); |
| 35 | |
| 36 | /** |
| 37 | * Unregisters a router listener. |
| 38 | * |
| 39 | * @param listener the listener to unregister |
| 40 | */ |
| 41 | void removeRouterListener(OspfRouterListener listener); |
| 42 | |
| 43 | /** |
| 44 | * Registers a listener for OSPF message events. |
| 45 | * |
| 46 | * @param listener the listener to notify |
| 47 | */ |
| 48 | void addLinkListener(OspfLinkListener listener); |
| 49 | |
| 50 | /** |
| 51 | * Unregisters a link listener. |
| 52 | * |
| 53 | * @param listener the listener to unregister |
| 54 | */ |
| 55 | void removeLinkListener(OspfLinkListener listener); |
| 56 | |
| 57 | /** |
| 58 | * Updates configuration of processes. |
| 59 | * |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 60 | * @param processesNode process info to update |
Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 61 | */ |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 62 | void updateConfig(JsonNode processesNode); |
Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 63 | |
| 64 | /** |
| 65 | * Deletes configuration parameters. |
| 66 | * |
| 67 | * @param processes list of process instance |
| 68 | * @param attribute attribute to delete |
| 69 | */ |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 70 | void deleteConfig(List<OspfProcess> processes, String attribute); |
Thomas Vachuska | a907612 | 2016-03-02 01:07:43 -0800 | [diff] [blame] | 71 | |
| 72 | /** |
| 73 | * Gets the list of listeners registered for router events. |
| 74 | * |
| 75 | * @return list of listeners |
| 76 | */ |
| 77 | Set<OspfRouterListener> listener(); |
| 78 | |
| 79 | /** |
| 80 | * Gets the list of listeners registered for link events. |
| 81 | * |
| 82 | * @return list of listeners |
| 83 | */ |
| 84 | public Set<OspfLinkListener> linkListener(); |
| 85 | |
| 86 | /** |
| 87 | * Gets the configured process. |
| 88 | * |
| 89 | * @return list of process instances |
| 90 | */ |
| 91 | public List<OspfProcess> getAllConfiguredProcesses(); |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 92 | } |