Simon Hunt | d7f7bcc | 2015-05-08 14:13:17 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | */ |
| 17 | |
| 18 | package org.onosproject.ui.impl.topo; |
| 19 | |
| 20 | import com.fasterxml.jackson.databind.node.ObjectNode; |
| 21 | |
| 22 | import java.util.List; |
| 23 | |
| 24 | /**t |
| 25 | * Defines the API for the Topology UI Model. |
| 26 | */ |
| 27 | public interface TopoUiModelService { |
| 28 | |
| 29 | /** |
| 30 | * Registers the specified listener for Topology UI Model events. |
| 31 | * |
| 32 | * @param listener the listener |
| 33 | */ |
| 34 | void addListener(TopoUiListener listener); |
| 35 | |
| 36 | /** |
| 37 | * Unregister the specified listener. |
| 38 | * |
| 39 | * @param listener the listener |
| 40 | */ |
| 41 | void removeListener(TopoUiListener listener); |
| 42 | |
| 43 | |
| 44 | /** |
| 45 | * Returns events describing the current state of the model. |
| 46 | * <p> |
| 47 | * These will be in the form of "addInstance", "addDevice", "addLink", |
| 48 | * and "addHost" events, as appropriate. |
| 49 | * |
Simon Hunt | c54cd1b | 2015-05-11 13:43:44 -0700 | [diff] [blame] | 50 | * @return initial state messages |
Simon Hunt | d7f7bcc | 2015-05-08 14:13:17 -0700 | [diff] [blame] | 51 | */ |
| 52 | List<ObjectNode> getInitialState(); |
| 53 | |
Simon Hunt | c54cd1b | 2015-05-11 13:43:44 -0700 | [diff] [blame] | 54 | /** |
| 55 | * Starts the summary monitoring process. |
| 56 | * <p> |
| 57 | * Sends a "showSummary" message now, and schedules a task to send |
| 58 | * updates whenever the data changes. |
| 59 | */ |
| 60 | void startSummaryMonitoring(); |
| 61 | |
| 62 | /** |
| 63 | * Cancels the task that sends summary updates. |
| 64 | */ |
| 65 | void stopSummaryMonitoring(); |
| 66 | |
| 67 | /** |
| 68 | * Returns base data about the topology. |
| 69 | * |
| 70 | * @return summary data |
| 71 | */ |
| 72 | SummaryData getSummaryData(); |
Simon Hunt | d7f7bcc | 2015-05-08 14:13:17 -0700 | [diff] [blame] | 73 | } |