*/
package org.opendaylight.netconf.callhome.protocol;
-import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Set;
import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.session.ClientSessionImpl;
/**
* Authorization context for incoming call home sessions.
@Override
protected void applyTo(final ClientSession session) {
- checkArgument(session instanceof ClientSessionImpl);
session.setUsername(username);
// First try authentication using server host keys, else try password.
import org.apache.sshd.client.future.AuthFuture;
import org.apache.sshd.client.future.OpenFuture;
import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.session.ClientSessionImpl;
import org.apache.sshd.common.future.SshFutureListener;
import org.apache.sshd.common.session.Session;
import org.checkerframework.checker.lock.qual.Holding;
private static final String NETCONF = "netconf";
- private final ClientSessionImpl sshSession;
+ private final ClientSession sshSession;
private final CallHomeAuthorization authorization;
private final Factory factory;
final SocketAddress remoteAddress, final Factory factory) {
this.authorization = requireNonNull(authorization, "authorization");
checkArgument(this.authorization.isServerAllowed(), "Server was not allowed.");
- checkArgument(sshSession instanceof ClientSessionImpl,
- "sshSession must implement ClientSessionImpl");
this.factory = requireNonNull(factory, "factory");
- this.sshSession = (ClientSessionImpl) sshSession;
+ this.sshSession = requireNonNull(sshSession, "sshSession");
this.sshSession.setAttribute(SESSION_KEY, this);
this.remoteAddress = (InetSocketAddress) this.sshSession.getIoSession().getRemoteAddress();
this.serverKey = this.sshSession.getKex().getServerKey();