Andrea Campanella | 950310c | 2016-02-12 18:14:38 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Andrea Campanella | 950310c | 2016-02-12 18:14:38 -0800 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.netconf; |
| 18 | |
gyewan.an | 91d7e7e | 2019-01-17 15:12:48 +0900 | [diff] [blame^] | 19 | import com.google.common.annotations.Beta; |
| 20 | |
Andrea Campanella | 950310c | 2016-02-12 18:14:38 -0800 | [diff] [blame] | 21 | /** |
| 22 | * Abstract interface for the creation of a NETCONF device. |
| 23 | */ |
Yuta HIGUCHI | 2ee4fba | 2018-06-12 16:21:06 -0700 | [diff] [blame] | 24 | @FunctionalInterface |
Andrea Campanella | 950310c | 2016-02-12 18:14:38 -0800 | [diff] [blame] | 25 | public 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.an | 91d7e7e | 2019-01-17 15:12:48 +0900 | [diff] [blame^] | 36 | |
| 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 Campanella | 950310c | 2016-02-12 18:14:38 -0800 | [diff] [blame] | 51 | } |