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);
}
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);
}
}
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);
}
}
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;
}
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);
}
}
Aggregations