Toshio Koide

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

...@@ -14,4 +14,9 @@ public class BandwidthResourceAllocation extends BandwidthResourceRequest ...@@ -14,4 +14,9 @@ public class BandwidthResourceAllocation extends BandwidthResourceRequest
14 public BandwidthResourceAllocation(Bandwidth bandwidth) { 14 public BandwidthResourceAllocation(Bandwidth bandwidth) {
15 super(bandwidth); 15 super(bandwidth);
16 } 16 }
17 +
18 + @Override
19 + public ResourceType type() {
20 + return ResourceType.BANDWIDTH;
21 + }
17 } 22 }
......
...@@ -30,7 +30,7 @@ public class BandwidthResourceRequest implements ResourceRequest { ...@@ -30,7 +30,7 @@ public class BandwidthResourceRequest implements ResourceRequest {
30 * 30 *
31 * @return the bandwidth resource 31 * @return the bandwidth resource
32 */ 32 */
33 - Bandwidth bandwidth() { 33 + public Bandwidth bandwidth() {
34 return bandwidth; 34 return bandwidth;
35 } 35 }
36 } 36 }
......
...@@ -7,6 +7,11 @@ public class LambdaResourceAllocation extends LambdaResourceRequest ...@@ -7,6 +7,11 @@ public class LambdaResourceAllocation extends LambdaResourceRequest
7 implements ResourceAllocation { 7 implements ResourceAllocation {
8 private final Lambda lambda; 8 private final Lambda lambda;
9 9
10 + @Override
11 + public ResourceType type() {
12 + return ResourceType.LAMBDA;
13 + }
14 +
10 /** 15 /**
11 * Creates a new {@link LambdaResourceAllocation} with {@link Lambda} 16 * Creates a new {@link LambdaResourceAllocation} with {@link Lambda}
12 * object. 17 * object.
...@@ -22,7 +27,7 @@ public class LambdaResourceAllocation extends LambdaResourceRequest ...@@ -22,7 +27,7 @@ public class LambdaResourceAllocation extends LambdaResourceRequest
22 * 27 *
23 * @return the lambda resource 28 * @return the lambda resource
24 */ 29 */
25 - Lambda lambda() { 30 + public Lambda lambda() {
26 return lambda; 31 return lambda;
27 } 32 }
28 } 33 }
......
...@@ -4,5 +4,5 @@ package org.onlab.onos.net.resource; ...@@ -4,5 +4,5 @@ package org.onlab.onos.net.resource;
4 * Abstraction of allocated resource. 4 * Abstraction of allocated resource.
5 */ 5 */
6 public interface ResourceAllocation extends ResourceRequest { 6 public interface ResourceAllocation extends ResourceRequest {
7 - 7 + ResourceType type();
8 } 8 }
......
1 +package org.onlab.onos.net.resource;
2 +
3 +public enum ResourceType {
4 + LAMBDA,
5 + BANDWIDTH,
6 +}