blob: 648ecd1ef3dc1bacd28068a174b12618cfee31b5 [file] [log] [blame]
Jian Li3bc6ef12017-05-04 21:51:41 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Jian Li3bc6ef12017-05-04 21:51:41 +09003 *
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 */
16package org.onosproject.mapping.web.gui;
17
18import com.fasterxml.jackson.databind.node.ObjectNode;
19import com.google.common.collect.ImmutableSet;
20import org.onosproject.ui.RequestHandler;
21import org.onosproject.ui.UiMessageHandler;
22import org.slf4j.Logger;
23import org.slf4j.LoggerFactory;
24
25import java.util.Collection;
26
27/**
28 * Mapping management UI topology-overlay message handler.
29 */
30public class MappingsTopoMessageHandler extends UiMessageHandler {
31
32 private static final String MAPPINGS_TOPO_DISPLAY_START = "mappingsTopoDisplayStart";
33 private static final String MAPPINGS_TOPO_DISPLAY_STOP = "mappingsTopoDisplayStop";
34
35 private final Logger log = LoggerFactory.getLogger(getClass());
36
37 @Override
38 protected Collection<RequestHandler> createRequestHandlers() {
39 return ImmutableSet.of(
40 new DisplayStartHandler(),
41 new DisplayStopHandler()
42 );
43 }
44
45 private final class DisplayStartHandler extends RequestHandler {
46
47 public DisplayStartHandler() {
48 super(MAPPINGS_TOPO_DISPLAY_START);
49 }
50
51 @Override
52 public void process(ObjectNode payload) {
53 log.debug("Start Display");
54 }
55 }
56
57 private final class DisplayStopHandler extends RequestHandler {
58
59 public DisplayStopHandler() {
60 super(MAPPINGS_TOPO_DISPLAY_STOP);
61 }
62
63 @Override
64 public void process(ObjectNode payload) {
65 log.debug("Stop Display");
66 }
67 }
68}