blob: 7acf8b6492e950dd673b8945e81b42323638e9ed [file] [log] [blame]
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08003 *
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.net.group;
17
18import org.onosproject.core.ApplicationId;
19import 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 */
26public interface GroupDescription {
27 /**
28 * Types of the group supported by ONOS.
29 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070030 enum Type {
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080031 /**
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 /**
44 * Uses the first live bucket in a group.
45 */
46 FAILOVER
47 }
48
49 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080050 * Returns type of a group object.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080051 *
52 * @return GroupType group type
53 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070054 Type type();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080055
56 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080057 * Returns device identifier on which this group object is created.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080058 *
59 * @return DeviceId device identifier
60 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070061 DeviceId deviceId();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080062
63 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080064 * Returns application identifier that has created this group object.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080065 *
66 * @return ApplicationId application identifier
67 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070068 ApplicationId appId();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080069
70 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080071 * Returns application cookie associated with a group object.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080072 *
73 * @return GroupKey application cookie
74 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070075 GroupKey appCookie();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080076
77 /**
Saurav Das100e3b82015-04-30 11:12:10 -070078 * Returns groupId passed in by caller.
79 *
80 * @return Integer group id passed in by caller. May be null if caller
81 * passed in null to let groupService determin the group id.
82 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070083 Integer givenGroupId();
Saurav Das100e3b82015-04-30 11:12:10 -070084
85 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080086 * Returns group buckets of a group.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080087 *
88 * @return GroupBuckets immutable list of group bucket
89 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070090 GroupBuckets buckets();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080091}