2 * Copyright 2015 Open Porting Laboratory
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
16 package org.onosproject.vtnrsc.virtualport;
\r
18 import java.util.Collection;
\r
20 import org.onosproject.net.DeviceId;
\r
21 import org.onosproject.vtnrsc.TenantId;
\r
22 import org.onosproject.vtnrsc.TenantNetworkId;
\r
23 import org.onosproject.vtnrsc.VirtualPort;
\r
24 import org.onosproject.vtnrsc.VirtualPortId;
\r
27 * Service for interacting with the inventory of virtualPort.
\r
29 public interface VirtualPortService {
\r
31 * Returns if the virtualPort is existed.
\r
33 * @param virtualPortId virtualPort identifier
\r
34 * @return true or false if one with the given identifier is not existed.
\r
36 boolean exists(VirtualPortId virtualPortId);
\r
39 * Returns the virtualPort with the identifier.
\r
41 * @param virtualPortId virtualPort ID
\r
42 * @return VirtualPort or null if one with the given ID is not know.
\r
44 VirtualPort getPort(VirtualPortId virtualPortId);
\r
47 * Returns the collection of the currently known virtualPort.
\r
48 * @return collection of VirtualPort.
\r
50 Collection<VirtualPort> getPorts();
\r
53 * Returns the collection of the virtualPorts associated with the networkId.
\r
55 * @param networkId the network identifer
\r
56 * @return collection of virtualPort.
\r
58 Collection<VirtualPort> getPorts(TenantNetworkId networkId);
\r
61 * Returns the collection of the virtualPorts associated with the tenantId.
\r
63 * @param tenantId the tenant identifier
\r
64 * @return collection of virtualPorts.
\r
66 Collection<VirtualPort> getPorts(TenantId tenantId);
\r
69 * Returns the collection of the virtualPorts associated with the deviceId.
\r
71 * @param deviceId the device identifier
\r
72 * @return collection of virtualPort.
\r
74 Collection<VirtualPort> getPorts(DeviceId deviceId);
\r
77 * Creates virtualPorts by virtualPorts.
\r
79 * @param virtualPorts the iterable collection of virtualPorts
\r
80 * @return true if all given identifiers created successfully.
\r
82 boolean createPorts(Iterable<VirtualPort> virtualPorts);
\r
85 * Updates virtualPorts by virtualPorts.
\r
87 * @param virtualPorts the iterable collection of virtualPorts
\r
88 * @return true if all given identifiers updated successfully.
\r
90 boolean updatePorts(Iterable<VirtualPort> virtualPorts);
\r
93 * Deletes virtualPortIds by virtualPortIds.
\r
95 * @param virtualPortIds the iterable collection of virtualPort identifiers
\r
96 * @return true or false if one with the given identifier to delete is
\r
99 boolean removePorts(Iterable<VirtualPortId> virtualPortIds);
\r