Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 3 | * |
| 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 | */ |
| 16 | package org.onosproject.vtnrsc.virtualport; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
lishuai | 858efd3 | 2015-12-04 14:30:36 +0800 | [diff] [blame] | 20 | import org.onlab.packet.IpAddress; |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 21 | import org.onosproject.net.DeviceId; |
lishuai | 69b36d5 | 2015-10-21 16:50:16 +0800 | [diff] [blame] | 22 | import org.onosproject.vtnrsc.FixedIp; |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 23 | import org.onosproject.vtnrsc.TenantId; |
| 24 | import org.onosproject.vtnrsc.TenantNetworkId; |
| 25 | import org.onosproject.vtnrsc.VirtualPort; |
| 26 | import org.onosproject.vtnrsc.VirtualPortId; |
| 27 | |
| 28 | /** |
| 29 | * Service for interacting with the inventory of virtualPort. |
| 30 | */ |
| 31 | public interface VirtualPortService { |
| 32 | /** |
| 33 | * Returns if the virtualPort is existed. |
| 34 | * |
| 35 | * @param virtualPortId virtualPort identifier |
| 36 | * @return true or false if one with the given identifier is not existed. |
| 37 | */ |
| 38 | boolean exists(VirtualPortId virtualPortId); |
| 39 | |
| 40 | /** |
| 41 | * Returns the virtualPort with the identifier. |
| 42 | * |
| 43 | * @param virtualPortId virtualPort ID |
| 44 | * @return VirtualPort or null if one with the given ID is not know. |
| 45 | */ |
| 46 | VirtualPort getPort(VirtualPortId virtualPortId); |
| 47 | |
| 48 | /** |
lishuai | 69b36d5 | 2015-10-21 16:50:16 +0800 | [diff] [blame] | 49 | * Returns the virtualPort associated with the fixedIP. |
| 50 | * |
| 51 | * @param fixedIP the fixedIP identifier |
| 52 | * @return virtualPort. |
| 53 | */ |
| 54 | VirtualPort getPort(FixedIp fixedIP); |
| 55 | |
| 56 | /** |
lishuai | 858efd3 | 2015-12-04 14:30:36 +0800 | [diff] [blame] | 57 | * Returns the virtualPort associated with the networkId and ip. |
| 58 | * |
| 59 | * @param networkId the TenantNetworkId identifier |
| 60 | * @param ip the ip identifier |
| 61 | * @return virtualPort. |
| 62 | */ |
| 63 | VirtualPort getPort(TenantNetworkId networkId, IpAddress ip); |
| 64 | |
| 65 | /** |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 66 | * Returns the collection of the currently known virtualPort. |
| 67 | * @return collection of VirtualPort. |
| 68 | */ |
| 69 | Collection<VirtualPort> getPorts(); |
| 70 | |
| 71 | /** |
| 72 | * Returns the collection of the virtualPorts associated with the networkId. |
| 73 | * |
| 74 | * @param networkId the network identifer |
| 75 | * @return collection of virtualPort. |
| 76 | */ |
| 77 | Collection<VirtualPort> getPorts(TenantNetworkId networkId); |
| 78 | |
| 79 | /** |
| 80 | * Returns the collection of the virtualPorts associated with the tenantId. |
| 81 | * |
| 82 | * @param tenantId the tenant identifier |
| 83 | * @return collection of virtualPorts. |
| 84 | */ |
| 85 | Collection<VirtualPort> getPorts(TenantId tenantId); |
| 86 | |
| 87 | /** |
| 88 | * Returns the collection of the virtualPorts associated with the deviceId. |
| 89 | * |
| 90 | * @param deviceId the device identifier |
| 91 | * @return collection of virtualPort. |
| 92 | */ |
| 93 | Collection<VirtualPort> getPorts(DeviceId deviceId); |
| 94 | |
| 95 | /** |
| 96 | * Creates virtualPorts by virtualPorts. |
| 97 | * |
| 98 | * @param virtualPorts the iterable collection of virtualPorts |
| 99 | * @return true if all given identifiers created successfully. |
| 100 | */ |
| 101 | boolean createPorts(Iterable<VirtualPort> virtualPorts); |
| 102 | |
| 103 | /** |
| 104 | * Updates virtualPorts by virtualPorts. |
| 105 | * |
| 106 | * @param virtualPorts the iterable collection of virtualPorts |
| 107 | * @return true if all given identifiers updated successfully. |
| 108 | */ |
| 109 | boolean updatePorts(Iterable<VirtualPort> virtualPorts); |
| 110 | |
| 111 | /** |
| 112 | * Deletes virtualPortIds by virtualPortIds. |
| 113 | * |
| 114 | * @param virtualPortIds the iterable collection of virtualPort identifiers |
| 115 | * @return true or false if one with the given identifier to delete is |
| 116 | * successfully. |
| 117 | */ |
| 118 | boolean removePorts(Iterable<VirtualPortId> virtualPortIds); |
| 119 | } |