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.virtualport;
18 import java.util.Collection;
20 import org.onosproject.net.DeviceId;
21 import org.onosproject.vtnrsc.TenantId;
22 import org.onosproject.vtnrsc.TenantNetworkId;
23 import org.onosproject.vtnrsc.VirtualPort;
24 import org.onosproject.vtnrsc.VirtualPortId;
27 * Service for interacting with the inventory of virtualPort.
29 public interface VirtualPortService {
31 * Returns if the virtualPort is existed.
33 * @param virtualPortId virtualPort identifier
34 * @return true or false if one with the given identifier is not existed.
36 boolean exists(VirtualPortId virtualPortId);
39 * Returns the virtualPort with the identifier.
41 * @param virtualPortId virtualPort ID
42 * @return VirtualPort or null if one with the given ID is not know.
44 VirtualPort getPort(VirtualPortId virtualPortId);
47 * Returns the collection of the currently known virtualPort.
48 * @return collection of VirtualPort.
50 Collection<VirtualPort> getPorts();
53 * Returns the collection of the virtualPorts associated with the networkId.
55 * @param networkId the network identifer
56 * @return collection of virtualPort.
58 Collection<VirtualPort> getPorts(TenantNetworkId networkId);
61 * Returns the collection of the virtualPorts associated with the tenantId.
63 * @param tenantId the tenant identifier
64 * @return collection of virtualPorts.
66 Collection<VirtualPort> getPorts(TenantId tenantId);
69 * Returns the collection of the virtualPorts associated with the deviceId.
71 * @param deviceId the device identifier
72 * @return collection of virtualPort.
74 Collection<VirtualPort> getPorts(DeviceId deviceId);
77 * Creates virtualPorts by virtualPorts.
79 * @param virtualPorts the iterable collection of virtualPorts
80 * @return true if all given identifiers created successfully.
82 boolean createPorts(Iterable<VirtualPort> virtualPorts);
85 * Updates virtualPorts by virtualPorts.
87 * @param virtualPorts the iterable collection of virtualPorts
88 * @return true if all given identifiers updated successfully.
90 boolean updatePorts(Iterable<VirtualPort> virtualPorts);
93 * Deletes virtualPortIds by virtualPortIds.
95 * @param virtualPortIds the iterable collection of virtualPort identifiers
96 * @return true or false if one with the given identifier to delete is
99 boolean removePorts(Iterable<VirtualPortId> virtualPortIds);