Committed by
Gerrit Code Review
Cleaning up Javadocs in core-ui classes.
Promoted Glyphs inner class to GlyphConstants. Change-Id: Ib12a4556a75d98edb3544b9ae45605fab554fdcf
Showing
14 changed files
with
185 additions
and
146 deletions
1 | +/* | ||
2 | + * Copyright 2016-present 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 | +package org.onosproject.ui; | ||
18 | + | ||
19 | +/** | ||
20 | + * Defines constants for standard glyph identifiers. | ||
21 | + * <p> | ||
22 | + * See also: | ||
23 | + * <ul> | ||
24 | + * <li> | ||
25 | + * https://wiki.onosproject.org/display/ONOS/UI+Service+-+GlyphService | ||
26 | + * </li> | ||
27 | + * </ul> | ||
28 | + */ | ||
29 | +public final class GlyphConstants { | ||
30 | + public static final String BIRD = "bird"; | ||
31 | + | ||
32 | + public static final String UNKNOWN = "m_unknown"; | ||
33 | + public static final String QUERY = "query"; | ||
34 | + public static final String NODE = "node"; | ||
35 | + | ||
36 | + public static final String SWITCH = "m_switch"; | ||
37 | + public static final String ROUTER = "router"; | ||
38 | + public static final String ROADM = "m_roadm"; | ||
39 | + public static final String OTN = "otn"; | ||
40 | + public static final String ROADM_OTN = "roadm_otn"; | ||
41 | + public static final String FIBER_SWITCH = "fiber_switch"; | ||
42 | + public static final String MICROWAVE = "microwave"; | ||
43 | + | ||
44 | + public static final String ENDSTATION = "m_endstation"; | ||
45 | + public static final String BGP_SPEAKER = "bgpSpeaker"; | ||
46 | + | ||
47 | + public static final String CHAIN = "chain"; | ||
48 | + public static final String CROWN = "crown"; | ||
49 | + public static final String LOCK = "lock"; | ||
50 | + public static final String TOPO = "topo"; | ||
51 | + public static final String REFRESH = "refresh"; | ||
52 | + public static final String GARBAGE = "garbage"; | ||
53 | + | ||
54 | + public static final String FLOW_TABLE = "flowTable"; | ||
55 | + public static final String PORT_TABLE = "portTable"; | ||
56 | + public static final String GROUP_TABLE = "groupTable"; | ||
57 | + public static final String METER_TABLE = "meterTable"; | ||
58 | + | ||
59 | + public static final String SUMMARY = "m_summary"; | ||
60 | + public static final String DETAILS = "m_details"; | ||
61 | + public static final String PORTS = "m_ports"; | ||
62 | + public static final String MAP = "m_map"; | ||
63 | + public static final String CYCLE_LABELS = "m_cycleLabels"; | ||
64 | + public static final String OBLIQUE = "m_oblique"; | ||
65 | + public static final String FILTERS = "m_filters"; | ||
66 | + public static final String RESET_ZOOM = "m_resetZoom"; | ||
67 | + public static final String RELATED_INTENTS = "m_relatedIntents"; | ||
68 | + public static final String NEXT = "m_next"; | ||
69 | + public static final String PREV = "m_prev"; | ||
70 | + public static final String INTENT_TRAFFIC = "m_intentTraffic"; | ||
71 | + public static final String ALL_TRAFFIC = "m_allTraffic"; | ||
72 | + public static final String FLOWS = "m_flows"; | ||
73 | + public static final String EQ_MASTER = "m_eqMaster"; | ||
74 | + | ||
75 | + public static final String UI_ATTACHED = "m_uiAttached"; | ||
76 | + public static final String CHECK_MARK = "checkMark"; | ||
77 | + public static final String X_MARK = "m_xMark"; | ||
78 | + public static final String TRIANGLE_UP = "triangleUp"; | ||
79 | + public static final String TRIANGLE_DOWN = "triangleDown"; | ||
80 | + public static final String PLUS = "plus"; | ||
81 | + public static final String MINUS = "minus"; | ||
82 | + public static final String PLAY = "play"; | ||
83 | + public static final String STOP = "stop"; | ||
84 | + | ||
85 | + public static final String CLOUD = "m_cloud"; | ||
86 | + | ||
87 | + // non-instantiable | ||
88 | + private GlyphConstants() { | ||
89 | + } | ||
90 | +} |
... | @@ -31,15 +31,14 @@ public final class JsonUtils { | ... | @@ -31,15 +31,14 @@ public final class JsonUtils { |
31 | } | 31 | } |
32 | 32 | ||
33 | /** | 33 | /** |
34 | - * Wraps a message payload into an event structure for the given event | 34 | + * Composes a message structure for the given message type and payload. |
35 | - * type and sequence ID. Generally, the sequence ID should be a copy of | ||
36 | - * the ID from the client request event. | ||
37 | * | 35 | * |
38 | * @param type event type | 36 | * @param type event type |
39 | * @param sid sequence ID | 37 | * @param sid sequence ID |
40 | * @param payload event payload | 38 | * @param payload event payload |
41 | * @return the object node representation | 39 | * @return the object node representation |
42 | */ | 40 | */ |
41 | + @Deprecated | ||
43 | public static ObjectNode envelope(String type, long sid, ObjectNode payload) { | 42 | public static ObjectNode envelope(String type, long sid, ObjectNode payload) { |
44 | ObjectNode event = MAPPER.createObjectNode(); | 43 | ObjectNode event = MAPPER.createObjectNode(); |
45 | event.put("event", type); | 44 | event.put("event", type); |
... | @@ -82,6 +81,7 @@ public final class JsonUtils { | ... | @@ -82,6 +81,7 @@ public final class JsonUtils { |
82 | * @param event message event | 81 | * @param event message event |
83 | * @return extracted sequence identifier | 82 | * @return extracted sequence identifier |
84 | */ | 83 | */ |
84 | + @Deprecated | ||
85 | public static long sid(ObjectNode event) { | 85 | public static long sid(ObjectNode event) { |
86 | return number(event, "sid"); | 86 | return number(event, "sid"); |
87 | } | 87 | } | ... | ... |
... | @@ -32,6 +32,12 @@ public abstract class RequestHandler { | ... | @@ -32,6 +32,12 @@ public abstract class RequestHandler { |
32 | private UiMessageHandler parent; | 32 | private UiMessageHandler parent; |
33 | 33 | ||
34 | 34 | ||
35 | + /** | ||
36 | + * Constructs a request handler instance that will handle events | ||
37 | + * of the specified type. | ||
38 | + * | ||
39 | + * @param eventType type of event that will be handled | ||
40 | + */ | ||
35 | public RequestHandler(String eventType) { | 41 | public RequestHandler(String eventType) { |
36 | this.eventType = eventType; | 42 | this.eventType = eventType; |
37 | } | 43 | } |
... | @@ -64,7 +70,7 @@ public abstract class RequestHandler { | ... | @@ -64,7 +70,7 @@ public abstract class RequestHandler { |
64 | // === Convenience methods... | 70 | // === Convenience methods... |
65 | 71 | ||
66 | /** | 72 | /** |
67 | - * Returns implementation of the specified service class. | 73 | + * Returns an implementation of the specified service class. |
68 | * | 74 | * |
69 | * @param serviceClass service class | 75 | * @param serviceClass service class |
70 | * @param <T> type of service | 76 | * @param <T> type of service |
... | @@ -76,19 +82,20 @@ public abstract class RequestHandler { | ... | @@ -76,19 +82,20 @@ public abstract class RequestHandler { |
76 | } | 82 | } |
77 | 83 | ||
78 | /** | 84 | /** |
79 | - * Sends a message back to the client. | 85 | + * Sends a message back to the client with the given event type and payload. |
80 | * | 86 | * |
81 | * @param eventType message event type | 87 | * @param eventType message event type |
82 | * @param sid message sequence identifier | 88 | * @param sid message sequence identifier |
83 | * @param payload message payload | 89 | * @param payload message payload |
84 | */ | 90 | */ |
85 | // TODO: remove sid from signature | 91 | // TODO: remove sid from signature |
92 | + @Deprecated | ||
86 | protected void sendMessage(String eventType, long sid, ObjectNode payload) { | 93 | protected void sendMessage(String eventType, long sid, ObjectNode payload) { |
87 | parent.connection().sendMessage(eventType, sid, payload); | 94 | parent.connection().sendMessage(eventType, sid, payload); |
88 | } | 95 | } |
89 | 96 | ||
90 | /** | 97 | /** |
91 | - * Sends a message back to the client. | 98 | + * Sends a message back to the client with the given event type and payload. |
92 | * | 99 | * |
93 | * @param eventType message event type | 100 | * @param eventType message event type |
94 | * @param payload message payload | 101 | * @param payload message payload |
... | @@ -100,8 +107,8 @@ public abstract class RequestHandler { | ... | @@ -100,8 +107,8 @@ public abstract class RequestHandler { |
100 | 107 | ||
101 | /** | 108 | /** |
102 | * Sends a message back to the client. | 109 | * Sends a message back to the client. |
103 | - * Here, the message is preformatted; the assumption is it has its | 110 | + * Here, the message is preformatted; the assumption is that it has its |
104 | - * eventType, sid and payload attributes already filled in. | 111 | + * eventType and payload attributes already filled in. |
105 | * | 112 | * |
106 | * @param message the message to send | 113 | * @param message the message to send |
107 | */ | 114 | */ |
... | @@ -161,5 +168,4 @@ public abstract class RequestHandler { | ... | @@ -161,5 +168,4 @@ public abstract class RequestHandler { |
161 | protected boolean bool(ObjectNode node, String key) { | 168 | protected boolean bool(ObjectNode node, String key) { |
162 | return JsonUtils.bool(node, key); | 169 | return JsonUtils.bool(node, key); |
163 | } | 170 | } |
164 | - | ||
165 | } | 171 | } | ... | ... |
... | @@ -27,7 +27,10 @@ import static com.google.common.base.Preconditions.checkArgument; | ... | @@ -27,7 +27,10 @@ import static com.google.common.base.Preconditions.checkArgument; |
27 | import static com.google.common.base.Preconditions.checkNotNull; | 27 | import static com.google.common.base.Preconditions.checkNotNull; |
28 | 28 | ||
29 | /** | 29 | /** |
30 | - * User interface extension. | 30 | + * Immutable representation of a user interface extension. |
31 | + * <p> | ||
32 | + * Note that the {@link Builder} class is used to create a user | ||
33 | + * interface extension instance, and that these instances are immutable. | ||
31 | */ | 34 | */ |
32 | public final class UiExtension { | 35 | public final class UiExtension { |
33 | 36 | ||
... | @@ -41,7 +44,7 @@ public final class UiExtension { | ... | @@ -41,7 +44,7 @@ public final class UiExtension { |
41 | 44 | ||
42 | private final ClassLoader classLoader; | 45 | private final ClassLoader classLoader; |
43 | private final String resourcePath; | 46 | private final String resourcePath; |
44 | - private final List<UiView> views; | 47 | + private final List<UiView> viewList; |
45 | private final UiMessageHandlerFactory messageHandlerFactory; | 48 | private final UiMessageHandlerFactory messageHandlerFactory; |
46 | private final UiTopoOverlayFactory topoOverlayFactory; | 49 | private final UiTopoOverlayFactory topoOverlayFactory; |
47 | private final UiTopoMapFactory topoMapFactory; | 50 | private final UiTopoMapFactory topoMapFactory; |
... | @@ -53,12 +56,12 @@ public final class UiExtension { | ... | @@ -53,12 +56,12 @@ public final class UiExtension { |
53 | UiMessageHandlerFactory mhFactory, | 56 | UiMessageHandlerFactory mhFactory, |
54 | UiTopoOverlayFactory toFactory, | 57 | UiTopoOverlayFactory toFactory, |
55 | UiTopoMapFactory tmFactory) { | 58 | UiTopoMapFactory tmFactory) { |
56 | - this.classLoader = cl; | 59 | + classLoader = cl; |
57 | - this.resourcePath = path; | 60 | + resourcePath = path; |
58 | - this.views = views; | 61 | + viewList = views; |
59 | - this.messageHandlerFactory = mhFactory; | 62 | + messageHandlerFactory = mhFactory; |
60 | - this.topoOverlayFactory = toFactory; | 63 | + topoOverlayFactory = toFactory; |
61 | - this.topoMapFactory = tmFactory; | 64 | + topoMapFactory = tmFactory; |
62 | } | 65 | } |
63 | 66 | ||
64 | 67 | ||
... | @@ -86,7 +89,7 @@ public final class UiExtension { | ... | @@ -86,7 +89,7 @@ public final class UiExtension { |
86 | * @return contributed view descriptors | 89 | * @return contributed view descriptors |
87 | */ | 90 | */ |
88 | public List<UiView> views() { | 91 | public List<UiView> views() { |
89 | - return isValid ? views : ImmutableList.of(); | 92 | + return isValid ? viewList : ImmutableList.of(); |
90 | } | 93 | } |
91 | 94 | ||
92 | /** | 95 | /** |
... | @@ -146,7 +149,7 @@ public final class UiExtension { | ... | @@ -146,7 +149,7 @@ public final class UiExtension { |
146 | private ClassLoader classLoader; | 149 | private ClassLoader classLoader; |
147 | 150 | ||
148 | private String resourcePath = EMPTY; | 151 | private String resourcePath = EMPTY; |
149 | - private List<UiView> views = new ArrayList<>(); | 152 | + private List<UiView> viewList = new ArrayList<>(); |
150 | private UiMessageHandlerFactory messageHandlerFactory = null; | 153 | private UiMessageHandlerFactory messageHandlerFactory = null; |
151 | private UiTopoOverlayFactory topoOverlayFactory = null; | 154 | private UiTopoOverlayFactory topoOverlayFactory = null; |
152 | private UiTopoMapFactory topoMapFactory = null; | 155 | private UiTopoMapFactory topoMapFactory = null; |
... | @@ -155,7 +158,7 @@ public final class UiExtension { | ... | @@ -155,7 +158,7 @@ public final class UiExtension { |
155 | * Create a builder with the given class loader. | 158 | * Create a builder with the given class loader. |
156 | * Resource path defaults to "". | 159 | * Resource path defaults to "". |
157 | * Views defaults to an empty list. | 160 | * Views defaults to an empty list. |
158 | - * Both Message and TopoOverlay factories default to null. | 161 | + * MessageHandler, TopoOverlay, and TopoMap factories default to null. |
159 | * | 162 | * |
160 | * @param cl the class loader | 163 | * @param cl the class loader |
161 | * @param views list of views contributed by this extension | 164 | * @param views list of views contributed by this extension |
... | @@ -163,19 +166,19 @@ public final class UiExtension { | ... | @@ -163,19 +166,19 @@ public final class UiExtension { |
163 | public Builder(ClassLoader cl, List<UiView> views) { | 166 | public Builder(ClassLoader cl, List<UiView> views) { |
164 | checkNotNull(cl, "Must provide a class loader"); | 167 | checkNotNull(cl, "Must provide a class loader"); |
165 | checkArgument(views.size() > 0, "Must provide at least one view"); | 168 | checkArgument(views.size() > 0, "Must provide at least one view"); |
166 | - this.classLoader = cl; | 169 | + classLoader = cl; |
167 | - this.views = views; | 170 | + viewList = views; |
168 | } | 171 | } |
169 | 172 | ||
170 | /** | 173 | /** |
171 | - * Set the resource path. That is, path to where the CSS and JS | 174 | + * Set the resource path. That is, the path to where the CSS and JS |
172 | - * files are located. This value should | 175 | + * files are located. |
173 | * | 176 | * |
174 | * @param path resource path | 177 | * @param path resource path |
175 | * @return self, for chaining | 178 | * @return self, for chaining |
176 | */ | 179 | */ |
177 | public Builder resourcePath(String path) { | 180 | public Builder resourcePath(String path) { |
178 | - this.resourcePath = path == null ? EMPTY : path + SLASH; | 181 | + resourcePath = path == null ? EMPTY : path + SLASH; |
179 | return this; | 182 | return this; |
180 | } | 183 | } |
181 | 184 | ||
... | @@ -186,7 +189,7 @@ public final class UiExtension { | ... | @@ -186,7 +189,7 @@ public final class UiExtension { |
186 | * @return self, for chaining | 189 | * @return self, for chaining |
187 | */ | 190 | */ |
188 | public Builder messageHandlerFactory(UiMessageHandlerFactory mhFactory) { | 191 | public Builder messageHandlerFactory(UiMessageHandlerFactory mhFactory) { |
189 | - this.messageHandlerFactory = mhFactory; | 192 | + messageHandlerFactory = mhFactory; |
190 | return this; | 193 | return this; |
191 | } | 194 | } |
192 | 195 | ||
... | @@ -197,7 +200,7 @@ public final class UiExtension { | ... | @@ -197,7 +200,7 @@ public final class UiExtension { |
197 | * @return self, for chaining | 200 | * @return self, for chaining |
198 | */ | 201 | */ |
199 | public Builder topoOverlayFactory(UiTopoOverlayFactory toFactory) { | 202 | public Builder topoOverlayFactory(UiTopoOverlayFactory toFactory) { |
200 | - this.topoOverlayFactory = toFactory; | 203 | + topoOverlayFactory = toFactory; |
201 | return this; | 204 | return this; |
202 | } | 205 | } |
203 | 206 | ||
... | @@ -208,21 +211,19 @@ public final class UiExtension { | ... | @@ -208,21 +211,19 @@ public final class UiExtension { |
208 | * @return self, for chaining | 211 | * @return self, for chaining |
209 | */ | 212 | */ |
210 | public Builder topoMapFactory(UiTopoMapFactory tmFactory) { | 213 | public Builder topoMapFactory(UiTopoMapFactory tmFactory) { |
211 | - this.topoMapFactory = tmFactory; | 214 | + topoMapFactory = tmFactory; |
212 | return this; | 215 | return this; |
213 | } | 216 | } |
214 | 217 | ||
215 | /** | 218 | /** |
216 | - * Builds the UI extension. | 219 | + * Builds the user interface extension. |
217 | * | 220 | * |
218 | * @return UI extension instance | 221 | * @return UI extension instance |
219 | */ | 222 | */ |
220 | public UiExtension build() { | 223 | public UiExtension build() { |
221 | - return new UiExtension(classLoader, resourcePath, views, | 224 | + return new UiExtension(classLoader, resourcePath, viewList, |
222 | messageHandlerFactory, topoOverlayFactory, | 225 | messageHandlerFactory, topoOverlayFactory, |
223 | topoMapFactory); | 226 | topoMapFactory); |
224 | } | 227 | } |
225 | - | ||
226 | } | 228 | } |
227 | - | ||
228 | } | 229 | } | ... | ... |
... | @@ -25,19 +25,19 @@ public interface UiExtensionService { | ... | @@ -25,19 +25,19 @@ public interface UiExtensionService { |
25 | /** | 25 | /** |
26 | * Registers the specified user interface extension. | 26 | * Registers the specified user interface extension. |
27 | * | 27 | * |
28 | - * @param extension GUI extension to register | 28 | + * @param extension UI extension to register |
29 | */ | 29 | */ |
30 | void register(UiExtension extension); | 30 | void register(UiExtension extension); |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Unregisters the specified user interface extension. | 33 | * Unregisters the specified user interface extension. |
34 | * | 34 | * |
35 | - * @param extension GUI extension to unregister | 35 | + * @param extension UI extension to unregister |
36 | */ | 36 | */ |
37 | void unregister(UiExtension extension); | 37 | void unregister(UiExtension extension); |
38 | 38 | ||
39 | /** | 39 | /** |
40 | - * Returns the list of user interface extensions. | 40 | + * Returns the list of registered user interface extensions. |
41 | * | 41 | * |
42 | * @return list of extensions | 42 | * @return list of extensions |
43 | */ | 43 | */ |
... | @@ -47,7 +47,7 @@ public interface UiExtensionService { | ... | @@ -47,7 +47,7 @@ public interface UiExtensionService { |
47 | * Returns the user interface extension that contributed the specified view. | 47 | * Returns the user interface extension that contributed the specified view. |
48 | * | 48 | * |
49 | * @param viewId view identifier | 49 | * @param viewId view identifier |
50 | - * @return user interface extension | 50 | + * @return contributing user interface extension |
51 | */ | 51 | */ |
52 | UiExtension getViewExtension(String viewId); | 52 | UiExtension getViewExtension(String viewId); |
53 | } | 53 | } | ... | ... |
... | @@ -154,16 +154,16 @@ public abstract class UiMessageHandler { | ... | @@ -154,16 +154,16 @@ public abstract class UiMessageHandler { |
154 | } | 154 | } |
155 | 155 | ||
156 | /** | 156 | /** |
157 | - * Returns the user interface connection with which this handler was primed. | 157 | + * Returns the service directory with which this handler was primed. |
158 | * | 158 | * |
159 | - * @return user interface connection | 159 | + * @return service directory |
160 | */ | 160 | */ |
161 | public ServiceDirectory directory() { | 161 | public ServiceDirectory directory() { |
162 | return directory; | 162 | return directory; |
163 | } | 163 | } |
164 | 164 | ||
165 | /** | 165 | /** |
166 | - * Returns implementation of the specified service class. | 166 | + * Returns an implementation of the specified service class. |
167 | * | 167 | * |
168 | * @param serviceClass service class | 168 | * @param serviceClass service class |
169 | * @param <T> type of service | 169 | * @param <T> type of service | ... | ... |
... | @@ -23,6 +23,8 @@ import java.util.Set; | ... | @@ -23,6 +23,8 @@ import java.util.Set; |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * Service for managing {@link UiTopoLayout} instances. | 25 | * Service for managing {@link UiTopoLayout} instances. |
26 | + * Those instances are used in conjunction with modeling the region-based | ||
27 | + * topology views. | ||
26 | */ | 28 | */ |
27 | public interface UiTopoLayoutService { | 29 | public interface UiTopoLayoutService { |
28 | 30 | ||
... | @@ -45,7 +47,7 @@ public interface UiTopoLayoutService { | ... | @@ -45,7 +47,7 @@ public interface UiTopoLayoutService { |
45 | * Adds a layout to the system or updates an existing one. | 47 | * Adds a layout to the system or updates an existing one. |
46 | * | 48 | * |
47 | * @param layout the layout to add or update | 49 | * @param layout the layout to add or update |
48 | - * @return an indication of success | 50 | + * @return true if added; false if updated |
49 | */ | 51 | */ |
50 | boolean addLayout(UiTopoLayout layout); | 52 | boolean addLayout(UiTopoLayout layout); |
51 | 53 | ||
... | @@ -87,7 +89,7 @@ public interface UiTopoLayoutService { | ... | @@ -87,7 +89,7 @@ public interface UiTopoLayoutService { |
87 | * Removes a layout from the system. | 89 | * Removes a layout from the system. |
88 | * | 90 | * |
89 | * @param layout the layout to remove | 91 | * @param layout the layout to remove |
90 | - * @return an indication of success | 92 | + * @return true if removed; false if no longer registered |
91 | */ | 93 | */ |
92 | boolean removeLayout(UiTopoLayout layout); | 94 | boolean removeLayout(UiTopoLayout layout); |
93 | 95 | ... | ... |
... | @@ -17,12 +17,13 @@ | ... | @@ -17,12 +17,13 @@ |
17 | package org.onosproject.ui; | 17 | package org.onosproject.ui; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | - * Represents user interface topology view overlay. | 20 | + * Represents a geographically-based map to be used in the user interface |
21 | + * topology view. Instances of this class are immutable. | ||
21 | */ | 22 | */ |
22 | public class UiTopoMap { | 23 | public class UiTopoMap { |
23 | 24 | ||
24 | private final String id; | 25 | private final String id; |
25 | - private final String description; | 26 | + private final String desc; |
26 | private final String filePath; | 27 | private final String filePath; |
27 | private final double scale; | 28 | private final double scale; |
28 | 29 | ||
... | @@ -31,13 +32,13 @@ public class UiTopoMap { | ... | @@ -31,13 +32,13 @@ public class UiTopoMap { |
31 | * Creates a new topology map. | 32 | * Creates a new topology map. |
32 | * | 33 | * |
33 | * @param id map identifier | 34 | * @param id map identifier |
34 | - * @param description map description | 35 | + * @param desc map description |
35 | - * @param filePath map filePath, | 36 | + * @param filePath map filePath |
36 | - * @param scale map scale, | 37 | + * @param scale map scale |
37 | */ | 38 | */ |
38 | - public UiTopoMap(String id, String description, String filePath, double scale) { | 39 | + public UiTopoMap(String id, String desc, String filePath, double scale) { |
39 | this.id = id; | 40 | this.id = id; |
40 | - this.description = description; | 41 | + this.desc = desc; |
41 | this.filePath = filePath; | 42 | this.filePath = filePath; |
42 | this.scale = scale; | 43 | this.scale = scale; |
43 | } | 44 | } |
... | @@ -47,8 +48,8 @@ public class UiTopoMap { | ... | @@ -47,8 +48,8 @@ public class UiTopoMap { |
47 | * | 48 | * |
48 | * @return the identifier | 49 | * @return the identifier |
49 | */ | 50 | */ |
50 | - public String getId() { | 51 | + public String id() { |
51 | - return this.id; | 52 | + return id; |
52 | } | 53 | } |
53 | 54 | ||
54 | /** | 55 | /** |
... | @@ -56,8 +57,8 @@ public class UiTopoMap { | ... | @@ -56,8 +57,8 @@ public class UiTopoMap { |
56 | * | 57 | * |
57 | * @return the description | 58 | * @return the description |
58 | */ | 59 | */ |
59 | - public String getDescription() { | 60 | + public String description() { |
60 | - return this.description; | 61 | + return desc; |
61 | } | 62 | } |
62 | 63 | ||
63 | /** | 64 | /** |
... | @@ -65,8 +66,8 @@ public class UiTopoMap { | ... | @@ -65,8 +66,8 @@ public class UiTopoMap { |
65 | * | 66 | * |
66 | * @return the filePath | 67 | * @return the filePath |
67 | */ | 68 | */ |
68 | - public String getFilePath() { | 69 | + public String filePath() { |
69 | - return this.filePath; | 70 | + return filePath; |
70 | } | 71 | } |
71 | 72 | ||
72 | /** | 73 | /** |
... | @@ -74,8 +75,7 @@ public class UiTopoMap { | ... | @@ -74,8 +75,7 @@ public class UiTopoMap { |
74 | * | 75 | * |
75 | * @return the scale | 76 | * @return the scale |
76 | */ | 77 | */ |
77 | - public double getScale() { | 78 | + public double scale() { |
78 | - return this.scale; | 79 | + return scale; |
79 | } | 80 | } |
80 | - | ||
81 | } | 81 | } | ... | ... |
... | @@ -19,15 +19,15 @@ package org.onosproject.ui; | ... | @@ -19,15 +19,15 @@ package org.onosproject.ui; |
19 | import java.util.List; | 19 | import java.util.List; |
20 | 20 | ||
21 | /** | 21 | /** |
22 | - * Abstraction of an entity capable of producing one or more topology | 22 | + * Abstraction of an entity capable of producing one or more geographic-based |
23 | - * map topologies. | 23 | + * maps for the topology view. |
24 | */ | 24 | */ |
25 | public interface UiTopoMapFactory { | 25 | public interface UiTopoMapFactory { |
26 | 26 | ||
27 | /** | 27 | /** |
28 | - * Produces a list of new maps. | 28 | + * Produces a list of maps to be added to the topology view. |
29 | * | 29 | * |
30 | - * @return list of new maps | 30 | + * @return list of maps |
31 | */ | 31 | */ |
32 | - List<UiTopoMap> newMaps(); | 32 | + List<UiTopoMap> geoMaps(); |
33 | } | 33 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -27,6 +27,10 @@ import java.util.Map; | ... | @@ -27,6 +27,10 @@ import java.util.Map; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * Represents user interface topology view overlay. | 29 | * Represents user interface topology view overlay. |
30 | + * <p> | ||
31 | + * This base class does little more than provide a logger and an identifier. | ||
32 | + * Subclasses will probably want to override some or all of the base methods | ||
33 | + * to do useful things during the life-cycle of the overlay. | ||
30 | */ | 34 | */ |
31 | public class UiTopoOverlay { | 35 | public class UiTopoOverlay { |
32 | 36 | ||
... | @@ -40,7 +44,8 @@ public class UiTopoOverlay { | ... | @@ -40,7 +44,8 @@ public class UiTopoOverlay { |
40 | private boolean isActive = false; | 44 | private boolean isActive = false; |
41 | 45 | ||
42 | /** | 46 | /** |
43 | - * Creates a new user interface topology view overlay descriptor. | 47 | + * Creates a new user interface topology view overlay descriptor, with |
48 | + * the given identifier. | ||
44 | * | 49 | * |
45 | * @param id overlay identifier | 50 | * @param id overlay identifier |
46 | */ | 51 | */ |
... | @@ -139,7 +144,7 @@ public class UiTopoOverlay { | ... | @@ -139,7 +144,7 @@ public class UiTopoOverlay { |
139 | * @param event the link event | 144 | * @param event the link event |
140 | * @return map of additional key/value pairs to be added to the JSON event | 145 | * @return map of additional key/value pairs to be added to the JSON event |
141 | * @deprecated this is a temporary addition for Goldeneye (1.6) release, | 146 | * @deprecated this is a temporary addition for Goldeneye (1.6) release, |
142 | - * and expected to be replaced in the Hummingbird (1.7) release | 147 | + * and expected to be replaced in the Ibis (1.8) release |
143 | */ | 148 | */ |
144 | @Deprecated | 149 | @Deprecated |
145 | public Map<String, String> additionalLinkData(LinkEvent event) { | 150 | public Map<String, String> additionalLinkData(LinkEvent event) { | ... | ... |
... | @@ -20,12 +20,12 @@ import com.google.common.base.MoreObjects; | ... | @@ -20,12 +20,12 @@ import com.google.common.base.MoreObjects; |
20 | import java.util.Objects; | 20 | import java.util.Objects; |
21 | 21 | ||
22 | /** | 22 | /** |
23 | - * Represents user interface view addition. | 23 | + * Represents a user interface view addition. |
24 | */ | 24 | */ |
25 | public class UiView { | 25 | public class UiView { |
26 | 26 | ||
27 | /** | 27 | /** |
28 | - * Designates navigation menu category. | 28 | + * Designates the navigation menu category. |
29 | */ | 29 | */ |
30 | public enum Category { | 30 | public enum Category { |
31 | /** | 31 | /** |
... | @@ -57,7 +57,7 @@ public class UiView { | ... | @@ -57,7 +57,7 @@ public class UiView { |
57 | } | 57 | } |
58 | 58 | ||
59 | /** | 59 | /** |
60 | - * Returns display label for the category. | 60 | + * Returns the display label for the category. |
61 | * | 61 | * |
62 | * @return display label | 62 | * @return display label |
63 | */ | 63 | */ |
... | @@ -87,6 +87,9 @@ public class UiView { | ... | @@ -87,6 +87,9 @@ public class UiView { |
87 | * Creates a new user interface view descriptor. The navigation item | 87 | * Creates a new user interface view descriptor. The navigation item |
88 | * will appear in the navigation menu under the specified category, | 88 | * will appear in the navigation menu under the specified category, |
89 | * with the specified icon adornment. | 89 | * with the specified icon adornment. |
90 | + * <p> | ||
91 | + * Note: see the {@code glyphMapping} structure in {@code icon.js} for | ||
92 | + * valid icon identifiers. | ||
90 | * | 93 | * |
91 | * @param category view category | 94 | * @param category view category |
92 | * @param id view identifier | 95 | * @param id view identifier |
... | @@ -112,7 +115,7 @@ public class UiView { | ... | @@ -112,7 +115,7 @@ public class UiView { |
112 | /** | 115 | /** |
113 | * Returns the view identifier. | 116 | * Returns the view identifier. |
114 | * | 117 | * |
115 | - * @return view id | 118 | + * @return view ID |
116 | */ | 119 | */ |
117 | public String id() { | 120 | public String id() { |
118 | return id; | 121 | return id; |
... | @@ -128,7 +131,7 @@ public class UiView { | ... | @@ -128,7 +131,7 @@ public class UiView { |
128 | } | 131 | } |
129 | 132 | ||
130 | /** | 133 | /** |
131 | - * Returns the icon ID. | 134 | + * Returns the icon identifier. |
132 | * | 135 | * |
133 | * @return icon ID | 136 | * @return icon ID |
134 | */ | 137 | */ |
... | @@ -149,7 +152,7 @@ public class UiView { | ... | @@ -149,7 +152,7 @@ public class UiView { |
149 | if (obj == null || getClass() != obj.getClass()) { | 152 | if (obj == null || getClass() != obj.getClass()) { |
150 | return false; | 153 | return false; |
151 | } | 154 | } |
152 | - final UiView other = (UiView) obj; | 155 | + UiView other = (UiView) obj; |
153 | return Objects.equals(this.id, other.id); | 156 | return Objects.equals(this.id, other.id); |
154 | } | 157 | } |
155 | 158 | ... | ... |
... | @@ -18,77 +18,10 @@ package org.onosproject.ui.topo; | ... | @@ -18,77 +18,10 @@ package org.onosproject.ui.topo; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Defines string constants used in the Topology View of the ONOS GUI. | 20 | * Defines string constants used in the Topology View of the ONOS GUI. |
21 | - * <p> | ||
22 | - * See also: | ||
23 | - * <ul> | ||
24 | - * <li> https://wiki.onosproject.org/display/ONOS/UI+Service+-+GlyphService </li> | ||
25 | - * </ul> | ||
26 | */ | 21 | */ |
27 | public final class TopoConstants { | 22 | public final class TopoConstants { |
28 | 23 | ||
29 | /** | 24 | /** |
30 | - * Defines constants for standard glyph identifiers. | ||
31 | - */ | ||
32 | - public static final class Glyphs { | ||
33 | - public static final String BIRD = "bird"; | ||
34 | - | ||
35 | - public static final String UNKNOWN = "m_unknown"; | ||
36 | - public static final String QUERY = "query"; | ||
37 | - public static final String NODE = "node"; | ||
38 | - | ||
39 | - public static final String SWITCH = "m_switch"; | ||
40 | - public static final String ROUTER = "router"; | ||
41 | - public static final String ROADM = "m_roadm"; | ||
42 | - public static final String OTN = "otn"; | ||
43 | - public static final String ROADM_OTN = "roadm_otn"; | ||
44 | - public static final String FIBER_SWITCH = "fiber_switch"; | ||
45 | - public static final String MICROWAVE = "microwave"; | ||
46 | - | ||
47 | - public static final String ENDSTATION = "m_endstation"; | ||
48 | - public static final String BGP_SPEAKER = "bgpSpeaker"; | ||
49 | - | ||
50 | - public static final String CHAIN = "chain"; | ||
51 | - public static final String CROWN = "crown"; | ||
52 | - public static final String LOCK = "lock"; | ||
53 | - public static final String TOPO = "topo"; | ||
54 | - public static final String REFRESH = "refresh"; | ||
55 | - public static final String GARBAGE = "garbage"; | ||
56 | - | ||
57 | - public static final String FLOW_TABLE = "flowTable"; | ||
58 | - public static final String PORT_TABLE = "portTable"; | ||
59 | - public static final String GROUP_TABLE = "groupTable"; | ||
60 | - public static final String METER_TABLE = "meterTable"; | ||
61 | - | ||
62 | - public static final String SUMMARY = "m_summary"; | ||
63 | - public static final String DETAILS = "m_details"; | ||
64 | - public static final String PORTS = "m_ports"; | ||
65 | - public static final String MAP = "m_map"; | ||
66 | - public static final String CYCLE_LABELS = "m_cycleLabels"; | ||
67 | - public static final String OBLIQUE = "m_oblique"; | ||
68 | - public static final String FILTERS = "m_filters"; | ||
69 | - public static final String RESET_ZOOM = "m_resetZoom"; | ||
70 | - public static final String RELATED_INTENTS = "m_relatedIntents"; | ||
71 | - public static final String NEXT = "m_next"; | ||
72 | - public static final String PREV = "m_prev"; | ||
73 | - public static final String INTENT_TRAFFIC = "m_intentTraffic"; | ||
74 | - public static final String ALL_TRAFFIC = "m_allTraffic"; | ||
75 | - public static final String FLOWS = "m_flows"; | ||
76 | - public static final String EQ_MASTER = "m_eqMaster"; | ||
77 | - | ||
78 | - public static final String UI_ATTACHED = "m_uiAttached"; | ||
79 | - public static final String CHECK_MARK = "checkMark"; | ||
80 | - public static final String X_MARK = "m_xMark"; | ||
81 | - public static final String TRIANGLE_UP = "triangleUp"; | ||
82 | - public static final String TRIANGLE_DOWN = "triangleDown"; | ||
83 | - public static final String PLUS = "plus"; | ||
84 | - public static final String MINUS = "minus"; | ||
85 | - public static final String PLAY = "play"; | ||
86 | - public static final String STOP = "stop"; | ||
87 | - | ||
88 | - public static final String CLOUD = "m_cloud"; | ||
89 | - } | ||
90 | - | ||
91 | - /** | ||
92 | * Defines constants for property names on the default summary and | 25 | * Defines constants for property names on the default summary and |
93 | * details panels. | 26 | * details panels. |
94 | */ | 27 | */ |
... | @@ -142,5 +75,4 @@ public final class TopoConstants { | ... | @@ -142,5 +75,4 @@ public final class TopoConstants { |
142 | public static final ButtonId SHOW_METER_VIEW = | 75 | public static final ButtonId SHOW_METER_VIEW = |
143 | new ButtonId("showMeterView"); | 76 | new ButtonId("showMeterView"); |
144 | } | 77 | } |
145 | - | ||
146 | } | 78 | } | ... | ... |
... | @@ -74,14 +74,14 @@ class MapSelectorMessageHandler extends UiMessageHandler { | ... | @@ -74,14 +74,14 @@ class MapSelectorMessageHandler extends UiMessageHandler { |
74 | UiTopoMapFactory mapFactory = ext.topoMapFactory(); | 74 | UiTopoMapFactory mapFactory = ext.topoMapFactory(); |
75 | 75 | ||
76 | if (mapFactory != null) { | 76 | if (mapFactory != null) { |
77 | - List<UiTopoMap> topoMaps = mapFactory.newMaps(); | 77 | + List<UiTopoMap> topoMaps = mapFactory.geoMaps(); |
78 | 78 | ||
79 | topoMaps.forEach(m -> { | 79 | topoMaps.forEach(m -> { |
80 | - maps.set(m.getId(), objectNode().put(MAP_ID, m.getId()) | 80 | + maps.set(m.id(), objectNode().put(MAP_ID, m.id()) |
81 | - .put(DESCRIPTION, m.getDescription()) | 81 | + .put(DESCRIPTION, m.description()) |
82 | - .put(FILE_PATH, m.getFilePath()) | 82 | + .put(FILE_PATH, m.filePath()) |
83 | - .put(SCALE, m.getScale())); | 83 | + .put(SCALE, m.scale())); |
84 | - order.add(m.getId()); | 84 | + order.add(m.id()); |
85 | }); | 85 | }); |
86 | } | 86 | } |
87 | }); | 87 | }); | ... | ... |
... | @@ -23,6 +23,7 @@ import org.onlab.osgi.ServiceDirectory; | ... | @@ -23,6 +23,7 @@ import org.onlab.osgi.ServiceDirectory; |
23 | import org.onlab.osgi.ServiceNotFoundException; | 23 | import org.onlab.osgi.ServiceNotFoundException; |
24 | import org.onosproject.cluster.ClusterService; | 24 | import org.onosproject.cluster.ClusterService; |
25 | import org.onosproject.cluster.ControllerNode; | 25 | import org.onosproject.cluster.ControllerNode; |
26 | +import org.onosproject.ui.GlyphConstants; | ||
26 | import org.onosproject.ui.UiConnection; | 27 | import org.onosproject.ui.UiConnection; |
27 | import org.onosproject.ui.UiExtensionService; | 28 | import org.onosproject.ui.UiExtensionService; |
28 | import org.onosproject.ui.UiMessageHandler; | 29 | import org.onosproject.ui.UiMessageHandler; |
... | @@ -32,7 +33,6 @@ import org.onosproject.ui.UiTopoOverlayFactory; | ... | @@ -32,7 +33,6 @@ import org.onosproject.ui.UiTopoOverlayFactory; |
32 | import org.onosproject.ui.impl.topo.UiTopoSession; | 33 | import org.onosproject.ui.impl.topo.UiTopoSession; |
33 | import org.onosproject.ui.impl.topo.model.UiSharedTopologyModel; | 34 | import org.onosproject.ui.impl.topo.model.UiSharedTopologyModel; |
34 | import org.onosproject.ui.model.topo.UiTopoLayout; | 35 | import org.onosproject.ui.model.topo.UiTopoLayout; |
35 | -import org.onosproject.ui.topo.TopoConstants; | ||
36 | import org.slf4j.Logger; | 36 | import org.slf4j.Logger; |
37 | import org.slf4j.LoggerFactory; | 37 | import org.slf4j.LoggerFactory; |
38 | 38 | ||
... | @@ -293,7 +293,7 @@ public class UiWebSocket | ... | @@ -293,7 +293,7 @@ public class UiWebSocket |
293 | ObjectNode instance = mapper.createObjectNode() | 293 | ObjectNode instance = mapper.createObjectNode() |
294 | .put(ID, node.id().toString()) | 294 | .put(ID, node.id().toString()) |
295 | .put(IP, node.ip().toString()) | 295 | .put(IP, node.ip().toString()) |
296 | - .put(TopoConstants.Glyphs.UI_ATTACHED, | 296 | + .put(GlyphConstants.UI_ATTACHED, |
297 | node.equals(service.getLocalNode())); | 297 | node.equals(service.getLocalNode())); |
298 | instances.add(instance); | 298 | instances.add(instance); |
299 | } | 299 | } | ... | ... |
-
Please register or login to post a comment