Examples of ClientSession


Examples of com.sun.sgs.app.ClientSession

      /*
       * Verfiy that the sending session (if any) is a member of this
       * channel.
       */
      if (senderRefId != null) {
    ClientSession sender =
        (ClientSession) getObjectForId(senderRefId);
    if (sender == null ||
        !channel.hasSession(getNodeId(sender), senderRefId))
    {
        return;
View Full Code Here

Examples of com.sun.sgs.app.ClientSession

            send(channelRef.get(), message);
        }

        public void send(WonderlandClientID wlID, Message message) {
            // issue 963: session may be null
            ClientSession session = wlID.getSession();
            if (session != null) {
                session.send(serializeMessage(message, clientID));
            }
        }
View Full Code Here

Examples of com.sun.sgs.app.ClientSession

     * @param ref a reference to the correct client handler
     */
    private void finishAttach(MessageID messageID, ConnectionType type,
                              Properties properties, ClientHandlerRef ref)
    {
        ClientSession session = getSession();

        // get the ID for this type
        WonderlandClientSenderImpl sender = getHandlerStore().getSender(type);
        short clientID = sender.getClientID();
       
        // make sure this isn't a duplicate join
        if (handlers.containsKey(Short.valueOf(clientID))) {
            logger.fine("Session " + session.getName() + " duplicate client " +
                        "for type " + type);
            sendError(messageID, SESSION_INTERNAL_CLIENT_ID,
                          "Duplicate client for " + type);
            return;
        }
View Full Code Here

Examples of com.sun.sgs.app.ClientSession

                sendError(m, "Client version incompatible with server " +
                             "version " + cp.getVersion());
            }
           
           
            ClientSession session = getSession();
            logger.info("Session " + session.getName() + " connected with " +
                        "protocol " + cp.getName());
           
            // all set -- set the wrapped session
            wrapped = cp.createSessionListener(session, psm.getProtocolVersion());
            if (wrapped instanceof ManagedObject) {
View Full Code Here

Examples of oracle.toplink.essentials.threetier.ClientSession

    * to determine whether the object could be created.
    */
    public static Sequencing createSequencing(AbstractSession session) {
        Sequencing sequencing = null;
        if (session.isClientSession()) {
            ClientSession cs = (ClientSession)session;
            if (ClientSessionSequencing.sequencingServerExists(cs)) {
                sequencing = new ClientSessionSequencing(cs);
            }
        }
        return sequencing;
View Full Code Here

Examples of org.apache.chemistry.opencmis.workbench.model.ClientSession

        return result;
    }

    public void createClientSession() {
        if (expertLogin) {
            clientSession = new ClientSession(createExpertSessionParameters());
        } else {
            clientSession = new ClientSession(createBasicSessionParameters());
        }
    }
View Full Code Here

Examples of org.apache.qpid.nclient.impl.ClientSession

    }

    public Session createSession(long expiryInSeconds)
    {
        Channel ch = _conn.getChannel();
        ClientSession ssn = new ClientSession(UUID.randomUUID().toString().getBytes());
        ssn.attach(ch);
        ssn.sessionAttach(ssn.getName());
        ssn.sessionRequestTimeout(expiryInSeconds);
        return ssn;
    }
View Full Code Here

Examples of org.apache.sshd.ClientSession

        }

        log.debug("Connected to {}:{}", getHost(), getPort());

        ClientChannel channel = null;
        ClientSession session = null;
       
        try {
            AuthFuture authResult;
            session = connectFuture.getSession();
   
            KeyPairProvider keyPairProvider;
            final String certResource = getCertResource();
            if (certResource != null) {
                log.debug("Attempting to authenticate using ResourceKey '{}'...", certResource);
                keyPairProvider = new ResourceHelperKeyPairProvider(new String[]{certResource}, getCamelContext().getClassResolver());
            } else {
                keyPairProvider = getKeyPairProvider();
            }
   
            if (keyPairProvider != null) {
                log.debug("Attempting to authenticate username '{}' using Key...", getUsername());
                KeyPair pair = keyPairProvider.loadKey(getKeyType());
                authResult = session.authPublicKey(getUsername(), pair);
            } else {
                log.debug("Attempting to authenticate username '{}' using Password...", getUsername());
                authResult = session.authPassword(getUsername(), getPassword());
            }
   
            authResult.await(getTimeout());
   
            if (!authResult.isDone() || authResult.isFailure()) {
                log.debug("Failed to authenticate");
                throw new RuntimeCamelException("Failed to authenticate username " + getUsername());
            }
       
            channel = session.createChannel(ClientChannel.CHANNEL_EXEC, command);

            ByteArrayInputStream in = new ByteArrayInputStream(new byte[]{0});
            channel.setIn(in);
   
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            channel.setOut(out);
   
            ByteArrayOutputStream err = new ByteArrayOutputStream();
            channel.setErr(err);
            OpenFuture openFuture = channel.open();
            openFuture.await(getTimeout());
            if (openFuture.isOpened()) {
                channel.waitFor(ClientChannel.CLOSED, 0);
                result = new SshResult(command, channel.getExitStatus(),
                        new ByteArrayInputStream(out.toByteArray()),
                        new ByteArrayInputStream(err.toByteArray()));
   
            }
            return result;
        } finally {
            if (channel != null) {
                channel.close(true);
            }
            // need to make sure the session is closed
            if (session != null) {
                session.close(false);
            }
        }
       
    }
View Full Code Here

Examples of org.eclipse.persistence.sessions.server.ClientSession

    * to determine whether the object could be created.
    */
    public static Sequencing createSequencing(AbstractSession session) {
        Sequencing sequencing = null;
        if (session.isClientSession()) {
            ClientSession cs = (ClientSession)session;
            if (ClientSessionSequencing.sequencingServerExists(cs)) {
                sequencing = new ClientSessionSequencing(cs);
            }
        } else if (session.isRemoteSession()) {
            RemoteConnection con = ((RemoteSession)session).getRemoteConnection();
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession

            // Check if the queue exists
            if(! queueExists(queueName, sf)) {
                throw new IllegalStateException();
            }

            ClientSession session = null;
            try {
               session = sf.createSession();
               ClientProducer producer = session.createProducer(queueName);
               ClientMessage message = session.createMessage(false);

               final String propName = "myprop";
               message.putStringProperty(propName, "Hello sent at " + new Date());
               System.out.println("Sending the message.");

               producer.send(message);

               ClientConsumer messageConsumer = session.createConsumer(queueName);
               session.start();

               ClientMessage messageReceived = messageConsumer.receive(1000);
               System.out.println("Received TextMessage:" + messageReceived.getStringProperty(propName));
            } finally {
               if (session != null) {
                  session.close();
               }
            }

            op = new ModelNode();
            op.get("operation").set("remove");
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.