blob: f7fa5078790e6f4d9ee6afa06b89ceceb2d7040c [file] [log] [blame]
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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.net.group;
17
18import org.onosproject.core.GroupId;
19
20/**
21 * ONOS representation of group that is stored in the system.
22 */
23public interface Group extends GroupDescription {
24 /**
25 * State of the group object in ONOS.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080026 */
27 public enum GroupState {
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080028 /**
29 * Group create request is processed by ONOS and not yet
30 * received the confirmation from data plane.
31 */
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080032 PENDING_ADD,
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080033 /**
34 * Group is created in the data plane.
35 */
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080036 ADDED,
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080037 /**
38 * Group update request is processed by ONOS and not
39 * received the confirmation from data plane post which
40 * state moves to ADDED state.
41 */
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080042 PENDING_UPDATE,
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080043 /**
44 * Group delete request is processed by ONOS and not
45 * received the confirmation from data plane.
46 */
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080047 PENDING_DELETE
48 }
49
50 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080051 * Returns group identifier associated with a group object.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080052 *
53 * @return GroupId Group Identifier
54 */
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080055 GroupId id();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080056
57 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080058 * Returns current state of a group object.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080059 *
60 * @return GroupState Group State
61 */
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080062 GroupState state();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080063
64 /**
65 * Returns the number of milliseconds this group has been alive.
66 *
67 * @return number of millis
68 */
69 long life();
70
71 /**
72 * Returns the number of packets processed by this group.
73 *
74 * @return number of packets
75 */
76 long packets();
77
78 /**
79 * Returns the number of bytes processed by this group.
80 *
81 * @return number of bytes
82 */
83 long bytes();
84}