Package org.apache.qpid.proton.amqp

Examples of org.apache.qpid.proton.amqp.Binary


        byte[] passwordBytes = password.getBytes();
        byte[] data = new byte[usernameBytes.length+passwordBytes.length+2];
        System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
        System.arraycopy(passwordBytes, 0, data, 2+usernameBytes.length, passwordBytes.length);

        setChallengeResponse(new Binary(data));

    }
View Full Code Here


        final Properties properties = amqp.getProperties();
        if( properties!=null ) {
            if( properties.getMessageId()!=null ) {
                jms.setJMSMessageID(properties.getMessageId().toString());
            }
            Binary userId = properties.getUserId();
            if( userId!=null ) {
                vendor.setJMSXUserID(jms, new String(userId.getArray(), userId.getArrayOffset(), userId.getLength(), "UTF-8"));
            }
            if( properties.getTo()!=null ) {
                jms.setJMSDestination(vendor.createDestination(properties.getTo(), toAttributes));
            }
            if( properties.getSubject()!=null ) {
View Full Code Here

                    TransportDelivery transportDelivery = new TransportDelivery(deliveryId, delivery, transportLink);
                    delivery.setTransportDelivery(transportDelivery);

                    final Transfer transfer = new Transfer();
                    transfer.setDeliveryId(deliveryId);
                    transfer.setDeliveryTag(new Binary(delivery.getTag()));
                    transfer.setHandle(transportLink.getLocalHandle());

                    if(delivery.isSettled())
                    {
                        transfer.setSettled(Boolean.TRUE);
View Full Code Here

        {
            return null;
        }
        else
        {
            final Binary userId = _properties.getUserId();
            byte[] id = new byte[userId.getLength()];
            System.arraycopy(userId.getArray(),userId.getArrayOffset(),id,0,userId.getLength());
            return id;
        }

    }
View Full Code Here

            {
                _properties = new Properties();
            }
            byte[] id = new byte[userId.length];
            System.arraycopy(userId, 0, id,0, userId.length);
            _properties.setUserId(new Binary(id));
        }
    }
View Full Code Here

            pn_type_t type = atom.getType();
            pn_atom_t_u value = atom.getU();

            if(pn_type_t.PN_BINARY.equals(type))
            {
                new Binary(Proton.pn_bytes_to_array(value.getAs_bytes()));
            }
            else if(pn_type_t.PN_STRING.equals(type))
            {
                return new String(Proton.pn_bytes_to_array(value.getAs_bytes()), UTF8_CHARSET);
            }
View Full Code Here

    private void decodeProperties()
    {
        _properties = new Properties();
        _properties.setMessageId(convert(Proton.pn_message_get_id(_impl)));
        _properties.setUserId(new Binary(Proton.pn_bytes_to_array(Proton.pn_message_get_user_id(_impl))));
        _properties.setTo(Proton.pn_message_get_address(_impl));
        _properties.setSubject(Proton.pn_message_get_subject(_impl));
        _properties.setReplyTo(Proton.pn_message_get_reply_to(_impl));
        _properties.setCorrelationId(convert(Proton.pn_message_get_correlation_id(_impl)));
        _properties.setContentType(Symbol.valueOf(Proton.pn_message_get_content_type(_impl)));
View Full Code Here

        Proton.pn_message_set_id(_impl, convertToAtom(noProperties ? null : _properties.getMessageId()));

        pn_bytes_t userId = new pn_bytes_t();;
        if(!noProperties && _properties.getUserId() != null)
        {
            final Binary binary = _properties.getUserId();
            byte[] bytes = new byte[binary.getLength()];
            System.arraycopy(binary.getArray(),binary.getArrayOffset(),bytes,0,binary.getLength());
            Proton.pn_bytes_from_array(userId, bytes);
        }

        Proton.pn_message_set_user_id(_impl, userId);
View Full Code Here

      Object action = ((AmqpValue) msg.getBody()).getValue();
      if (action instanceof Declare)
      {
         Transaction tx = protonSession.getServerSession().getCurrentTransaction();
         Declared declared = new Declared();
         declared.setTxnId(new Binary(longToBytes(tx.getID())));
         delivery.disposition(declared);
         delivery.settle();
      }
      else if (action instanceof Discharge)
      {
View Full Code Here

        {
            return null;
        }
        else
        {
            final Binary userId = _properties.getUserId();
            byte[] id = new byte[userId.getLength()];
            System.arraycopy(userId.getArray(),userId.getArrayOffset(),id,0,userId.getLength());
            return id;
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.amqp.Binary

Copyright © 2018 www.massapicom. 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.