Search in sources :

Example 36 with AMQShortString

use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.

the class ProtocolOutputConverterImpl method createEncodedDeliverBody.

private AMQBody createEncodedDeliverBody(AMQMessage message, boolean isRedelivered, final long deliveryTag, final AMQShortString consumerTag) {
    final AMQShortString exchangeName;
    final AMQShortString routingKey;
    final MessagePublishInfo pb = message.getMessagePublishInfo();
    exchangeName = pb.getExchange();
    routingKey = pb.getRoutingKey();
    return new EncodedDeliveryBody(deliveryTag, routingKey, exchangeName, consumerTag, isRedelivered);
}
Also used : MessagePublishInfo(org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo)

Example 37 with AMQShortString

use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.

the class AccessRequestBody method process.

public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) {
    AMQShortString realm = AMQShortString.readAMQShortString(buffer);
    byte bitfield = buffer.get();
    boolean exclusive = (bitfield & 0x01) == 0x1;
    boolean passive = (bitfield & 0x02) == 0x2;
    boolean active = (bitfield & 0x04) == 0x4;
    boolean write = (bitfield & 0x08) == 0x8;
    boolean read = (bitfield & 0x10) == 0x10;
    if (!dispatcher.ignoreAllButCloseOk()) {
        dispatcher.receiveAccessRequest(realm, exclusive, passive, active, write, read);
    }
}
Also used : AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString)

Example 38 with AMQShortString

use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.

the class BasicCancelBody method process.

public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) {
    AMQShortString consumerTag = AMQShortString.readAMQShortString(buffer);
    boolean noWait = (buffer.get() & 0x01) == 0x01;
    if (!dispatcher.ignoreAllButCloseOk()) {
        dispatcher.receiveBasicCancel(consumerTag, noWait);
    }
}
Also used : AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString)

Example 39 with AMQShortString

use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.

the class BasicContentHeaderProperties method read.

public int read(QpidByteBuffer input) {
    _propertyFlags = input.getUnsignedShort();
    int length = 2;
    if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) {
        length++;
        _contentType = AMQShortString.readAMQShortString(input);
        if (_contentType != null) {
            length += _contentType.length();
        }
    }
    if ((_propertyFlags & ENCODING_MASK) != 0) {
        length++;
        _encoding = AMQShortString.readAMQShortString(input);
        if (_encoding != null) {
            length += _encoding.length();
        }
    }
    if ((_propertyFlags & HEADERS_MASK) != 0) {
        int fieldTableLength = input.getInt();
        _headers = new FieldTable(input, fieldTableLength);
        length += 4;
        length += fieldTableLength;
    }
    if ((_propertyFlags & DELIVERY_MODE_MASK) != 0) {
        _deliveryMode = input.get();
        length++;
    }
    if ((_propertyFlags & PRIORITY_MASK) != 0) {
        _priority = input.get();
        length++;
    }
    if ((_propertyFlags & CORRELATION_ID_MASK) != 0) {
        length++;
        _correlationId = AMQShortString.readAMQShortString(input);
        if (_correlationId != null) {
            length += _correlationId.length();
        }
    }
    if ((_propertyFlags & REPLY_TO_MASK) != 0) {
        length++;
        _replyTo = AMQShortString.readAMQShortString(input);
        if (_replyTo != null) {
            length += _replyTo.length();
        }
    }
    if ((_propertyFlags & EXPIRATION_MASK) != 0) {
        length++;
        AMQShortString expiration = AMQShortString.readAMQShortString(input);
        if (expiration != null) {
            length += expiration.length();
            _expiration = Long.parseLong(expiration.toString());
        }
    }
    if ((_propertyFlags & MESSAGE_ID_MASK) != 0) {
        length++;
        _messageId = AMQShortString.readAMQShortString(input);
        if (_messageId != null) {
            length += _messageId.length();
        }
    }
    if ((_propertyFlags & TIMESTAMP_MASK) != 0) {
        _timestamp = input.getLong();
        length += 8;
    }
    if ((_propertyFlags & TYPE_MASK) != 0) {
        length++;
        _type = AMQShortString.readAMQShortString(input);
        if (_type != null) {
            length += _type.length();
        }
    }
    if ((_propertyFlags & USER_ID_MASK) != 0) {
        length++;
        _userId = AMQShortString.readAMQShortString(input);
        if (_userId != null) {
            length += _userId.length();
        }
    }
    if ((_propertyFlags & APPLICATION_ID_MASK) != 0) {
        length++;
        _appId = AMQShortString.readAMQShortString(input);
        if (_appId != null) {
            length += _appId.length();
        }
    }
    if ((_propertyFlags & CLUSTER_ID_MASK) != 0) {
        length++;
        _clusterId = AMQShortString.readAMQShortString(input);
        if (_clusterId != null) {
            length += _clusterId.length();
        }
    }
    return length;
}
Also used : AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) FieldTable(org.apache.qpid.server.protocol.v0_8.FieldTable)

Example 40 with AMQShortString

use of org.apache.qpid.server.protocol.v0_8.AMQShortString in project qpid-broker-j by apache.

the class BasicDeliverBody method process.

public static void process(final QpidByteBuffer buffer, final ClientChannelMethodProcessor dispatcher) {
    AMQShortString consumerTag = AMQShortString.readAMQShortString(buffer);
    long deliveryTag = buffer.getLong();
    boolean redelivered = (buffer.get() & 0x01) != 0;
    AMQShortString exchange = AMQShortString.readAMQShortString(buffer);
    AMQShortString routingKey = AMQShortString.readAMQShortString(buffer);
    if (!dispatcher.ignoreAllButCloseOk()) {
        dispatcher.receiveBasicDeliver(consumerTag, deliveryTag, redelivered, exchange, routingKey);
    }
}
Also used : AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString)

Aggregations

AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)45 FieldTable (org.apache.qpid.server.protocol.v0_8.FieldTable)13 Transaction (com.sleepycat.je.Transaction)7 Database (com.sleepycat.je.Database)6 DatabaseEntry (com.sleepycat.je.DatabaseEntry)6 MessagePublishInfo (org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo)6 TupleOutput (com.sleepycat.bind.tuple.TupleOutput)4 MessageConversionException (org.apache.qpid.server.protocol.converter.MessageConversionException)4 TupleInput (com.sleepycat.bind.tuple.TupleInput)3 DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)3 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)3 URISyntaxException (java.net.URISyntaxException)2 HashSet (java.util.HashSet)2 MessageDestination (org.apache.qpid.server.message.MessageDestination)2 Exchange (org.apache.qpid.server.model.Exchange)2 Header (org.apache.qpid.server.protocol.v0_10.transport.Header)2 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)2 ReplyTo (org.apache.qpid.server.protocol.v0_10.transport.ReplyTo)2 AMQBody (org.apache.qpid.server.protocol.v0_8.transport.AMQBody)2 ContentHeaderBody (org.apache.qpid.server.protocol.v0_8.transport.ContentHeaderBody)2