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.tenantnetwork;
18 import org.onosproject.vtnrsc.TenantNetwork;
19 import org.onosproject.vtnrsc.TenantNetworkId;
22 * Service for interacting with the inventory of tenantNetwork.
24 public interface TenantNetworkService {
27 * Returns if the tenantNetwork is existed.
29 * @param networkId tenantNetwork identifier
30 * @return true or false if one with the given identifier exists.
32 boolean exists(TenantNetworkId networkId);
35 * Returns the number of tenantNetwork known to the system.
37 * @return number of tenantNetwork.
39 int getNetworkCount();
42 * Returns an iterable collection of the currently known tenantNetwork.
44 * @return collection of tenantNetwork.
46 Iterable<TenantNetwork> getNetworks();
49 * Returns the tenantNetwork with the identifier.
51 * @param networkId TenantNetwork identifier
52 * @return TenantNetwork or null if one with the given identifier is not
55 TenantNetwork getNetwork(TenantNetworkId networkId);
58 * Creates tenantNetworks by networks.
60 * @param networks the collection of tenantNetworks
61 * @return true if all given identifiers created successfully.
63 boolean createNetworks(Iterable<TenantNetwork> networks);
66 * Updates tenantNetworks by tenantNetworks.
68 * @param networks the collection of tenantNetworks
69 * @return true if all given identifiers updated successfully.
71 boolean updateNetworks(Iterable<TenantNetwork> networks);
74 * Deletes tenantNetwork by tenantNetworkIds.
76 * @param networksIds the collection of tenantNetworkIds
77 * @return true if the specified tenantNetworks deleted successfully.
79 boolean removeNetworks(Iterable<TenantNetworkId> networksIds);