Class DefaultGroup

    • Constructor Detail

      • DefaultGroup

        public DefaultGroup​(GroupId id,
                            GroupDescription groupDesc)
        Default group object constructor with the parameters.
        Parameters:
        id - group identifier
        groupDesc - group description parameters
      • DefaultGroup

        public 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

      • id

        public GroupId id()
        Returns group identifier associated with a group object.
        Specified by:
        id in interface Group
        Returns:
        GroupId Group Identifier
      • state

        public Group.GroupState state()
        Returns current state of a group object.
        Specified by:
        state in interface Group
        Returns:
        GroupState Group State
      • life

        public long life()
        Returns the number of milliseconds this group has been alive.
        Specified by:
        life in interface Group
        Returns:
        number of millis
      • packets

        public long packets()
        Returns the number of packets processed by this group.
        Specified by:
        packets in interface Group
        Returns:
        number of packets
      • bytes

        public long bytes()
        Returns the number of bytes processed by this group.
        Specified by:
        bytes in interface Group
        Returns:
        number of bytes
      • age

        public int age()
        Description copied from interface: Group
        Obtains the age of a group. The age reflects the number of polling rounds the group has had a reference count of zero.
        Specified by:
        age in interface Group
        Returns:
        the age of the group as an integer
      • failedRetryCount

        public int failedRetryCount()
        Description copied from interface: Group
        Returns the count for the number of attempts at programming a failed group.
        Specified by:
        failedRetryCount in interface Group
        Returns:
        the count for the number of failed attempts at programming this group
      • setState

        public void setState​(Group.GroupState newState)
        Sets the new state for this entry.
        Specified by:
        setState in interface StoredGroupEntry
        Parameters:
        newState - new group entry state.
      • setLife

        public void setLife​(long life)
        Sets how long this entry has been entered in the system.
        Specified by:
        setLife in interface StoredGroupEntry
        Parameters:
        life - epoch time
      • setPackets

        public void setPackets​(long packets)
        Sets number of packets processed by this group entry.
        Specified by:
        setPackets in interface StoredGroupEntry
        Parameters:
        packets - a long value
      • setBytes

        public void setBytes​(long bytes)
        Sets number of bytes processed by this group entry.
        Specified by:
        setBytes in interface StoredGroupEntry
        Parameters:
        bytes - a long value
      • setReferenceCount

        public void setReferenceCount​(long referenceCount)
        Description copied from interface: StoredGroupEntry
        Sets number of flow rules or groups referencing this group entry.
        Specified by:
        setReferenceCount in interface StoredGroupEntry
        Parameters:
        referenceCount - reference count
      • referenceCount

        public long referenceCount()
        Description copied from interface: Group
        Returns the number of flow rules or other groups reference this group.
        Specified by:
        referenceCount in interface Group
        Returns:
        number of flow rules or other groups pointing to this group
      • incrFailedRetryCount

        public void incrFailedRetryCount()
        Description copied from interface: StoredGroupEntry
        Increments the count for the number of failed attempts in programming this group.
        Specified by:
        incrFailedRetryCount in interface StoredGroupEntry
      • setFailedRetryCount

        public void setFailedRetryCount​(int failedRetryCount)
        Description copied from interface: StoredGroupEntry
        Sets the count for the number of failed attempts in programming this group.
        Specified by:
        setFailedRetryCount in interface StoredGroupEntry
        Parameters:
        failedRetryCount - count for number of failed attempts in programming this group
      • setIsGroupStateAddedFirstTime

        public void setIsGroupStateAddedFirstTime​(boolean isGroupStateAddedFirstTime)
        Description copied from interface: StoredGroupEntry
        Sets 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:
        setIsGroupStateAddedFirstTime in interface StoredGroupEntry
        Parameters:
        isGroupStateAddedFirstTime - true if group moves to ADDED state for the first time.
      • isGroupStateAddedFirstTime

        public boolean isGroupStateAddedFirstTime()
        Description copied from interface: StoredGroupEntry
        Returns the isGroupStateAddedFirstTime value. For internal use only.
        Specified by:
        isGroupStateAddedFirstTime in interface StoredGroupEntry
        Returns:
        isGroupStateAddedFirstTime value