2 * Copyright (c) 2023 PANTHEON.tech s.r.o. 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.topology.callhome;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects;
13 import com.google.common.util.concurrent.SettableFuture;
14 import io.netty.channel.Channel;
15 import org.opendaylight.netconf.client.NetconfClientSession;
16 import org.opendaylight.netconf.client.NetconfClientSessionListener;
18 public record CallHomeTlsSessionContext(String id, Channel nettyChannel,
19 NetconfClientSessionListener netconfSessionListener, SettableFuture<NetconfClientSession> settableFuture)
20 implements CallHomeSessionContext {
22 public CallHomeTlsSessionContext {
24 requireNonNull(nettyChannel);
25 requireNonNull(netconfSessionListener);
26 requireNonNull(settableFuture);
31 if (nettyChannel.isOpen()) {
37 public String toString() {
38 return MoreObjects.toStringHelper(this)
39 .add("protocol", "TLS")
41 .add("address", nettyChannel.remoteAddress())