blob: 33a7969fc311ae62451206e57708d13996cb7049 [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.
26 * PENDING_ADD: group create request is processed by ONOS and
27 * not yet received the confirmation from data plane
28 * ADDED: group is created in the data plane
29 * PENDING_UPDATE: group update request is processed by ONOS and
30 * not received the confirmation from data plane post which state
31 * moves to ADDED state
32 * PENDING_DELETE: group delete request is processed by ONOS and
33 * not received the confirmation from data plane
34 */
35 public enum GroupState {
36 PENDING_ADD,
37 ADDED,
38 PENDING_UPDATE,
39 PENDING_DELETE
40 }
41
42 /**
43 * Return group identifier associated with a group object.
44 *
45 * @return GroupId Group Identifier
46 */
47 public GroupId id();
48
49 /**
50 * Return current state of a group object.
51 *
52 * @return GroupState Group State
53 */
54 public GroupState state();
55
56 /**
57 * Returns the number of milliseconds this group has been alive.
58 *
59 * @return number of millis
60 */
61 long life();
62
63 /**
64 * Returns the number of packets processed by this group.
65 *
66 * @return number of packets
67 */
68 long packets();
69
70 /**
71 * Returns the number of bytes processed by this group.
72 *
73 * @return number of bytes
74 */
75 long bytes();
76}