blob: 4c6d5d1f705f407db2c713248d5d88e12a37da1b [file] [log] [blame]
Simon Hunte05cae42015-07-23 17:35:24 -07001/*
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
18package org.onosproject.ui;
19
Simon Hunt0af1ec32015-07-24 12:17:55 -070020import org.onosproject.ui.topo.PropertyPanel;
Simon Hunte05cae42015-07-23 17:35:24 -070021import org.slf4j.Logger;
22import org.slf4j.LoggerFactory;
23
24/**
25 * Represents user interface topology view overlay.
26 */
27public class UiTopoOverlay {
28
Simon Huntb745ca62015-07-28 15:37:11 -070029 /**
30 * Logger for this overlay.
31 */
32 protected final Logger log = LoggerFactory.getLogger(getClass());
Simon Hunte05cae42015-07-23 17:35:24 -070033
34 private final String id;
35
36 /**
37 * Creates a new user interface topology view overlay descriptor.
38 *
39 * @param id overlay identifier
40 */
41 public UiTopoOverlay(String id) {
42 this.id = id;
43 }
44
45 /**
46 * Returns the identifier for this overlay.
47 *
48 * @return the identifier
49 */
50 public String id() {
51 return id;
52 }
53
54 /**
55 * Callback invoked to initialize this overlay, soon after creation.
56 * This default implementation does nothing.
57 */
58 public void init() {
59 }
60
61 /**
62 * Callback invoked when this overlay is activated.
63 */
64 public void activate() {
65 log.debug("Overlay '{}' Activated", id);
66 }
67
68 /**
69 * Callback invoked when this overlay is deactivated.
70 */
71 public void deactivate() {
72 log.debug("Overlay '{}' Deactivated", id);
73 }
74
75 /**
76 * Callback invoked to destroy this instance by cleaning up any
77 * internal state ready for garbage collection.
Simon Huntb745ca62015-07-28 15:37:11 -070078 * This default implementation holds no state and does nothing.
Simon Hunte05cae42015-07-23 17:35:24 -070079 */
80 public void destroy() {
81 }
Simon Hunt0af1ec32015-07-24 12:17:55 -070082
83 /**
84 * Callback to modify the contents of the summary panel.
85 * This default implementation does nothing.
86 *
87 * @param pp property panel model of summary data
88 */
89 public void modifySummary(PropertyPanel pp) {
90 }
Simon Huntb745ca62015-07-28 15:37:11 -070091
92 /**
93 * Callback to modify the contents of the details panel for
94 * a selected device.
95 * This default implementation does nothing.
96 *
97 * @param pp property panel model of summary data
98 */
99 public void modifyDeviceDetails(PropertyPanel pp) {
100 }
101
102 /**
103 * Callback to modify the contents of the details panel for
104 * a selected host.
105 * This default implementation does nothing.
106 *
107 * @param pp property panel model of summary data
108 */
109 public void modifyHostDetails(PropertyPanel pp) {
110 }
Simon Hunte05cae42015-07-23 17:35:24 -0700111}