Add transport-{api,tcp}
[netconf.git] / transport / transport-api / src / main / java / org / opendaylight / netconf / transport / api / TransportChannelListener.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. 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.transport.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11
12 /**
13  * Transport-level channel event listener.
14  */
15 public interface TransportChannelListener {
16     /**
17      * Invoked when a {@link TransportChannel} is established. Implementations of this method are expected to attach
18      * to validate the channel and connect it to the messages layer.
19      *
20      * @param channel Established channel
21      */
22     void onTransportChannelEstablished(@NonNull TransportChannel channel);
23
24     /**
25      * Invoked when a {@link TransportChannel} could not be established. Implementations of this method are expected
26      * to react to this failure at least by logging it.
27      *
28      * @param cause Failure cause
29      */
30     void onTransportChannelFailed(@NonNull Throwable cause);
31 }