blob: ead7b0dcd387e253184143573848aa9f5f9f0b06 [file] [log] [blame]
Thomas Vachuska3553b302015-03-07 14:49:43 -08001/*
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 */
16package org.onosproject.ui;
17
18import com.fasterxml.jackson.databind.node.ObjectNode;
19
20/**
21 * Abstraction of a user interface session connection.
22 */
23public interface UiConnection {
24
25 /**
26 * Sends the specified JSON message to the user interface client.
27 *
28 * @param message message to send
29 */
30 void sendMessage(ObjectNode message);
31
Thomas Vachuskab6acc7b2015-03-11 09:11:21 -070032 /**
33 * Composes a message into JSON and sends it to the user interface client.
34 *
35 * @param type message type
36 * @param sid message sequence number
37 * @param payload message payload
38 */
Simon Huntda580882015-05-12 20:58:18 -070039 // TODO: remove sid parameter
Thomas Vachuskab6acc7b2015-03-11 09:11:21 -070040 void sendMessage(String type, long sid, ObjectNode payload);
41
Thomas Vachuska3553b302015-03-07 14:49:43 -080042}