CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.ovsdb.controller.driver; |
| 17 | |
| 18 | import io.netty.channel.Channel; |
| 19 | |
YuanyouZhang | d06bb6b | 2015-08-05 16:59:07 +0800 | [diff] [blame] | 20 | import org.onosproject.ovsdb.rfc.jsonrpc.Callback; |
| 21 | |
| 22 | import com.fasterxml.jackson.databind.JsonNode; |
| 23 | |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 24 | /** |
| 25 | * Represents the driver side of an ovsdb node. This interface should never be |
| 26 | * exposed to consumers. |
| 27 | */ |
| 28 | public interface OvsdbProviderService { |
| 29 | /** |
| 30 | * Sets the ovsdb agent to be used. This method can only be called once. |
| 31 | * |
| 32 | * @param agent the agent to set. |
| 33 | */ |
| 34 | void setAgent(OvsdbAgent agent); |
| 35 | |
| 36 | /** |
| 37 | * Sets the associated Netty channel for this node. |
| 38 | * |
| 39 | * @param channel the Netty channel |
| 40 | */ |
| 41 | void setChannel(Channel channel); |
| 42 | |
| 43 | /** |
| 44 | * Announces to the ovsdb agent that this node has added. |
| 45 | */ |
| 46 | void nodeAdded(); |
| 47 | |
| 48 | /** |
| 49 | * Announces to the ovsdb agent that this node has removed. |
| 50 | */ |
| 51 | void nodeRemoved(); |
| 52 | |
| 53 | /** |
| 54 | * Sets whether the node is connected. |
| 55 | * |
| 56 | * @param connected whether the node is connected |
| 57 | */ |
| 58 | void setConnection(boolean connected); |
YuanyouZhang | d06bb6b | 2015-08-05 16:59:07 +0800 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * Processes result from ovsdb. |
| 62 | * |
| 63 | * @param response JsonNode response from ovsdb |
| 64 | */ |
| 65 | void processResult(JsonNode response); |
| 66 | |
| 67 | /** |
| 68 | * processes request from ovsdb. |
| 69 | * |
| 70 | * @param request JsonNode request from ovsdb |
| 71 | */ |
| 72 | void processRequest(JsonNode request); |
| 73 | |
| 74 | /** |
| 75 | * Sets call back. |
| 76 | * |
| 77 | * @param monitorCallback the callback to set |
| 78 | */ |
| 79 | void setCallback(Callback monitorCallback); |
| 80 | |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 81 | } |