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.FixedIp;
22 import org.onosproject.vtnrsc.TenantId;
23 import org.onosproject.vtnrsc.TenantNetworkId;
24 import org.onosproject.vtnrsc.VirtualPort;
25 import org.onosproject.vtnrsc.VirtualPortId;
28 * Service for interacting with the inventory of virtualPort.
30 public interface VirtualPortService {
32 * Returns if the virtualPort is existed.
34 * @param virtualPortId virtualPort identifier
35 * @return true or false if one with the given identifier is not existed.
37 boolean exists(VirtualPortId virtualPortId);
40 * Returns the virtualPort with the identifier.
42 * @param virtualPortId virtualPort ID
43 * @return VirtualPort or null if one with the given ID is not know.
45 VirtualPort getPort(VirtualPortId virtualPortId);
48 * Returns the virtualPort associated with the fixedIP.
50 * @param fixedIP the fixedIP identifier
51 * @return virtualPort.
53 VirtualPort getPort(FixedIp fixedIP);
56 * Returns the collection of the currently known virtualPort.
57 * @return collection of VirtualPort.
59 Collection<VirtualPort> getPorts();
62 * Returns the collection of the virtualPorts associated with the networkId.
64 * @param networkId the network identifer
65 * @return collection of virtualPort.
67 Collection<VirtualPort> getPorts(TenantNetworkId networkId);
70 * Returns the collection of the virtualPorts associated with the tenantId.
72 * @param tenantId the tenant identifier
73 * @return collection of virtualPorts.
75 Collection<VirtualPort> getPorts(TenantId tenantId);
78 * Returns the collection of the virtualPorts associated with the deviceId.
80 * @param deviceId the device identifier
81 * @return collection of virtualPort.
83 Collection<VirtualPort> getPorts(DeviceId deviceId);
86 * Creates virtualPorts by virtualPorts.
88 * @param virtualPorts the iterable collection of virtualPorts
89 * @return true if all given identifiers created successfully.
91 boolean createPorts(Iterable<VirtualPort> virtualPorts);
94 * Updates virtualPorts by virtualPorts.
96 * @param virtualPorts the iterable collection of virtualPorts
97 * @return true if all given identifiers updated successfully.
99 boolean updatePorts(Iterable<VirtualPort> virtualPorts);
102 * Deletes virtualPortIds by virtualPortIds.
104 * @param virtualPortIds the iterable collection of virtualPort identifiers
105 * @return true or false if one with the given identifier to delete is
108 boolean removePorts(Iterable<VirtualPortId> virtualPortIds);