Madan Jampani | c27b6b2 | 2016-02-05 11:36:31 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Madan Jampani | c27b6b2 | 2016-02-05 11:36:31 -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 | |
| 17 | package org.onosproject.net.statistic; |
| 18 | |
| 19 | import org.onosproject.net.ConnectPoint; |
| 20 | |
| 21 | /** |
| 22 | * Summary Load classified by flow live type. |
| 23 | */ |
| 24 | public class SummaryFlowEntryWithLoad { |
| 25 | private ConnectPoint cp; |
| 26 | private Load totalLoad; |
| 27 | private Load immediateLoad; |
| 28 | private Load shortLoad; |
| 29 | private Load midLoad; |
| 30 | private Load longLoad; |
| 31 | private Load unknownLoad; |
| 32 | |
| 33 | /** |
| 34 | * Creates a new summary flow entry having load for the given connect point and total load. |
| 35 | * |
| 36 | * @param cp connect point |
| 37 | * @param totalLoad total load |
| 38 | */ |
| 39 | public SummaryFlowEntryWithLoad(ConnectPoint cp, Load totalLoad) { |
| 40 | this.cp = cp; |
| 41 | this.totalLoad = totalLoad; |
| 42 | this.immediateLoad = new DefaultLoad(); |
| 43 | this.shortLoad = new DefaultLoad(); |
| 44 | this.midLoad = new DefaultLoad(); |
| 45 | this.longLoad = new DefaultLoad(); |
| 46 | this.unknownLoad = new DefaultLoad(); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Creates a new summary flow entry having load for the given connect point |
| 51 | * and total, immediate, short, mid, and long load. |
| 52 | * |
| 53 | * @param cp connect point |
| 54 | * @param totalLoad total load |
| 55 | * @param immediateLoad immediate load |
| 56 | * @param shortLoad short load |
| 57 | * @param midLoad mid load |
| 58 | * @param longLoad long load |
| 59 | */ |
| 60 | public SummaryFlowEntryWithLoad(ConnectPoint cp, |
| 61 | Load totalLoad, Load immediateLoad, Load shortLoad, Load midLoad, Load longLoad) { |
| 62 | this.cp = cp; |
| 63 | this.totalLoad = totalLoad; |
| 64 | this.immediateLoad = immediateLoad; |
| 65 | this.shortLoad = shortLoad; |
| 66 | this.midLoad = midLoad; |
| 67 | this.longLoad = longLoad; |
| 68 | this.unknownLoad = new DefaultLoad(); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Creates a new summary flow entry having load for the given connect point |
| 73 | * and total, immediate, short, mid, long, and unknown load. |
| 74 | * |
| 75 | * @param cp connect point |
| 76 | * @param totalLoad total load |
| 77 | * @param immediateLoad immediate load |
| 78 | * @param shortLoad short load |
| 79 | * @param midLoad mid load |
| 80 | * @param longLoad long load |
| 81 | * @param unknownLoad long load |
| 82 | */ |
| 83 | public SummaryFlowEntryWithLoad(ConnectPoint cp, |
| 84 | Load totalLoad, Load immediateLoad, |
| 85 | Load shortLoad, Load midLoad, Load longLoad, Load unknownLoad) { |
| 86 | this.cp = cp; |
| 87 | this.totalLoad = totalLoad; |
| 88 | this.immediateLoad = immediateLoad; |
| 89 | this.shortLoad = shortLoad; |
| 90 | this.midLoad = midLoad; |
| 91 | this.longLoad = longLoad; |
| 92 | this.unknownLoad = unknownLoad; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Returns connect point. |
| 97 | * |
| 98 | * @return connect point |
| 99 | */ |
| 100 | public ConnectPoint connectPoint() { |
| 101 | return cp; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Returns total load of connect point. |
| 106 | * |
| 107 | * @return total load |
| 108 | */ |
| 109 | public Load totalLoad() { |
| 110 | return totalLoad; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Returns immediate load of connect point. |
| 115 | * |
| 116 | * @return immediate load |
| 117 | */ |
| 118 | public Load immediateLoad() { |
| 119 | return immediateLoad; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Returns short load of connect point. |
| 124 | * |
| 125 | * @return short load |
| 126 | */ |
| 127 | public Load shortLoad() { |
| 128 | return shortLoad; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Returns mid load of connect point. |
| 133 | * |
| 134 | * @return mid load |
| 135 | */ |
| 136 | public Load midLoad() { |
| 137 | return midLoad; |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Returns long load of connect point. |
| 142 | * |
| 143 | * @return long load |
| 144 | */ |
| 145 | public Load longLoad() { |
| 146 | return longLoad; |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * Returns unknown load of connect point. |
| 151 | * |
| 152 | * @return unknown load |
| 153 | */ |
| 154 | public Load unknownLoad() { |
| 155 | return unknownLoad; |
| 156 | } |
| 157 | } |