blob: 8c756e51f85727630899d8ae9fdb19f993fcfa7c [file] [log] [blame]
andreaeb70a942015-10-16 21:34:46 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
andreaeb70a942015-10-16 21:34:46 -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.netconf;
18
19/**
20 * Interface representing a NETCONF device.
21 */
22public interface NetconfDevice {
23
24
25 /**
26 * Returns whether a device is a NETCONF device with a capabilities list
gyewan.an91d7e7e2019-01-17 15:12:48 +090027 * and is accessible, through a secure transport session or a proxy session.
andreaeb70a942015-10-16 21:34:46 -070028 *
29 * @return true if device is accessible, false otherwise
30 */
31 boolean isActive();
32
33 /**
gyewan.an91d7e7e2019-01-17 15:12:48 +090034 * Returns whether the device has secure transport session.
35 *
36 * @return true if secure transport session exists, false otherwise
37 */
38 default boolean isMasterSession() {
39 return isActive();
40 }
41
42 /**
andreaeb70a942015-10-16 21:34:46 -070043 * Returns a NETCONF session context for this device.
44 *
45 * @return netconf session
46 */
47 NetconfSession getSession();
48
49 /**
50 * Ensures that all sessions are closed.
51 * A device cannot be used after disconnect is called.
52 */
53 void disconnect();
54
55 /**
56 * return all the info associated with this device.
57 * @return NetconfDeviceInfo
58 */
59 NetconfDeviceInfo getDeviceInfo();
60}