Toshio Koide

Add ResourceType field for ResourceAllocation, and change visibility of some of methods

......@@ -14,4 +14,9 @@ public class BandwidthResourceAllocation extends BandwidthResourceRequest
public BandwidthResourceAllocation(Bandwidth bandwidth) {
super(bandwidth);
}
@Override
public ResourceType type() {
return ResourceType.BANDWIDTH;
}
}
......
......@@ -30,7 +30,7 @@ public class BandwidthResourceRequest implements ResourceRequest {
*
* @return the bandwidth resource
*/
Bandwidth bandwidth() {
public Bandwidth bandwidth() {
return bandwidth;
}
}
......
......@@ -7,6 +7,11 @@ public class LambdaResourceAllocation extends LambdaResourceRequest
implements ResourceAllocation {
private final Lambda lambda;
@Override
public ResourceType type() {
return ResourceType.LAMBDA;
}
/**
* Creates a new {@link LambdaResourceAllocation} with {@link Lambda}
* object.
......@@ -22,7 +27,7 @@ public class LambdaResourceAllocation extends LambdaResourceRequest
*
* @return the lambda resource
*/
Lambda lambda() {
public Lambda lambda() {
return lambda;
}
}
......
......@@ -4,5 +4,5 @@ package org.onlab.onos.net.resource;
* Abstraction of allocated resource.
*/
public interface ResourceAllocation extends ResourceRequest {
ResourceType type();
}
......
package org.onlab.onos.net.resource;
public enum ResourceType {
LAMBDA,
BANDWIDTH,
}