blob: f0741ece5948cf28e25f34140a54934562e8dfaf [file] [log] [blame]
Jonathan Hart06e89082016-08-08 17:21:01 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Jonathan Hart06e89082016-08-08 17:21:01 -07003 *
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
Ray Milkeyb65d7842017-08-03 16:28:24 -070017package org.onosproject.net.neighbour;
Jonathan Hart06e89082016-08-08 17:21:01 -070018
Jonathan Hartc4f681c2016-09-09 07:14:25 -070019import org.onosproject.core.ApplicationId;
Ray Milkeyfacf2862017-08-03 11:58:29 -070020import org.onosproject.net.intf.Interface;
Jonathan Hart06e89082016-08-08 17:21:01 -070021import org.onosproject.net.ConnectPoint;
22
Jonathan Hartc4f681c2016-09-09 07:14:25 -070023import java.util.Collection;
24import java.util.Map;
25
Jonathan Hart06e89082016-08-08 17:21:01 -070026/**
27 * Provides a means of registering logic for handling neighbour messages.
28 */
Jonathan Hart06e89082016-08-08 17:21:01 -070029public interface NeighbourResolutionService {
30
31 /**
32 * Registers a neighbour message handler for all neighbour messages
33 * incoming on the given connect point.
34 *
35 * @param connectPoint connect point
36 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070037 * @param appId application ID
Jonathan Hart06e89082016-08-08 17:21:01 -070038 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070039 void registerNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler,
40 ApplicationId appId);
Jonathan Hart06e89082016-08-08 17:21:01 -070041
42 /**
43 * Registers a neighbour message handler for all neighbour messages incoming
44 * on the given interface. Neighbour packets must match the fields of the
45 * interface in order to be handled by this message handler.
46 *
47 * @param intf interface
48 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070049 * @param appId application ID
Jonathan Hart06e89082016-08-08 17:21:01 -070050 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070051 void registerNeighbourHandler(Interface intf, NeighbourMessageHandler handler,
52 ApplicationId appId);
Jonathan Hart06e89082016-08-08 17:21:01 -070053
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070054 /**
55 * Unregisters a neighbour message handler that was assigned to a connect
56 * point.
57 *
58 * @param connectPoint connect point
59 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070060 * @param appId application ID
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070061 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070062 void unregisterNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler,
63 ApplicationId appId);
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070064
65 /**
66 * Unregisters a neighbour message handler that was assigned to an interface.
67 *
68 * @param intf interface
69 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070070 * @param appId application ID
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070071 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070072 void unregisterNeighbourHandler(Interface intf, NeighbourMessageHandler handler,
73 ApplicationId appId);
74
75 /**
76 * Unregisters all neighbour handlers that were registered by the given
77 * application.
78 *
79 * @param appId application ID
80 */
81 void unregisterNeighbourHandlers(ApplicationId appId);
82
83 /**
84 * Gets the neighbour message handlers that have been registered with the
85 * service.
86 *
87 * @return neighbour message handlers indexed by connect point
88 */
89 Map<ConnectPoint, Collection<NeighbourHandlerRegistration>> getHandlerRegistrations();
Jonathan Hart06e89082016-08-08 17:21:01 -070090}