blob: 91d6676bbb70894c9fd3401caade8e3a916d7b22 [file] [log] [blame]
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -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
18/**
19 * Interface that defines set methods for a group entry
20 * that is stored in the system.
21 */
22public interface StoredGroupEntry extends Group {
23
24 /**
25 * Sets the new state for this entry.
26 *
27 * @param newState new group entry state.
28 */
29 void setState(Group.GroupState newState);
30
31 /**
Srikanth Vavilapalli717361f2015-03-16 12:06:04 -070032 * Sets if group has transitioned to ADDED state for the first time.
33 * This is to differentiate state transitions "from PENDING_ADD to ADDED"
34 * and "from PENDING_UPDATE to ADDED". For internal use only.
35 *
36 * @param isGroupAddedFirstTime true if group moves to ADDED state
37 * for the first time.
38 */
39 void setIsGroupStateAddedFirstTime(boolean isGroupAddedFirstTime);
40
41 /**
42 * Returns the isGroupStateAddedFirstTime value. For internal use only.
43 *
44 * @return isGroupStateAddedFirstTime value
45 */
46 boolean isGroupStateAddedFirstTime();
47
48 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080049 * Sets how long this entry has been entered in the system.
50 *
51 * @param life epoch time
52 */
53 void setLife(long life);
54
55 /**
56 * Sets number of packets processed by this group entry.
57 *
58 * @param packets a long value
59 */
60 void setPackets(long packets);
61
62 /**
63 * Sets number of bytes processed by this group entry.
64 *
65 * @param bytes a long value
66 */
67 void setBytes(long bytes);
68
Srikanth Vavilapalli45c27c82015-01-30 12:57:56 -080069 /**
70 * Sets number of flow rules or groups referencing this group entry.
71 *
72 * @param referenceCount reference count
73 */
74 void setReferenceCount(long referenceCount);
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080075}