blob: cd935b5daa915474cee882612605b09bc9b6447d [file] [log] [blame]
sunish vk30637eb2016-02-16 15:19:32 +05301/*
2 * Copyright 2016 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 */
16package org.onosproject.ospf.controller;
17
18import java.util.List;
19import java.util.Set;
20
21/**
22 * Abstraction of an OSPF controller.
23 * Serves as a one stop shop for obtaining OSPF devices and (un)register listeners on OSPF events.
24 */
25public interface OspfController {
26
27 /**
28 * Registers a listener for router meta events.
29 *
30 * @param listener the listener to notify
31 */
32 void addRouterListener(OspfRouterListener listener);
33
34 /**
35 * Unregisters a router listener.
36 *
37 * @param listener the listener to unregister
38 */
39 void removeRouterListener(OspfRouterListener listener);
40
41 /**
42 * Registers a listener for OSPF message events.
43 *
44 * @param listener the listener to notify
45 */
46 void addLinkListener(OspfLinkListener listener);
47
48 /**
49 * Unregisters a link listener.
50 *
51 * @param listener the listener to unregister
52 */
53 void removeLinkListener(OspfLinkListener listener);
54
55 /**
56 * Updates configuration of processes.
57 *
58 * @param processes process info to update
59 */
60 public void updateConfig(List<OspfProcess> processes);
61
62 /**
63 * Deletes configuration parameters.
64 *
65 * @param processes list of process instance
66 * @param attribute attribute to delete
67 */
68 public void deleteConfig(List<OspfProcess> processes, String attribute);
69
70 /**
71 * Gets string representation of area configuration parameters to be displayed after CLI command.
72 *
73 * @param processId process Id
74 * @param areaId area Id
75 * @return Area Information
76 */
77 public String showAreaParameters(String processId, String areaId);
78
79 /**
80 * Gets string representation of area configuration information for the given area/process.
81 * This method will be called for CLI command.
82 *
83 * @param processId process id to which area belongs
84 * @param areaId area id
85 * @return string representation of area configuration for CLI display
86 */
87 List<String> showAreaConfigurations(String processId, String areaId);
88
89 /**
90 * Gets the list of listeners registered for router events.
91 *
92 * @return list of listeners
93 */
94 Set<OspfRouterListener> listener();
95
96 /**
97 * Gets the list of listeners registered for link events.
98 *
99 * @return list of listeners
100 */
101 public Set<OspfLinkListener> linkListener();
102
103 /**
104 * Gets the configured process.
105 *
106 * @return list of process instances
107 */
108 public List<OspfProcess> getAllConfiguredProcesses();
109}