blob: 047b244a145135ac1d9bdb8df5b6a9a028d663f0 [file] [log] [blame]
Sho SHIMIZUb2b2d982015-09-11 15:35:06 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Sho SHIMIZUb2b2d982015-09-11 15:35:06 -07003 *
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.vtnrsc.subnet;
17
18import org.onosproject.vtnrsc.Subnet;
19import org.onosproject.vtnrsc.SubnetId;
20
21
22/**
23 * Service for interacting with the inventory of subnets.
24 */
25public interface SubnetService {
26 /**
27 * Returns the subnet with the specified identifier.
28 *
29 * @param subnetId subnet identifier
30 * @return true or false
31 */
32 boolean exists(SubnetId subnetId);
33 /**
34 * Returns a collection of the currently known subnets.
35 *
36 * @return iterable collection of subnets
37 */
38 Iterable<Subnet> getSubnets();
39
40 /**
41 * Returns the subnet with the specified identifier.
42 *
43 * @param subnetId subnet identifier
44 * @return subnet or null if one with the given identifier is not known
45 */
46 Subnet getSubnet(SubnetId subnetId);
47 /**
48 * Creates new subnets.
49 *
50 * @param subnets the iterable collection of subnets
51 * @return true if the identifier subnet has been created right
52 */
53 boolean createSubnets(Iterable<Subnet> subnets);
54
55 /**
56 * Updates existing subnets.
57 *
58 * @param subnets the iterable collection of subnets
59 * @return true if all subnets were updated successfully
60 */
61 boolean updateSubnets(Iterable<Subnet> subnets);
62
63 /**
64 * Administratively removes the specified subnets from the store.
65 *
66 * @param subnetIds the iterable collection of subnets identifier
67 * @return true if remove identifier subnets successfully
68 */
69 boolean removeSubnets(Iterable<SubnetId> subnetIds);
70
71
72}