ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright 2015 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 | */
|
| 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.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 97 | *
|
| 98 | * @return connect point
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 99 | */
|
| 100 | public ConnectPoint connectPoint() {
|
| 101 | return cp;
|
| 102 | }
|
| 103 |
|
| 104 | /**
|
| 105 | * Returns total load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 106 | *
|
| 107 | * @return total load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 108 | */
|
| 109 | public Load totalLoad() {
|
| 110 | return totalLoad;
|
| 111 | }
|
| 112 |
|
| 113 | /**
|
| 114 | * Returns immediate load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 115 | *
|
| 116 | * @return immediate load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 117 | */
|
| 118 | public Load immediateLoad() {
|
| 119 | return immediateLoad;
|
| 120 | }
|
| 121 |
|
| 122 | /**
|
| 123 | * Returns short load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 124 | *
|
| 125 | * @return short load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 126 | */
|
| 127 | public Load shortLoad() {
|
| 128 | return shortLoad;
|
| 129 | }
|
| 130 |
|
| 131 | /**
|
| 132 | * Returns mid load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 133 | *
|
| 134 | * @return mid load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 135 | */
|
| 136 | public Load midLoad() {
|
| 137 | return midLoad;
|
| 138 | }
|
| 139 |
|
| 140 | /**
|
| 141 | * Returns long load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 142 | *
|
| 143 | * @return long load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 144 | */
|
| 145 | public Load longLoad() {
|
| 146 | return longLoad;
|
| 147 | }
|
| 148 |
|
| 149 | /**
|
| 150 | * Returns unknown load of connect point.
|
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 151 | *
|
| 152 | * @return unknown load
|
ssyoon90 | a98825a | 2015-08-26 00:48:15 +0900 | [diff] [blame] | 153 | */
|
| 154 | public Load unknownLoad() {
|
| 155 | return unknownLoad;
|
| 156 | }
|
| 157 | }
|