Interface FlowRule

    • Method Detail

      • id

        FlowId id()
        Returns the ID of this flow.
        Returns:
        the flow ID
      • appId

        short appId()
        Returns the application id of this flow.
        Returns:
        an applicationId
      • groupId

        GroupId groupId()
        Returns the group id of this flow.
        Returns:
        an groupId
      • priority

        int priority()
        Returns the flow rule priority given in natural order; higher numbers mean higher priorities.
        Returns:
        flow rule priority
      • deviceId

        DeviceId deviceId()
        Returns the identity of the device where this rule applies.
        Returns:
        device identifier
      • selector

        TrafficSelector selector()
        Returns the traffic selector that identifies what traffic this rule should apply to.
        Returns:
        traffic selector
      • treatment

        TrafficTreatment treatment()
        Returns the traffic treatment that applies to selected traffic.
        Returns:
        traffic treatment
      • timeout

        int timeout()
        Returns the timeout for this flow requested by an application.
        Returns:
        integer value of the timeout
      • hardTimeout

        int hardTimeout()
        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.
        Returns:
        integer value of the hard Timeout
      • reason

        FlowRule.FlowRemoveReason reason()
        Returns the reason for the flow received from switches.
        Returns:
        FlowRemoveReason value of reason
      • isPermanent

        boolean isPermanent()
        Returns whether the flow is permanent i.e. does not time out.
        Returns:
        true if the flow is permanent, otherwise false
      • tableId

        @Deprecated
        int tableId()
        Deprecated.
        in Loon release (version 1.11.0). Use table() instead.
        Returns the table id for this rule.
        Returns:
        an integer.
      • table

        TableId table()
        Returns the table identifier for this rule.
        Returns:
        a table identifier.
      • equals

        boolean equals​(Object obj)
        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.
        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

        boolean exactMatch​(FlowRule rule)
        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.

        Parameters:
        rule - other rule to match against
        Returns:
        true if the rules are an exact match, otherwise false