blob: 1b8e869258aded3029fd9f9e38d95ddff0196704 [file] [log] [blame]
Jordi Ortizaa8de492016-12-01 00:21:36 +01001/*
2 * Copyright 2015-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.net.meter;
17
18import org.onosproject.net.DeviceId;
19
20import java.util.Set;
21
22/**
23 * Meter Features of a device.
24 */
25public interface MeterFeatures {
26
27 /**
28 * Return the device id to which this meter features apply.
29 *
30 * @return the device id
31 */
32 DeviceId deviceId();
33
34 /**
35 * Returns the maximum number of meters accepted by the device.
36 *
37 * @return the maximum meter value.
38 */
39 long maxMeter();
40
41 /**
42 * Returns band types supported.
43 *
44 * @return the band types supported.
45 */
46 Set<Band.Type> bandTypes();
47
48 /**
49 * Returns unit types available for meters.
50 *
51 * @return the unit types available.
52 */
53 Set<Meter.Unit> unitTypes();
54
55 /**
56 * Returns if burst size is available.
57 *
58 * @return burst availability
59 */
60 boolean isBurstSupported();
61
62 /**
63 * Returns if statistics collection is available.
64 *
65 * @return statistics availability
66 */
67 boolean isStatsSupported();
68
69 /**
70 * Returns the maximum bands per meter.
71 *
72 * @return the max bands value
73 */
74 short maxBands();
75
76 /**
77 * Returns the maximum colors value for DiffServ operation.
78 *
79 * @return the maximum colors value.
80 */
81 short maxColor();
82
83 /**
84 * A meter features builder.
85 */
86 interface Builder {
87 /**
88 * Assigns the target device for this meter features.
89 *
90 * @param deviceId a device id
91 * @return this builder
92 */
93 Builder forDevice(DeviceId deviceId);
94
95 /**
96 * Assigns the max meters value for this meter features.
97 *
98 * @param maxMeter the maximum meters available
99 * @return this builder
100 */
101 Builder withMaxMeters(long maxMeter);
102
103 /**
104 * Assigns the max bands value for this meter features.
105 *
106 * @param maxBands the maximum bands available.
107 * @return this builder
108 */
109 Builder withMaxBands(short maxBands);
110
111 /**
112 * Assigns the max colors value for this meter features.
113 *
114 * @param maxColors the maximum colors available.
115 * @return this builder
116 */
117 Builder withMaxColors(short maxColors);
118
119 /**
120 * Assigns the band types for this meter features.
121 *
122 * @param types the band types available.
123 * @return this builder
124 */
125 Builder withBandTypes(Set<Band.Type> types);
126
127 /**
128 * Assigns the capabilities for this meter features.
129 *
130 * @param units the units available
131 * @return this
132 */
133 Builder withUnits(Set<Meter.Unit> units);
134
135 /**
136 * Assigns the burst capabilities.
137 *
138 * @param hasBurst if the burst is supported
139 * @return this builder
140 */
141 Builder hasBurst(boolean hasBurst);
142
143 /**
144 * Assigns the stats capabilities.
145 *
146 * @param hasStats if the statistics are supported
147 * @return this builder
148 */
149 Builder hasStats(boolean hasStats);
150
151 /**
152 * Builds the Meter Features based on the specified parameters.
153 *
154 * @return the meter features
155 */
156 MeterFeatures build();
157 }
158}