use of org.apache.qpid.server.protocol.v0_8.FieldTable in project qpid-broker-j by apache.
the class ExchangeDeclareBody method process.
public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) throws AMQFrameDecodingException {
int ticket = buffer.getUnsignedShort();
AMQShortString exchange = AMQShortString.readAMQShortString(buffer);
AMQShortString type = AMQShortString.readAMQShortString(buffer);
byte bitfield = buffer.get();
boolean passive = (bitfield & 0x1) == 0x1;
boolean durable = (bitfield & 0x2) == 0x2;
boolean autoDelete = (bitfield & 0x4) == 0x4;
boolean internal = (bitfield & 0x8) == 0x8;
boolean nowait = (bitfield & 0x10) == 0x10;
FieldTable arguments = EncodingUtils.readFieldTable(buffer);
if (!dispatcher.ignoreAllButCloseOk()) {
dispatcher.receiveExchangeDeclare(exchange, type, passive, durable, autoDelete, internal, nowait, arguments);
}
if (arguments != null) {
arguments.clearEncodedForm();
}
}
use of org.apache.qpid.server.protocol.v0_8.FieldTable in project qpid-broker-j by apache.
the class QueueBindBody method process.
public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) throws AMQFrameDecodingException {
int ticket = buffer.getUnsignedShort();
AMQShortString queue = AMQShortString.readAMQShortString(buffer);
AMQShortString exchange = AMQShortString.readAMQShortString(buffer);
AMQShortString bindingKey = AMQShortString.readAMQShortString(buffer);
boolean nowait = (buffer.get() & 0x01) == 0x01;
FieldTable arguments = EncodingUtils.readFieldTable(buffer);
if (!dispatcher.ignoreAllButCloseOk()) {
dispatcher.receiveQueueBind(queue, exchange, bindingKey, nowait, arguments);
}
if (arguments != null) {
arguments.clearEncodedForm();
}
}
use of org.apache.qpid.server.protocol.v0_8.FieldTable in project qpid-broker-j by apache.
the class QueueDeclareBody method process.
public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) throws AMQFrameDecodingException {
int ticket = buffer.getUnsignedShort();
AMQShortString queue = AMQShortString.readAMQShortString(buffer);
byte bitfield = buffer.get();
boolean passive = (bitfield & 0x01) == 0x01;
boolean durable = (bitfield & 0x02) == 0x02;
boolean exclusive = (bitfield & 0x04) == 0x04;
boolean autoDelete = (bitfield & 0x08) == 0x08;
boolean nowait = (bitfield & 0x010) == 0x010;
FieldTable arguments = EncodingUtils.readFieldTable(buffer);
if (!dispatcher.ignoreAllButCloseOk()) {
dispatcher.receiveQueueDeclare(queue, passive, durable, exclusive, autoDelete, nowait, arguments);
}
if (arguments != null) {
arguments.clearEncodedForm();
}
}
use of org.apache.qpid.server.protocol.v0_8.FieldTable in project qpid-broker-j by apache.
the class QueueUnbindBody method process.
public static void process(final QpidByteBuffer buffer, final ServerChannelMethodProcessor dispatcher) throws AMQFrameDecodingException {
int ticket = buffer.getUnsignedShort();
AMQShortString queue = AMQShortString.readAMQShortString(buffer);
AMQShortString exchange = AMQShortString.readAMQShortString(buffer);
AMQShortString routingKey = AMQShortString.readAMQShortString(buffer);
FieldTable arguments = EncodingUtils.readFieldTable(buffer);
if (!dispatcher.ignoreAllButCloseOk()) {
dispatcher.receiveQueueUnbind(queue, exchange, routingKey, arguments);
}
if (arguments != null) {
arguments.clearEncodedForm();
}
}
use of org.apache.qpid.server.protocol.v0_8.FieldTable in project qpid-broker-j by apache.
the class AMQPConnection_0_8Test method testConnectionEnforcesMaxSessions.
public void testConnectionEnforcesMaxSessions() throws Exception {
AMQPConnection_0_8Impl conn = new AMQPConnection_0_8Impl(_broker, _network, _port, _transport, _protocol, 0, _ticker);
conn.create();
conn.receiveProtocolHeader(new ProtocolInitiation(ProtocolVersion.v0_8));
conn.receiveConnectionStartOk(new FieldTable(), SASL_MECH, SASL_RESPONSE, LOCALE);
int maxChannels = 10;
conn.receiveConnectionTuneOk(maxChannels, 65535, 0);
conn.receiveConnectionOpen(new AMQShortString(VIRTUAL_HOST_NAME), AMQShortString.EMPTY_STRING, false);
// check the channel count is correct
int channelCount = conn.getSessionModels().size();
assertEquals("Initial channel count wrong", 0, channelCount);
assertEquals("Number of channels not correctly set.", maxChannels, conn.getSessionCountLimit());
assertFalse("Connection should not be closed after opening " + maxChannels + " channels", conn.isClosing());
for (long currentChannel = 1L; currentChannel <= maxChannels; currentChannel++) {
conn.receiveChannelOpen((int) currentChannel);
}
assertFalse("Connection should not be closed after opening " + maxChannels + " channels", conn.isClosing());
assertEquals("Maximum number of channels not set.", maxChannels, conn.getSessionModels().size());
conn.receiveChannelOpen(maxChannels + 1);
assertTrue("Connection should be closed after opening " + (maxChannels + 1) + " channels", conn.isClosing());
}
Aggregations