blob: 4c68d76acf7323d866da0aca8524eaf281a2013e [file] [log] [blame]
jiangruie3d60b12015-11-25 16:27:04 +08001/*
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 */
16package org.onosproject.vtnrsc.service;
17
18import java.util.Iterator;
19
20import org.onlab.packet.MacAddress;
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053021import org.onosproject.event.ListenerService;
jiangruie3d60b12015-11-25 16:27:04 +080022import org.onosproject.net.Device;
23import org.onosproject.net.DeviceId;
lishuaib43dbf72016-01-06 11:11:35 +080024import org.onosproject.net.Host;
jiangruie3d60b12015-11-25 16:27:04 +080025import org.onosproject.net.HostId;
26import org.onosproject.vtnrsc.SegmentationId;
27import org.onosproject.vtnrsc.TenantId;
28import org.onosproject.vtnrsc.VirtualPortId;
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053029import org.onosproject.vtnrsc.event.VtnRscEvent;
jiangruie3d60b12015-11-25 16:27:04 +080030import org.onosproject.vtnrsc.event.VtnRscListener;
31
32/**
33 * Service for interacting with the inventory of Vtn resource.
34 */
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053035public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListener> {
jiangruie3d60b12015-11-25 16:27:04 +080036 /**
37 * Returns the SegmentationId of tenant.
38 *
39 * @param tenantId tenant identifier
40 * @return SegmentationId the SegmentationId of tenant
41 */
42 SegmentationId getL3vni(TenantId tenantId);
43
44 /**
45 * Returns Classifier Ovs list of the specific tenant.
46 *
47 * @param tenantId tenant identifier
48 * @return iterable collection of Device
49 */
50 Iterator<Device> getClassifierOfTenant(TenantId tenantId);
51
52 /**
53 * Returns Service function forwarders Ovs list of the specific tenant.
54 *
55 * @param tenantId tenant identifier
56 * @return iterable collection of Device
57 */
58 Iterator<Device> getSFFOfTenant(TenantId tenantId);
59
60 /**
61 * Returns gateway mac address of the specific host.
62 *
63 * @param hostId host identifier
64 * @return MacAddress of host
65 */
66 MacAddress getGatewayMac(HostId hostId);
67
68 /**
69 * Checks if a specific port is a service function.
70 *
71 * @param portId port identifier
72 * @return true or false
73 */
74 boolean isServiceFunction(VirtualPortId portId);
75
76 /**
77 * Returns device identifier mapping to the specific port.
78 *
79 * @param portId port identifier
80 * @return device identifier
81 */
82 DeviceId getSFToSFFMaping(VirtualPortId portId);
lishuaib43dbf72016-01-06 11:11:35 +080083
84 /**
85 * Adds specify Device identifier to Service Function Forward OvsMap
86 * or Classifier OvsMap.
87 *
88 * @param virtualPortId the VirtualPort identifier
89 * @param tenantId the tenant identifier
90 * @param deviceId the device identifier
91 */
92 void addDeviceIdOfOvsMap(VirtualPortId virtualPortId, TenantId tenantId, DeviceId deviceId);
93
94 /**
95 * Removes specify Device identifier from Service Function Forward OvsMap
96 * or Classifier OvsMap.
97 *
98 * @param host Host
99 * @param tenantId the tenant identifier
100 * @param deviceId the device identifier
101 */
102 void removeDeviceIdOfOvsMap(Host host, TenantId tenantId, DeviceId deviceId);
jiangruie3d60b12015-11-25 16:27:04 +0800103}