Class DefaultFlowEntry

    • Constructor Detail

      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule,
                                FlowEntry.FlowEntryState state,
                                long life,
                                java.util.concurrent.TimeUnit lifeTimeUnit,
                                long packets,
                                long bytes)
        Creates a flow entry of flow table specified with the flow rule, state and statistic information.
        Parameters:
        rule - the flow rule
        state - the flow state
        life - the duration second of flow
        lifeTimeUnit - life time unit
        packets - the number of packets of this flow
        bytes - the the number of bytes of this flow
      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule,
                                FlowEntry.FlowEntryState state,
                                long life,
                                java.util.concurrent.TimeUnit lifeTimeUnit,
                                FlowEntry.FlowLiveType liveType,
                                long packets,
                                long bytes)
        Creates a flow entry of flow table specified with the flow rule, state and statistic information.
        Parameters:
        rule - the flow rule
        state - the flow state
        life - the duration second of flow
        lifeTimeUnit - life time unit
        liveType - the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG
        packets - the number of packets of this flow
        bytes - the the number of bytes of this flow
      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule,
                                FlowEntry.FlowEntryState state,
                                long lifeSecs,
                                FlowEntry.FlowLiveType liveType,
                                long packets,
                                long bytes)
        Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.
        Parameters:
        rule - the flow rule
        state - the flow state
        lifeSecs - the duration second of flow
        liveType - the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG
        packets - the number of packets of this flow
        bytes - the the number of bytes of this flow
      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule)
      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule,
                                FlowEntry.FlowEntryState state)
        Creates a flow entry based on specified flow rule and state.
        Parameters:
        rule - to use as base
        state - of the flow entry
      • DefaultFlowEntry

        public DefaultFlowEntry​(FlowRule rule,
                                int errType,
                                int errCode)
        Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.
        Parameters:
        rule - the flow rule
        errType - the error type
        errCode - the error code
    • Method Detail

      • life

        public long life()
        Description copied from interface: FlowEntry
        Returns the number of seconds this flow rule has been applied.
        Specified by:
        life in interface FlowEntry
        Returns:
        number of seconds
      • life

        public long life​(java.util.concurrent.TimeUnit timeUnit)
        Description copied from interface: FlowEntry
        Returns the time this flow rule has been applied.
        Specified by:
        life in interface FlowEntry
        Parameters:
        timeUnit - time unit the result will be converted to
        Returns:
        time in the requested TimeUnit
      • packets

        public long packets()
        Description copied from interface: FlowEntry
        Returns the number of packets this flow rule has matched.
        Specified by:
        packets in interface FlowEntry
        Returns:
        number of packets
      • bytes

        public long bytes()
        Description copied from interface: FlowEntry
        Returns the number of bytes this flow rule has matched.
        Specified by:
        bytes in interface FlowEntry
        Returns:
        number of bytes
      • lastSeen

        public long lastSeen()
        Description copied from interface: FlowEntry
        When this flow entry was last deemed active.
        Specified by:
        lastSeen in interface FlowEntry
        Returns:
        epoch time of last activity
      • setLife

        public void setLife​(long life)
        Description copied from interface: StoredFlowEntry
        Sets how long this entry has been entered in the system.
        Specified by:
        setLife in interface StoredFlowEntry
        Parameters:
        life - seconds
      • setLife

        public void setLife​(long life,
                            java.util.concurrent.TimeUnit timeUnit)
        Description copied from interface: StoredFlowEntry
        Sets how long this entry has been entered in the system.
        Specified by:
        setLife in interface StoredFlowEntry
        Parameters:
        life - time
        timeUnit - unit of time
      • setPackets

        public void setPackets​(long packets)
        Description copied from interface: StoredFlowEntry
        Number of packets seen by this entry.
        Specified by:
        setPackets in interface StoredFlowEntry
        Parameters:
        packets - a long value
      • setBytes

        public void setBytes​(long bytes)
        Description copied from interface: StoredFlowEntry
        Number of bytes seen by this rule.
        Specified by:
        setBytes in interface StoredFlowEntry
        Parameters:
        bytes - a long value
      • errType

        public int errType()
        Description copied from interface: FlowEntry
        Indicates the error type.
        Specified by:
        errType in interface FlowEntry
        Returns:
        an integer value of the error
      • errCode

        public int errCode()
        Description copied from interface: FlowEntry
        Indicates the error code.
        Specified by:
        errCode in interface FlowEntry
        Returns:
        an integer value of the error