Package org.onosproject.net.meter
Class MeterScope
- java.lang.Object
-
- org.onlab.util.Identifier<String>
-
- org.onosproject.net.meter.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
METER_GLOBAL_SCOPE
-
Fields inherited from class org.onlab.util.Identifier
identifier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MeterScope
globalScope()
Create a global Meter Scope.boolean
isGlobal()
Global scope or not.static MeterScope
of(String scope)
Create a Meter Scope from id string.-
Methods inherited from class org.onlab.util.Identifier
equals, hashCode, id, toString
-
-
-
-
Field Detail
-
METER_GLOBAL_SCOPE
public static final String METER_GLOBAL_SCOPE
- See Also:
- Constant Field Values
-
-
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.
-
-