CNlucius | 5b2fff1 | 2015-08-20 14:13:46 +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.vtnrsc.virtualport;
|
| 17 |
|
| 18 | import java.util.Collection;
|
| 19 |
|
| 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;
|
| 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.
|
| 48 | * @return collection of VirtualPort.
|
| 49 | */
|
| 50 | Collection<VirtualPort> getPorts();
|
| 51 |
|
| 52 | /**
|
| 53 | * Returns the collection of the virtualPorts associated with the networkId.
|
| 54 | *
|
| 55 | * @param networkId the network identifer
|
| 56 | * @return collection of virtualPort.
|
| 57 | */
|
| 58 | Collection<VirtualPort> getPorts(TenantNetworkId networkId);
|
| 59 |
|
| 60 | /**
|
| 61 | * Returns the collection of the virtualPorts associated with the tenantId.
|
| 62 | *
|
| 63 | * @param tenantId the tenant identifier
|
| 64 | * @return collection of virtualPorts.
|
| 65 | */
|
| 66 | Collection<VirtualPort> getPorts(TenantId tenantId);
|
| 67 |
|
| 68 | /**
|
| 69 | * Returns the collection of the virtualPorts associated with the deviceId.
|
| 70 | *
|
| 71 | * @param deviceId the device identifier
|
| 72 | * @return collection of virtualPort.
|
| 73 | */
|
| 74 | Collection<VirtualPort> getPorts(DeviceId deviceId);
|
| 75 |
|
| 76 | /**
|
| 77 | * Creates virtualPorts by virtualPorts.
|
| 78 | *
|
| 79 | * @param virtualPorts the iterable collection of virtualPorts
|
| 80 | * @return true if all given identifiers created successfully.
|
| 81 | */
|
| 82 | boolean createPorts(Iterable<VirtualPort> virtualPorts);
|
| 83 |
|
| 84 | /**
|
| 85 | * Updates virtualPorts by virtualPorts.
|
| 86 | *
|
| 87 | * @param virtualPorts the iterable collection of virtualPorts
|
| 88 | * @return true if all given identifiers updated successfully.
|
| 89 | */
|
| 90 | boolean updatePorts(Iterable<VirtualPort> virtualPorts);
|
| 91 |
|
| 92 | /**
|
| 93 | * Deletes virtualPortIds by virtualPortIds.
|
| 94 | *
|
| 95 | * @param virtualPortIds the iterable collection of virtualPort identifiers
|
| 96 | * @return true or false if one with the given identifier to delete is
|
| 97 | * successfully.
|
| 98 | */
|
| 99 | boolean removePorts(Iterable<VirtualPortId> virtualPortIds);
|
| 100 | }
|