Add transport-{api,tcp}
[netconf.git] / transport / transport-api / src / main / java / org / opendaylight / netconf / transport / api / TransportStack.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 com.google.common.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.yangtools.yang.common.Empty;
13
14 /**
15  * A wiring of multiple transport components which provides resolution of {@link TransportChannel}s. There are generally
16  * two ways to provide a stack:
17  * <ul>
18  *   <li>a listen stack, used for normal NETCONF servers and Call-Home clients, and</li>
19  *   <li>a connect stack, used for normal NETCONF clients and Call-Home servers</li>
20  * </ul>.
21  */
22 @NonNullByDefault
23 public interface TransportStack {
24     /**
25      * Initiate shutdown of this stack, terminating all underlying transport sessions. Implementations of this method
26      * are required to be idempotent, returning the same future.
27      *
28      * @return a {@link ListenableFuture} which completes when all resources have been released.
29      */
30     ListenableFuture<Empty> shutdown();
31 }