2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netconf.api;
10 // FIXME: NETCONF-554: rework this interface
11 public interface NetconfSessionListener<S extends NetconfSession> {
13 * Fired when the session was established successfully.
15 * @param session New session
17 void onSessionUp(S session);
20 * Fired when the session went down because of an IO error. Implementation should take care of closing underlying
23 * @param session that went down
24 * @param cause Exception that was thrown as the cause of session being down
26 void onSessionDown(S session, Exception cause);
29 * Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state.
30 * Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
32 * @param reason the cause why the session went down
34 void onSessionTerminated(S session, NetconfTerminationReason reason);
37 * Fired when a normal protocol message is received.
39 * @param message Protocol message
41 void onMessage(S session, NetconfMessage message);