blob: 4a0df589c9b5661dddf9ffe49daad03699305d83 [file] [log] [blame]
Jian Lie87c2712019-09-11 11:15:16 +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.openstacknetworking.api;
17
18import org.onosproject.core.ApplicationId;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.group.GroupBucket;
21import org.onosproject.net.group.GroupDescription;
22
23import java.util.List;
24
25/**
26 * Service for setting group rules.
27 */
28public interface OpenstackGroupRuleService {
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 GroupDescription.Type type, List<GroupBucket> buckets, boolean install);
42
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 * With install flag true, this method will add buckets to existing buckets,
55 * while with install flag false, this method will remove buckets from
56 * existing buckets.
57 *
58 * @param appId application ID
59 * @param deviceId device ID
60 * @param groupId group ID
61 * @param buckets a list of group buckets
62 * @param install true for buckets addition, false for buckets removal
63 */
64 void setBuckets(ApplicationId appId, DeviceId deviceId, int groupId,
65 List<GroupBucket> buckets, boolean install);
66
67 /**
68 * Configures buckets.
69 *
70 * @param appId application ID
71 * @param deviceId device ID
72 * @param groupId group ID
73 * @param buckets a lit of group buckets
74 */
75 void setBuckets(ApplicationId appId, DeviceId deviceId, int groupId,
76 List<GroupBucket> buckets);
77}