blob: 3435f959f7d3edbe37ca14c6b6cd3aca3749ca8d [file] [log] [blame]
Thomas Vachuskaa9076122016-03-02 01:07:43 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Thomas Vachuskaa9076122016-03-02 01:07:43 -08003 *
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 */
16package org.onosproject.ospf.controller;
17
sunishvkf7c56552016-07-18 16:02:39 +053018import com.fasterxml.jackson.databind.JsonNode;
19
Thomas Vachuskaa9076122016-03-02 01:07:43 -080020import java.util.List;
21import 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 */
27public 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 *
sunishvkf7c56552016-07-18 16:02:39 +053060 * @param processesNode process info to update
Thomas Vachuskaa9076122016-03-02 01:07:43 -080061 */
sunishvkf7c56552016-07-18 16:02:39 +053062 void updateConfig(JsonNode processesNode);
Thomas Vachuskaa9076122016-03-02 01:07:43 -080063
64 /**
65 * Deletes configuration parameters.
66 *
67 * @param processes list of process instance
68 * @param attribute attribute to delete
69 */
sunishvkf7c56552016-07-18 16:02:39 +053070 void deleteConfig(List<OspfProcess> processes, String attribute);
Thomas Vachuskaa9076122016-03-02 01:07:43 -080071
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 vk30637eb2016-02-16 15:19:32 +053092}