Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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.incubator.net.l2monitoring.soam.delay; |
| 17 | |
| 18 | import java.time.Duration; |
| 19 | import java.util.Collection; |
| 20 | |
| 21 | import org.onosproject.incubator.net.l2monitoring.soam.SoamId; |
| 22 | |
| 23 | /** |
| 24 | * Delay Measurement from ITU Y.1731 Chapter 8.2, MEF 17, MEF 36.1 and MEF 39. |
| 25 | * |
| 26 | * This represents the result returned and includes the parameters used to |
| 27 | * configure the DM when it was created |
| 28 | */ |
| 29 | public interface DelayMeasurementEntry extends DelayMeasurementCreate { |
| 30 | /** |
| 31 | * This uniquely identifies a scheduled measurement. |
| 32 | * It is automatically generated by the server on creation of a new measurement |
| 33 | * @return the id |
| 34 | */ |
| 35 | SoamId dmId(); |
| 36 | |
| 37 | /** |
| 38 | * The current status of the DM session. |
| 39 | * A value of 'active' indicates the current DM session is active, |
| 40 | * i.e. the current time lies between the start time and the stop time, and |
| 41 | * enabled is true. A value of 'not-active' indicates the current DM session |
| 42 | * is not active, i.e. it has not started yet, has stopped upon reaching the |
| 43 | * stop time, or is disabled |
| 44 | * @return the status |
| 45 | */ |
| 46 | SessionStatus sessionStatus(); |
| 47 | |
| 48 | /** |
| 49 | * The two-way frame delay calculated by this MEP from the last received SOAM PDU. |
| 50 | * This object is undefined is measurement-type is dm1-transmitted or dm1-received |
| 51 | * @return The delay as a java duration |
| 52 | */ |
| 53 | Duration frameDelayTwoWay(); |
| 54 | |
| 55 | /** |
| 56 | * The frame delay in the forward direction calculated by this MEP from the last received SOAM PDU. |
| 57 | * The value of this object may not be accurate in the absence of sufficiently |
| 58 | * precise clock synchronization. |
| 59 | * This object is undefined is measurement-type is dm1-transmitted |
| 60 | * @return The delay as a java duration |
| 61 | */ |
| 62 | Duration frameDelayForward(); |
| 63 | |
| 64 | /** |
| 65 | * The frame delay in the backward direction calculated by this MEP from the last received SOAM PDU. |
| 66 | * The value of this object may not be accurate in the absence of sufficiently |
| 67 | * precise clock synchronization. |
| 68 | * This object is undefined is measurement-type is dm1-transmitted or dm1-received |
| 69 | * @return The delay as a java duration |
| 70 | */ |
| 71 | Duration frameDelayBackward(); |
| 72 | |
| 73 | /** |
| 74 | * The last two-way inter-frame delay interval calculated by this MEP. |
| 75 | * The value of this object is undefined when measurement-type is dm1-transmitted or dm1-received |
| 76 | * @return The delay as a java duration |
| 77 | */ |
| 78 | Duration interFrameDelayVariationTwoWay(); |
| 79 | |
| 80 | /** |
| 81 | * The last one-way inter-frame delay interval in the forward direction calculated by this MEP. |
| 82 | * The value of this object is undefined when measurement-type is dm1-transmitted |
| 83 | * @return The delay as a java duration |
| 84 | */ |
| 85 | Duration interFrameDelayVariationForward(); |
| 86 | |
| 87 | /** |
| 88 | * The last one-way inter-frame delay interval in the backward direction calculated by this MEP. |
| 89 | * The value of this object is undefined when measurement-type is |
| 90 | * dm1-transmitted or dm1-received |
| 91 | * @return The delay as a java duration |
| 92 | */ |
| 93 | Duration interFrameDelayVariationBackward(); |
| 94 | |
| 95 | /** |
| 96 | * The results for the current Measurement Interval in a SOAM Delay Measurement session. |
| 97 | * gathered during the interval indicated by measurement-interval. |
| 98 | * @return The current set of results |
| 99 | */ |
| 100 | DelayMeasurementStatCurrent currentResult(); |
| 101 | |
| 102 | /** |
| 103 | * The results for history Measurement Intervals in a SOAM Delay Measurement session. |
| 104 | * @return A collection of history results |
| 105 | */ |
| 106 | Collection<DelayMeasurementStatHistory> historicalResults(); |
| 107 | |
| 108 | /** |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 109 | * Builder for {@link DelayMeasurementEntry}. |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 110 | */ |
| 111 | public interface DmEntryBuilder extends DmCreateBuilder { |
| 112 | DmEntryBuilder sessionStatus(SessionStatus sessionStatus); |
| 113 | |
| 114 | DmEntryBuilder frameDelayTwoWay(Duration frameDelayTwoWay); |
| 115 | |
| 116 | DmEntryBuilder frameDelayForward(Duration frameDelayForward); |
| 117 | |
| 118 | DmEntryBuilder frameDelayBackward(Duration frameDelayBackward); |
| 119 | |
| 120 | DmEntryBuilder interFrameDelayVariationTwoWay(Duration interFrameDelayVariationTwoWay); |
| 121 | |
| 122 | DmEntryBuilder interFrameDelayVariationForward(Duration interFrameDelayVariationForward); |
| 123 | |
| 124 | DmEntryBuilder interFrameDelayVariationBackward(Duration interFrameDelayVariationBackward); |
| 125 | |
| 126 | DmEntryBuilder currentResult(DelayMeasurementStatCurrent currentResult); |
| 127 | |
| 128 | DmEntryBuilder addToHistoricalResults( |
| 129 | DelayMeasurementStatHistory historicalResult); |
| 130 | |
| 131 | DelayMeasurementEntry build(); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Session Status options. |
| 136 | */ |
| 137 | public enum SessionStatus { |
| 138 | ACTIVE, |
| 139 | NOT_ACTIVE; |
| 140 | } |
| 141 | } |