blob: d91b0bebd3486057ee72a108708c431401244ecb [file] [log] [blame]
Jian Li2cc2b632019-02-18 00:56:40 +09001/*
2 * Copyright 2019-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 */
16package org.onosproject.k8snetworking.api;
17
18import org.onosproject.core.ApplicationId;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.group.GroupBucket;
21import org.onosproject.net.group.GroupDescription.Type;
22
23import java.util.List;
24
25/**
26 * Service for setting group rules.
27 */
28public interface K8sGroupRuleService {
29
30 /**
31 * Configures the group table rule.
32 *
33 * @param appId application ID
34 * @param deviceId device ID
35 * @param groupId group ID
36 * @param type group type
37 * @param buckets a list of group buckets
38 * @param install true for rule addition, false for rule removal
39 */
40 void setRule(ApplicationId appId, DeviceId deviceId, int groupId,
41 Type type, List<GroupBucket> buckets, boolean install);
Jian Li4a7ce672019-04-09 15:20:25 +090042
43 /**
44 * Checks whether has the group in store with given device ID and group ID.
45 *
46 * @param deviceId device ID
47 * @param groupId group ID
48 * @return true if the group exists, false otherwise
49 */
50 boolean hasGroup(DeviceId deviceId, int groupId);
51
52 /**
53 * Configures buckets to the existing group.
54 *
55 * @param appId application ID
56 * @param deviceId device ID
57 * @param groupId group ID
58 * @param buckets a list of group buckets
59 * @param install true for buckets addition, false for buckets removal
60 */
61 void setBuckets(ApplicationId appId, DeviceId deviceId, int groupId,
62 List<GroupBucket> buckets, boolean install);
Jian Li2cc2b632019-02-18 00:56:40 +090063}