added treatment support and conversion to an instruction

moved to meter api to onos-api

Change-Id: I0504f06fdc503953fa7696224d97edda43596d6e
diff --git a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
index d125a9f..042aeaf 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
@@ -24,6 +24,7 @@
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.flow.instructions.Instruction;
 import org.onosproject.net.flow.instructions.Instructions;
+import org.onosproject.net.meter.MeterId;
 
 import java.util.List;
 
@@ -75,6 +76,13 @@
     Instructions.MetadataInstruction writeMetadata();
 
     /**
+     * Returns the meter instruction if there is one.
+     *
+     * @return a meter instruction that may be null
+     */
+    Instructions.MeterInstruction metered();
+
+    /**
      * Builder of traffic treatment entities.
      */
     interface Builder {
@@ -243,6 +251,13 @@
          */
         Builder group(GroupId groupId);
 
+        /**
+         * Sets a meter to be used by this flow.
+         *
+         * @param meterId a meter id
+         * @return a treatment builder
+         */
+        Builder meter(MeterId meterId);
 
         /**
          * Sets the next table type to transition to.