blob: e6e3e20c68d9cc262bb4d5c330d0966eedfbfa99 [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
17package org.onosproject.incubator.net.neighbour;
18
19import com.google.common.annotations.Beta;
Jonathan Hartc4f681c2016-09-09 07:14:25 -070020import org.onosproject.core.ApplicationId;
Ray Milkeyfacf2862017-08-03 11:58:29 -070021import org.onosproject.net.intf.Interface;
Jonathan Hart06e89082016-08-08 17:21:01 -070022import org.onosproject.net.ConnectPoint;
23
Jonathan Hartc4f681c2016-09-09 07:14:25 -070024import java.util.Collection;
25import java.util.Map;
26
Jonathan Hart06e89082016-08-08 17:21:01 -070027/**
28 * Provides a means of registering logic for handling neighbour messages.
29 */
30@Beta
31public interface NeighbourResolutionService {
32
33 /**
34 * Registers a neighbour message handler for all neighbour messages
35 * incoming on the given connect point.
36 *
37 * @param connectPoint connect point
38 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070039 * @param appId application ID
Jonathan Hart06e89082016-08-08 17:21:01 -070040 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070041 void registerNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler,
42 ApplicationId appId);
Jonathan Hart06e89082016-08-08 17:21:01 -070043
44 /**
45 * Registers a neighbour message handler for all neighbour messages incoming
46 * on the given interface. Neighbour packets must match the fields of the
47 * interface in order to be handled by this message handler.
48 *
49 * @param intf interface
50 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070051 * @param appId application ID
Jonathan Hart06e89082016-08-08 17:21:01 -070052 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070053 void registerNeighbourHandler(Interface intf, NeighbourMessageHandler handler,
54 ApplicationId appId);
Jonathan Hart06e89082016-08-08 17:21:01 -070055
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070056 /**
57 * Unregisters a neighbour message handler that was assigned to a connect
58 * point.
59 *
60 * @param connectPoint connect point
61 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070062 * @param appId application ID
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070063 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070064 void unregisterNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler,
65 ApplicationId appId);
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070066
67 /**
68 * Unregisters a neighbour message handler that was assigned to an interface.
69 *
70 * @param intf interface
71 * @param handler neighbour message handler
Jonathan Hartc4f681c2016-09-09 07:14:25 -070072 * @param appId application ID
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070073 */
Jonathan Hartc4f681c2016-09-09 07:14:25 -070074 void unregisterNeighbourHandler(Interface intf, NeighbourMessageHandler handler,
75 ApplicationId appId);
76
77 /**
78 * Unregisters all neighbour handlers that were registered by the given
79 * application.
80 *
81 * @param appId application ID
82 */
83 void unregisterNeighbourHandlers(ApplicationId appId);
84
85 /**
86 * Gets the neighbour message handlers that have been registered with the
87 * service.
88 *
89 * @return neighbour message handlers indexed by connect point
90 */
91 Map<ConnectPoint, Collection<NeighbourHandlerRegistration>> getHandlerRegistrations();
Jonathan Hart06e89082016-08-08 17:21:01 -070092}