Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.group; |
| 17 | |
| 18 | /** |
| 19 | * Interface that defines set methods for a group entry |
| 20 | * that is stored in the system. |
| 21 | */ |
| 22 | public 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 Vavilapalli | 717361f | 2015-03-16 12:06:04 -0700 | [diff] [blame] | 32 | * 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 Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 49 | * 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 Vavilapalli | 45c27c8 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 69 | /** |
| 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 Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 75 | } |