in sshd-core/src/main/java/org/apache/sshd/client/simple/AbstractSimpleClientSessionCreator.java [151:245]
public static SimpleClient wrap(ClientSessionCreator creator, Channel channel) {
Objects.requireNonNull(creator, "No sessions creator");
Objects.requireNonNull(channel, "No channel");
return new AbstractSimpleClientSessionCreator() {
@Override
public ConnectFuture connect(String uri) throws IOException {
return creator.connect(uri);
}
@Override
public ConnectFuture connect(String username, String host, int port) throws IOException {
return creator.connect(username, host, port);
}
@Override
public ConnectFuture connect(String username, String host, int port, SocketAddress localAddress)
throws IOException {
return creator.connect(username, host, port, localAddress);
}
@Override
public ConnectFuture connect(String username, SocketAddress address) throws IOException {
return creator.connect(username, address);
}
@Override
public ConnectFuture connect(String username, SocketAddress targetAddress, SocketAddress localAddress)
throws IOException {
return creator.connect(username, targetAddress, localAddress);
}
@Override
public ConnectFuture connect(HostConfigEntry hostConfig) throws IOException {
return creator.connect(hostConfig);
}
@Override
public ConnectFuture connect(HostConfigEntry hostConfig, SocketAddress localAddress) throws IOException {
return creator.connect(hostConfig, localAddress);
}
@Override
public ConnectFuture connect(
HostConfigEntry hostConfig, AttributeRepository context, SocketAddress localAddress)
throws IOException {
return creator.connect(hostConfig, context, localAddress);
}
@Override
public ConnectFuture connect(
String username, SocketAddress targetAddress, AttributeRepository context, SocketAddress localAddress)
throws IOException {
return creator.connect(username, targetAddress, context, localAddress);
}
@Override
public ConnectFuture connect(
String username, String host, int port, AttributeRepository context, SocketAddress localAddress)
throws IOException {
return creator.connect(username, host, port, context, localAddress);
}
@Override
public ConnectFuture connect(HostConfigEntry hostConfig, AttributeRepository context) throws IOException {
return creator.connect(hostConfig, context);
}
@Override
public ConnectFuture connect(String username, SocketAddress address, AttributeRepository context)
throws IOException {
return creator.connect(username, address, context);
}
@Override
public ConnectFuture connect(String username, String host, int port, AttributeRepository context)
throws IOException {
return creator.connect(username, host, port, context);
}
@Override
public boolean isOpen() {
return channel.isOpen();
}
@Override
public void close() throws IOException {
channel.close();
}
@Override
public String toString() {
return SimpleClient.class.getSimpleName() + "[" + channel + "]";
}
};
}