Package org.apache.qpid.amqp_1_0.type

Examples of org.apache.qpid.amqp_1_0.type.Binary


                    header.setTtl(oldHeader.getTtl());
                }
                header.setDeliveryCount(UnsignedInteger.valueOf(queueEntry.getDeliveryCount()));
                _sectionEncoder.reset();
                _sectionEncoder.encodeObject(header);
                Binary encodedHeader = _sectionEncoder.getEncoding();

                ByteBuffer oldPayload = payload;
                payload = ByteBuffer.allocate(oldPayload.remaining() + encodedHeader.getLength());
                payload.put(encodedHeader.getArray(),encodedHeader.getArrayOffset(),encodedHeader.getLength());
                payload.put(oldPayload);
                payload.flip();
            }

            transfer.setPayload(payload);
            byte[] data = new byte[8];
            ByteBuffer.wrap(data).putLong(_deliveryTag++);
            final Binary tag = new Binary(data);

            transfer.setDeliveryTag(tag);

            synchronized(_link.getLock())
            {
View Full Code Here


        }

        public boolean process(DeliveryState state, final Boolean settled)
        {

            Binary transactionId = null;
            final Outcome outcome;
            // If disposition is settled this overrides the txn?
            if(state instanceof TransactionalState)
            {
                transactionId = ((TransactionalState)state).getTxnId();
View Full Code Here

        {
        }

        public boolean process(final DeliveryState state, final Boolean settled)
        {
            Binary transactionId = null;
            Outcome outcome = null;
            // If disposition is settled this overrides the txn?
            if(state instanceof TransactionalState)
            {
                transactionId = ((TransactionalState)state).getTxnId();
View Full Code Here


            Sender s = session.createSender(queue, 10);

            Message message = new Message("dump me");
            message.setDeliveryTag(new Binary("dump".getBytes()));

            s.send(message);

            s.close();
            session.close();
View Full Code Here

            msg.setTtl(null);
        }

        if(!getDisableMessageID() && msg.getMessageId() == null)
        {
            final Binary messageId = generateMessageId();
            msg.setMessageId(messageId);

        }

        if(message != msg)
View Full Code Here

    }

    private Binary generateMessageId()
    {
        UUID uuid = UUID.randomUUID();
        return new Binary(uuid.toString().getBytes());
    }
View Full Code Here

                            System.arraycopy(origBytes,0,bytes,0,origBytes.length);
                            for(int x = origBytes.length; x < bytes.length; x++)
                            {
                                bytes[x] = (byte) '.';
                            }
                            bodySection = new Data(new Binary(bytes));
                        }
                        else
                        {
                            bodySection = new AmqpValue(message + " " + i);
                        }
View Full Code Here

                for(String fileName : unsettledFiles)
                {
                    File aFile = new File(tmpDirectory, fileName);
                    if(aFile.canRead() && aFile.canWrite())
                    {
                        Binary deliveryTag = new Binary(md5.digest(fileName.getBytes()));
                        unsettled.put(deliveryTag, null);
                        unsettledFileNames.put(deliveryTag, fileName);
                    }
                }
View Full Code Here

        int read = fis.read(data);

        fis.close();

        Section applicationProperties = new ApplicationProperties(Collections.singletonMap("filename", fileName));
        Section amqpValue = new Data(new Binary(data));
        Message message = new Message(Arrays.asList(applicationProperties, amqpValue));
        Binary deliveryTag = new Binary(md5.digest(fileName.getBytes()));
        message.setDeliveryTag(deliveryTag);
        md5.reset();
        return message;
    }
View Full Code Here

    {

        Object o = getCorrelationId();
        if(o instanceof Binary)
        {
            Binary correlationIdBinary = (Binary) o;
            byte[] correlationId = new byte[correlationIdBinary.getLength()];
            correlationIdBinary.asByteBuffer().get(correlationId);
            return correlationId;
        }
        else
        {
            return o == null ? null : o.toString().getBytes();
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.type.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.