blob: dcc265e29315054ba08dc106b3e44d69838c67a0 [file] [log] [blame]
Hyunsun Moon90163ba2016-10-12 13:35:14 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon90163ba2016-10-12 13:35:14 -07003 *
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.ofagent.api;
17
18import io.netty.channel.Channel;
19import org.projectfloodlight.openflow.protocol.OFControllerRole;
20
21import java.util.Set;
22
23/**
24 * Service for administering the OF role of multiple controllers.
25 */
26public interface OFControllerRoleService {
27
28 /**
29 * Adds a new controller channel.
30 * EQUAL role is set by default.
31 *
32 * @param channel openflow channel
33 */
34 void addControllerChannel(Channel channel);
35
36 /**
37 * Deletes the controller channel.
38 *
39 * @param channel openflow channel
40 */
41 void deleteControllerChannel(Channel channel);
42
43 /**
44 * Returns controller channels.
45 *
46 * @return set of controller channels
47 */
48 Set<Channel> controllerChannels();
49
50 /**
51 * Sets a role of the controller with a given channel.
52 *
53 * @param channel openflow channel
54 * @param role role of the controller
55 */
56 void setRole(Channel channel, OFControllerRole role);
57
58 /**
59 * Returns a role of the controller with a given channel.
60 *
61 * @param channel openflow channel
62 * @return role of the controller
63 */
64 OFControllerRole role(Channel channel);
65}