Package org.onosproject.net.group
Class DefaultGroup
- java.lang.Object
- 
- org.onosproject.net.group.DefaultGroupDescription
- 
- org.onosproject.net.group.DefaultGroup
 
 
- 
- All Implemented Interfaces:
- Group,- GroupDescription,- StoredGroupEntry,- PiTranslatable
 
 public class DefaultGroup extends DefaultGroupDescription implements Group, StoredGroupEntry ONOS implementation of default group that is stored in the system.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.onosproject.net.group.GroupGroup.GroupState
 - 
Nested classes/interfaces inherited from interface org.onosproject.net.group.GroupDescriptionGroupDescription.Type
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultGroup(GroupId id, DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets)Default group object constructor with the available information from data plane.DefaultGroup(GroupId id, GroupDescription groupDesc)Default group object constructor with the parameters.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intage()Obtains the age of a group.longbytes()Returns the number of bytes processed by this group.booleanequals(java.lang.Object obj)intfailedRetryCount()Returns the count for the number of attempts at programming a failed group.inthashCode()GroupIdid()Returns group identifier associated with a group object.voidincrFailedRetryCount()Increments the count for the number of failed attempts in programming this group.booleanisGroupStateAddedFirstTime()Returns the isGroupStateAddedFirstTime value.longlife()Returns the number of milliseconds this group has been alive.longpackets()Returns the number of packets processed by this group.longreferenceCount()Returns the number of flow rules or other groups reference this group.voidsetBytes(long bytes)Sets number of bytes processed by this group entry.voidsetFailedRetryCount(int failedRetryCount)Sets the count for the number of failed attempts in programming this group.voidsetIsGroupStateAddedFirstTime(boolean isGroupStateAddedFirstTime)Sets if group has transitioned to ADDED state for the first time.voidsetLife(long life)Sets how long this entry has been entered in the system.voidsetPackets(long packets)Sets number of packets processed by this group entry.voidsetReferenceCount(long referenceCount)Sets number of flow rules or groups referencing this group entry.voidsetState(Group.GroupState newState)Sets the new state for this entry.Group.GroupStatestate()Returns current state of a group object.java.lang.StringtoString()- 
Methods inherited from class org.onosproject.net.group.DefaultGroupDescriptionappCookie, appId, buckets, deviceId, givenGroupId, type
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.onosproject.net.group.GroupDescriptionappCookie, appId, buckets, deviceId, givenGroupId, type
 
- 
 
- 
- 
- 
Constructor Detail- 
DefaultGrouppublic DefaultGroup(GroupId id, GroupDescription groupDesc) Default group object constructor with the parameters.- Parameters:
- id- group identifier
- groupDesc- group description parameters
 
 - 
DefaultGrouppublic DefaultGroup(GroupId id, DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets) Default group object constructor with the available information from data plane.- Parameters:
- id- group identifier
- deviceId- device identifier
- type- type of the group
- buckets- immutable list of group bucket
 
 
- 
 - 
Method Detail- 
idpublic GroupId id() Returns group identifier associated with a group object.
 - 
statepublic Group.GroupState state() Returns current state of a group object.
 - 
lifepublic long life() Returns the number of milliseconds this group has been alive.
 - 
packetspublic long packets() Returns the number of packets processed by this group.
 - 
bytespublic long bytes() Returns the number of bytes processed by this group.
 - 
agepublic int age() Description copied from interface:GroupObtains the age of a group. The age reflects the number of polling rounds the group has had a reference count of zero.
 - 
failedRetryCountpublic int failedRetryCount() Description copied from interface:GroupReturns the count for the number of attempts at programming a failed group.- Specified by:
- failedRetryCountin interface- Group
- Returns:
- the count for the number of failed attempts at programming this group
 
 - 
setStatepublic void setState(Group.GroupState newState) Sets the new state for this entry.- Specified by:
- setStatein interface- StoredGroupEntry
- Parameters:
- newState- new group entry state.
 
 - 
setLifepublic void setLife(long life) Sets how long this entry has been entered in the system.- Specified by:
- setLifein interface- StoredGroupEntry
- Parameters:
- life- epoch time
 
 - 
setPacketspublic void setPackets(long packets) Sets number of packets processed by this group entry.- Specified by:
- setPacketsin interface- StoredGroupEntry
- Parameters:
- packets- a long value
 
 - 
setBytespublic void setBytes(long bytes) Sets number of bytes processed by this group entry.- Specified by:
- setBytesin interface- StoredGroupEntry
- Parameters:
- bytes- a long value
 
 - 
setReferenceCountpublic void setReferenceCount(long referenceCount) Description copied from interface:StoredGroupEntrySets number of flow rules or groups referencing this group entry.- Specified by:
- setReferenceCountin interface- StoredGroupEntry
- Parameters:
- referenceCount- reference count
 
 - 
referenceCountpublic long referenceCount() Description copied from interface:GroupReturns the number of flow rules or other groups reference this group.- Specified by:
- referenceCountin interface- Group
- Returns:
- number of flow rules or other groups pointing to this group
 
 - 
incrFailedRetryCountpublic void incrFailedRetryCount() Description copied from interface:StoredGroupEntryIncrements the count for the number of failed attempts in programming this group.- Specified by:
- incrFailedRetryCountin interface- StoredGroupEntry
 
 - 
setFailedRetryCountpublic void setFailedRetryCount(int failedRetryCount) Description copied from interface:StoredGroupEntrySets the count for the number of failed attempts in programming this group.- Specified by:
- setFailedRetryCountin interface- StoredGroupEntry
- Parameters:
- failedRetryCount- count for number of failed attempts in programming this group
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- DefaultGroupDescription
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- DefaultGroupDescription
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- DefaultGroupDescription
 
 - 
setIsGroupStateAddedFirstTimepublic void setIsGroupStateAddedFirstTime(boolean isGroupStateAddedFirstTime) Description copied from interface:StoredGroupEntrySets if group has transitioned to ADDED state for the first time. This is to differentiate state transitions "from PENDING_ADD to ADDED" and "from PENDING_UPDATE to ADDED". For internal use only.- Specified by:
- setIsGroupStateAddedFirstTimein interface- StoredGroupEntry
- Parameters:
- isGroupStateAddedFirstTime- true if group moves to ADDED state for the first time.
 
 - 
isGroupStateAddedFirstTimepublic boolean isGroupStateAddedFirstTime() Description copied from interface:StoredGroupEntryReturns the isGroupStateAddedFirstTime value. For internal use only.- Specified by:
- isGroupStateAddedFirstTimein interface- StoredGroupEntry
- Returns:
- isGroupStateAddedFirstTime value
 
 
- 
 
-