blob: ac8303841454790330cef2c6e99449cada1767e5 [file] [log] [blame]
Esin Karaman971fb7f2017-12-28 13:44:52 +00001/*
2 * Copyright 2018-present Open Networking Foundation
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 */
17
18package org.onosproject.drivers.bmv2.api;
19
20import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroup;
21import org.onosproject.drivers.bmv2.api.runtime.Bmv2RuntimeException;
22import org.onosproject.net.DeviceId;
23
24import java.util.List;
25
26/**
27 * An agent to control a BMv2 device.
28 */
29public interface Bmv2DeviceAgent {
30
31 /**
32 * Returns the device ID of this agent.
33 *
34 * @return a device id
35 */
36 DeviceId deviceId();
37
38 /**
39 * Creates a multicast group and related entries atomically on a BMv2 device.
40 * If successful returns modified version of the group object that is filled with BMv2 switch-specific identifiers
41 * of the created group and nodes; throws Bmv2RuntimeException otherwise.
42 *
43 * @param preGroup Bmv2PreGroup
44 * @return modified version of preGroup param.
45 * @throws Bmv2RuntimeException if any error occurs
46 */
47 Bmv2PreGroup writePreGroup(Bmv2PreGroup preGroup) throws Bmv2RuntimeException;
48
49 /**
50 * Deletes a multicast group and all associated nodes from a BMV2 device.
51 *
52 * @param preGroup Bmv2PreGroup
53 * @throws Bmv2RuntimeException if any error occurs
54 */
55 void deletePreGroup(Bmv2PreGroup preGroup) throws Bmv2RuntimeException;
56
57 /**
58 * Returns all BMv2 PRE groups.
59 *
60 * @return list of PRE groups.
61 * @throws Bmv2RuntimeException if any error occurs
62 */
63 List<Bmv2PreGroup> getPreGroups() throws Bmv2RuntimeException;
64}