blob: 0c465ee1e0fa17a9a0f26beeb66660460b31a213 [file] [log] [blame]
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +02001/*
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
17package org.onosproject.sdxl2;
18
pierventre3849e562016-05-11 11:47:32 +020019import java.util.Optional;
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020020import java.util.Set;
21
22/**
pierventre3849e562016-05-11 11:47:32 +020023 * Storage service for SDX-L2 application.
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020024 */
25public interface SdxL2Store {
26
27 /**
pierventre3849e562016-05-11 11:47:32 +020028 * Creates a named SDX-L2.
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020029 *
Carolina Fernandezad893432016-07-18 11:11:34 +020030 * @param sdxl2 name of SDX-L2
31 * @throws SdxL2Exception if SDX-L2 is not added
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020032 */
33 void putSdxL2(String sdxl2) throws SdxL2Exception;
34
35 /**
pierventre3849e562016-05-11 11:47:32 +020036 * Removes a named SDX-L2.
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020037 *
Carolina Fernandezad893432016-07-18 11:11:34 +020038 * @param sdxl2 name of SDX-L2
39 * @throws SdxL2Exception if SDX-L2 is not removed
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020040 */
41 void removeSdxL2(String sdxl2) throws SdxL2Exception;
42
43 /**
pierventre3849e562016-05-11 11:47:32 +020044 * Returns a set of SDX-L2 names.
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020045 *
Carolina Fernandezad893432016-07-18 11:11:34 +020046 * @return set of SDX-L2 names
Pier Luigi Ventre0a023f42016-04-30 11:03:15 +020047 */
48 Set<String> getSdxL2s();
49
pierventre3849e562016-05-11 11:47:32 +020050 /**
Carolina Fernandezad893432016-07-18 11:11:34 +020051 * Adds a Connection Point to an SDX-L2.
pierventre3849e562016-05-11 11:47:32 +020052 *
Carolina Fernandezad893432016-07-18 11:11:34 +020053 * @param sdxl2 name of SDX-L2
54 * @param connectionPoint SDX-L2 cCnnection Point object
55 * @throws SdxL2Exception if SDX-L2 is not added
pierventre3849e562016-05-11 11:47:32 +020056 */
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 Fernandezad893432016-07-18 11:11:34 +020063 * @param sdxl2 name of the SDX-L2 (optional)
pierventre3849e562016-05-11 11:47:32 +020064 * @return a set of SDX-L2 connection points names, the result depends on the input parameter;
Carolina Fernandezad893432016-07-18 11:11:34 +020065 * @throws SdxL2Exception if SDX-L2 cannot be found
pierventre3849e562016-05-11 11:47:32 +020066 */
67 Set<String> getSdxL2ConnectionPoints(Optional<String> sdxl2) throws SdxL2Exception;
68
pierventre3849e562016-05-11 11:47:32 +020069 /**
Carolina Fernandezad893432016-07-18 11:11:34 +020070 * Removes a named Connection Point in an SDX-L2.
pierventre3849e562016-05-11 11:47:32 +020071 *
Carolina Fernandezad893432016-07-18 11:11:34 +020072 * @param sdxl2cp name of Connection Point
73 * @throws SdxL2Exception if SDX-L2 Connection Point does not exist
pierventre3849e562016-05-11 11:47:32 +020074 */
75 void removeSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception;
76
pierventre1483e642016-06-08 18:52:29 +020077 /**
Carolina Fernandezad893432016-07-18 11:11:34 +020078 * Returns a Connection Point in a SDX-L2.
pierventre1483e642016-06-08 18:52:29 +020079 *
Carolina Fernandezad893432016-07-18 11:11:34 +020080 * @param sdxl2cp name of Connection Point
81 * @return relative SDX-L2 Connection Point
82 * @throws SdxL2Exception if SDX-L2 CP cannot be found
pierventre1483e642016-06-08 18:52:29 +020083 */
84 SdxL2ConnectionPoint getSdxL2ConnectionPoint(String sdxl2cp) throws SdxL2Exception;
85
Carolina Fernandezad893432016-07-18 11:11:34 +020086 /**
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 Ventre0a023f42016-04-30 11:03:15 +0200140}