Class DefaultFlowRule

    • Constructor Detail

      • DefaultFlowRule

        public DefaultFlowRule​(FlowRule rule)
        Creates a new flow rule from an existing rule.
        Parameters:
        rule - new flow rule
    • Method Detail

      • id

        public FlowId id()
        Description copied from interface: FlowRule
        Returns the ID of this flow.
        Specified by:
        id in interface FlowRule
        Returns:
        the flow ID
      • appId

        public short appId()
        Description copied from interface: FlowRule
        Returns the application id of this flow.
        Specified by:
        appId in interface FlowRule
        Returns:
        an applicationId
      • groupId

        public GroupId groupId()
        Description copied from interface: FlowRule
        Returns the group id of this flow.
        Specified by:
        groupId in interface FlowRule
        Returns:
        an groupId
      • priority

        public int priority()
        Description copied from interface: FlowRule
        Returns the flow rule priority given in natural order; higher numbers mean higher priorities.
        Specified by:
        priority in interface FlowRule
        Returns:
        flow rule priority
      • deviceId

        public DeviceId deviceId()
        Description copied from interface: FlowRule
        Returns the identity of the device where this rule applies.
        Specified by:
        deviceId in interface FlowRule
        Returns:
        device identifier
      • selector

        public TrafficSelector selector()
        Description copied from interface: FlowRule
        Returns the traffic selector that identifies what traffic this rule should apply to.
        Specified by:
        selector in interface FlowRule
        Returns:
        traffic selector
      • treatment

        public TrafficTreatment treatment()
        Description copied from interface: FlowRule
        Returns the traffic treatment that applies to selected traffic.
        Specified by:
        treatment in interface FlowRule
        Returns:
        traffic treatment
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Description copied from interface: FlowRule
        Equality for flow rules only considers 'match equality'. This means that two flow rules with the same match conditions will be equal, regardless of the treatment or other characteristics of the flow.
        Specified by:
        equals in interface FlowRule
        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • exactMatch

        public boolean exactMatch​(FlowRule rule)
        Description copied from interface: FlowRule
        Returns whether this flow rule is an exact match to the flow rule given in the argument.

        Exact match means that deviceId, priority, selector, tableId, flowId and treatment are equal. Note that this differs from the notion of object equality for flow rules, which does not consider the flowId or treatment when testing equality.

        Specified by:
        exactMatch in interface FlowRule
        Parameters:
        rule - other rule to match against
        Returns:
        true if the rules are an exact match, otherwise false
      • timeout

        public int timeout()
        Description copied from interface: FlowRule
        Returns the timeout for this flow requested by an application.
        Specified by:
        timeout in interface FlowRule
        Returns:
        integer value of the timeout
      • hardTimeout

        public int hardTimeout()
        Description copied from interface: FlowRule
        Returns the hard timeout for this flow requested by an application. This parameter configure switch's flow hard timeout. In case of controller-switch connection lost, this variable can be useful.
        Specified by:
        hardTimeout in interface FlowRule
        Returns:
        integer value of the hard Timeout
      • reason

        public FlowRule.FlowRemoveReason reason()
        Description copied from interface: FlowRule
        Returns the reason for the flow received from switches.
        Specified by:
        reason in interface FlowRule
        Returns:
        FlowRemoveReason value of reason
      • isPermanent

        public boolean isPermanent()
        Description copied from interface: FlowRule
        Returns whether the flow is permanent i.e. does not time out.
        Specified by:
        isPermanent in interface FlowRule
        Returns:
        true if the flow is permanent, otherwise false
      • tableId

        public int tableId()
        Description copied from interface: FlowRule
        Returns the table id for this rule.
        Specified by:
        tableId in interface FlowRule
        Returns:
        an integer.
      • table

        public TableId table()
        Description copied from interface: FlowRule
        Returns the table identifier for this rule.
        Specified by:
        table in interface FlowRule
        Returns:
        a table identifier.
      • created

        public long created()
        Returns the wallclock time that the flow was created.
        Returns:
        creation time in milliseconds since epoch