blob: c91018ef90f17cc41eb77b015f625ece74c0190f [file] [log] [blame]
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -07001/*
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.net.edge;
17
18import org.onosproject.net.ConnectPoint;
19import org.onosproject.net.DeviceId;
20import org.onosproject.net.flow.TrafficTreatment;
21
22import java.nio.ByteBuffer;
23import java.util.Optional;
24
25/**
Thomas Vachuska85021922015-06-29 13:29:42 -070026 * Service for interacting with an inventory of network edge ports. A port
27 * is considered an edge port if it is an active port and does not have an
28 * infrastructure link associated with it.
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070029 */
30public interface EdgePortService {
31
32 /**
33 * Indicates whether or not the specified connection point is an edge point.
34 *
35 * @param point connection point
36 * @return true if edge point
37 */
38 boolean isEdgePoint(ConnectPoint point);
39
40 /**
41 * Returns a collection of all edge point within the current topology.
42 *
43 * @return iterable collection of all edge points
44 */
Aaron Kruglikova2b59152015-06-24 14:01:41 -070045 Iterable<ConnectPoint> getEdgePoints();
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070046
47 /**
48 * Returns a collection of all edge point for the specified device.
49 *
Madan Jampani0dbac7a2015-06-25 10:37:45 -070050 * @param deviceId device identifier
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070051 * @return iterable collection of all edge points for the device
52 */
Aaron Kruglikova2b59152015-06-24 14:01:41 -070053 Iterable<ConnectPoint> getEdgePoints(DeviceId deviceId);
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070054
55 /**
56 * Emits the specified packet, with optional treatment to all edge ports.
57 *
58 * @param data packet data
59 * @param treatment optional traffic treatment to apply to the packet
60 */
61 void emitPacket(ByteBuffer data, Optional<TrafficTreatment> treatment);
62
63 /**
64 * Emits the specified packet, with optional treatment to all edge ports.
65 *
66 * @param deviceId device where to send the packet out
67 * @param data packet data
68 * @param treatment optional traffic treatment to apply to the packet
69 */
70 void emitPacket(DeviceId deviceId, ByteBuffer data,
71 Optional<TrafficTreatment> treatment);
72
73 /**
74 * Adds a listener for edge port events.
75 *
76 * @param listener listener to be added
77 */
78 void addListener(EdgePortListener listener);
79
80 /**
81 * Removes the listener for edge port events.
82 *
83 * @param listener listener to be removed
84 */
85 void removeListener(EdgePortListener listener);
86
87}