org.apache.sshd.common.io.IoHandler Java Examples

The following examples show how to use org.apache.sshd.common.io.IoHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NettyIoAcceptor.java    From termd with Apache License 2.0 6 votes vote down vote up
public NettyIoAcceptor(NettyIoServiceFactory factory, final IoHandler handler) {
  this.factory = factory;
  this.handler = handler;
  channelGroup = new DefaultChannelGroup("sshd-acceptor-channels", GlobalEventExecutor.INSTANCE);
  bootstrap.group(factory.eventLoopGroup)
      .channel(NioServerSocketChannel.class)
      .option(ChannelOption.SO_BACKLOG, 100)
      .handler(new LoggingHandler(LogLevel.INFO))
      .childHandler(new ChannelInitializer<SocketChannel>() {
        @Override
        public void initChannel(SocketChannel ch) throws Exception {
          ChannelPipeline p = ch.pipeline();
          p.addLast(new NettyIoSession(NettyIoAcceptor.this, handler).adapter);
        }
      });
}
 
Example #2
Source File: NettyIoAcceptor.java    From termd with Apache License 2.0 6 votes vote down vote up
public NettyIoAcceptor(NettyIoServiceFactory factory, IoHandler handler) {
  this.factory = factory;
  this.handler = handler;
  channelGroup = new DefaultChannelGroup("sshd-acceptor-channels", GlobalEventExecutor.INSTANCE);;
  bootstrap.group(factory.eventLoopGroup)
      .channel(NioServerSocketChannel.class)
      .option(ChannelOption.SO_BACKLOG, 100)
      .handler(new LoggingHandler(LogLevel.INFO))
      .childHandler(new ChannelInitializer<SocketChannel>() {
        @Override
        public void initChannel(SocketChannel ch) throws Exception {
          ChannelPipeline p = ch.pipeline();
          p.addLast(new NettyIoSession(NettyIoAcceptor.this, handler).adapter);
        }
      });
}
 
Example #3
Source File: NettyIoAcceptor.java    From aesh-readline with Apache License 2.0 6 votes vote down vote up
public NettyIoAcceptor(NettyIoServiceFactory factory, IoHandler handler) {
    this.factory = factory;
    this.handler = handler;
    channelGroup = new DefaultChannelGroup("sshd-acceptor-channels", GlobalEventExecutor.INSTANCE);;
    bootstrap.group(factory.eventLoopGroup)
            .channel(NioServerSocketChannel.class)
            .option(ChannelOption.SO_BACKLOG, 100)
            .handler(new LoggingHandler(LogLevel.INFO))
            .childHandler(new ChannelInitializer<SocketChannel>() {
                @Override
                public void initChannel(SocketChannel ch) throws Exception {
                    ChannelPipeline p = ch.pipeline();
                    p.addLast(new NettyIoSession(NettyIoAcceptor.this, handler).adapter);
                }
            });
}
 
Example #4
Source File: VertxIoHandlerBridge.java    From vertx-shell with Apache License 2.0 5 votes vote down vote up
@Override
public void messageReceived(IoHandler handler, IoSession session, org.apache.sshd.common.util.Readable message) throws Exception {
  context.dispatch(v -> {
    try {
      super.messageReceived(handler, session, message);
    } catch (Exception e) {
      throw new VertxException(e);
    }
  });
}
 
Example #5
Source File: VertxIoHandlerBridge.java    From vertx-shell with Apache License 2.0 5 votes vote down vote up
@Override
public void sessionClosed(IoHandler handler, IoSession session) throws Exception {
  context.dispatch(v -> {
    try {
      super.sessionClosed(handler, session);
    } catch (Exception e) {
      throw new VertxException(e);
    }
  });
}
 
Example #6
Source File: VertxIoHandlerBridge.java    From vertx-shell with Apache License 2.0 5 votes vote down vote up
@Override
public void sessionCreated(IoHandler handler, IoSession session) throws Exception {
  context.dispatch(v -> {
    try {
      super.sessionCreated(handler, session);
    } catch (Exception e) {
      throw new VertxException(e);
    }
  });
}
 
Example #7
Source File: NettyIoServiceFactory.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
@Override
public IoConnector createConnector(IoHandler handler) {
  throw new UnsupportedOperationException("Only implement server for now");
}
 
Example #8
Source File: TestServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(factory, handler);
}
 
Example #9
Source File: NettyIoServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(this, handler);
}
 
Example #10
Source File: NettyIoServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoConnector createConnector(IoHandler handler) {
  throw new UnsupportedOperationException("Only implement server for now");
}
 
Example #11
Source File: NettyIoSession.java    From termd with Apache License 2.0 4 votes vote down vote up
public NettyIoSession(NettyIoAcceptor acceptor, IoHandler handler) {
  this.acceptor = acceptor;
  this.handler = handler;
  this.id = acceptor.ioService.sessionSeq.incrementAndGet();
}
 
Example #12
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void messageReceived(IoHandler handler, IoSession session, Readable message) throws Exception {
  handler.messageReceived(session, message);
}
 
Example #13
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void sessionClosed(IoHandler handler, IoSession session) throws Exception {
  handler.sessionClosed(session);
}
 
Example #14
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void sessionCreated(IoHandler handler, IoSession session) throws Exception {
  handler.sessionCreated(session);
}
 
Example #15
Source File: TestServiceFactory.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(factory, handler);
}
 
Example #16
Source File: NettyIoServiceFactory.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(this, handler);
}
 
Example #17
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void sessionCreated(IoHandler handler, IoSession session) throws Exception {
  handler.sessionCreated(session);
}
 
Example #18
Source File: NettyIoSession.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public NettyIoSession(NettyIoAcceptor acceptor, IoHandler handler) {
    this.acceptor = acceptor;
    this.handler = handler;
    this.id = acceptor.ioService.sessionSeq.incrementAndGet();
}
 
Example #19
Source File: NettyIoHandlerBridge.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public void messageReceived(IoHandler handler, IoSession session, Readable message) throws Exception {
  handler.messageReceived(session, message);
}
 
Example #20
Source File: NettyIoHandlerBridge.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public void sessionClosed(IoHandler handler, IoSession session) throws Exception {
  handler.sessionClosed(session);
}
 
Example #21
Source File: NettyIoHandlerBridge.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public void sessionCreated(IoHandler handler, IoSession session) throws Exception {
  handler.sessionCreated(session);
}
 
Example #22
Source File: TestServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(factory, handler);
}
 
Example #23
Source File: NettyIoServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
  return new NettyIoAcceptor(this, handler);
}
 
Example #24
Source File: NettyIoServiceFactory.java    From termd with Apache License 2.0 4 votes vote down vote up
@Override
public IoConnector createConnector(IoHandler handler) {
  throw new UnsupportedOperationException("Only implement server for now");
}
 
Example #25
Source File: NettyIoSession.java    From termd with Apache License 2.0 4 votes vote down vote up
public NettyIoSession(NettyIoAcceptor acceptor, IoHandler handler) {
  this.acceptor = acceptor;
  this.handler = handler;
  this.id = acceptor.ioService.sessionSeq.incrementAndGet();
}
 
Example #26
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void messageReceived(IoHandler handler, IoSession session, Readable message) throws Exception {
  handler.messageReceived(session, message);
}
 
Example #27
Source File: NettyIoHandlerBridge.java    From termd with Apache License 2.0 4 votes vote down vote up
public void sessionClosed(IoHandler handler, IoSession session) throws Exception {
  handler.sessionClosed(session);
}