2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.vtnrsc.tunnel;
18 import org.onosproject.vtnrsc.Subnet;
19 import org.onosproject.vtnrsc.SubnetId;
23 * Service for interacting with the inventory of subnets.
25 public interface TunnelConfigService {
27 * Returns the subnet with the specified identifier.
29 * @param subnetId subnet identifier
30 * @return true or false
32 boolean exists(SubnetId subnetId);
34 * Returns a collection of the currently known subnets.
36 * @return iterable collection of subnets
38 Iterable<Subnet> getSubnets();
41 * Returns the subnet with the specified identifier.
43 * @param subnetId subnet identifier
44 * @return subnet or null if one with the given identifier is not known
46 Subnet getSubnet(SubnetId subnetId);
48 * Creates new subnets.
50 * @param subnets the iterable collection of subnets
51 * @return true if the identifier subnet has been created right
53 boolean createSubnets(Iterable<Subnet> subnets);
56 * Updates existing subnets.
58 * @param subnets the iterable collection of subnets
59 * @return true if all subnets were updated successfully
61 boolean updateSubnets(Iterable<Subnet> subnets);
64 * Administratively removes the specified subnets from the store.
66 * @param subnetIds the iterable collection of subnets identifier
67 * @return true if remove identifier subnets successfully
69 boolean removeSubnets(Iterable<SubnetId> subnetIds);