Class MeterScope


  • public class MeterScope
    extends Identifier<String>
    Scope of Meter Features. There are multiple meter tables in a P4RT device, to distinguish and represent them uniquely, we added a Scope field. For P4RT device, value will be the PiMeterId. For OF device, we use "global" by default, since there is only 1 table in OF. In general, a Meter Scope is referring to a Meter Table. It can be a PiMeterId or "global" for the single OF meter table. During runtime, users need to provide a PiMeterId to indicate which Meter Cell they are intended to modify. The value will then be used to create a Meter Scope for the rest of the process. If no PiMeterId is provided, a "global" Meter Scope is created.
    • Method Detail

      • of

        public static MeterScope of​(String scope)
        Create a Meter Scope from id string.
        Parameters:
        scope - the scope
        Returns:
        a Meter Scope
      • globalScope

        public static MeterScope globalScope()
        Create a global Meter Scope.
        Returns:
        a Meter Scope
      • isGlobal

        public boolean isGlobal()
        Global scope or not.
        Returns:
        true if global scope, false if not.