ONOS-314 Added ability to export JSON via GUI rest.
Change-Id: I8cc6011f54ce6a3fb50916a74cabb7234b04ef39
Showing
3 changed files
with
10 additions
and
37 deletions
| 1 | -/* | ||
| 2 | - * Copyright 2014 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 | -package org.onlab.onos.gui; | ||
| 17 | - | ||
| 18 | -import org.onlab.rest.BaseResource; | ||
| 19 | - | ||
| 20 | -import javax.ws.rs.DefaultValue; | ||
| 21 | -import javax.ws.rs.GET; | ||
| 22 | -import javax.ws.rs.Path; | ||
| 23 | -import javax.ws.rs.QueryParam; | ||
| 24 | -import javax.ws.rs.core.Response; | ||
| 25 | - | ||
| 26 | -/** | ||
| 27 | - * Simple example of a GUI JAX-RS resource. | ||
| 28 | - */ | ||
| 29 | -@Path("greet") | ||
| 30 | -public class GreetResource extends BaseResource { | ||
| 31 | - | ||
| 32 | - @GET | ||
| 33 | - public Response yo(@QueryParam("name") @DefaultValue("dude") String name) { | ||
| 34 | - return Response.ok("Yo!!!").build(); | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | -} |
This diff is collapsed. Click to expand it.
| ... | @@ -66,6 +66,7 @@ import org.slf4j.LoggerFactory; | ... | @@ -66,6 +66,7 @@ import org.slf4j.LoggerFactory; |
| 66 | 66 | ||
| 67 | import java.text.DecimalFormat; | 67 | import java.text.DecimalFormat; |
| 68 | import java.util.ArrayList; | 68 | import java.util.ArrayList; |
| 69 | +import java.util.Collections; | ||
| 69 | import java.util.HashMap; | 70 | import java.util.HashMap; |
| 70 | import java.util.HashSet; | 71 | import java.util.HashSet; |
| 71 | import java.util.Iterator; | 72 | import java.util.Iterator; |
| ... | @@ -129,6 +130,15 @@ public abstract class TopologyViewMessages { | ... | @@ -129,6 +130,15 @@ public abstract class TopologyViewMessages { |
| 129 | private static Map<String, ObjectNode> metaUi = new ConcurrentHashMap<>(); | 130 | private static Map<String, ObjectNode> metaUi = new ConcurrentHashMap<>(); |
| 130 | 131 | ||
| 131 | /** | 132 | /** |
| 133 | + * Returns read-only view of the meta-ui information. | ||
| 134 | + * | ||
| 135 | + * @return map of id to meta-ui mementos | ||
| 136 | + */ | ||
| 137 | + static Map<String, ObjectNode> getMetaUi() { | ||
| 138 | + return Collections.unmodifiableMap(metaUi); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + /** | ||
| 132 | * Creates a messaging facility for creating messages for topology viewer. | 142 | * Creates a messaging facility for creating messages for topology viewer. |
| 133 | * | 143 | * |
| 134 | * @param directory service directory | 144 | * @param directory service directory | ... | ... |
-
Please register or login to post a comment