Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.cpman; |
| 17 | |
| 18 | /** |
| 19 | * Include various control plane metrics. |
| 20 | */ |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 21 | public class ControlMetric { |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 22 | |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 23 | private final ControlMetricType metricType; |
| 24 | private final MetricValue metricValue; |
| 25 | |
Jian Li | c5cb4a1 | 2016-02-03 23:24:42 -0800 | [diff] [blame] | 26 | /** |
| 27 | * Constructs a control metric using the given control metric type and |
| 28 | * metric value. |
| 29 | * |
| 30 | * @param metricType metric type reference |
| 31 | * @param metricValue metric value reference |
| 32 | */ |
Jian Li | c132c11 | 2016-01-28 20:27:34 -0800 | [diff] [blame] | 33 | public ControlMetric(ControlMetricType metricType, MetricValue metricValue) { |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 34 | this.metricType = metricType; |
| 35 | this.metricValue = metricValue; |
| 36 | } |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 37 | |
Jian Li | c5cb4a1 | 2016-02-03 23:24:42 -0800 | [diff] [blame] | 38 | /** |
| 39 | * Returns metric type reference. |
| 40 | * |
| 41 | * @return metric type reference |
| 42 | */ |
Jian Li | 7d180c5 | 2016-02-01 21:53:08 -0800 | [diff] [blame] | 43 | public ControlMetricType metricType() { |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 44 | return metricType; |
| 45 | } |
| 46 | |
Jian Li | c5cb4a1 | 2016-02-03 23:24:42 -0800 | [diff] [blame] | 47 | /** |
| 48 | * Returns metric value reference. |
| 49 | * |
| 50 | * @return metric value reference |
| 51 | */ |
Jian Li | 7d180c5 | 2016-02-01 21:53:08 -0800 | [diff] [blame] | 52 | public MetricValue metricValue() { |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 53 | return metricValue; |
| 54 | } |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 55 | } |