Examples of ServerChannel


Examples of org.apache.sshd.server.ServerChannel

            buffer.putString("");
            writePacket(buffer);
            return;
        }

        ServerChannel channel = null;
        for (NamedFactory<ServerChannel> factory : getServerFactoryManager().getChannelFactories()) {
            if (factory.getName().equals(type)) {
                channel = factory.create();
                break;
            }
        }
        if (channel == null) {
            buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
            buffer.putInt(id);
            buffer.putInt(SshConstants.SSH_OPEN_UNKNOWN_CHANNEL_TYPE);
            buffer.putString("Unsupported channel type: " + type);
            buffer.putString("");
            writePacket(buffer);
            return;
        }

        int channelId;
        synchronized (channels) {
            channelId = nextChannelId++;
        }
        channels.put(channelId, channel);
        channel.init(this, channelId, id, rwsize, rmpsize);
        buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
        buffer.putInt(id);
        buffer.putInt(channelId);
        buffer.putInt(channel.getLocalWindow().getSize());
        buffer.putInt(channel.getLocalWindow().getPacketSize());
        writePacket(buffer);
    }
View Full Code Here

Examples of org.apache.sshd.server.ServerChannel

            buffer.putString("");
            writePacket(buffer);
            return;
        }

        ServerChannel channel = null;
        for (NamedFactory<ServerChannel> factory : getServerFactoryManager().getChannelFactories()) {
            if (factory.getName().equals(type)) {
                channel = factory.create();
                break;
            }
        }
        if (channel == null) {
            buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
            buffer.putInt(id);
            buffer.putInt(SshConstants.SSH_OPEN_UNKNOWN_CHANNEL_TYPE);
            buffer.putString("Unsupported channel type: " + type);
            buffer.putString("");
            writePacket(buffer);
            return;
        }

        int channelId;
        synchronized (channels) {
            channelId = nextChannelId++;
        }
        channels.put(channelId, channel);
        channel.init(this, channelId, id, rwsize, rmpsize);
        buffer = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
        buffer.putInt(id);
        buffer.putInt(channelId);
        buffer.putInt(channel.getLocalWindow().getSize());
        buffer.putInt(channel.getLocalWindow().getPacketSize());
        writePacket(buffer);
    }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

    // This does nothing, remove it. XXX
  }

  public void serverPut(OutputLine line) {
    this.log.add(line);
    ServerChannel channel = this.bayeux.getChannel("/outputlog");
    if (channel != null) {
      channel.publish(this.localSession, line, null);
    }
  }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

  public NamespaceBinding get(String session, String name)
    throws RuntimeException, InterruptedException
  {
    Map<String, Object> data = new HashMap<String, Object>(1);
    data.put("name", name);
    ServerChannel channel = getChannel(session);
    if (null == channel) {
      System.err.println("channel not found for session " + session);
      return null;
    }
    channel.publish(this.localSession, data, null);
    NamespaceBinding binding = getHandoff(session).take(); // blocks
    if (!binding.getName().equals(name)) {
      throw new RuntimeException("Namespace get, name mismatch.  Received " +
                                 binding.getName() + ", expected " + name);
    }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

    data.put("name", name);
    if (!unset) {
      data.put("value", value);
    }
    data.put("sync", sync);
    ServerChannel channel = getChannel(session);
    if (null == channel) {
      System.err.println("channel not found for session " + session);
      return;
    }
    channel.publish(this.localSession, data, null);
    if (sync) {
      NamespaceBinding binding = getHandoff(session).take(); // blocks
      if (!binding.getName().equals(name)) {
        throw new RuntimeException("Namespace set, name mismatch.  Received " +
                                   binding.getName() + ", expected " + name);
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            if (channel != null) {
                logDelivery(exchange, channel);
                channel.publish(serverSession, exchange.getIn().getBody(), null);
            }
        }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            try {
                if (channel != null) {
                    logDelivery(exchange, channel);
                    ServerMessage.Mutable mutable = binding.createCometdMessage(channel, serverSession,
                                                                                exchange.getIn());
                    channel.publish(serverSession, mutable);
                }
            } finally {
                if (disconnectLocalSession && serverSession.isLocalSession()) {
                    LOG.trace("Disconnection local session {}", serverSession);
                    serverSession.disconnect();
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

            exchange.setIn(message);

            consumer.getProcessor().process(exchange);

            if (ExchangeHelper.isOutCapable(exchange)) {
                ServerChannel channel = getBayeux().getChannel(channelName);
                ServerSession serverSession = getServerSession();

                ServerMessage.Mutable outMessage = binding.createCometdMessage(channel, serverSession, exchange.getOut());
                remote.deliver(serverSession, outMessage);
            }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

        }

        public void process(final Exchange exchange) {
            String channelName = producer.getEndpoint().getPath();
            BayeuxServerImpl bayeux = producer.getBayeux();
            ServerChannel channel = bayeux.getChannel(channelName);
            ServerSession serverSession = getServerSession();

            if (channel != null) {
                logDelivery(exchange, channel);
                ServerMessage.Mutable mutable = binding.createCometdMessage(channel, serverSession, exchange.getIn());
                channel.publish(serverSession, mutable);
            }
        }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel

            exchange.setIn(message);

            consumer.getProcessor().process(exchange);

            if (ExchangeHelper.isOutCapable(exchange)) {
                ServerChannel channel = getBayeux().getChannel(channelName);
                ServerSession serverSession = getServerSession();

                ServerMessage.Mutable outMessage = binding.createCometdMessage(channel, serverSession, exchange.getOut());
                remote.deliver(serverSession, outMessage);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.