public class DefaultGroup extends DefaultGroupDescription implements Group, StoredGroupEntry
Group.GroupState
GroupDescription.Type
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
int |
age()
Obtains the age of a group.
|
long |
bytes()
Returns the number of bytes processed by this group.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
GroupId |
id()
Returns group identifier associated with a group object.
|
boolean |
isGroupStateAddedFirstTime()
Returns the isGroupStateAddedFirstTime value.
|
long |
life()
Returns the number of milliseconds this group has been alive.
|
long |
packets()
Returns the number of packets processed by this group.
|
long |
referenceCount()
Returns the number of flow rules or other groups reference this group.
|
void |
setBytes(long bytes)
Sets number of bytes processed by this group entry.
|
void |
setIsGroupStateAddedFirstTime(boolean isGroupStateAddedFirstTime)
Sets if group has transitioned to ADDED state for the first time.
|
void |
setLife(long life)
Sets how long this entry has been entered in the system.
|
void |
setPackets(long packets)
Sets number of packets processed by this group entry.
|
void |
setReferenceCount(long referenceCount)
Sets number of flow rules or groups referencing this group entry.
|
void |
setState(Group.GroupState newState)
Sets the new state for this entry.
|
Group.GroupState |
state()
Returns current state of a group object.
|
java.lang.String |
toString() |
appCookie, appId, buckets, deviceId, givenGroupId, type
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
appCookie, appId, buckets, deviceId, givenGroupId, type
public DefaultGroup(GroupId id, GroupDescription groupDesc)
id
- group identifiergroupDesc
- group description parameterspublic DefaultGroup(GroupId id, DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets)
id
- group identifierdeviceId
- device identifiertype
- type of the groupbuckets
- immutable list of group bucketpublic GroupId id()
public Group.GroupState state()
public long life()
public long packets()
public long bytes()
public int age()
Group
public void setState(Group.GroupState newState)
setState
in interface StoredGroupEntry
newState
- new group entry state.public void setLife(long life)
setLife
in interface StoredGroupEntry
life
- epoch timepublic void setPackets(long packets)
setPackets
in interface StoredGroupEntry
packets
- a long valuepublic void setBytes(long bytes)
setBytes
in interface StoredGroupEntry
bytes
- a long valuepublic void setReferenceCount(long referenceCount)
StoredGroupEntry
setReferenceCount
in interface StoredGroupEntry
referenceCount
- reference countpublic long referenceCount()
Group
referenceCount
in interface Group
public int hashCode()
hashCode
in class DefaultGroupDescription
public boolean equals(java.lang.Object obj)
equals
in class DefaultGroupDescription
public java.lang.String toString()
toString
in class DefaultGroupDescription
public void setIsGroupStateAddedFirstTime(boolean isGroupStateAddedFirstTime)
StoredGroupEntry
setIsGroupStateAddedFirstTime
in interface StoredGroupEntry
isGroupStateAddedFirstTime
- true if group moves to ADDED state
for the first time.public boolean isGroupStateAddedFirstTime()
StoredGroupEntry
isGroupStateAddedFirstTime
in interface StoredGroupEntry