blob: fc777cb97a4c2c9b95c2702ae5b3c844e5445420 [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.util.Collection;
19import java.util.Optional;
20
21import org.onosproject.incubator.net.l2monitoring.cfm.MepTsCreate;
22import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdShort;
23import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MdId;
24import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
25import org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException;
26import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate;
27import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementEntry;
28import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent;
29import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatHistory;
30import org.onosproject.incubator.net.l2monitoring.soam.loss.LossMeasurementCreate;
31import org.onosproject.incubator.net.l2monitoring.soam.loss.LossMeasurementEntry;
32import org.onosproject.incubator.net.l2monitoring.soam.loss.LossMeasurementStatCurrent;
33
34/**
35 * Methods callable on MEPs to implement SOAM functionality.
36 * Most of the methods have been derived from the MEF 38 and MEF 39 standards
37 *
38 */
39public interface SoamService {
40 /**
41 * Get all of the Delay Measurements on a particular MEP.
42 *
43 * @param mdName The Maintenance Domain of the MEP
44 * @param maName The Maintenance Association of the MEP
45 * @param mepId The id of the MEP itself
46 * @return A collection of Delay Measurements and their children
47 * @throws CfmConfigException If there's a problem with Cfm attributes
48 * @throws SoamConfigException If there's a problem with Soam attributes
49 */
50 Collection<DelayMeasurementEntry> getAllDms(MdId mdName, MaIdShort maName, MepId mepId)
51 throws CfmConfigException, SoamConfigException;
52
53 /**
54 * Get a named Delay Measurements on a particular MEP.
55 * While devices are not required to have named delay measurement objects
56 * so do. The getAllDms() method may have produced a list of DM Ids that can
57 * be used here to retrieve one DM at a time
58 *
59 * @param mdName The Maintenance Domain of the MEP
60 * @param maName The Maintenance Association of the MEP
61 * @param mepId The id of the MEP itself
62 * @param dmId The id of the Delay Measurement
63 * @return A collection of Delay Measurements and their children
64 * @throws CfmConfigException If there's a problem with Cfm attributes
65 * @throws SoamConfigException If there's a problem with Soam attributes
66 */
67 DelayMeasurementEntry getDm(MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId)
68 throws CfmConfigException, SoamConfigException;
69
70 /**
71 * Get only the current stats of a named Delay Measurements on a particular MEP.
72 * It may be useful to retrieve the current stats on their own to retrieve
73 * values between Delay Measurement intervals
74 *
75 * @param mdName The Maintenance Domain of the MEP
76 * @param maName The Maintenance Association of the MEP
77 * @param mepId The id of the MEP itself
78 * @param dmId The id of the Delay Measurement
79 * @throws CfmConfigException If there's a problem with Cfm attributes
80 * @throws SoamConfigException If there's a problem with Soam attributes
81 * @return A collection of Delay Measurements and their children
82 */
83 DelayMeasurementStatCurrent getDmCurrentStat(
84 MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId)
85 throws CfmConfigException, SoamConfigException;
86
87 /**
88 * Get only the history stats of a named Delay Measurements on a particular MEP.
89 * It may be useful to retrieve the history stats on their own to retrieve
90 * values before they have been overwritten
91 *
92 * @param mdName The Maintenance Domain of the MEP
93 * @param maName The Maintenance Association of the MEP
94 * @param mepId The id of the MEP itself
95 * @param dmId The id of the Delay Measurement
96 * @throws CfmConfigException If there's a problem with Cfm attributes
97 * @throws SoamConfigException If there's a problem with Soam attributes
98 * @return A collection of Delay Measurements and their children
99 */
100 Collection<DelayMeasurementStatHistory> getDmHistoricalStats(
101 MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId)
102 throws CfmConfigException, SoamConfigException;
103
104 /**
105 * Create a Delay Measurement on a particular MEP.
106 * MEF 39 defines a delay measurement as an ephemeral object and does not
107 * require the supporting device to persist it. It runs as an action until
108 * stopped with the corresponding abort action below.
109 *
110 * @param mdName The Maintenance Domain of the MEP
111 * @param maName The Maintenance Association of the MEP
112 * @param mepId The id of the MEP itself
113 * @param dm The parameters of the Delay Measurement
114 * @return The id of the newly created DM if available
115 * @throws CfmConfigException If there's a problem with Cfm attributes
116 * @throws SoamConfigException If there's a problem with Soam attributes
117 */
118 Optional<SoamId> createDm(MdId mdName, MaIdShort maName, MepId mepId,
119 DelayMeasurementCreate dm) throws CfmConfigException, SoamConfigException;
120
121 /**
122 * Stop all Delay Measurements on a particular MEP.
123 * This stops the Delay Measurement activity started through the
124 * createDm action above. It is up to the individual device how to implement
125 * it. It does not necessarily mean delete the DM.
126 *
127 * @param mdName The Maintenance Domain of the MEP
128 * @param maName The Maintenance Association of the MEP
129 * @param mepId The id of the MEP itself
130 * @throws CfmConfigException When the command cannot be completed
131 */
132 void abortDm(MdId mdName, MaIdShort maName, MepId mepId)
133 throws CfmConfigException;
134
135 /**
136 * Stop a particular named Delay Measurement on a particular MEP.
137 * This stops the Delay Measurement activity started through the
138 * createDm action above. It is up to the individual device how to implement
139 * it. It does not necessarily mean delete the DM.
140 *
141 * @param mdName The Maintenance Domain of the MEP
142 * @param maName The Maintenance Association of the MEP
143 * @param mepId The id of the MEP itself
144 * @param dmId The id of the DM
145 * @throws CfmConfigException When the command cannot be completed
146 */
147 void abortDm(MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId)
148 throws CfmConfigException;
149
150 /**
151 * Clear the history stats on all Delay Measurements on a particular MEP.
152 * This removes any historical stats stored on a device for one MEP
153 * It does NOT require that the Delay Measurement test is aborted.
154 *
155 * @param mdName The Maintenance Domain of the MEP
156 * @param maName The Maintenance Association of the MEP
157 * @param mepId The id of the MEP itself
158 * @throws CfmConfigException When the command cannot be completed
159 */
160 void clearDelayHistoryStats(MdId mdName, MaIdShort maName, MepId mepId)
161 throws CfmConfigException;
162
163 /**
164 * Clear the history stats on a named Delay Measurement on a particular MEP.
165 * This removes any historical stats stored on a device for one DM on one MEP
166 * It does NOT require that the Delay Measurement test is aborted.
167 *
168 * @param mdName The Maintenance Domain of the MEP
169 * @param maName The Maintenance Association of the MEP
170 * @param mepId The id of the MEP itself
171 * @param dmId The id of the DM
172 * @throws CfmConfigException When the command cannot be completed
173 */
174 void clearDelayHistoryStats(MdId mdName, MaIdShort maName, MepId mepId,
175 SoamId dmId) throws CfmConfigException;
176
177 /**
178 * Get all of the Loss Measurements on a particular MEP.
179 *
180 * @param mdName The Maintenance Domain of the MEP
181 * @param maName The Maintenance Association of the MEP
182 * @param mepId The id of the MEP itself
183 * @return A collection of Loss Measurements and their children
184 * @throws CfmConfigException When the command cannot be completed
185 * @throws SoamConfigException When the command cannot be completed
186 */
187 Collection<LossMeasurementEntry> getAllLms(MdId mdName, MaIdShort maName, MepId mepId)
188 throws CfmConfigException, SoamConfigException;
189
190 /**
191 * Get a named Loss Measurements on a particular MEP.
192 * While devices are not required to have named Loss measurement objects
193 * some do. The getAllLms() method may have produced a list of LM Ids that
194 * can be used here to retrieve one LM at a time
195 *
196 * @param mdName The Maintenance Domain of the MEP
197 * @param maName The Maintenance Association of the MEP
198 * @param mepId The id of the MEP itself
199 * @param lmId The id of the Loss Measurement
200 * @return A collection of Loss Measurements and their children
201 * @throws CfmConfigException When the command cannot be completed
202 * @throws SoamConfigException When the command cannot be completed
203 */
204 LossMeasurementEntry getLm(MdId mdName, MaIdShort maName, MepId mepId,
205 SoamId lmId) throws CfmConfigException, SoamConfigException;
206
207 /**
208 * Get only the current stats of a named Loss Measurements on a particular MEP.
209 * It may be useful to retrieve the current stats on their own to retrieve
210 * values between Loss Measurement intervals
211 *
212 * @param mdName The Maintenance Domain of the MEP
213 * @param maName The Maintenance Association of the MEP
214 * @param mepId The id of the MEP itself
215 * @param lmId The id of the Loss Measurement
216 * @return A collection of Loss Measurements and their children
217 */
218 LossMeasurementStatCurrent getLmCurrentStat(
219 MdId mdName, MaIdShort maName, MepId mepId, SoamId lmId);
220
221 /**
222 * Get only the history stats of a named Loss Measurements on a particular MEP.
223 * It may be useful to retrieve the history stats on their own to retrieve
224 * values before they have been overwritten
225 *
226 * @param mdName The Maintenance Domain of the MEP
227 * @param maName The Maintenance Association of the MEP
228 * @param mepId The id of the MEP itself
229 * @param lmId The id of the Loss Measurement
230 * @return A collection of Loss Measurements and their children
231 */
232 Collection<LossMeasurementStatCurrent> getLmHistoricalStats(
233 MdId mdName, MaIdShort maName, MepId mepId, SoamId lmId);
234
235 /**
236 * Create a Loss Measurement on a particular MEP.
237 * MEF 39 defines a Loss measurement as an ephemeral object and does not
238 * require the supporting device to persist it. It runs as an action until
239 * stopped with the corresponding abort action below.
240 *
241 * @param mdName The Maintenance Domain of the MEP
242 * @param maName The Maintenance Association of the MEP
243 * @param mepId The id of the MEP itself
244 * @param lm The parameters of the Loss Measurement
245 * @return The id of the newly created LM if available
246 * @throws CfmConfigException When the command cannot be completed
247 * @throws SoamConfigException When the command cannot be completed
248 */
249 Optional<SoamId> createLm(MdId mdName, MaIdShort maName, MepId mepId,
250 LossMeasurementCreate lm) throws CfmConfigException, SoamConfigException;
251
252 /**
253 * Stop all Loss Measurements on a particular MEP.
254 * This stops the Loss Measurement activity started through the
255 * createLm action above. It is up to the individual device how to implement
256 * it. It does not necessarily mean delete the LM.
257 *
258 * @param mdName The Maintenance Domain of the MEP
259 * @param maName The Maintenance Association of the MEP
260 * @param mepId The id of the MEP itself
261 * @throws CfmConfigException When the command cannot be completed
262 */
263 void abortLm(MdId mdName, MaIdShort maName, MepId mepId)
264 throws CfmConfigException;
265
266 /**
267 * Stop a particular named Loss Measurement on a particular MEP.
268 * This stops the Loss Measurement activity started through the
269 * createLm action above. It is up to the individual device how to implement
270 * it. It does not necessarily mean delete the LM.
271 *
272 * @param mdName The Maintenance Domain of the MEP
273 * @param maName The Maintenance Association of the MEP
274 * @param mepId The id of the MEP itself
275 * @param lmId The id of the LM
276 * @throws CfmConfigException When the command cannot be completed
277 */
278 void abortLm(MdId mdName, MaIdShort maName, MepId mepId, SoamId lmId)
279 throws CfmConfigException;
280
281 /**
282 * Clear the history stats on all Loss Measurements on a particular MEP.
283 * This removes any historical stats stored on a device for one MEP
284 * It does NOT require that the Loss Measurement test is aborted.
285 *
286 * @param mdName The Maintenance Domain of the MEP
287 * @param maName The Maintenance Association of the MEP
288 * @param mepId The id of the MEP itself
289 * @throws CfmConfigException When the command cannot be completed
290 */
291 void clearLossHistoryStats(MdId mdName, MaIdShort maName, MepId mepId)
292 throws CfmConfigException;
293
294 /**
295 * Clear the history stats on a named Loss Measurement on a particular MEP.
296 * This removes any historical stats stored on a device for one LM on one MEP
297 * It does NOT require that the Loss Measurement test is aborted.
298 *
299 * @param mdName The Maintenance Domain of the MEP
300 * @param maName The Maintenance Association of the MEP
301 * @param mepId The id of the MEP itself
302 * @param lmId The id of the LM
303 * @throws CfmConfigException When the command cannot be completed
304 */
305 void clearLossHistoryStats(MdId mdName, MaIdShort maName, MepId mepId,
306 SoamId lmId) throws CfmConfigException;
307
308 /**
309 * Create a Test Signal operation on a particular MEP.
310 * MEF39 defines the Test Signal as an ephemeral operation that is not
311 * required to be persisted by a device. Only one Test Signal is active
312 * on a MEP at a time
313 *
314 * @param mdName The Maintenance Domain of the MEP
315 * @param maName The Maintenance Association of the MEP
316 * @param mepId The id of the MEP itself
317 * @param tsCreate The parameters the Test Signal is created with
318 * @throws CfmConfigException When the command cannot be completed
319 */
320 void createTestSignal(MdId mdName, MaIdShort maName, MepId mepId,
321 MepTsCreate tsCreate) throws CfmConfigException;
322
323 /**
324 * Abort a Test Signal operation on a particular MEP.
325 * Abort a Test Signal operation on a Mep
326 *
327 * @param mdName The Maintenance Domain of the MEP
328 * @param maName The Maintenance Association of the MEP
329 * @param mepId The id of the MEP itself
330 * @throws CfmConfigException When the command cannot be completed
331 */
332 void abortTestSignal(MdId mdName, MaIdShort maName, MepId mepId)
333 throws CfmConfigException;
334}