commit | fa0dff61cfbf900e89c87b64a98319320c201823 | [log] [tgz] |
---|---|---|
author | Toshio Koide <t-koide@onlab.us> | Thu Oct 23 11:46:44 2014 -0700 |
committer | Toshio Koide <t-koide@onlab.us> | Thu Oct 23 11:46:44 2014 -0700 |
tree | bcc171b3af4e28cafd657d4c887b17f41a4a4f14 | |
parent | 569ca70f12240886bf004f397fc579ebb53e9c85 [diff] |
Implement link resource request/allocation objects.
diff --git a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceAllocation.java b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceAllocation.java index b542533..77db287 100644 --- a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceAllocation.java +++ b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceAllocation.java
@@ -3,6 +3,14 @@ /** * Representation of allocated bandwidth resource. */ -public interface BandwidthResourceAllocation extends BandwidthResourceRequest { - +public class BandwidthResourceAllocation extends BandwidthResourceRequest { + /** + * Creates a new {@link BandwidthResourceAllocation} with {@link Bandwidth} + * object. + * + * @param bandwidth allocated bandwidth + */ + public BandwidthResourceAllocation(Bandwidth bandwidth) { + super(bandwidth); + } }
diff --git a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java index c958271..7251ea1 100644 --- a/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java +++ b/core/api/src/main/java/org/onlab/onos/net/resource/BandwidthResourceRequest.java
@@ -3,7 +3,7 @@ /** * Representation of a request for bandwidth resource. */ -public final class BandwidthResourceRequest implements ResourceRequest { +public class BandwidthResourceRequest implements ResourceRequest { private final Bandwidth bandwidth; /**
diff --git a/core/api/src/main/java/org/onlab/onos/net/resource/LambdaResourceAllocation.java b/core/api/src/main/java/org/onlab/onos/net/resource/LambdaResourceAllocation.java index 1ed63b4..a8686ea 100644 --- a/core/api/src/main/java/org/onlab/onos/net/resource/LambdaResourceAllocation.java +++ b/core/api/src/main/java/org/onlab/onos/net/resource/LambdaResourceAllocation.java
@@ -3,11 +3,25 @@ /** * Representation of allocated lambda resource. */ -public interface LambdaResourceAllocation extends LambdaResourceRequest { +public class LambdaResourceAllocation extends LambdaResourceRequest { + private final Lambda lambda; + + /** + * Creates a new {@link LambdaResourceAllocation} with {@link Lambda} + * object. + * + * @param lambda allocated lambda + */ + public LambdaResourceAllocation(Lambda lambda) { + this.lambda = lambda; + } + /** * Returns the lambda resource. * * @return the lambda resource */ - Lambda lambda(); + Lambda lambda() { + return lambda; + } }
diff --git a/core/api/src/main/java/org/onlab/onos/net/resource/LinkResourceAllocations.java b/core/api/src/main/java/org/onlab/onos/net/resource/LinkResourceAllocations.java index a3d3e87..3dce62f 100644 --- a/core/api/src/main/java/org/onlab/onos/net/resource/LinkResourceAllocations.java +++ b/core/api/src/main/java/org/onlab/onos/net/resource/LinkResourceAllocations.java
@@ -5,7 +5,7 @@ /** * Representation of allocated link resources. */ -public interface LinkResourceAllocations extends LinkResourceRequest { +public interface LinkResourceAllocations { /** * Returns allocated resource for the given link. *