blob: 53e5db759e90a0b1a93ddb287ce9f5d27468f7b7 [file] [log] [blame]
Andrea Campanella950310c2016-02-12 18:14:38 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Andrea Campanella950310c2016-02-12 18:14:38 -08003 *
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
gyewan.an91d7e7e2019-01-17 15:12:48 +090019import com.google.common.annotations.Beta;
20
Andrea Campanella950310c2016-02-12 18:14:38 -080021/**
22 * Abstract interface for the creation of a NETCONF device.
23 */
Yuta HIGUCHI2ee4fba2018-06-12 16:21:06 -070024@FunctionalInterface
Andrea Campanella950310c2016-02-12 18:14:38 -080025public interface NetconfDeviceFactory {
26
27 /**
28 * Creates a new NETCONF device based on the supplied information.
29 * @param netconfDeviceInfo information of the device to create.
30 * @return Instance of NetconfDevice.
31 * @throws NetconfException when problems arise creating the device and establishing
32 * the connection.
33 */
34 NetconfDevice createNetconfDevice(NetconfDeviceInfo netconfDeviceInfo)
35 throws NetconfException;
gyewan.an91d7e7e2019-01-17 15:12:48 +090036
37 /**
38 * Creates a new NETCONF device based on the supplied information.
39 * @param netconfDeviceInfo information of the device to create.
40 * @param isMaster if true create secure transport session with the device,
41 * else just create a proxy session
42 * @return Instance of NetconfDevice.
43 * @throws NetconfException when problems arise creating the device and establishing
44 * the connection.
45 */
46 @Beta
47 default NetconfDevice createNetconfDevice(NetconfDeviceInfo netconfDeviceInfo,
48 boolean isMaster) throws NetconfException {
49 return createNetconfDevice(netconfDeviceInfo);
50 }
Andrea Campanella950310c2016-02-12 18:14:38 -080051}