Initial implementation of Meter Service (needs testing)
Change-Id: Ie07bd3e2bd7c67a6499c965d8926eb361ad16462
store impl started
Change-Id: Ib8b474f40dcecff335a421c12ad149fe9830c427
full implementation
Change-Id: Ie59fd61d02972bd04d887bdcca9745793b880681
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/meter/MeterId.java b/incubator/api/src/main/java/org/onosproject/incubator/net/meter/MeterId.java
index ea7cf36..8619e14 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/meter/MeterId.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/meter/MeterId.java
@@ -19,19 +19,19 @@
/**
* A representation of a meter id.
- * Uniquely identifies a meter for a given device.
+ * Uniquely identifies a meter system wide.
*/
public final class MeterId {
static final long MAX = 0xFFFF0000;
- private final int id;
+ private final long id;
public static final MeterId SLOWPATH = new MeterId(0xFFFFFFFD);
public static final MeterId CONTROLLER = new MeterId(0xFFFFFFFE);
public static final MeterId ALL = new MeterId(0xFFFFFFFF);
- private MeterId(int id) {
+ private MeterId(long id) {
checkArgument(id <= MAX, "id cannot be larger than 0xFFFF0000");
this.id = id;
}
@@ -39,9 +39,9 @@
/**
* The integer representation of the meter id.
*
- * @return an integer
+ * @return a long
*/
- public int id() {
+ public long id() {
return id;
}
@@ -62,10 +62,10 @@
@Override
public int hashCode() {
- return id;
+ return Long.hashCode(id);
}
- public static MeterId meterId(int id) {
+ public static MeterId meterId(long id) {
return new MeterId(id);
}