Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present 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.sdxl2; |
| 18 | |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 19 | import java.util.Optional; |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 23 | * Storage service for SDX-L2 application. |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 24 | */ |
| 25 | public interface SdxL2Store { |
| 26 | |
| 27 | /** |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 28 | * Creates a named SDX-L2. |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 29 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 30 | * @param sdxl2 name of SDX-L2 |
| 31 | * @throws SdxL2Exception if SDX-L2 is not added |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 32 | */ |
| 33 | void putSdxL2(String sdxl2) throws SdxL2Exception; |
| 34 | |
| 35 | /** |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 36 | * Removes a named SDX-L2. |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 37 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 38 | * @param sdxl2 name of SDX-L2 |
| 39 | * @throws SdxL2Exception if SDX-L2 is not removed |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 40 | */ |
| 41 | void removeSdxL2(String sdxl2) throws SdxL2Exception; |
| 42 | |
| 43 | /** |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 44 | * Returns a set of SDX-L2 names. |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 45 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 46 | * @return set of SDX-L2 names |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 47 | */ |
| 48 | Set<String> getSdxL2s(); |
| 49 | |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 50 | /** |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 51 | * Adds a Connection Point to an SDX-L2. |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 52 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 53 | * @param sdxl2 name of SDX-L2 |
| 54 | * @param connectionPoint SDX-L2 cCnnection Point object |
| 55 | * @throws SdxL2Exception if SDX-L2 is not added |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 56 | */ |
| 57 | void addSdxL2ConnectionPoint(String sdxl2, SdxL2ConnectionPoint connectionPoint) throws SdxL2Exception; |
| 58 | |
| 59 | /** |
| 60 | * Returns all the SDX-L2 connection points names or the SDX-L2 connection points name |
| 61 | * that are related to an SDX-L2. |
| 62 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 63 | * @param sdxl2 name of the SDX-L2 (optional) |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 64 | * @return a set of SDX-L2 connection points names, the result depends on the input parameter; |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 65 | * @throws SdxL2Exception if SDX-L2 cannot be found |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 66 | */ |
| 67 | Set<String> getSdxL2ConnectionPoints(Optional<String> sdxl2) throws SdxL2Exception; |
| 68 | |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 69 | /** |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 70 | * Removes a named Connection Point in an SDX-L2. |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 71 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 72 | * @param sdxl2cp name of Connection Point |
| 73 | * @throws SdxL2Exception if SDX-L2 Connection Point does not exist |
pierventre | 3849e56 | 2016-05-11 11:47:32 +0200 | [diff] [blame] | 74 | */ |
| 75 | void removeSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception; |
| 76 | |
pierventre | 1483e64 | 2016-06-08 18:52:29 +0200 | [diff] [blame] | 77 | /** |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 78 | * Returns a Connection Point in a SDX-L2. |
pierventre | 1483e64 | 2016-06-08 18:52:29 +0200 | [diff] [blame] | 79 | * |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 80 | * @param sdxl2cp name of Connection Point |
| 81 | * @return relative SDX-L2 Connection Point |
| 82 | * @throws SdxL2Exception if SDX-L2 CP cannot be found |
pierventre | 1483e64 | 2016-06-08 18:52:29 +0200 | [diff] [blame] | 83 | */ |
| 84 | SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception; |
| 85 | |
Carolina Fernandez | ad89343 | 2016-07-18 11:11:34 +0200 | [diff] [blame] | 86 | /** |
| 87 | * Creates a Virtual Circuit between two SDX-L2 Connection Points. |
| 88 | * |
| 89 | * @param sdxl2 name of SDX-L2 |
| 90 | * @param sdxl2cplhs name of SDX-L2 CP, left hand side of the VC |
| 91 | * @param sdxl2cprhs name of SDX-L2 CP, right hand side of the VC |
| 92 | * @throws SdxL2Exception if SDX-L2 VC cannot be added |
| 93 | */ |
| 94 | void addVC(String sdxl2, SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs) |
| 95 | throws SdxL2Exception;; |
| 96 | |
| 97 | /** |
| 98 | * Deletes a Virtual Circuit between Connection Points in an SDX-L2. |
| 99 | * |
| 100 | * @param sdxl2cplhs name of SDX-L2 CP, left hand side of the VC |
| 101 | * @param sdxl2cprhs ame of SDX-L2 CP, right hand side of the VC |
| 102 | * @throws SdxL2Exception if no name is provided for VC |
| 103 | */ |
| 104 | void removeVC(SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs) |
| 105 | throws SdxL2Exception;; |
| 106 | |
| 107 | /** |
| 108 | * Deletes a Virtual Circuit where a given SDX-L2 CP acts as endpoint. |
| 109 | * |
| 110 | * @param cp Connection Point |
| 111 | * @throws SdxL2Exception if appropriate VC identifier is not provided |
| 112 | */ |
| 113 | void removeVC(SdxL2ConnectionPoint cp) throws SdxL2Exception;; |
| 114 | |
| 115 | /** |
| 116 | * Removes all Virtual Circuits created in a given SDX-L2. |
| 117 | * |
| 118 | * @param sdxl2 name of SDX-L2 |
| 119 | */ |
| 120 | void removeVCs(String sdxl2); |
| 121 | |
| 122 | /** |
| 123 | * Returns an encoded Virtual Circuit in a SDX-L2. |
| 124 | * |
| 125 | * @param sdxl2cplhs name of SDX-L2 CP, left hand side of the VC |
| 126 | * @param sdxl2cprhs ame of SDX-L2 CP, right hand side of the VC |
| 127 | * @return the encoded Virtual Circuit |
| 128 | * @throws SdxL2Exception if no matching VC exists |
| 129 | */ |
| 130 | String getVC(SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs) |
| 131 | throws SdxL2Exception; |
| 132 | |
| 133 | /** |
| 134 | * Returns a) all Virtual Circuits, or b) Virtual Circuits in a given SDX-L2. |
| 135 | * |
| 136 | * @param sdxl2 name of SDX-L2 |
| 137 | * @return set of names for Virtual Circuits |
| 138 | */ |
| 139 | Set<String> getVCs(Optional<String> sdxl2); |
Pier Luigi Ventre | 0a023f4 | 2016-04-30 11:03:15 +0200 | [diff] [blame] | 140 | } |