Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 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.net.group; |
| 17 | |
| 18 | import org.onosproject.core.ApplicationId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | |
| 21 | /** |
| 22 | * ONOS representation of group description that is used to create |
| 23 | * a group. It contains immutable properties of a ONOS group construct |
| 24 | * such as "type", "DeviceId", "appCookie", "appId" and "buckets" |
| 25 | */ |
| 26 | public interface GroupDescription { |
| 27 | /** |
| 28 | * Types of the group supported by ONOS. |
| 29 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 30 | enum Type { |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 31 | /** |
| 32 | * Load-balancing among different buckets in a group. |
| 33 | */ |
| 34 | SELECT, |
| 35 | /** |
| 36 | * Single Bucket Group. |
| 37 | */ |
| 38 | INDIRECT, |
| 39 | /** |
| 40 | * Multicast to all buckets in a group. |
| 41 | */ |
| 42 | ALL, |
| 43 | /** |
Carmelo Cascone | 5079a7f | 2019-04-16 17:33:31 -0700 | [diff] [blame] | 44 | * Similar to {@link Type#ALL} but used for cloning of packets |
| 45 | * independently of the egress decision (singleton treatment or other |
| 46 | * group). |
| 47 | */ |
| 48 | CLONE, |
| 49 | /** |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 50 | * Uses the first live bucket in a group. |
| 51 | */ |
| 52 | FAILOVER |
| 53 | } |
| 54 | |
| 55 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 56 | * Returns type of a group object. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 57 | * |
| 58 | * @return GroupType group type |
| 59 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 60 | Type type(); |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 61 | |
| 62 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 63 | * Returns device identifier on which this group object is created. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 64 | * |
| 65 | * @return DeviceId device identifier |
| 66 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 67 | DeviceId deviceId(); |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 70 | * Returns application identifier that has created this group object. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 71 | * |
| 72 | * @return ApplicationId application identifier |
| 73 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 74 | ApplicationId appId(); |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 75 | |
| 76 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 77 | * Returns application cookie associated with a group object. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 78 | * |
| 79 | * @return GroupKey application cookie |
| 80 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 81 | GroupKey appCookie(); |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 82 | |
| 83 | /** |
Saurav Das | 100e3b8 | 2015-04-30 11:12:10 -0700 | [diff] [blame] | 84 | * Returns groupId passed in by caller. |
| 85 | * |
| 86 | * @return Integer group id passed in by caller. May be null if caller |
Yuta HIGUCHI | 013688c | 2016-08-09 16:57:11 -0700 | [diff] [blame] | 87 | * passed in null to let groupService determine the group id. |
Saurav Das | 100e3b8 | 2015-04-30 11:12:10 -0700 | [diff] [blame] | 88 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 89 | Integer givenGroupId(); |
Saurav Das | 100e3b8 | 2015-04-30 11:12:10 -0700 | [diff] [blame] | 90 | |
| 91 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 92 | * Returns group buckets of a group. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 93 | * |
| 94 | * @return GroupBuckets immutable list of group bucket |
| 95 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 96 | GroupBuckets buckets(); |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 97 | } |