jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking 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.service; |
| 17 | |
| 18 | import java.util.Iterator; |
| 19 | |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | import org.onosproject.net.Device; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.HostId; |
| 24 | import org.onosproject.vtnrsc.SegmentationId; |
| 25 | import org.onosproject.vtnrsc.TenantId; |
| 26 | import org.onosproject.vtnrsc.VirtualPortId; |
| 27 | import org.onosproject.vtnrsc.event.VtnRscListener; |
| 28 | |
| 29 | /** |
| 30 | * Service for interacting with the inventory of Vtn resource. |
| 31 | */ |
| 32 | public interface VtnRscService { |
| 33 | /** |
| 34 | * Adds the specified listener. |
| 35 | * |
| 36 | * @param listener VtnRsc listener |
| 37 | */ |
| 38 | void addListener(VtnRscListener listener); |
| 39 | |
| 40 | /** |
| 41 | * Removes the specified listener. |
| 42 | * |
| 43 | * @param listener VtnRsc listener |
| 44 | */ |
| 45 | void removeListener(VtnRscListener listener); |
| 46 | |
| 47 | /** |
| 48 | * Returns the SegmentationId of tenant. |
| 49 | * |
| 50 | * @param tenantId tenant identifier |
| 51 | * @return SegmentationId the SegmentationId of tenant |
| 52 | */ |
| 53 | SegmentationId getL3vni(TenantId tenantId); |
| 54 | |
| 55 | /** |
| 56 | * Returns Classifier Ovs list of the specific tenant. |
| 57 | * |
| 58 | * @param tenantId tenant identifier |
| 59 | * @return iterable collection of Device |
| 60 | */ |
| 61 | Iterator<Device> getClassifierOfTenant(TenantId tenantId); |
| 62 | |
| 63 | /** |
| 64 | * Returns Service function forwarders Ovs list of the specific tenant. |
| 65 | * |
| 66 | * @param tenantId tenant identifier |
| 67 | * @return iterable collection of Device |
| 68 | */ |
| 69 | Iterator<Device> getSFFOfTenant(TenantId tenantId); |
| 70 | |
| 71 | /** |
| 72 | * Returns gateway mac address of the specific host. |
| 73 | * |
| 74 | * @param hostId host identifier |
| 75 | * @return MacAddress of host |
| 76 | */ |
| 77 | MacAddress getGatewayMac(HostId hostId); |
| 78 | |
| 79 | /** |
| 80 | * Checks if a specific port is a service function. |
| 81 | * |
| 82 | * @param portId port identifier |
| 83 | * @return true or false |
| 84 | */ |
| 85 | boolean isServiceFunction(VirtualPortId portId); |
| 86 | |
| 87 | /** |
| 88 | * Returns device identifier mapping to the specific port. |
| 89 | * |
| 90 | * @param portId port identifier |
| 91 | * @return device identifier |
| 92 | */ |
| 93 | DeviceId getSFToSFFMaping(VirtualPortId portId); |
| 94 | } |