2 * Copyright (c) 2022 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.transport.api;
10 import com.google.common.base.MoreObjects;
11 import com.google.common.base.MoreObjects.ToStringHelper;
12 import io.netty.channel.Channel;
13 import org.eclipse.jdt.annotation.NonNull;
16 * A transport-level session. This concept is bound to a {@link Channel} for now, so as to enforce type-safety. It acts
17 * as a meeting point between a logical NETCONF session and the underlying transport.
19 public abstract class TransportChannel {
21 * Return the underlying Netty channel.
23 * @return Netty channel
25 public abstract @NonNull Channel channel();
28 public final int hashCode() {
29 return super.hashCode();
33 public final boolean equals(final Object obj) {
34 return super.equals(obj);
38 public final String toString() {
39 return addToStringAttributes(MoreObjects.toStringHelper(this).omitNullValues()).toString();
42 protected ToStringHelper addToStringAttributes(final ToStringHelper helper) {
43 return helper.add("channel", channel());