blob: 7175bc604761827167364636eeb57a24e1db65c6 [file] [log] [blame]
Simon Hunte05cae42015-07-23 17:35:24 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Simon Hunte05cae42015-07-23 17:35:24 -07003 *
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.
Simon Hunte05cae42015-07-23 17:35:24 -070015 */
16
17package org.onosproject.ui;
18
Simon Huntde99e0b2015-10-23 18:54:06 -070019import org.onosproject.net.DeviceId;
20import org.onosproject.net.HostId;
Simon Hunt0af1ec32015-07-24 12:17:55 -070021import org.onosproject.ui.topo.PropertyPanel;
Simon Hunte05cae42015-07-23 17:35:24 -070022import org.slf4j.Logger;
23import org.slf4j.LoggerFactory;
24
25/**
26 * Represents user interface topology view overlay.
27 */
28public class UiTopoOverlay {
29
Simon Huntb745ca62015-07-28 15:37:11 -070030 /**
31 * Logger for this overlay.
32 */
33 protected final Logger log = LoggerFactory.getLogger(getClass());
Simon Hunte05cae42015-07-23 17:35:24 -070034
35 private final String id;
36
Simon Huntd2862c32015-08-24 17:41:51 -070037 private boolean isActive = false;
38
Simon Hunte05cae42015-07-23 17:35:24 -070039 /**
40 * Creates a new user interface topology view overlay descriptor.
41 *
42 * @param id overlay identifier
43 */
44 public UiTopoOverlay(String id) {
45 this.id = id;
46 }
47
48 /**
49 * Returns the identifier for this overlay.
50 *
51 * @return the identifier
52 */
53 public String id() {
54 return id;
55 }
56
57 /**
58 * Callback invoked to initialize this overlay, soon after creation.
59 * This default implementation does nothing.
60 */
61 public void init() {
62 }
63
64 /**
65 * Callback invoked when this overlay is activated.
66 */
67 public void activate() {
Simon Huntd2862c32015-08-24 17:41:51 -070068 isActive = true;
Simon Hunte05cae42015-07-23 17:35:24 -070069 }
70
71 /**
72 * Callback invoked when this overlay is deactivated.
73 */
74 public void deactivate() {
Simon Huntd2862c32015-08-24 17:41:51 -070075 isActive = false;
76 }
77
78 /**
79 * Returns true if this overlay is currently active.
80 *
81 * @return true if overlay active
82 */
83 public boolean isActive() {
84 return isActive;
Simon Hunte05cae42015-07-23 17:35:24 -070085 }
86
87 /**
88 * Callback invoked to destroy this instance by cleaning up any
89 * internal state ready for garbage collection.
Simon Huntb745ca62015-07-28 15:37:11 -070090 * This default implementation holds no state and does nothing.
Simon Hunte05cae42015-07-23 17:35:24 -070091 */
92 public void destroy() {
93 }
Simon Hunt0af1ec32015-07-24 12:17:55 -070094
95 /**
96 * Callback to modify the contents of the summary panel.
97 * This default implementation does nothing.
98 *
99 * @param pp property panel model of summary data
100 */
101 public void modifySummary(PropertyPanel pp) {
102 }
Simon Huntb745ca62015-07-28 15:37:11 -0700103
104 /**
105 * Callback to modify the contents of the details panel for
106 * a selected device.
107 * This default implementation does nothing.
108 *
109 * @param pp property panel model of summary data
Ray Milkeye3026a42015-10-27 10:39:42 -0700110 * @param deviceId device id
Simon Huntb745ca62015-07-28 15:37:11 -0700111 */
Simon Huntde99e0b2015-10-23 18:54:06 -0700112 public void modifyDeviceDetails(PropertyPanel pp, DeviceId deviceId) {
Simon Huntb745ca62015-07-28 15:37:11 -0700113 }
114
115 /**
116 * Callback to modify the contents of the details panel for
117 * a selected host.
118 * This default implementation does nothing.
119 *
120 * @param pp property panel model of summary data
Ray Milkeye3026a42015-10-27 10:39:42 -0700121 * @param hostId host id
Simon Huntb745ca62015-07-28 15:37:11 -0700122 */
Simon Huntde99e0b2015-10-23 18:54:06 -0700123 public void modifyHostDetails(PropertyPanel pp, HostId hostId) {
Simon Huntb745ca62015-07-28 15:37:11 -0700124 }
Simon Hunte05cae42015-07-23 17:35:24 -0700125}