Attempt netconf remount regardless of error-type
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / api / RemoteDeviceHandler.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.sal.connect.api;
9
10 import org.opendaylight.mdsal.dom.api.DOMActionService;
11 import org.opendaylight.mdsal.dom.api.DOMNotification;
12 import org.opendaylight.mdsal.dom.api.DOMRpcService;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15
16 public interface RemoteDeviceHandler<PREF> extends AutoCloseable {
17
18     /**
19      * When device connected, init new mount point with specific schema context and DOM services.
20      *
21      * @param remoteSchemaContext - schema context of connected device
22      * @param netconfSessionPreferences - session of device
23      * @param deviceRpc - {@link DOMRpcService} of device
24      */
25     default void onDeviceConnected(final SchemaContext remoteSchemaContext, final PREF netconfSessionPreferences,
26             final DOMRpcService deviceRpc) {
27         // DO NOTHING
28     }
29
30     /**
31      * When device connected, init new mount point with specific schema context and DOM services.
32      *
33      * @param remoteSchemaContext - schema context of connected device
34      * @param netconfSessionPreferences - session of device
35      * @param deviceRpc - {@link DOMRpcService} of device
36      * @param deviceAction - {@link DOMActionService} of device
37      */
38     default void onDeviceConnected(final SchemaContext remoteSchemaContext, final PREF netconfSessionPreferences,
39             final DOMRpcService deviceRpc, final DOMActionService deviceAction) {
40         // DO NOTHING
41     }
42
43     default void onDeviceReconnected(final PREF netconfSessionPreferences, final NetconfNode node) {
44         // DO NOTHING
45     }
46
47     void onDeviceDisconnected();
48
49     void onDeviceFailed(Throwable throwable);
50
51     void onNotification(DOMNotification domNotification);
52
53     @Override
54     void close();
55 }