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.cfm.service; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.incubator.net.l2monitoring.cfm.Mep; |
| 21 | import org.onosproject.incubator.net.l2monitoring.cfm.MepEntry; |
| 22 | import org.onosproject.incubator.net.l2monitoring.cfm.MepLbCreate; |
| 23 | import org.onosproject.incubator.net.l2monitoring.cfm.MepLtCreate; |
| 24 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdShort; |
| 25 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MdId; |
| 26 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId; |
| 27 | |
| 28 | /** |
| 29 | * For the management of Maintenance Association Endpoints. |
| 30 | * |
| 31 | * These are dependent on the Maintenance Domain service which maintains the |
| 32 | * Maintenance Domain and Maintenance Associations |
| 33 | */ |
| 34 | public interface CfmMepService { |
| 35 | /** |
| 36 | * Retrieve all {@link org.onosproject.incubator.net.l2monitoring.cfm.MepEntry}(s) belonging to an MA. |
| 37 | * @param mdName A Maintenance Domain |
| 38 | * @param maName A Maintetance Association in the MD |
| 39 | * @return A collection of MEP Entries |
| 40 | * @throws CfmConfigException If there a problem with the MD or MA |
| 41 | */ |
| 42 | Collection<MepEntry> getAllMeps(MdId mdName, MaIdShort maName) |
| 43 | throws CfmConfigException; |
| 44 | |
| 45 | /** |
| 46 | * Retrieve a named {@link org.onosproject.incubator.net.l2monitoring.cfm.MepEntry} belonging to an MA. |
| 47 | * @param mdName A Maintenance Domain |
| 48 | * @param maName A Maintetance Association in the MD |
| 49 | * @param mepId A Mep Id |
| 50 | * @return A MEP Entry or null if none found |
| 51 | * @throws CfmConfigException If there a problem with the MD, MA or MEP |
| 52 | */ |
| 53 | MepEntry getMep(MdId mdName, MaIdShort maName, MepId mepId) |
| 54 | throws CfmConfigException; |
| 55 | |
| 56 | /** |
| 57 | * Delete a named {@link org.onosproject.incubator.net.l2monitoring.cfm.Mep} belonging to an MA. |
| 58 | * @param mdName A Maintenance Domain |
| 59 | * @param maName A Maintetance Association in the MD |
| 60 | * @param mepId A Mep Id |
| 61 | * @return true if the MEP was deleted successfully. false if it was not found |
| 62 | * @throws CfmConfigException If there a problem with the MD or MA |
| 63 | */ |
| 64 | boolean deleteMep(MdId mdName, MaIdShort maName, MepId mepId) |
| 65 | throws CfmConfigException; |
| 66 | |
| 67 | /** |
| 68 | * Create a named {@link org.onosproject.incubator.net.l2monitoring.cfm.Mep} on an MA. |
| 69 | * @param mdName A Maintenance Domain |
| 70 | * @param maName A Maintetance Association in the MD |
| 71 | * @param mep A Mep object |
| 72 | * @return False if it was created successfully. True if the object already exists. |
| 73 | * @throws CfmConfigException If there a problem with the MD, MA or MEP |
| 74 | */ |
| 75 | boolean createMep(MdId mdName, MaIdShort maName, Mep mep) |
| 76 | throws CfmConfigException; |
| 77 | |
| 78 | /** |
| 79 | * Create a {@link org.onosproject.incubator.net.l2monitoring.cfm.MepLbEntry Loopback} session on the named Mep. |
| 80 | * @param mdName A Maintenance Domain |
| 81 | * @param maName A Maintetance Association in the MD |
| 82 | * @param mepId A Mep Id |
| 83 | * @param lbCreate The Loopback session details |
| 84 | * @throws CfmConfigException If there a problem with the MD, MA or MEP |
| 85 | */ |
| 86 | void transmitLoopback(MdId mdName, MaIdShort maName, MepId mepId, |
| 87 | MepLbCreate lbCreate) throws CfmConfigException; |
| 88 | |
| 89 | /** |
| 90 | * Abort a {@link org.onosproject.incubator.net.l2monitoring.cfm.MepLbEntry Loopback} session on the named Mep. |
| 91 | * @param mdName A Maintenance Domain |
| 92 | * @param maName A Maintetance Association in the MD |
| 93 | * @param mepId A Mep Id |
| 94 | * @throws CfmConfigException If there a problem with the MD, MA or MEP |
| 95 | */ |
| 96 | void abortLoopback(MdId mdName, MaIdShort maName, MepId mepId) |
| 97 | throws CfmConfigException; |
| 98 | |
| 99 | /** |
| 100 | * Create a {@link org.onosproject.incubator.net.l2monitoring.cfm.MepLtEntry Linktrace} session on the named Mep. |
| 101 | * @param mdName A Maintenance Domain |
| 102 | * @param maName A Maintetance Association in the MD |
| 103 | * @param mepId A Mep Id |
| 104 | * @param ltCreate The Linktrace session details |
| 105 | * @throws CfmConfigException If there a problem with the MD, MA or MEP |
| 106 | */ |
| 107 | void transmitLinktrace(MdId mdName, MaIdShort maName, MepId mepId, |
| 108 | MepLtCreate ltCreate) throws CfmConfigException; |
| 109 | } |