blob: 02b46edd623b6ae40f6e6b40080a509be2c1ae56 [file] [log] [blame]
Thomas Vachuska7d638d32014-11-07 10:24:43 -08001/*
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 */
16package org.onlab.onos.gui;
17
18import org.eclipse.jetty.websocket.WebSocket;
19import org.eclipse.jetty.websocket.WebSocketServlet;
20import org.onlab.osgi.DefaultServiceDirectory;
21import org.onlab.osgi.ServiceDirectory;
22
23import javax.servlet.http.HttpServletRequest;
24
25/**
26 * Web socket servlet capable of creating various sockets for the user interface.
27 */
28public class GuiWebSocketServlet extends WebSocketServlet {
29
30 private ServiceDirectory directory = new DefaultServiceDirectory();
31
32 @Override
33 public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
34
35 return new TopologyWebSocket(directory);
36 }
37
38}