blob: 89428b0b169242d3d4d17b4a16848369fe8b88ce [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
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 */
16package org.onosproject.incubator.net.l2monitoring.soam;
17
18import java.time.Duration;
19
20import org.onosproject.incubator.net.l2monitoring.cfm.Mep.Priority;
21import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
22import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate.DataPattern;
23import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate.TestTlvPattern;
24import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate.Version;
25
26/**
27 * A base interface with attributes that are common to both Delay and Loss Measurements.
28 */
29public interface MeasurementCreateBase {
30 /**
31 * The version of the PDUs used to perform Loss or Delay Measurement.
32 * The exact PDUs to use are specified by this object in combination with measurement-type
33 * @return The version of the PDUs
34 */
35 Version version();
36
37 /**
38 * The remote MEP to perform the tests against.
39 * @return An ID of a MEP
40 */
41 MepId remoteMepId();
42
43 /**
44 * The interval between Loss or Delay Measurement OAM message transmission.
45 * For Loss Measurement monitoring applications the default value is 1 sec.
46 * This object is not applicable if measurement-type is set to 'ccm' and is ignored for that Loss Measurement Type
47 * @return A java Duration
48 */
49 Duration messagePeriod();
50
51 /**
52 * The priority of frames with Performance Monitoring OAM message information.
53 * @return A priority enumerated value 0-7
54 */
55 Priority priority();
56
57 /**
58 * The Loss Measurement frame size between 64 bytes and the maximum transmission unit of the EVC.
59 * The range of frame sizes from 64 through 2000 octets need to be supported,
60 * and the range of frame sizes from 2001 through 9600 octets is suggested be supported.
61 * The adjustment to the frame size of the standard frame size is accomplished
62 * by the addition of a Data or Test TLV. A Data or Test TLV is only added to
63 * the frame if the frame size is greater than 64 bytes
64 * @return frame size in bytes
65 */
66 Short frameSize();
67
68 /**
69 * The LM data pattern included in a Data TLV.
70 * when the size of the LM frame is determined by the frame-size object and test-tlv-included is 'false'.
71 * If the frame size object does not define the LM frame size or
72 * test-tlv-included is 'true' the value of this object is ignored
73 * @return The data pattern - ones or zeroes
74 */
75 DataPattern dataPattern();
76
77 /**
78 * Whether a Test TLV or Data TLV is included when the size of the LM frame is determined by the frame-size object.
79 * If the frame-size object does not define the LM frame size the value of
80 * this object is ignored.
81 * @return true indicates that the Test TLV is to be included, false indicates it is not
82 */
83 boolean testTlvIncluded();
84
85 /**
86 * The type of test pattern to be sent in the LM frame Test TLV.
87 * when the size of LM PDU is determined by the frame-size object and
88 * test-tlv-included is 'true'.
89 * If the frame size object does not define the LM frame size or
90 * test-tlv-included is 'false' the value of this object is ignored
91 * @return A TLV pattern enum
92 */
93 TestTlvPattern testTlvPattern();
94
95 /**
96 * The Measurement Interval for FLR statistics.
97 * A Measurement Interval of 15 minutes needs to be supported, other
98 * intervals may be supported.
99 * @return A java Duration
100 */
101 Duration measurementInterval();
102
103 /**
104 * The number of completed measurement intervals to store in the history statistic table.
105 * At least 32 completed measurement intervals are to be stored.
106 * 96 measurement intervals are recommended to be stored
107 * @return The number to be stored.
108 */
109 Short numberIntervalsStored();
110
111 /**
112 * Whether the measurement intervals for the Loss Measurement session are aligned with a zero offset to real time.
113 * The value 'true' indicates that each Measurement Interval starts at a time
114 * which is aligned to NE time source hour if the interval is a factor of an
115 * hour, i.e. 60min/15min = 4. For instance, a measurement time interval of
116 * 15 minutes would stop/start the measurement interval at 0, 15, 30, and 45
117 * minutes of an hour. A measurement interval of 7 minutes would not align to
118 * the hour since 7 minutes is NOT a factor of an hour, i.e. 60min/7min = 8.6,
119 * and the behavior is the same as if the object is set to 'false'.
120 * The value 'false' indicates that each Measurement Interval starts at a time
121 * which is indicated by repetition-period.
122 * One side effect of the usage of this parameter is that if the value is true
123 * and the repetition-period is not a factor of an hour then the start of the
124 * next Measurement Interval will be delayed until the next factor of an hour.
125 * @return See above for the meaning of true and false
126 */
127 boolean alignMeasurementIntervals();
128
129 /**
130 * The offset in minutes from the time of day value.
131 * if align-measurement-intervals is 'true' and the repetition time is a factor
132 * of 60 minutes. If not, the value of this object is ignored.
133 * If the Measurement Interval is 15 minutes and align-measurement-intervals
134 * is true and if this object was set to 5 minutes, the Measurement Intervals
135 * would start at 5, 20, 35, 50 minutes past each hour
136 * @return A java Duration
137 */
138 Duration alignMeasurementOffset();
139
140 /**
141 * Defines the session start time.
142 * @return An object with the start time type and optionally an instant
143 */
144 StartTime startTime();
145
146 /**
147 * Defines the session stop time.
148 * @return An object with the stop time type and optionally an instant
149 */
150 StopTime stopTime();
151
152 /**
153 * Indicates whether the current session is defined to be 'proactive' or 'on-demand.
154 * @return An enumerated value
155 */
156 SessionType sessionType();
157
158 /**
159 * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.MeasurementCreateBase}.
160 */
161 public interface MeasCreateBaseBuilder {
162 MeasCreateBaseBuilder messagePeriod(
163 Duration messagePeriod) throws SoamConfigException;
164
165 MeasCreateBaseBuilder frameSize(Short frameSize) throws SoamConfigException;
166
167 MeasCreateBaseBuilder dataPattern(DataPattern dataPattern);
168
169 MeasCreateBaseBuilder testTlvIncluded(boolean testTlvIncluded);
170
171 MeasCreateBaseBuilder testTlvPattern(TestTlvPattern testTlvPattern);
172
173 MeasCreateBaseBuilder measurementInterval(
174 Duration measurementInterval) throws SoamConfigException;
175
176 MeasCreateBaseBuilder numberIntervalsStored(
177 Short numberIntervalsStored) throws SoamConfigException;
178
179 MeasCreateBaseBuilder alignMeasurementIntervals(
180 boolean alignMeasurementIntervals);
181
182 MeasCreateBaseBuilder alignMeasurementOffset(
183 Duration alignMeasurementOffset) throws SoamConfigException;
184
185 MeasCreateBaseBuilder startTime(StartTime startTime) throws SoamConfigException;
186
187 MeasCreateBaseBuilder stopTime(StopTime stopTime) throws SoamConfigException;
188
189 MeasCreateBaseBuilder sessionType(SessionType sessionType);
190
191 }
192
193 /**
194 * Supported session types.
195 * reference [MEF SOAM IA] R3
196 */
197 public enum SessionType {
198 /**
199 * The current session is 'proactive'.
200 */
201 PROACTIVE,
202 /**
203 * The current session is 'on-demand'.
204 */
205 ONDEMAND;
206 }
207
208}