blob: 6411c0114b76bad1936b3b3e8aa429ef56c4efa0 [file] [log] [blame]
andreaeb70a942015-10-16 21:34:46 -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 */
16
17package org.onosproject.netconf;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.net.DeviceId;
21
22import java.util.Map;
23
24/**
25 * Abstraction of an NETCONF controller. Serves as a one stop shop for obtaining
26 * NetconfDevice and (un)register listeners on NETCONF device events.
27 */
28public interface NetconfController {
29
30 /**
31 * Adds Device Event Listener.
32 *
33 * @param listener node listener
34 */
35 void addDeviceListener(NetconfDeviceListener listener);
36
37 /**
38 * Removes Device Listener.
39 *
40 * @param listener node listener
41 */
42 void removeDeviceListener(NetconfDeviceListener listener);
43
44 /**
45 * Tries to connect to a specific NETCONF device, if the connection is succesful
46 * it creates and adds the device to the ONOS core as a NetconfDevice.
47 *
48 * @param deviceInfo info about the device to add
49 * @return NetconfDevice Netconf device
50 */
51 NetconfDevice connectDevice(NetconfDeviceInfo deviceInfo);
52
53 /**
54 * Removes a Netconf device.
55 *
56 * @param deviceInfo info about the device to remove
57 */
58 void removeDevice(NetconfDeviceInfo deviceInfo);
59
60 /**
61 * Gets all the nodes information.
62 *
63 * @return map of devices
64 */
65 Map<DeviceId, NetconfDevice> getDevicesMap();
66
67 /**
68 * Gets a Netconf Device by node identifier.
69 *
70 * @param deviceInfo node identifier
71 * @return NetconfDevice Netconf device
72 */
73 NetconfDevice getNetconfDevice(DeviceId deviceInfo);
74
75 /**
76 * Gets a Netconf Device by node identifier.
77 *
78 * @param ip device ip
79 * @param port device port
80 * @return NetconfDevice Netconf device
81 */
82 NetconfDevice getNetconfDevice(IpAddress ip, int port);
83
84}