xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Porting Laboratory |
| 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.app.vtnrsc.virtualport; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.app.vtnrsc.TenantNetworkId; |
| 21 | import org.onosproject.app.vtnrsc.TenantId; |
| 22 | import org.onosproject.app.vtnrsc.VirtualPort; |
| 23 | import org.onosproject.app.vtnrsc.VirtualPortId; |
| 24 | import org.onosproject.net.DeviceId; |
| 25 | |
| 26 | /** |
| 27 | * Service for interacting with the inventory of virtualPort. |
| 28 | */ |
| 29 | public interface VirtualPortService { |
| 30 | /** |
| 31 | * Returns if the virtualPort is existed. |
| 32 | * |
| 33 | * @param virtualPortId virtualPort identifier |
| 34 | * @return true or false if one with the given identifier is not existed. |
| 35 | */ |
| 36 | boolean exists(VirtualPortId virtualPortId); |
| 37 | |
| 38 | /** |
| 39 | * Returns the virtualPort with the identifier. |
| 40 | * |
| 41 | * @param virtualPortId virtualPort ID |
| 42 | * @return VirtualPort or null if one with the given ID is not know. |
| 43 | */ |
| 44 | VirtualPort getPort(VirtualPortId virtualPortId); |
| 45 | |
| 46 | /** |
| 47 | * Returns the collection of the currently known virtualPort. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 48 | */ |
| 49 | Collection<VirtualPort> getPorts(); |
| 50 | |
| 51 | /** |
| 52 | * Returns the collection of the virtualPorts associated with the networkId. |
| 53 | * |
xuzhang | fda0093 | 2015-08-11 11:33:45 +0800 | [diff] [blame] | 54 | * @param networkId the network identifer |
| 55 | * @return collection of virtualPort. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 56 | */ |
| 57 | Collection<VirtualPort> getPorts(TenantNetworkId networkId); |
| 58 | |
| 59 | /** |
| 60 | * Returns the collection of the virtualPorts associated with the tenantId. |
| 61 | * |
xuzhang | fda0093 | 2015-08-11 11:33:45 +0800 | [diff] [blame] | 62 | * @param tenantId the tenant identifier |
| 63 | * @return collection of virtualPorts. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 64 | */ |
| 65 | Collection<VirtualPort> getPorts(TenantId tenantId); |
| 66 | |
| 67 | /** |
| 68 | * Returns the collection of the virtualPorts associated with the deviceId. |
| 69 | * |
xuzhang | fda0093 | 2015-08-11 11:33:45 +0800 | [diff] [blame] | 70 | * @param deviceId the device identifier |
| 71 | * @return collection of virtualPort. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 72 | */ |
| 73 | Collection<VirtualPort> getPorts(DeviceId deviceId); |
| 74 | |
| 75 | /** |
| 76 | * Creates virtualPorts by virtualPorts. |
| 77 | * |
| 78 | * @param virtualPorts the iterable collection of virtualPorts |
| 79 | * @return true if all given identifiers created successfully. |
| 80 | */ |
| 81 | boolean createPorts(Iterable<VirtualPort> virtualPorts); |
| 82 | |
| 83 | /** |
| 84 | * Updates virtualPorts by virtualPorts. |
| 85 | * |
| 86 | * @param virtualPorts the iterable collection of virtualPorts |
xuzhang | fda0093 | 2015-08-11 11:33:45 +0800 | [diff] [blame] | 87 | * @return true if all given identifiers updated successfully. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 88 | */ |
| 89 | boolean updatePorts(Iterable<VirtualPort> virtualPorts); |
| 90 | |
| 91 | /** |
| 92 | * Deletes virtualPortIds by virtualPortIds. |
| 93 | * |
| 94 | * @param virtualPortIds the iterable collection of virtualPort identifiers |
| 95 | * @return true or false if one with the given identifier to delete is |
xuzhang | fda0093 | 2015-08-11 11:33:45 +0800 | [diff] [blame] | 96 | * successfully. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 97 | */ |
| 98 | boolean removePorts(Iterable<VirtualPortId> virtualPortIds); |
| 99 | } |