blob: 5743d8e38b9621c694136cba3a1d853a5c47cccd [file] [log] [blame]
Toshio Koide485b4782014-10-20 19:34:21 -07001package org.onlab.onos.net.resource;
2
3/**
4 * Representation of a request for bandwidth resource.
5 */
Toshio Koidefa0dff62014-10-23 11:46:44 -07006public class BandwidthResourceRequest implements ResourceRequest {
Toshio Koide569ca702014-10-23 11:37:44 -07007 private final Bandwidth bandwidth;
8
9 /**
10 * Creates a new {@link BandwidthResourceRequest} with {@link Bandwidth}
11 * object.
12 *
13 * @param bandwidth {@link Bandwidth} object to be requested
14 */
15 public BandwidthResourceRequest(Bandwidth bandwidth) {
16 this.bandwidth = bandwidth;
17 }
18
19 /**
20 * Creates a new {@link BandwidthResourceRequest} with bandwidth value.
21 *
22 * @param bandwidth bandwidth value to be requested
23 */
24 public BandwidthResourceRequest(double bandwidth) {
25 this.bandwidth = Bandwidth.valueOf(bandwidth);
26 }
27
Toshio Koide485b4782014-10-20 19:34:21 -070028 /**
29 * Returns the bandwidth resource.
30 *
31 * @return the bandwidth resource
32 */
Toshio Koided1865a42014-10-23 12:44:55 -070033 public Bandwidth bandwidth() {
Toshio Koide569ca702014-10-23 11:37:44 -070034 return bandwidth;
35 }
Toshio Koideca0fcff2014-10-23 14:08:36 -070036
37 @Override
38 public ResourceType type() {
39 return ResourceType.BANDWIDTH;
40 }
Toshio Koide485b4782014-10-20 19:34:21 -070041}