blob: 94ab611235f98c1260e103a2f2fef911dbb9814c [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/**
26 * Service for interacting with an inventory of network edge ports.
27 */
28public interface EdgePortService {
29
30 /**
31 * Indicates whether or not the specified connection point is an edge point.
32 *
33 * @param point connection point
34 * @return true if edge point
35 */
36 boolean isEdgePoint(ConnectPoint point);
37
38 /**
39 * Returns a collection of all edge point within the current topology.
40 *
41 * @return iterable collection of all edge points
42 */
43 Iterable<ConnectPoint> getEdgePoint();
44
45 /**
46 * Returns a collection of all edge point for the specified device.
47 *
Madan Jampani0dbac7a2015-06-25 10:37:45 -070048 * @param deviceId device identifier
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070049 * @return iterable collection of all edge points for the device
50 */
51 Iterable<ConnectPoint> getEdgePoint(DeviceId deviceId);
52
53 /**
54 * Emits the specified packet, with optional treatment to all edge ports.
55 *
56 * @param data packet data
57 * @param treatment optional traffic treatment to apply to the packet
58 */
59 void emitPacket(ByteBuffer data, Optional<TrafficTreatment> treatment);
60
61 /**
62 * Emits the specified packet, with optional treatment to all edge ports.
63 *
64 * @param deviceId device where to send the packet out
65 * @param data packet data
66 * @param treatment optional traffic treatment to apply to the packet
67 */
68 void emitPacket(DeviceId deviceId, ByteBuffer data,
69 Optional<TrafficTreatment> treatment);
70
71 /**
72 * Adds a listener for edge port events.
73 *
74 * @param listener listener to be added
75 */
76 void addListener(EdgePortListener listener);
77
78 /**
79 * Removes the listener for edge port events.
80 *
81 * @param listener listener to be removed
82 */
83 void removeListener(EdgePortListener listener);
84
85}