summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net/group/GroupDescription.java
blob: 671b9a546789feb862d2eada7a7e701c62b44801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
 * Copyright 2015 Open Networking Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.onosproject.net.group;

import org.onosproject.core.ApplicationId;
import org.onosproject.net.DeviceId;

/**
 * ONOS representation of group description that is used to create
 * a group. It contains immutable properties of a ONOS group construct
 * such as "type", "DeviceId", "appCookie", "appId" and "buckets"
 */
public interface GroupDescription {
    /**
     * Types of the group supported by ONOS.
     */
    enum Type {
        /**
         * Load-balancing among different buckets in a group.
         */
        SELECT,
        /**
         * Single Bucket Group.
         */
        INDIRECT,
        /**
         * Multicast to all buckets in a group.
         */
        ALL,
        /**
         * Uses the first live bucket in a group.
         */
        FAILOVER
    }

    /**
     * Returns type of a group object.
     *
     * @return GroupType group type
     */
    Type type();

    /**
     * Returns device identifier on which this group object is created.
     *
     * @return DeviceId device identifier
     */
    DeviceId deviceId();

    /**
     * Returns application identifier that has created this group object.
     *
     * @return ApplicationId application identifier
     */
    ApplicationId appId();

    /**
     * Returns application cookie associated with a group object.
     *
     * @return GroupKey application cookie
     */
    GroupKey appCookie();

    /**
     * Returns groupId passed in by caller.
     *
     * @return Integer group id passed in by caller. May be null if caller
     *                 passed in null to let groupService determin the group id.
     */
    Integer givenGroupId();

    /**
     * Returns group buckets of a group.
     *
     * @return GroupBuckets immutable list of group bucket
     */
    GroupBuckets buckets();
}