diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2014-09-29 23:20:39 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2014-09-29 23:20:39 +0000 |
commit | 38e0deb8298e6f4b27255066b8309cd19f703958 (patch) | |
tree | b49e9ab3a2ba9cf2a1b07ea4eeb31951b7f2aa05 | |
parent | 17ff2442352bac23f3776b3a8a6e4e419833e787 (diff) | |
download | qpid-python-38e0deb8298e6f4b27255066b8309cd19f703958.tar.gz |
Merge method body implementation classes
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-6125-ProtocolRefactoring@1628336 13f79535-47bb-0310-9956-ffa450edef68
115 files changed, 1852 insertions, 7354 deletions
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java index 765e7d6ad7..cc6b76957a 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java @@ -1407,7 +1407,11 @@ public class AMQProtocolEngine implements ServerProtocolEngine, AMQProtocolSessi MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(getProtocolVersion()); - ConnectionCloseBody closeBody = methodRegistry.createConnectionCloseBody(200, AMQShortString.validValueOf(throwable.getMessage()),0,0); + ConnectionCloseBody closeBody = methodRegistry.createConnectionCloseBody(200, + AMQShortString.validValueOf( + throwable.getMessage()), + 0, + 0); writeFrame(closeBody.generateFrame(0)); diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/AccessRequestHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/AccessRequestHandler.java index bf89a812b9..df66120731 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/AccessRequestHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/AccessRequestHandler.java @@ -25,8 +25,7 @@ import org.apache.qpid.AMQException; import org.apache.qpid.framing.AccessRequestBody;
import org.apache.qpid.framing.AccessRequestOkBody;
import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0;
+import org.apache.qpid.framing.ProtocolVersion;
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.server.protocol.v0_8.AMQChannel;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
@@ -63,22 +62,14 @@ public class AccessRequestHandler implements StateAwareMethodListener<AccessRequ MethodRegistry methodRegistry = connection.getMethodRegistry();
- // We don't implement access control class, but to keep clients happy that expect it
- // always use the "0" ticket.
- AccessRequestOkBody response;
- if(methodRegistry instanceof MethodRegistry_0_9)
- {
- response = ((MethodRegistry_0_9)methodRegistry).createAccessRequestOkBody(0);
- }
- else if(methodRegistry instanceof MethodRegistry_8_0)
- {
- response = ((MethodRegistry_8_0)methodRegistry).createAccessRequestOkBody(0);
- }
- else
+ if(ProtocolVersion.v0_91.equals(connection.getProtocolVersion()) )
{
throw new AMQException(AMQConstant.COMMAND_INVALID, "AccessRequest not present in AMQP versions other than 0-8, 0-9");
}
+ // We don't implement access control class, but to keep clients happy that expect it
+ // always use the "0" ticket.
+ AccessRequestOkBody response = methodRegistry.createAccessRequestOkBody(0);
channel.sync();
connection.writeFrame(response.generateFrame(channelId));
}
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java index e90744ab5e..b352a2772c 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java @@ -28,6 +28,7 @@ import org.apache.qpid.AMQException; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.BasicPublishBody; import org.apache.qpid.framing.abstraction.MessagePublishInfo; +import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.server.message.MessageDestination; import org.apache.qpid.server.protocol.v0_8.AMQChannel; @@ -94,7 +95,10 @@ public class BasicPublishMethodHandler implements StateAwareMethodListener<Basic throw body.getChannelNotFoundException(channelId, connection.getMethodRegistry()); } - MessagePublishInfo info = connection.getMethodRegistry().getProtocolVersionMethodConverter().convertToInfo(body); + MessagePublishInfo info = new MessagePublishInfoImpl(body.getExchange(), + body.getImmediate(), + body.getMandatory(), + body.getRoutingKey()); info.setExchange(exchangeName); try { diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverMethodHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverMethodHandler.java index 2f0468fd15..29ddf4421a 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverMethodHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverMethodHandler.java @@ -25,8 +25,8 @@ import org.apache.log4j.Logger; import org.apache.qpid.AMQException; import org.apache.qpid.framing.AMQMethodBody; import org.apache.qpid.framing.BasicRecoverBody; +import org.apache.qpid.framing.MethodRegistry; import org.apache.qpid.framing.ProtocolVersion; -import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0; import org.apache.qpid.server.protocol.v0_8.AMQChannel; import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession; import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener; @@ -61,8 +61,8 @@ public class BasicRecoverMethodHandler implements StateAwareMethodListener<Basic // In Qpid 0-9 we create a separate sync-recover, sync-recover-ok pair to be "more" compliant if(connection.getProtocolVersion().equals(ProtocolVersion.v8_0)) { - MethodRegistry_8_0 methodRegistry = (MethodRegistry_8_0) connection.getMethodRegistry(); - AMQMethodBody recoverOk = methodRegistry.createBasicRecoverOkBody(); + MethodRegistry methodRegistry = connection.getMethodRegistry(); + AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody(); channel.sync(); connection.writeFrame(recoverOk.generateFrame(channelId)); diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverSyncMethodHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverSyncMethodHandler.java index efcec299e9..b75492a65d 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverSyncMethodHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicRecoverSyncMethodHandler.java @@ -26,9 +26,7 @@ import org.apache.log4j.Logger; import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.framing.BasicRecoverSyncBody;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91;
+import org.apache.qpid.framing.MethodRegistry;
import org.apache.qpid.server.protocol.v0_8.AMQChannel;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
@@ -60,22 +58,9 @@ public class BasicRecoverSyncMethodHandler implements StateAwareMethodListener<B channel.sync();
channel.resend();
- // Qpid 0-8 hacks a synchronous -ok onto recover.
- // In Qpid 0-9 we create a separate sync-recover, sync-recover-ok pair to be "more" compliant
- if(connection.getProtocolVersion().equals(ProtocolVersion.v0_9))
- {
- MethodRegistry_0_9 methodRegistry = (MethodRegistry_0_9) connection.getMethodRegistry();
- AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody();
- connection.writeFrame(recoverOk.generateFrame(channelId));
-
- }
- else if(connection.getProtocolVersion().equals(ProtocolVersion.v0_91))
- {
- MethodRegistry_0_91 methodRegistry = (MethodRegistry_0_91) connection.getMethodRegistry();
- AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody();
- connection.writeFrame(recoverOk.generateFrame(channelId));
-
- }
+ MethodRegistry methodRegistry = connection.getMethodRegistry();
+ AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody();
+ connection.writeFrame(recoverOk.generateFrame(channelId));
}
}
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ChannelOpenHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ChannelOpenHandler.java index dbfe07840f..cb1a59ba2a 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ChannelOpenHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ChannelOpenHandler.java @@ -20,26 +20,15 @@ */ package org.apache.qpid.server.protocol.v0_8.handler; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.UUID; - import org.apache.log4j.Logger; import org.apache.qpid.AMQException; import org.apache.qpid.framing.ChannelOpenBody; import org.apache.qpid.framing.ChannelOpenOkBody; -import org.apache.qpid.framing.MethodRegistry; -import org.apache.qpid.framing.ProtocolVersion; -import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9; -import org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91; -import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.server.protocol.v0_8.AMQChannel; import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession; import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener; -import org.apache.qpid.server.util.ConnectionScopedRuntimeException; import org.apache.qpid.server.virtualhost.VirtualHostImpl; public class ChannelOpenHandler implements StateAwareMethodListener<ChannelOpenBody> @@ -76,66 +65,9 @@ public class ChannelOpenHandler implements StateAwareMethodListener<ChannelOpenB ChannelOpenOkBody response; - ProtocolVersion pv = connection.getProtocolVersion(); - if(pv.equals(ProtocolVersion.v8_0)) - { - MethodRegistry_8_0 methodRegistry = (MethodRegistry_8_0) MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0); - response = methodRegistry.createChannelOpenOkBody(); + response = connection.getMethodRegistry().createChannelOpenOkBody(); - } - else if(pv.equals(ProtocolVersion.v0_9)) - { - MethodRegistry_0_9 methodRegistry = (MethodRegistry_0_9) MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9); - UUID uuid = UUID.randomUUID(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - DataOutputStream dataOut = new DataOutputStream(output); - try - { - dataOut.writeLong(uuid.getMostSignificantBits()); - dataOut.writeLong(uuid.getLeastSignificantBits()); - dataOut.flush(); - dataOut.close(); - } - catch (IOException e) - { - // This *really* shouldn't happen as we're not doing any I/O - throw new ConnectionScopedRuntimeException("I/O exception when writing to byte array", e); - } - - // should really associate this channelId to the session - byte[] channelName = output.toByteArray(); - - response = methodRegistry.createChannelOpenOkBody(channelName); - } - else if(pv.equals(ProtocolVersion.v0_91)) - { - MethodRegistry_0_91 methodRegistry = (MethodRegistry_0_91) MethodRegistry.getMethodRegistry(ProtocolVersion.v0_91); - UUID uuid = UUID.randomUUID(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - DataOutputStream dataOut = new DataOutputStream(output); - try - { - dataOut.writeLong(uuid.getMostSignificantBits()); - dataOut.writeLong(uuid.getLeastSignificantBits()); - dataOut.flush(); - dataOut.close(); - } - catch (IOException e) - { - // This *really* shouldn't happen as we're not doing any I/O - throw new ConnectionScopedRuntimeException("I/O exception when writing to byte array", e); - } - - // should really associate this channelId to the session - byte[] channelName = output.toByteArray(); - - response = methodRegistry.createChannelOpenOkBody(channelName); - } - else - { - throw new AMQException(AMQConstant.INTERNAL_ERROR, "Got channel open for protocol version not catered for: " + pv, null); - } connection.writeFrame(response.generateFrame(channelId)); diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java index 9ae66b889c..1b2d3c0653 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java @@ -27,10 +27,8 @@ import org.apache.log4j.Logger; import org.apache.qpid.AMQException; import org.apache.qpid.framing.AMQMethodBody; import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.MethodRegistry; +import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.framing.QueueUnbindBody; -import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9; -import org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.server.exchange.ExchangeImpl; import org.apache.qpid.server.protocol.v0_8.AMQChannel; @@ -58,6 +56,13 @@ public class QueueUnbindHandler implements StateAwareMethodListener<QueueUnbindB QueueUnbindBody body, int channelId) throws AMQException { + + if (ProtocolVersion.v8_0.equals(connection.getProtocolVersion())) + { + // 0-8 does not support QueueUnbind + throw new AMQException(AMQConstant.COMMAND_INVALID, "QueueUnbind not present in AMQP version: " + connection.getProtocolVersion(), null); + } + VirtualHostImpl virtualHost = connection.getVirtualHost(); final AMQQueue queue; @@ -133,21 +138,8 @@ public class QueueUnbindHandler implements StateAwareMethodListener<QueueUnbindB _log.info("Binding queue " + queue + " to exchange " + exch + " with routing key " + routingKey); } - final MethodRegistry registry = connection.getMethodRegistry(); - final AMQMethodBody responseBody; - if (registry instanceof MethodRegistry_0_9) - { - responseBody = ((MethodRegistry_0_9)registry).createQueueUnbindOkBody(); - } - else if (registry instanceof MethodRegistry_0_91) - { - responseBody = ((MethodRegistry_0_91)registry).createQueueUnbindOkBody(); - } - else - { - // 0-8 does not support QueueUnbind - throw new AMQException(AMQConstant.COMMAND_INVALID, "QueueUnbind not present in AMQP version: " + connection.getProtocolVersion(), null); - } + + final AMQMethodBody responseBody = connection.getMethodRegistry().createQueueUnbindOkBody(); channel.sync(); connection.writeFrame(responseBody.generateFrame(channelId)); } diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java index 429b5875bc..ce735306ee 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java @@ -186,6 +186,21 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher throw new UnexpectedMethodException(body);
}
+ @Override
+ public boolean dispatchQueueUnbindOk(final QueueUnbindOkBody body, final int channelId)
+ throws AMQException
+ {
+ throw new UnexpectedMethodException(body);
+ }
+
+ @Override
+ public boolean dispatchBasicRecoverSyncOk(final BasicRecoverSyncOkBody body,
+ final int channelId)
+ throws AMQException
+ {
+ throw new UnexpectedMethodException(body);
+ }
+
public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException
{
throw new UnexpectedMethodException(body);
@@ -434,7 +449,11 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher return true;
}
-
+ @Override
+ public boolean dispatchQueueUnbind(final QueueUnbindBody queueUnbindBody, final int channelId) throws AMQException
+ {
+ return false;
+ }
}
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl_8_0.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl_8_0.java index df2306428f..b8c253d601 100644 --- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl_8_0.java +++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl_8_0.java @@ -21,8 +21,10 @@ package org.apache.qpid.server.protocol.v0_8.handler;
import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicRecoverOkBody;
+import org.apache.qpid.framing.BasicRecoverSyncOkBody;
import org.apache.qpid.framing.ChannelAlertBody;
+import org.apache.qpid.framing.QueueUnbindBody;
+import org.apache.qpid.framing.QueueUnbindOkBody;
import org.apache.qpid.framing.amqp_8_0.MethodDispatcher_8_0;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
@@ -35,14 +37,27 @@ public class ServerMethodDispatcherImpl_8_0 super(connection);
}
- public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException
+ public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException
{
throw new UnexpectedMethodException(body);
}
- public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException
+ @Override
+ public boolean dispatchQueueUnbindOk(final QueueUnbindOkBody queueUnbindOkBody, final int channelId)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean dispatchBasicRecoverSyncOk(final BasicRecoverSyncOkBody body,
+ final int channelId) throws AMQException
{
throw new UnexpectedMethodException(body);
}
+ @Override
+ public boolean dispatchQueueUnbind(final QueueUnbindBody queueUnbindBody, final int channelId) throws AMQException
+ {
+ return false;
+ }
}
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java index 693358c3ae..8a15fffe84 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java @@ -61,8 +61,6 @@ import org.apache.qpid.client.state.listener.SpecificMethodFrameListener; import org.apache.qpid.common.AMQPFilterTypes; import org.apache.qpid.configuration.ClientProperties; import org.apache.qpid.framing.*; -import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9; -import org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91; import org.apache.qpid.jms.Session; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.protocol.AMQMethodEvent; @@ -314,21 +312,12 @@ public class AMQSession_0_8 extends AMQSession<BasicMessageConsumer_0_8, BasicMe if(getProtocolHandler().getProtocolVersion().equals(ProtocolVersion.v8_0)) { BasicRecoverBody body = getMethodRegistry().createBasicRecoverBody(false); - getAMQConnection().getProtocolHandler().syncWrite(body.generateFrame(getChannelId()), BasicRecoverOkBody.class); - } - else if(getProtocolVersion().equals(ProtocolVersion.v0_9)) - { - BasicRecoverSyncBody body = ((MethodRegistry_0_9)getMethodRegistry()).createBasicRecoverSyncBody(false); - getAMQConnection().getProtocolHandler().syncWrite(body.generateFrame(getChannelId()), BasicRecoverSyncOkBody.class); - } - else if(getProtocolVersion().equals(ProtocolVersion.v0_91)) - { - BasicRecoverSyncBody body = ((MethodRegistry_0_91)getMethodRegistry()).createBasicRecoverSyncBody(false); getAMQConnection().getProtocolHandler().syncWrite(body.generateFrame(getChannelId()), BasicRecoverSyncOkBody.class); } else { - throw new RuntimeException("Unsupported version of the AMQP Protocol: " + getProtocolVersion()); + BasicRecoverSyncBody body = getMethodRegistry().createBasicRecoverSyncBody(false); + getAMQConnection().getProtocolHandler().syncWrite(body.generateFrame(getChannelId()), BasicRecoverSyncOkBody.class); } } } @@ -1145,33 +1134,22 @@ public class AMQSession_0_8 extends AMQSession<BasicMessageConsumer_0_8, BasicMe if (isBound(null, AMQShortString.valueOf(queue), null)) { - MethodRegistry methodRegistry = getProtocolHandler().getMethodRegistry(); - AMQMethodBody body; - if (methodRegistry instanceof MethodRegistry_0_9) + + if(ProtocolVersion.v8_0.equals(getProtocolVersion())) { - String bindingKey = binding.getBindingKey() == null ? queue : binding.getBindingKey(); + throw new AMQException(AMQConstant.NOT_IMPLEMENTED, "Cannot unbind a queue in AMQP 0-8"); + } - MethodRegistry_0_9 methodRegistry_0_9 = (MethodRegistry_0_9) methodRegistry; - body = methodRegistry_0_9.createQueueUnbindBody(getTicket(), + MethodRegistry methodRegistry = getProtocolHandler().getMethodRegistry(); + + String bindingKey = binding.getBindingKey() == null ? queue : binding.getBindingKey(); + + AMQMethodBody body = methodRegistry.createQueueUnbindBody(getTicket(), AMQShortString.valueOf(queue), AMQShortString.valueOf(exchange), AMQShortString.valueOf(bindingKey), null); - } - else if (methodRegistry instanceof MethodRegistry_0_91) - { - MethodRegistry_0_91 methodRegistry_0_91 = (MethodRegistry_0_91) methodRegistry; - body = methodRegistry_0_91.createQueueUnbindBody(getTicket(), - AMQShortString.valueOf(queue), - AMQShortString.valueOf(exchange), - AMQShortString.valueOf(binding.getBindingKey()), - null); - } - else - { - throw new AMQException(AMQConstant.NOT_IMPLEMENTED, "Cannot unbind a queue in AMQP 0-8"); - } getProtocolHandler().syncWrite(body.generateFrame(getChannelId()), QueueUnbindOkBody.class); return null; } diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java b/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java index 29a064b712..8144fd1258 100644 --- a/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java +++ b/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java @@ -125,6 +125,21 @@ public class ClientMethodDispatcherImpl implements MethodDispatcher return false; } + @Override + public boolean dispatchQueueUnbindOk(final QueueUnbindOkBody body, final int channelId) + throws AMQException + { + throw new AMQMethodNotImplementedException(body); + } + + @Override + public boolean dispatchBasicRecoverSyncOk(final BasicRecoverSyncOkBody basicRecoverSyncOkBody, + final int channelId) + throws AMQException + { + return false; + } + public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException { _basicCancelOkMethodHandler.methodReceived(_session, body, channelId); @@ -365,6 +380,12 @@ public class ClientMethodDispatcherImpl implements MethodDispatcher throw new AMQMethodNotImplementedException(body); } + @Override + public boolean dispatchQueueUnbind(final QueueUnbindBody queueUnbindBody, final int channelId) throws AMQException + { + return false; + } + public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException { _exchangeBoundOkMethodHandler.methodReceived(_session, body, channelId); diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java b/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java index d2ae057e6d..fc2037097f 100644 --- a/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java +++ b/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java @@ -22,8 +22,11 @@ import org.apache.qpid.AMQException; import org.apache.qpid.client.protocol.AMQProtocolSession; -import org.apache.qpid.framing.BasicRecoverOkBody; +import org.apache.qpid.client.state.AMQMethodNotImplementedException; +import org.apache.qpid.framing.BasicRecoverSyncOkBody; import org.apache.qpid.framing.ChannelAlertBody; +import org.apache.qpid.framing.QueueUnbindBody; +import org.apache.qpid.framing.QueueUnbindOkBody; import org.apache.qpid.framing.amqp_8_0.MethodDispatcher_8_0; public class ClientMethodDispatcherImpl_8_0 extends ClientMethodDispatcherImpl implements MethodDispatcher_8_0 @@ -33,14 +36,27 @@ public class ClientMethodDispatcherImpl_8_0 extends ClientMethodDispatcherImpl i super(session); } - public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException + public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException { return false; } - public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException + @Override + public boolean dispatchQueueUnbindOk(final QueueUnbindOkBody queueUnbindOkBody, final int channelId) + { + return false; + } + + @Override + public boolean dispatchBasicRecoverSyncOk(final BasicRecoverSyncOkBody basicRecoverSyncOkBody, + final int channelId) { return false; } + @Override + public boolean dispatchQueueUnbind(final QueueUnbindBody body, final int channelId) throws AMQException + { + throw new AMQMethodNotImplementedException(body); + } } diff --git a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java index 5c9d8f9b91..78f6273db8 100644 --- a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java +++ b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java @@ -753,8 +753,12 @@ public class AMQProtocolHandler implements ProtocolEngine // Connection is already closed then don't do a syncWrite try { - final ConnectionCloseBody body = _protocolSession.getMethodRegistry().createConnectionCloseBody(AMQConstant.REPLY_SUCCESS.getCode(), // replyCode - new AMQShortString("JMS client is closing the connection."), 0, 0); + final ConnectionCloseBody body = _protocolSession.getMethodRegistry().createConnectionCloseBody( + AMQConstant.REPLY_SUCCESS.getCode(), + // replyCode + new AMQShortString("JMS client is closing the connection."), + 0, + 0); final AMQFrame frame = body.generateFrame(0); syncWrite(frame, ConnectionCloseOkBody.class, timeout); diff --git a/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java b/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java index 70fcfcedb8..61e5247ead 100644 --- a/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java +++ b/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java @@ -20,6 +20,9 @@ */ package org.apache.qpid.client.protocol; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,12 +35,10 @@ import org.apache.qpid.client.transport.TestNetworkConnection; import org.apache.qpid.framing.AMQBody; import org.apache.qpid.framing.AMQFrame; import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.amqp_8_0.BasicRecoverOkBodyImpl; +import org.apache.qpid.framing.BasicRecoverSyncOkBody; +import org.apache.qpid.framing.ProtocolVersion; import org.apache.qpid.protocol.AMQConstant; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - /** * This is a test address QPID-1431 where frame listeners would fail to be notified of an incomming exception. * @@ -75,7 +76,7 @@ public class AMQProtocolHandlerTest extends TestCase //Create a new ProtocolHandler with a fake connection. _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='tcp://localhost:1'")); _handler.setNetworkConnection(new TestNetworkConnection()); - AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1); + AMQBody body = new BasicRecoverSyncOkBody(ProtocolVersion.v8_0); _blockFrame = new AMQFrame(0, body); _handleCountDown = new CountDownLatch(1); diff --git a/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java b/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java deleted file mode 100644 index 88b1ca7189..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing; - -import org.apache.qpid.codec.MarkableDataInput; - -import java.io.IOException; - - -public abstract interface AMQMethodBodyInstanceFactory -{ - public AMQMethodBody newInstance(MarkableDataInput buffer, long size) throws AMQFrameDecodingException, IOException; -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java b/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java index 38701385d6..695e41bc13 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/AccessRequestBody.java @@ -22,25 +22,147 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 8-0 + */ package org.apache.qpid.framing; -public interface AccessRequestBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class AccessRequestBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - public boolean getActive(); + public static final int CLASS_ID = 30; + public static final int METHOD_ID = 10; + + // Fields declared in specification + private final AMQShortString _realm; // [realm] + private final byte _bitfield0; // [exclusive, passive, active, write, read] + + // Constructor + public AccessRequestBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException + { + _realm = readAMQShortString( buffer ); + _bitfield0 = readBitfield( buffer ); + } + + public AccessRequestBody( + AMQShortString realm, + boolean exclusive, + boolean passive, + boolean active, + boolean write, + boolean read + ) + { + _realm = realm; + byte bitfield0 = (byte)0; + if( exclusive ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); + } + + if( passive ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 1)); + } + + if( active ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 2)); + } + + if( write ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 3)); + } + + if( read ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 4)); + } + _bitfield0 = bitfield0; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + public final AMQShortString getRealm() + { + return _realm; + } + public final boolean getExclusive() + { + return (((int)(_bitfield0)) & ( 1 << 0)) != 0; + } + public final boolean getPassive() + { + return (((int)(_bitfield0)) & ( 1 << 1)) != 0; + } + public final boolean getActive() + { + return (((int)(_bitfield0)) & ( 1 << 2)) != 0; + } + public final boolean getWrite() + { + return (((int)(_bitfield0)) & ( 1 << 3)) != 0; + } + public final boolean getRead() + { + return (((int)(_bitfield0)) & ( 1 << 4)) != 0; + } - public boolean getExclusive(); + protected int getBodySize() + { + int size = 1; + size += getSizeOf( _realm ); + return size; + } - public boolean getPassive(); + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeAMQShortString( buffer, _realm ); + writeBitfield( buffer, _bitfield0 ); + } - public boolean getRead(); + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchAccessRequest(this, channelId); + } - public AMQShortString getRealm(); + public String toString() + { + StringBuilder buf = new StringBuilder("[AccessRequestBodyImpl: "); + buf.append( "realm=" ); + buf.append( getRealm() ); + buf.append( ", " ); + buf.append( "exclusive=" ); + buf.append( getExclusive() ); + buf.append( ", " ); + buf.append( "passive=" ); + buf.append( getPassive() ); + buf.append( ", " ); + buf.append( "active=" ); + buf.append( getActive() ); + buf.append( ", " ); + buf.append( "write=" ); + buf.append( getWrite() ); + buf.append( ", " ); + buf.append( "read=" ); + buf.append( getRead() ); + buf.append("]"); + return buf.toString(); + } - public boolean getWrite(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java index aa7c171411..c2bd5929fb 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/AccessRequestOkBody.java @@ -22,15 +22,77 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 8-0 + */ package org.apache.qpid.framing; -public interface AccessRequestOkBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class AccessRequestOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - public int getTicket(); + public static final int CLASS_ID = 30; + public static final int METHOD_ID = 11; + + // Fields declared in specification + private final int _ticket; // [ticket] + + // Constructor + public AccessRequestOkBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException + { + _ticket = readUnsignedShort( buffer ); + } + + public AccessRequestOkBody( + int ticket + ) + { + _ticket = ticket; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + public final int getTicket() + { + return _ticket; + } + + protected int getBodySize() + { + int size = 2; + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeUnsignedShort( buffer, _ticket ); + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchAccessRequestOk(this, channelId); + } + + public String toString() + { + StringBuilder buf = new StringBuilder("[AccessRequestOkBodyImpl: "); + buf.append( "ticket=" ); + buf.append( getTicket() ); + buf.append("]"); + return buf.toString(); + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java index b04379b0cd..b78e27996e 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicAckBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicAckBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicAckBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 80; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java index d52e5f5ac8..70783712c2 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicCancelBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicCancelBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicCancelBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 30; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java index ea087ac025..7cec873cc4 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicCancelOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicCancelOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicCancelOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 31; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java index c198d3938b..f6a4c7e659 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicConsumeBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicConsumeBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 20; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java index ec6cdd5130..b68de3a8de 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicConsumeOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicConsumeOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicConsumeOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 21; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java index 4247447d0d..987b8106d8 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicDeliverBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicDeliverBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicDeliverBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 60; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java index 9c38eb859a..8b6842463e 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicGetBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicGetBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicGetBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 70; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java index 1a3d27705e..c85876b260 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicGetEmptyBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicGetEmptyBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicGetEmptyBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 72; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java index 2e3823482c..d3ba82b0d3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicGetOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicGetOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicGetOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 71; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java index 6246f46651..7d24492395 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicPublishBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicPublishBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicPublishBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 40; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java index 28f657ee95..76b30d1e3c 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicQosBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicQosBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicQosBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 10; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java index 824e5f6111..4be10906c2 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicQosOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicQosOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicQosOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 11; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java index 526e9e0df3..fdda88534c 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicRecoverBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 100; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java deleted file mode 100644 index a4abdd0cd7..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverOkBody.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ - -package org.apache.qpid.framing; - -public interface BasicRecoverOkBody extends EncodableAMQDataBlock, AMQMethodBody -{ -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java index 9175da5796..f4d1b795bd 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncBody.java @@ -22,15 +22,86 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface BasicRecoverSyncBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; +import org.apache.qpid.framing.amqp_0_91.MethodDispatcher_0_91; + +public class BasicRecoverSyncBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + private int _methodId; + + public static final int CLASS_ID = 60; + + // Fields declared in specification + private final byte _bitfield0; // [requeue] + + // Constructor + public BasicRecoverSyncBody(MarkableDataInput buffer, ProtocolVersion protocolVersion) throws AMQFrameDecodingException, IOException + { + _methodId = ProtocolVersion.v0_9.equals(protocolVersion) ? 102 : 110; + _bitfield0 = readBitfield( buffer ); + } + + public BasicRecoverSyncBody(ProtocolVersion protocolVersion, + boolean requeue + ) + { + _methodId = ProtocolVersion.v0_9.equals(protocolVersion) ? 102 : 110; + + byte bitfield0 = (byte)0; + if( requeue ) + { + bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); + } + _bitfield0 = bitfield0; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return _methodId; + } + + public final boolean getRequeue() + { + return (((int)(_bitfield0)) & ( 1 << 0)) != 0; + } + + protected int getBodySize() + { + int size = 1; + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeBitfield( buffer, _bitfield0 ); + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecoverSync(this, channelId); + } + + public String toString() + { + StringBuilder buf = new StringBuilder("[BasicRecoverSyncBodyImpl: "); + buf.append( "requeue=" ); + buf.append( getRequeue() ); + buf.append("]"); + return buf.toString(); + } - public boolean getRequeue(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java index c34aeda625..65c15d8cd7 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicRecoverSyncOkBody.java @@ -22,13 +22,67 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface BasicRecoverSyncOkBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class BasicRecoverSyncOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + + public static final int CLASS_ID = 60; + public final int _ownMethodId; + + // Fields declared in specification + + // Constructor + public BasicRecoverSyncOkBody(ProtocolVersion protocolVersion) + { + if(ProtocolVersion.v0_91.equals(protocolVersion)) + { + _ownMethodId = 111; + } + else + { + _ownMethodId = 101; + } + } + + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return _ownMethodId; + } + + + protected int getBodySize() + { + return 0; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchBasicRecoverSyncOk(this, channelId); + } + + public String toString() + { + return "[BasicRecoverSyncOkBody]"; + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java index 69f84390a7..162fae9dda 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicRejectBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicRejectBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRejectBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 90; diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java b/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java index aa1fa61e81..073bbceb06 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicReturnBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class BasicReturnBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicReturnBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 60; public static final int METHOD_ID = 50; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java index 5c2354551a..e0a1e05e58 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelAlertBody.java @@ -22,19 +22,104 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 8-0 + */ package org.apache.qpid.framing; -public interface ChannelAlertBody extends EncodableAMQDataBlock, AMQMethodBody +import org.apache.qpid.codec.MarkableDataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.framing.amqp_8_0.MethodDispatcher_8_0; + +public class ChannelAlertBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - public FieldTable getDetails(); + public static final int CLASS_ID = 20; + public static final int METHOD_ID = 30; + + // Fields declared in specification + private final int _replyCode; // [replyCode] + private final AMQShortString _replyText; // [replyText] + private final FieldTable _details; // [details] + + // Constructor + public ChannelAlertBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException + { + _replyCode = readUnsignedShort( buffer ); + _replyText = readAMQShortString( buffer ); + _details = readFieldTable( buffer ); + } + + public ChannelAlertBody( + int replyCode, + AMQShortString replyText, + FieldTable details + ) + { + _replyCode = replyCode; + _replyText = replyText; + _details = details; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + public final int getReplyCode() + { + return _replyCode; + } + public final AMQShortString getReplyText() + { + return _replyText; + } + public final FieldTable getDetails() + { + return _details; + } + + protected int getBodySize() + { + int size = 2; + size += getSizeOf( _replyText ); + size += getSizeOf( _details ); + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeUnsignedShort( buffer, _replyCode ); + writeAMQShortString( buffer, _replyText ); + writeFieldTable( buffer, _details ); + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return ((MethodDispatcher_8_0)dispatcher).dispatchChannelAlert(this, channelId); + } - public int getReplyCode(); + public String toString() + { + StringBuilder buf = new StringBuilder("[ChannelAlertBodyImpl: "); + buf.append( "replyCode=" ); + buf.append( getReplyCode() ); + buf.append( ", " ); + buf.append( "replyText=" ); + buf.append( getReplyText() ); + buf.append( ", " ); + buf.append( "details=" ); + buf.append( getDetails() ); + buf.append("]"); + return buf.toString(); + } - public AMQShortString getReplyText(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java index 62eb7f3986..7c969ba3bb 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ChannelCloseBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelCloseBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 20; public static final int METHOD_ID = 40; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java index 66b01ce0d4..d3d7dbc79b 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelCloseOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ChannelCloseOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelCloseOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 20; public static final int METHOD_ID = 41; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java index 096b6f8704..9973e45e5f 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ChannelFlowBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelFlowBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 20; public static final int METHOD_ID = 20; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java index c2bc6619c7..20c793c3f4 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelFlowOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ChannelFlowOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelFlowOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 20; public static final int METHOD_ID = 21; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java index 49b5e9c6cb..a04856d49b 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ChannelOpenBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelOpenBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 20; public static final int METHOD_ID = 10; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java index 7682cea782..a60e7f331b 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ChannelOpenOkBody.java @@ -22,14 +22,78 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 8-0 + */ package org.apache.qpid.framing; -public interface ChannelOpenOkBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class ChannelOpenOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + public static final int CLASS_ID = 20; + public static final int METHOD_ID = 11; + + public static final ChannelOpenOkBody INSTANCE_0_8 = new ChannelOpenOkBody(true); + public static final ChannelOpenOkBody INSTANCE_0_9 = new ChannelOpenOkBody(false); + + public static ChannelOpenOkBody getInstance(ProtocolVersion protocolVersion, MarkableDataInput input) + throws IOException + { + final boolean isAMQP08 = ProtocolVersion.v8_0.equals(protocolVersion); + ChannelOpenOkBody instance = isAMQP08 ? INSTANCE_0_8 : INSTANCE_0_9; + if(!isAMQP08) + { + EncodingUtils.readBytes(input); + } + return instance; + } + // Fields declared in specification + private final boolean _isAMQP08; + // Constructor + + private ChannelOpenOkBody(boolean isAMQP08) + { + _isAMQP08 = isAMQP08; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + + protected int getBodySize() + { + return _isAMQP08 ? 0 : 4; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + if(!_isAMQP08) + { + buffer.writeInt(0); + } + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchChannelOpenOk(this, channelId); + } + + public String toString() + { + return "[ChannelOpenOkBody]"; + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java b/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java index bc92212590..038963f4e1 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ClientMethodDispatcher.java @@ -63,4 +63,11 @@ public interface ClientMethodDispatcher public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException; public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException; + boolean dispatchConnectionRedirect(ConnectionRedirectBody connectionRedirectBody, int channelId) throws AMQException; + boolean dispatchAccessRequestOk(AccessRequestOkBody accessRequestOkBody, int channelId) throws AMQException; + + boolean dispatchQueueUnbindOk(QueueUnbindOkBody queueUnbindOkBody, int channelId) throws AMQException; + + boolean dispatchBasicRecoverSyncOk(BasicRecoverSyncOkBody basicRecoverSyncOkBody, int channelId) + throws AMQException; } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java index d03892d29f..64388a42f3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseBody.java @@ -22,21 +22,116 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface ConnectionCloseBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class ConnectionCloseBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - public int getClassId(); + public static final int CLASS_ID = 10; + + private final int _ownMethodId; + // Fields declared in specification + private final int _replyCode; // [replyCode] + private final AMQShortString _replyText; // [replyText] + private final int _classId; // [classId] + private final int _methodId; // [methodId] + + // Constructor + public ConnectionCloseBody(MarkableDataInput buffer, ProtocolVersion protocolVersion) throws AMQFrameDecodingException, IOException + { + _ownMethodId = ProtocolVersion.v8_0.equals(protocolVersion) ? 60 : 50; + _replyCode = readUnsignedShort( buffer ); + _replyText = readAMQShortString( buffer ); + _classId = readUnsignedShort( buffer ); + _methodId = readUnsignedShort( buffer ); + } + + public ConnectionCloseBody(ProtocolVersion protocolVersion, + int replyCode, + AMQShortString replyText, + int classId, + int methodId + ) + { + _ownMethodId = ProtocolVersion.v8_0.equals(protocolVersion) ? 60 : 50; + _replyCode = replyCode; + _replyText = replyText; + _classId = classId; + _methodId = methodId; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return _ownMethodId; + } + + public final int getReplyCode() + { + return _replyCode; + } + public final AMQShortString getReplyText() + { + return _replyText; + } + public final int getClassId() + { + return _classId; + } + public final int getMethodId() + { + return _methodId; + } + + protected int getBodySize() + { + int size = 6; + size += getSizeOf( _replyText ); + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeUnsignedShort( buffer, _replyCode ); + writeAMQShortString( buffer, _replyText ); + writeUnsignedShort( buffer, _classId ); + writeUnsignedShort( buffer, _methodId ); + } - public int getMethodId(); + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchConnectionClose(this, channelId); + } - public int getReplyCode(); + public String toString() + { + StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: "); + buf.append( "replyCode=" ); + buf.append( getReplyCode() ); + buf.append( ", " ); + buf.append( "replyText=" ); + buf.append( getReplyText() ); + buf.append( ", " ); + buf.append( "classId=" ); + buf.append( getClassId() ); + buf.append( ", " ); + buf.append( "methodId=" ); + buf.append( getMethodId() ); + buf.append("]"); + return buf.toString(); + } - public AMQShortString getReplyText(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java index f849095877..30e9f90b9a 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionCloseOkBody.java @@ -22,13 +22,61 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface ConnectionCloseOkBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class ConnectionCloseOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + private final int _ownMethodId; + + public static final int CLASS_ID = 10; + + public static final ConnectionCloseOkBody CONNECTION_CLOSE_OK_0_8 = new ConnectionCloseOkBody(61); + public static final ConnectionCloseOkBody CONNECTION_CLOSE_OK_0_9 = new ConnectionCloseOkBody(51); + + // Constructor + private ConnectionCloseOkBody(int methodId) + { + _ownMethodId = methodId; + } + + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return _ownMethodId; + } + + + protected int getBodySize() + { + return 0; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchConnectionCloseOk(this, channelId); + } + + public String toString() + { + return "[ConnectionCloseOkBody]"; + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java index d643151bb0..df20a1e0b3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionOpenBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionOpenBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 40; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java index 26f1e45475..68cb424f3b 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionOpenOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionOpenOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionOpenOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 41; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java index df200e8572..569e9d1cc1 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionRedirectBody.java @@ -22,17 +22,90 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 8-0 + */ package org.apache.qpid.framing; -public interface ConnectionRedirectBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class ConnectionRedirectBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + private final int _ownMethodId; + + public static final int CLASS_ID = 10; + + // Fields declared in specification + private final AMQShortString _host; // [host] + private final AMQShortString _knownHosts; // [knownHosts] + + // Constructor + public ConnectionRedirectBody(MarkableDataInput buffer, ProtocolVersion protocolVersion) throws AMQFrameDecodingException, IOException + { + _ownMethodId = ProtocolVersion.v8_0.equals(protocolVersion) ? 50 : 42; + _host = readAMQShortString( buffer ); + _knownHosts = readAMQShortString( buffer ); + } + + public ConnectionRedirectBody(ProtocolVersion protocolVersion, AMQShortString host, AMQShortString knownHosts) + { + _ownMethodId = ProtocolVersion.v8_0.equals(protocolVersion) ? 50 : 42; + _host = host; + _knownHosts = knownHosts; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return _ownMethodId; + } + + public final AMQShortString getHost() + { + return _host; + } + public final AMQShortString getKnownHosts() + { + return _knownHosts; + } + + protected int getBodySize() + { + int size = 0; + size += getSizeOf( _host ); + size += getSizeOf( _knownHosts ); + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeAMQShortString( buffer, _host ); + writeAMQShortString( buffer, _knownHosts ); + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchConnectionRedirect(this, channelId); + } - public AMQShortString getHost(); + public String toString() + { + StringBuilder buf = new StringBuilder("[ConnectionRedirectBodyImpl: "); + buf.append( "host=" ); + buf.append( getHost() ); + buf.append( ", " ); + buf.append( "knownHosts=" ); + buf.append( getKnownHosts() ); + buf.append("]"); + return buf.toString(); + } - public AMQShortString getKnownHosts(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java index 6fcde5f96e..18faeacf34 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionSecureBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionSecureBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 20; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java index 69c3cecefd..1131567b06 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionSecureOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionSecureOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionSecureOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 21; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java index f393dc8cff..a445dd953a 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionStartBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionStartBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 10; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java index f46fa4ed9f..e2284a7a5e 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionStartOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionStartOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionStartOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 11; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java index cc5618db27..2b6a67c4f6 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionTuneBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionTuneBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 30; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java index a2ea80b13c..84ab6027e5 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ConnectionTuneOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionTuneOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 10; public static final int METHOD_ID = 31; diff --git a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java index 86eba9e0a8..a7fe4b01f3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java +++ b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java @@ -938,7 +938,6 @@ public class EncodingUtils } else { - // really writing out unsigned byte writeUnsignedInteger(buffer, 0L); } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java index 7f94da70a0..028e3c83be 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeBoundBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeBoundBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 22; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java index 9f546cf413..fa12cdf2cf 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeBoundOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeBoundOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeBoundOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 23; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java index b6efaf1cfa..23f428a381 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeDeclareBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeDeclareBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 10; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java index c0d2e557fd..68b193cfb0 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeclareOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeDeclareOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeDeclareOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 11; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java index b99c85b023..98b0ba30f0 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeDeleteBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeDeleteBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 20; diff --git a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java index 6ef35352af..7af0b02ef0 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ExchangeDeleteOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class ExchangeDeleteOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ExchangeDeleteOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 40; public static final int METHOD_ID = 21; diff --git a/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java b/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java index e027705af7..0fad853194 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java +++ b/java/common/src/main/java/org/apache/qpid/framing/MethodRegistry.java @@ -30,39 +30,293 @@ package org.apache.qpid.framing; import java.io.IOException; +import java.util.HashMap; +import java.util.Map; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; import org.apache.qpid.codec.MarkableDataInput; - -import java.util.Map; -import java.util.HashMap; +import org.apache.qpid.protocol.AMQConstant; -public abstract class MethodRegistry +public final class MethodRegistry { - private static final Map<ProtocolVersion, MethodRegistry> _registries = - new HashMap<ProtocolVersion, MethodRegistry>(); + private static final Map<ProtocolVersion, MethodRegistry> _registries = new HashMap<>(); public static final MethodRegistry registry_0_9 = - new org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9(); + new MethodRegistry(ProtocolVersion.v0_9); public static final MethodRegistry registry_0_91 = - new org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91(); + new MethodRegistry(ProtocolVersion.v0_91); public static final MethodRegistry registry_8_0 = - new org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0(); + new MethodRegistry(ProtocolVersion.v8_0); - public abstract AMQMethodBody convertToBody(MarkableDataInput in, long size) - throws AMQFrameDecodingException, IOException; + private final ProtocolVersion _protocolVersion; - public abstract int getMaxClassId(); + public final AMQMethodBody convertToBody(MarkableDataInput in, long size) + throws AMQFrameDecodingException, IOException + { + final int classAndMethod = in.readInt(); + + AMQMethodBody methodBody; + switch(classAndMethod) + { + //CONNECTION_CLASS: + case 0x000a000a: + methodBody = new ConnectionStartBody(in); + break; + case 0x000a000b: + methodBody = new ConnectionStartOkBody(in); + break; + case 0x000a0014: + methodBody = new ConnectionSecureBody(in); + break; + case 0x000a0015: + methodBody = new ConnectionSecureOkBody(in); + break; + case 0x000a001e: + methodBody = new ConnectionTuneBody(in); + break; + case 0x000a001f: + methodBody = new ConnectionTuneOkBody(in); + break; + case 0x000a0028: + methodBody = new ConnectionOpenBody(in); + break; + case 0x000a0029: + methodBody = new ConnectionOpenOkBody(in); + break; + case 0x000a002a: + methodBody = new ConnectionRedirectBody(in, _protocolVersion); + break; + case 0x000a0032: + if(_protocolVersion.equals(ProtocolVersion.v8_0)) + { + methodBody = new ConnectionRedirectBody(in, _protocolVersion); + } + else + { + methodBody = new ConnectionCloseBody(in, _protocolVersion); + } + break; + case 0x000a0033: + if(_protocolVersion.equals(ProtocolVersion.v8_0)) + { + throw newUnknownMethodException((classAndMethod >> 16), (classAndMethod & 0xFFFF)); + } + else + { + methodBody = ConnectionCloseOkBody.CONNECTION_CLOSE_OK_0_9; + } + break; + case 0x000a003c: + if(_protocolVersion.equals(ProtocolVersion.v8_0)) + { + methodBody = new ConnectionCloseBody(in, _protocolVersion); + } + else + { + throw newUnknownMethodException((classAndMethod >> 16), (classAndMethod & 0xFFFF)); + } + break; + case 0x000a003d: + if(_protocolVersion.equals(ProtocolVersion.v8_0)) + { + methodBody = ConnectionCloseOkBody.CONNECTION_CLOSE_OK_0_8; + } + else + { + throw newUnknownMethodException((classAndMethod >> 16), (classAndMethod & 0xFFFF)); + } + break; + + // CHANNEL_CLASS: + + case 0x0014000a: + methodBody = new ChannelOpenBody(in); + break; + case 0x0014000b: + methodBody = ChannelOpenOkBody.getInstance(_protocolVersion, in); + break; + case 0x00140014: + methodBody = new ChannelFlowBody(in); + break; + case 0x00140015: + methodBody = new ChannelFlowOkBody(in); + break; + case 0x0014001e: + methodBody = new ChannelAlertBody(in); + break; + case 0x00140028: + methodBody = new ChannelCloseBody(in); + break; + case 0x00140029: + methodBody = new ChannelCloseOkBody(in); + break; + // ACCESS_CLASS: + + case 0x001e000a: + methodBody = new AccessRequestBody(in); + break; + case 0x001e000b: + methodBody = new AccessRequestOkBody(in); + break; + + // EXCHANGE_CLASS: + + case 0x0028000a: + methodBody = new ExchangeDeclareBody(in); + break; + case 0x0028000b: + methodBody = new ExchangeDeclareOkBody(in); + break; + case 0x00280014: + methodBody = new ExchangeDeleteBody(in); + break; + case 0x00280015: + methodBody = new ExchangeDeleteOkBody(in); + break; + case 0x00280016: + methodBody = new ExchangeBoundBody(in); + break; + case 0x00280017: + methodBody = new ExchangeBoundOkBody(in); + break; + + + // QUEUE_CLASS: + + case 0x0032000a: + methodBody = new QueueDeclareBody(in); + break; + case 0x0032000b: + methodBody = new QueueDeclareOkBody(in); + break; + case 0x00320014: + methodBody = new QueueBindBody(in); + break; + case 0x00320015: + methodBody = new QueueBindOkBody(in); + break; + case 0x0032001e: + methodBody = new QueuePurgeBody(in); + break; + case 0x0032001f: + methodBody = new QueuePurgeOkBody(in); + break; + case 0x00320028: + methodBody = new QueueDeleteBody(in); + break; + case 0x00320029: + methodBody = new QueueDeleteOkBody(in); + break; + case 0x00320032: + methodBody = new QueueUnbindBody(in); + break; + case 0x00320033: + methodBody = new QueueUnbindOkBody(in); + break; + + + // BASIC_CLASS: + + case 0x003c000a: + methodBody = new BasicQosBody(in); + break; + case 0x003c000b: + methodBody = new BasicQosOkBody(in); + break; + case 0x003c0014: + methodBody = new BasicConsumeBody(in); + break; + case 0x003c0015: + methodBody = new BasicConsumeOkBody(in); + break; + case 0x003c001e: + methodBody = new BasicCancelBody(in); + break; + case 0x003c001f: + methodBody = new BasicCancelOkBody(in); + break; + case 0x003c0028: + methodBody = new BasicPublishBody(in); + break; + case 0x003c0032: + methodBody = new BasicReturnBody(in); + break; + case 0x003c003c: + methodBody = new BasicDeliverBody(in); + break; + case 0x003c0046: + methodBody = new BasicGetBody(in); + break; + case 0x003c0047: + methodBody = new BasicGetOkBody(in); + break; + case 0x003c0048: + methodBody = new BasicGetEmptyBody(in); + break; + case 0x003c0050: + methodBody = new BasicAckBody(in); + break; + case 0x003c005a: + methodBody = new BasicRejectBody(in); + break; + case 0x003c0064: + methodBody = new BasicRecoverBody(in); + break; + case 0x003c0065: + methodBody = new BasicRecoverSyncOkBody(_protocolVersion); + break; + case 0x003c0066: + methodBody = new BasicRecoverSyncBody(in, _protocolVersion); + break; + case 0x003c006e: + methodBody = new BasicRecoverSyncBody(in, _protocolVersion); + break; + case 0x003c006f: + methodBody = new BasicRecoverSyncOkBody(_protocolVersion); + break; + + // TX_CLASS: + + case 0x005a000a: + methodBody = TxSelectBody.INSTANCE; + break; + case 0x005a000b: + methodBody = TxSelectOkBody.INSTANCE; + break; + case 0x005a0014: + methodBody = TxCommitBody.INSTANCE; + break; + case 0x005a0015: + methodBody = TxCommitOkBody.INSTANCE; + break; + case 0x005a001e: + methodBody = TxRollbackBody.INSTANCE; + break; + case 0x005a001f: + methodBody = TxRollbackOkBody.INSTANCE; + break; + + default: + throw newUnknownMethodException((classAndMethod >> 16), (classAndMethod & 0xFFFF)); + + } + return methodBody; + } - public abstract int getMaxMethodId(int classId); + private AMQFrameDecodingException newUnknownMethodException(final int classId, final int methodId) + { + return new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, + "Method " + methodId + " unknown in AMQP version " + _protocolVersion + + " (while trying to decode class " + classId + " method " + methodId + "."); + } - protected MethodRegistry(ProtocolVersion pv) + private MethodRegistry(ProtocolVersion pv) { _registries.put(pv, this); + _protocolVersion = pv; } public static MethodRegistry getMethodRegistry(ProtocolVersion pv) @@ -71,288 +325,508 @@ public abstract class MethodRegistry } + public final AccessRequestBody createAccessRequestBody(final AMQShortString realm, + final boolean exclusive, + final boolean passive, + final boolean active, + final boolean write, + final boolean read) + { + return new AccessRequestBody(realm, + exclusive, + passive, + active, + write, + read); + } + + public final AccessRequestOkBody createAccessRequestOkBody(final int ticket) + { + return new AccessRequestOkBody(ticket); + } + + + public final BasicQosBody createBasicQosBody(final long prefetchSize, + final int prefetchCount, + final boolean global) + { + return new BasicQosBody(prefetchSize, + prefetchCount, + global); + } + + public final BasicQosOkBody createBasicQosOkBody() + { + return new BasicQosOkBody(); + } + + public final BasicConsumeBody createBasicConsumeBody(final int ticket, + final AMQShortString queue, + final AMQShortString consumerTag, + final boolean noLocal, + final boolean noAck, + final boolean exclusive, + final boolean nowait, + final FieldTable arguments) + { + return new BasicConsumeBody(ticket, + queue, + consumerTag, + noLocal, + noAck, + exclusive, + nowait, + arguments); + } + + public final BasicConsumeOkBody createBasicConsumeOkBody(final AMQShortString consumerTag) + { + return new BasicConsumeOkBody(consumerTag); + } + + public final BasicCancelBody createBasicCancelBody(final AMQShortString consumerTag, + final boolean nowait) + { + return new BasicCancelBody(consumerTag, + nowait); + } + + public final BasicCancelOkBody createBasicCancelOkBody(final AMQShortString consumerTag) + { + return new BasicCancelOkBody(consumerTag); + } + + public final BasicPublishBody createBasicPublishBody(final int ticket, + final AMQShortString exchange, + final AMQShortString routingKey, + final boolean mandatory, + final boolean immediate) + { + return new BasicPublishBody(ticket, + exchange, + routingKey, + mandatory, + immediate); + } + + public final BasicReturnBody createBasicReturnBody(final int replyCode, + final AMQShortString replyText, + final AMQShortString exchange, + final AMQShortString routingKey) + { + return new BasicReturnBody(replyCode, + replyText, + exchange, + routingKey); + } + + public final BasicDeliverBody createBasicDeliverBody(final AMQShortString consumerTag, + final long deliveryTag, + final boolean redelivered, + final AMQShortString exchange, + final AMQShortString routingKey) + { + return new BasicDeliverBody(consumerTag, + deliveryTag, + redelivered, + exchange, + routingKey); + } + + public final BasicGetBody createBasicGetBody(final int ticket, + final AMQShortString queue, + final boolean noAck) + { + return new BasicGetBody(ticket, + queue, + noAck); + } + + public final BasicGetOkBody createBasicGetOkBody(final long deliveryTag, + final boolean redelivered, + final AMQShortString exchange, + final AMQShortString routingKey, + final long messageCount) + { + return new BasicGetOkBody(deliveryTag, + redelivered, + exchange, + routingKey, + messageCount); + } + + public final BasicGetEmptyBody createBasicGetEmptyBody(final AMQShortString clusterId) + { + return new BasicGetEmptyBody(clusterId); + } + + public final BasicAckBody createBasicAckBody(final long deliveryTag, + final boolean multiple) + { + return new BasicAckBody(deliveryTag, + multiple); + } + + public final BasicRejectBody createBasicRejectBody(final long deliveryTag, + final boolean requeue) + { + return new BasicRejectBody(deliveryTag, + requeue); + } + + public final BasicRecoverBody createBasicRecoverBody(final boolean requeue) + { + return new BasicRecoverBody(requeue); + } + + + public final BasicRecoverSyncOkBody createBasicRecoverSyncOkBody() + { + return new BasicRecoverSyncOkBody(_protocolVersion); + } + + + public final BasicRecoverSyncBody createBasicRecoverSyncBody(final boolean requeue) + { + return new BasicRecoverSyncBody(_protocolVersion, requeue); + } + + public final ChannelAlertBody createChannelAlertBody(final int replyCode, + final AMQShortString replyText, + final FieldTable details) + { + return new ChannelAlertBody(replyCode, + replyText, + details); + } + + public final ChannelOpenBody createChannelOpenBody(final AMQShortString outOfBand) + { + return new ChannelOpenBody(outOfBand); + } + + public final ChannelOpenOkBody createChannelOpenOkBody(byte[] channelId) + { + return createChannelOpenOkBody(); + } + + public final ChannelOpenOkBody createChannelOpenOkBody() + { + return _protocolVersion.equals(ProtocolVersion.v8_0) + ? ChannelOpenOkBody.INSTANCE_0_8 + : ChannelOpenOkBody.INSTANCE_0_9; + } + + public final ChannelFlowBody createChannelFlowBody(final boolean active) + { + return new ChannelFlowBody(active); + } + + public final ChannelFlowOkBody createChannelFlowOkBody(final boolean active) + { + return new ChannelFlowOkBody(active); + } + + public final ChannelCloseBody createChannelCloseBody(final int replyCode, final AMQShortString replyText, + final int classId, + final int methodId + ) + { + return new ChannelCloseBody(replyCode, + replyText, + classId, + methodId); + } + + public final ChannelCloseOkBody createChannelCloseOkBody() + { + return new ChannelCloseOkBody(); + } + + + + + public final ConnectionStartBody createConnectionStartBody(final short versionMajor, + final short versionMinor, + final FieldTable serverProperties, + final byte[] mechanisms, + final byte[] locales) + { + return new ConnectionStartBody(versionMajor, + versionMinor, + serverProperties, + mechanisms, + locales); + } + + public final ConnectionStartOkBody createConnectionStartOkBody(final FieldTable clientProperties, + final AMQShortString mechanism, + final byte[] response, + final AMQShortString locale) + { + return new ConnectionStartOkBody(clientProperties, + mechanism, + response, + locale); + } + + public final ConnectionSecureBody createConnectionSecureBody(final byte[] challenge) + { + return new ConnectionSecureBody(challenge); + } + + public final ConnectionSecureOkBody createConnectionSecureOkBody(final byte[] response) + { + return new ConnectionSecureOkBody(response); + } + + public final ConnectionTuneBody createConnectionTuneBody(final int channelMax, + final long frameMax, + final int heartbeat) + { + return new ConnectionTuneBody(channelMax, + frameMax, + heartbeat); + } + + public final ConnectionTuneOkBody createConnectionTuneOkBody(final int channelMax, + final long frameMax, + final int heartbeat) + { + return new ConnectionTuneOkBody(channelMax, + frameMax, + heartbeat); + } + + public final ConnectionOpenBody createConnectionOpenBody(final AMQShortString virtualHost, + final AMQShortString capabilities, + final boolean insist) + { + return new ConnectionOpenBody(virtualHost, + capabilities, + insist); + } + + public final ConnectionOpenOkBody createConnectionOpenOkBody(final AMQShortString knownHosts) + { + return new ConnectionOpenOkBody(knownHosts); + } + + public final ConnectionRedirectBody createConnectionRedirectBody(final AMQShortString host, + final AMQShortString knownHosts) + { + return new ConnectionRedirectBody(_protocolVersion, + host, + knownHosts); + } + + public final ConnectionCloseBody createConnectionCloseBody(final int replyCode, + final AMQShortString replyText, + final int classId, + final int methodId) + { + return new ConnectionCloseBody(_protocolVersion, + replyCode, + replyText, + classId, + methodId); + } + + public final ConnectionCloseOkBody createConnectionCloseOkBody() + { + return ProtocolVersion.v8_0 == _protocolVersion + ? ConnectionCloseOkBody.CONNECTION_CLOSE_OK_0_8 + : ConnectionCloseOkBody.CONNECTION_CLOSE_OK_0_9; + } + + + public final ExchangeDeclareBody createExchangeDeclareBody(final int ticket, + final AMQShortString exchange, + final AMQShortString type, + final boolean passive, + final boolean durable, + final boolean autoDelete, + final boolean internal, + final boolean nowait, + final FieldTable arguments) + { + return new ExchangeDeclareBody(ticket, + exchange, + type, + passive, + durable, + autoDelete, + internal, + nowait, + arguments); + } + + public final ExchangeDeclareOkBody createExchangeDeclareOkBody() + { + return new ExchangeDeclareOkBody(); + } + + public final ExchangeDeleteBody createExchangeDeleteBody(final int ticket, + final AMQShortString exchange, + final boolean ifUnused, + final boolean nowait) + { + return new ExchangeDeleteBody(ticket, + exchange, + ifUnused, + nowait + ); + } + + public final ExchangeDeleteOkBody createExchangeDeleteOkBody() + { + return new ExchangeDeleteOkBody(); + } + + public final ExchangeBoundBody createExchangeBoundBody(final AMQShortString exchange, + final AMQShortString routingKey, + final AMQShortString queue) + { + return new ExchangeBoundBody(exchange, + routingKey, + queue); + } + + public final ExchangeBoundOkBody createExchangeBoundOkBody(final int replyCode, + final AMQShortString replyText) + { + return new ExchangeBoundOkBody(replyCode, + replyText); + } + + public final QueueDeclareBody createQueueDeclareBody(final int ticket, + final AMQShortString queue, + final boolean passive, + final boolean durable, + final boolean exclusive, + final boolean autoDelete, + final boolean nowait, + final FieldTable arguments) + { + return new QueueDeclareBody(ticket, + queue, + passive, + durable, + exclusive, + autoDelete, + nowait, + arguments); + } + + public final QueueDeclareOkBody createQueueDeclareOkBody(final AMQShortString queue, + final long messageCount, + final long consumerCount) + { + return new QueueDeclareOkBody(queue, + messageCount, + consumerCount); + } + + public final QueueBindBody createQueueBindBody(final int ticket, + final AMQShortString queue, + final AMQShortString exchange, + final AMQShortString routingKey, + final boolean nowait, + final FieldTable arguments) + { + return new QueueBindBody(ticket, + queue, + exchange, + routingKey, + nowait, + arguments); + } + + public final QueueBindOkBody createQueueBindOkBody() + { + return new QueueBindOkBody(); + } + + public final QueuePurgeBody createQueuePurgeBody(final int ticket, + final AMQShortString queue, + final boolean nowait) + { + return new QueuePurgeBody(ticket, + queue, + nowait); + } - public abstract BasicAckBody createBasicAckBody( - final long deliveryTag, - final boolean multiple - ); - - public abstract BasicCancelBody createBasicCancelBody( - final AMQShortString consumerTag, - final boolean nowait - ); - - public abstract BasicCancelOkBody createBasicCancelOkBody( - final AMQShortString consumerTag - ); - - public abstract BasicConsumeBody createBasicConsumeBody( - final int ticket, - final AMQShortString queue, - final AMQShortString consumerTag, - final boolean noLocal, - final boolean noAck, - final boolean exclusive, - final boolean nowait, - final FieldTable arguments - ); - - public abstract BasicConsumeOkBody createBasicConsumeOkBody( - final AMQShortString consumerTag - ); - - public abstract BasicDeliverBody createBasicDeliverBody( - final AMQShortString consumerTag, - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey - ); - - public abstract BasicGetBody createBasicGetBody( - final int ticket, - final AMQShortString queue, - final boolean noAck - ); - - public abstract BasicGetEmptyBody createBasicGetEmptyBody( - final AMQShortString clusterId - ); - - public abstract BasicGetOkBody createBasicGetOkBody( - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey, - final long messageCount - ); - - public abstract BasicPublishBody createBasicPublishBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean mandatory, - final boolean immediate - ); - - public abstract BasicQosBody createBasicQosBody( - final long prefetchSize, - final int prefetchCount, - final boolean global - ); - - public abstract BasicQosOkBody createBasicQosOkBody( - ); - - public abstract BasicRecoverBody createBasicRecoverBody( - final boolean requeue - ); - - public abstract BasicRejectBody createBasicRejectBody( - final long deliveryTag, - final boolean requeue - ); - - public abstract BasicReturnBody createBasicReturnBody( - final int replyCode, - final AMQShortString replyText, - final AMQShortString exchange, - final AMQShortString routingKey - ); - - - public abstract ChannelCloseBody createChannelCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ); - - public abstract ChannelCloseOkBody createChannelCloseOkBody( - ); - - public abstract ChannelFlowBody createChannelFlowBody( - final boolean active - ); - - public abstract ChannelFlowOkBody createChannelFlowOkBody( - final boolean active - ); - - public abstract ChannelOpenBody createChannelOpenBody( - final AMQShortString outOfBand - ); - - - public abstract ConnectionCloseBody createConnectionCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ); - - public abstract ConnectionCloseOkBody createConnectionCloseOkBody( - ); - - public abstract ConnectionOpenBody createConnectionOpenBody( - final AMQShortString virtualHost, - final AMQShortString capabilities, - final boolean insist - ); - - public abstract ConnectionOpenOkBody createConnectionOpenOkBody( - final AMQShortString knownHosts - ); - - public abstract ConnectionSecureBody createConnectionSecureBody( - final byte[] challenge - ); - - public abstract ConnectionSecureOkBody createConnectionSecureOkBody( - final byte[] response - ); - - public abstract ConnectionStartBody createConnectionStartBody( - final short versionMajor, - final short versionMinor, - final FieldTable serverProperties, - final byte[] mechanisms, - final byte[] locales - ); - - public abstract ConnectionStartOkBody createConnectionStartOkBody( - final FieldTable clientProperties, - final AMQShortString mechanism, - final byte[] response, - final AMQShortString locale - ); - - public abstract ConnectionTuneBody createConnectionTuneBody( - final int channelMax, - final long frameMax, - final int heartbeat - ); - - public abstract ConnectionTuneOkBody createConnectionTuneOkBody( - final int channelMax, - final long frameMax, - final int heartbeat - ); - - - - public abstract ExchangeBoundBody createExchangeBoundBody( - final AMQShortString exchange, - final AMQShortString routingKey, - final AMQShortString queue - ); - - public abstract ExchangeBoundOkBody createExchangeBoundOkBody( - final int replyCode, - final AMQShortString replyText - ); - - public abstract ExchangeDeclareBody createExchangeDeclareBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString type, - final boolean passive, - final boolean durable, - final boolean autoDelete, - final boolean internal, - final boolean nowait, - final FieldTable arguments - ); - - public abstract ExchangeDeclareOkBody createExchangeDeclareOkBody( - ); - - public abstract ExchangeDeleteBody createExchangeDeleteBody( - final int ticket, - final AMQShortString exchange, - final boolean ifUnused, - final boolean nowait - ); - - public abstract ExchangeDeleteOkBody createExchangeDeleteOkBody( - ); - - - - - public abstract QueueBindBody createQueueBindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean nowait, - final FieldTable arguments - ); - - public abstract QueueBindOkBody createQueueBindOkBody( - ); - - public abstract QueueDeclareBody createQueueDeclareBody( - final int ticket, - final AMQShortString queue, - final boolean passive, - final boolean durable, - final boolean exclusive, - final boolean autoDelete, - final boolean nowait, - final FieldTable arguments - ); - - public abstract QueueDeclareOkBody createQueueDeclareOkBody( - final AMQShortString queue, - final long messageCount, - final long consumerCount - ); - - public abstract QueueDeleteBody createQueueDeleteBody( - final int ticket, - final AMQShortString queue, - final boolean ifUnused, - final boolean ifEmpty, - final boolean nowait - ); - - public abstract QueueDeleteOkBody createQueueDeleteOkBody( - final long messageCount - ); - - public abstract QueuePurgeBody createQueuePurgeBody( - final int ticket, - final AMQShortString queue, - final boolean nowait - ); + public final QueuePurgeOkBody createQueuePurgeOkBody(final long messageCount) + { + return new QueuePurgeOkBody(messageCount); + } - public abstract QueuePurgeOkBody createQueuePurgeOkBody( - final long messageCount - ); + public final QueueDeleteBody createQueueDeleteBody(final int ticket, + final AMQShortString queue, + final boolean ifUnused, + final boolean ifEmpty, + final boolean nowait) + { + return new QueueDeleteBody(ticket, + queue, + ifUnused, + ifEmpty, + nowait); + } + public final QueueDeleteOkBody createQueueDeleteOkBody(final long messageCount) + { + return new QueueDeleteOkBody(messageCount); + } + public final QueueUnbindBody createQueueUnbindBody(final int ticket, + final AMQShortString queue, + final AMQShortString exchange, + final AMQShortString routingKey, + final FieldTable arguments) + { + return new QueueUnbindBody(ticket, + queue, + exchange, + routingKey, + arguments); + } + public final QueueUnbindOkBody createQueueUnbindOkBody() + { + return new QueueUnbindOkBody(); + } - public abstract TxCommitBody createTxCommitBody( - ); + public final TxSelectBody createTxSelectBody() + { + return TxSelectBody.INSTANCE; + } - public abstract TxCommitOkBody createTxCommitOkBody( - ); + public final TxSelectOkBody createTxSelectOkBody() + { + return TxSelectOkBody.INSTANCE; + } - public abstract TxRollbackBody createTxRollbackBody( - ); + public final TxCommitBody createTxCommitBody() + { + return TxCommitBody.INSTANCE; + } - public abstract TxRollbackOkBody createTxRollbackOkBody( - ); + public final TxCommitOkBody createTxCommitOkBody() + { + return TxCommitOkBody.INSTANCE; + } - public abstract TxSelectBody createTxSelectBody( - ); + public final TxRollbackBody createTxRollbackBody() + { + return TxRollbackBody.INSTANCE; + } - public abstract TxSelectOkBody createTxSelectOkBody( - ); + public final TxRollbackOkBody createTxRollbackOkBody() + { + return TxRollbackOkBody.INSTANCE; + } - public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java index 35ff7faeb2..ddcaf6290e 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueBindBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueBindBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueBindBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 20; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java index be230b9cb7..cf6b18b932 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueBindOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueBindOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueBindOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 21; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java index a2cc2cf994..c7322aa71c 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueDeclareBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueDeclareBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 10; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java index 0df80bd6b4..7ee65e377a 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueDeclareOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueDeclareOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueDeclareOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 11; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java index 95390976fd..6e534fd556 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueDeleteBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueDeleteBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 40; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java index 3c31e77b9f..cb58db5de6 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueDeleteOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueueDeleteOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueDeleteOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 41; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java index ee2858ebcb..713b0b24ad 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueuePurgeBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueuePurgeBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 30; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java index 921aa751f4..c2bc1caf14 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueuePurgeOkBody.java @@ -35,18 +35,6 @@ import org.apache.qpid.codec.MarkableDataInput; public class QueuePurgeOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueuePurgeOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 50; public static final int METHOD_ID = 31; diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java index 9c6caafc74..a5aba58f15 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindBody.java @@ -22,23 +22,129 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface QueueUnbindBody extends EncodableAMQDataBlock, AMQMethodBody +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; +import org.apache.qpid.codec.MarkableDataInput; + +public class QueueUnbindBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - public FieldTable getArguments(); + public static final int CLASS_ID = 50; + public static final int METHOD_ID = 50; + + // Fields declared in specification + private final int _ticket; // [ticket] + private final AMQShortString _queue; // [queue] + private final AMQShortString _exchange; // [exchange] + private final AMQShortString _routingKey; // [routingKey] + private final FieldTable _arguments; // [arguments] + + // Constructor + public QueueUnbindBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException + { + _ticket = readUnsignedShort( buffer ); + _queue = readAMQShortString( buffer ); + _exchange = readAMQShortString( buffer ); + _routingKey = readAMQShortString( buffer ); + _arguments = readFieldTable( buffer ); + } + + public QueueUnbindBody( + int ticket, + AMQShortString queue, + AMQShortString exchange, + AMQShortString routingKey, + FieldTable arguments + ) + { + _ticket = ticket; + _queue = queue; + _exchange = exchange; + _routingKey = routingKey; + _arguments = arguments; + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + public final int getTicket() + { + return _ticket; + } + public final AMQShortString getQueue() + { + return _queue; + } + public final AMQShortString getExchange() + { + return _exchange; + } + public final AMQShortString getRoutingKey() + { + return _routingKey; + } + public final FieldTable getArguments() + { + return _arguments; + } + + protected int getBodySize() + { + int size = 2; + size += getSizeOf( _queue ); + size += getSizeOf( _exchange ); + size += getSizeOf( _routingKey ); + size += getSizeOf( _arguments ); + return size; + } - public AMQShortString getExchange(); + public void writeMethodPayload(DataOutput buffer) throws IOException + { + writeUnsignedShort( buffer, _ticket ); + writeAMQShortString( buffer, _queue ); + writeAMQShortString( buffer, _exchange ); + writeAMQShortString( buffer, _routingKey ); + writeFieldTable( buffer, _arguments ); + } - public AMQShortString getQueue(); + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchQueueUnbind(this, channelId); + } - public AMQShortString getRoutingKey(); + public String toString() + { + StringBuilder buf = new StringBuilder("[QueueUnbindBodyImpl: "); + buf.append( "ticket=" ); + buf.append( getTicket() ); + buf.append( ", " ); + buf.append( "queue=" ); + buf.append( getQueue() ); + buf.append( ", " ); + buf.append( "exchange=" ); + buf.append( getExchange() ); + buf.append( ", " ); + buf.append( "routingKey=" ); + buf.append( getRoutingKey() ); + buf.append( ", " ); + buf.append( "arguments=" ); + buf.append( getArguments() ); + buf.append("]"); + return buf.toString(); + } - public int getTicket(); } diff --git a/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java index bdd8eb9359..27c49a0804 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/QueueUnbindOkBody.java @@ -22,13 +22,66 @@ /* * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. * Supported AMQP version: - * 0-9 - * 0-91 - * 8-0 - */ + * 0-91 + */ package org.apache.qpid.framing; -public interface QueueUnbindOkBody extends EncodableAMQDataBlock, AMQMethodBody +import org.apache.qpid.codec.MarkableDataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.qpid.AMQException; + +public class QueueUnbindOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { + + public static final int CLASS_ID = 50; + public static final int METHOD_ID = 51; + + // Fields declared in specification + + // Constructor + public QueueUnbindOkBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException + { + } + + public QueueUnbindOkBody( + ) + { + } + + public int getClazz() + { + return CLASS_ID; + } + + public int getMethod() + { + return METHOD_ID; + } + + + protected int getBodySize() + { + int size = 0; + return size; + } + + public void writeMethodPayload(DataOutput buffer) throws IOException + { + } + + public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException + { + return dispatcher.dispatchQueueUnbindOk(this, channelId); + } + + public String toString() + { + StringBuilder buf = new StringBuilder("[QueueUnbindOkBodyImpl: "); + buf.append("]"); + return buf.toString(); + } + } diff --git a/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java b/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java index 4ad16b9ca5..fd87911b26 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java +++ b/java/common/src/main/java/org/apache/qpid/framing/ServerMethodDispatcher.java @@ -33,6 +33,7 @@ import org.apache.qpid.AMQException; public interface ServerMethodDispatcher { + boolean dispatchAccessRequest(AccessRequestBody accessRequestBody, int channelId) throws AMQException; public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException; public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException; @@ -64,4 +65,5 @@ public interface ServerMethodDispatcher public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException; public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException; + boolean dispatchQueueUnbind(QueueUnbindBody queueUnbindBody, int channelId) throws AMQException; } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java index f610301ffe..63c12dffc6 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxCommitBody.java @@ -31,35 +31,19 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxCommitBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxCommitBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 20; - // Fields declared in specification + public static final TxCommitBody INSTANCE = new TxCommitBody(); // Constructor - public TxCommitBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - public TxCommitBody( - ) + + public TxCommitBody() { } @@ -76,8 +60,7 @@ public class TxCommitBody extends AMQMethodBodyImpl implements EncodableAMQDataB protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +74,7 @@ public class TxCommitBody extends AMQMethodBodyImpl implements EncodableAMQDataB public String toString() { - StringBuilder buf = new StringBuilder("[TxCommitBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxCommitBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java index 2976d3ea8d..c1a8dd0d23 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxCommitOkBody.java @@ -31,35 +31,17 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxCommitOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxCommitOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 21; - // Fields declared in specification + public static final TxCommitOkBody INSTANCE = new TxCommitOkBody(); // Constructor - public TxCommitOkBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public TxCommitOkBody( - ) + private TxCommitOkBody() { } @@ -76,8 +58,7 @@ public class TxCommitOkBody extends AMQMethodBodyImpl implements EncodableAMQDat protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +72,7 @@ public class TxCommitOkBody extends AMQMethodBodyImpl implements EncodableAMQDat public String toString() { - StringBuilder buf = new StringBuilder("[TxCommitOkBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxCommitOkBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java index b456a67cf6..97ac5ddcba 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxRollbackBody.java @@ -31,35 +31,17 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxRollbackBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxRollbackBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 30; - // Fields declared in specification + public static final TxRollbackBody INSTANCE = new TxRollbackBody(); - // Constructor - public TxRollbackBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - public TxRollbackBody( - ) + private TxRollbackBody() { } @@ -76,8 +58,7 @@ public class TxRollbackBody extends AMQMethodBodyImpl implements EncodableAMQDat protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +72,7 @@ public class TxRollbackBody extends AMQMethodBodyImpl implements EncodableAMQDat public String toString() { - StringBuilder buf = new StringBuilder("[TxRollbackBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxRollbackBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java index 26bd9d21b8..d8ab92c1c3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxRollbackOkBody.java @@ -31,35 +31,18 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxRollbackOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxRollbackOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 31; - // Fields declared in specification + public static final TxRollbackOkBody INSTANCE = new TxRollbackOkBody(); // Constructor - public TxRollbackOkBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - public TxRollbackOkBody( - ) + private TxRollbackOkBody() { } @@ -76,8 +59,7 @@ public class TxRollbackOkBody extends AMQMethodBodyImpl implements EncodableAMQD protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +73,7 @@ public class TxRollbackOkBody extends AMQMethodBodyImpl implements EncodableAMQD public String toString() { - StringBuilder buf = new StringBuilder("[TxRollbackOkBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxRollbackOkBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java index ced3c59050..79af85f177 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxSelectBody.java @@ -31,35 +31,20 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxSelectBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxSelectBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 10; + public static final TxSelectBody INSTANCE = new TxSelectBody(); + // Fields declared in specification // Constructor - public TxSelectBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - public TxSelectBody( - ) + private TxSelectBody() { } @@ -76,8 +61,7 @@ public class TxSelectBody extends AMQMethodBodyImpl implements EncodableAMQDataB protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +75,7 @@ public class TxSelectBody extends AMQMethodBodyImpl implements EncodableAMQDataB public String toString() { - StringBuilder buf = new StringBuilder("[TxSelectBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxSelectBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java b/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java index 4814aed18f..64c8979deb 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java +++ b/java/common/src/main/java/org/apache/qpid/framing/TxSelectOkBody.java @@ -31,35 +31,16 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; public class TxSelectOkBody extends AMQMethodBodyImpl implements EncodableAMQDataBlock, AMQMethodBody { - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new TxSelectOkBody(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } public static final int CLASS_ID = 90; public static final int METHOD_ID = 11; - // Fields declared in specification - - // Constructor - public TxSelectOkBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } + public static final TxSelectOkBody INSTANCE = new TxSelectOkBody(); - public TxSelectOkBody( - ) + private TxSelectOkBody() { } @@ -76,8 +57,7 @@ public class TxSelectOkBody extends AMQMethodBodyImpl implements EncodableAMQDat protected int getBodySize() { - int size = 0; - return size; + return 0; } public void writeMethodPayload(DataOutput buffer) throws IOException @@ -91,9 +71,7 @@ public class TxSelectOkBody extends AMQMethodBodyImpl implements EncodableAMQDat public String toString() { - StringBuilder buf = new StringBuilder("[TxSelectOkBodyImpl: "); - buf.append("]"); - return buf.toString(); + return "[TxSelectOkBody]"; } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java b/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java deleted file mode 100644 index 1d7c05e9cc..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing.abstraction; - -public abstract class AbstractMethodConverter implements ProtocolVersionMethodConverter -{ - private final byte _protocolMajorVersion; - - - private final byte _protocolMinorVersion; - - public AbstractMethodConverter(byte major, byte minor) - { - _protocolMajorVersion = major; - _protocolMinorVersion = minor; - } - - - public final byte getProtocolMajorVersion() - { - return _protocolMajorVersion; - } - - public final byte getProtocolMinorVersion() - { - return _protocolMinorVersion; - } -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java b/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java deleted file mode 100644 index b3897771c5..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing.abstraction; - -import org.apache.qpid.framing.AMQMethodBody; - -public interface ProtocolVersionMethodConverter -{ - public MessagePublishInfo convertToInfo(AMQMethodBody body); - public AMQMethodBody convertToBody(MessagePublishInfo info); -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java deleted file mode 100644 index 7d25099045..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestBodyImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.AMQFrameDecodingException; -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQMethodBodyImpl; -import org.apache.qpid.framing.AMQMethodBodyInstanceFactory; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.AccessRequestBody; -import org.apache.qpid.framing.MethodDispatcher; - -public class AccessRequestBodyImpl extends AMQMethodBodyImpl implements AccessRequestBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new AccessRequestBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 30; - public static final int METHOD_ID = 10; - - // Fields declared in specification - private final AMQShortString _realm; // [realm] - private final byte _bitfield0; // [exclusive, passive, active, write, read] - - // Constructor - public AccessRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _realm = readAMQShortString( buffer ); - _bitfield0 = readBitfield( buffer ); - } - - public AccessRequestBodyImpl( - AMQShortString realm, - boolean exclusive, - boolean passive, - boolean active, - boolean write, - boolean read - ) - { - _realm = realm; - byte bitfield0 = (byte)0; - if( exclusive ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); - } - - if( passive ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 1)); - } - - if( active ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 2)); - } - - if( write ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 3)); - } - - if( read ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 4)); - } - _bitfield0 = bitfield0; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final AMQShortString getRealm() - { - return _realm; - } - public final boolean getExclusive() - { - return (((int)(_bitfield0)) & ( 1 << 0)) != 0; - } - public final boolean getPassive() - { - return (((int)(_bitfield0)) & ( 1 << 1)) != 0; - } - public final boolean getActive() - { - return (((int)(_bitfield0)) & ( 1 << 2)) != 0; - } - public final boolean getWrite() - { - return (((int)(_bitfield0)) & ( 1 << 3)) != 0; - } - public final boolean getRead() - { - return (((int)(_bitfield0)) & ( 1 << 4)) != 0; - } - - protected int getBodySize() - { - int size = 1; - size += getSizeOf( _realm ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeAMQShortString( buffer, _realm ); - writeBitfield( buffer, _bitfield0 ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchAccessRequest(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[AccessRequestBodyImpl: "); - buf.append( "realm=" ); - buf.append( getRealm() ); - buf.append( ", " ); - buf.append( "exclusive=" ); - buf.append( getExclusive() ); - buf.append( ", " ); - buf.append( "passive=" ); - buf.append( getPassive() ); - buf.append( ", " ); - buf.append( "active=" ); - buf.append( getActive() ); - buf.append( ", " ); - buf.append( "write=" ); - buf.append( getWrite() ); - buf.append( ", " ); - buf.append( "read=" ); - buf.append( getRead() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java deleted file mode 100644 index 055deb64e0..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AccessRequestOkBodyImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class AccessRequestOkBodyImpl extends AMQMethodBodyImpl implements AccessRequestOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new AccessRequestOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 30; - public static final int METHOD_ID = 11; - - // Fields declared in specification - private final int _ticket; // [ticket] - - // Constructor - public AccessRequestOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _ticket = readUnsignedShort( buffer ); - } - - public AccessRequestOkBodyImpl( - int ticket - ) - { - _ticket = ticket; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getTicket() - { - return _ticket; - } - - protected int getBodySize() - { - int size = 2; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _ticket ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchAccessRequestOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[AccessRequestOkBodyImpl: "); - buf.append( "ticket=" ); - buf.append( getTicket() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java deleted file mode 100644 index cfad3a1ff6..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncBodyImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class BasicRecoverSyncBodyImpl extends AMQMethodBodyImpl implements BasicRecoverSyncBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverSyncBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 60; - public static final int METHOD_ID = 102; - - // Fields declared in specification - private final byte _bitfield0; // [requeue] - - // Constructor - public BasicRecoverSyncBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _bitfield0 = readBitfield( buffer ); - } - - public BasicRecoverSyncBodyImpl( - boolean requeue - ) - { - byte bitfield0 = (byte)0; - if( requeue ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); - } - _bitfield0 = bitfield0; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final boolean getRequeue() - { - return (((int)(_bitfield0)) & ( 1 << 0)) != 0; - } - - protected int getBodySize() - { - int size = 1; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeBitfield( buffer, _bitfield0 ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchBasicRecoverSync(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[BasicRecoverSyncBodyImpl: "); - buf.append( "requeue=" ); - buf.append( getRequeue() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java deleted file mode 100644 index 91ef3e9343..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/BasicRecoverSyncOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class BasicRecoverSyncOkBodyImpl extends AMQMethodBodyImpl implements BasicRecoverSyncOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverSyncOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 60; - public static final int METHOD_ID = 101; - - // Fields declared in specification - - // Constructor - public BasicRecoverSyncOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public BasicRecoverSyncOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchBasicRecoverSyncOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[BasicRecoverSyncOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java deleted file mode 100644 index fa6ce1873b..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ChannelOpenOkBodyImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ChannelOpenOkBodyImpl extends AMQMethodBodyImpl implements ChannelOpenOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelOpenOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 20; - public static final int METHOD_ID = 11; - - // Fields declared in specification - private final byte[] _channelId; // [channelId] - - // Constructor - public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _channelId = readBytes( buffer ); - } - - public ChannelOpenOkBodyImpl( - byte[] channelId - ) - { - _channelId = channelId; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final byte[] getChannelId() - { - return _channelId; - } - - protected int getBodySize() - { - int size = 0; - size += getSizeOf( _channelId ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeBytes( buffer, _channelId ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchChannelOpenOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: "); - buf.append( "channelId=" ); - buf.append( getChannelId() == null ? "null" : java.util.Arrays.toString( getChannelId() ) ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java deleted file mode 100644 index b2e01f5c37..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseBodyImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 50; - - // Fields declared in specification - private final int _replyCode; // [replyCode] - private final AMQShortString _replyText; // [replyText] - private final int _classId; // [classId] - private final int _methodId; // [methodId] - - // Constructor - public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _replyCode = readUnsignedShort( buffer ); - _replyText = readAMQShortString( buffer ); - _classId = readUnsignedShort( buffer ); - _methodId = readUnsignedShort( buffer ); - } - - public ConnectionCloseBodyImpl( - int replyCode, - AMQShortString replyText, - int classId, - int methodId - ) - { - _replyCode = replyCode; - _replyText = replyText; - _classId = classId; - _methodId = methodId; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getReplyCode() - { - return _replyCode; - } - public final AMQShortString getReplyText() - { - return _replyText; - } - public final int getClassId() - { - return _classId; - } - public final int getMethodId() - { - return _methodId; - } - - protected int getBodySize() - { - int size = 6; - size += getSizeOf( _replyText ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _replyCode ); - writeAMQShortString( buffer, _replyText ); - writeUnsignedShort( buffer, _classId ); - writeUnsignedShort( buffer, _methodId ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionClose(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: "); - buf.append( "replyCode=" ); - buf.append( getReplyCode() ); - buf.append( ", " ); - buf.append( "replyText=" ); - buf.append( getReplyText() ); - buf.append( ", " ); - buf.append( "classId=" ); - buf.append( getClassId() ); - buf.append( ", " ); - buf.append( "methodId=" ); - buf.append( getMethodId() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java deleted file mode 100644 index 77a5b5f1b9..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionCloseOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseOkBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 51; - - // Fields declared in specification - - // Constructor - public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public ConnectionCloseOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionCloseOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java deleted file mode 100644 index 0a9ace2458..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/ConnectionRedirectBodyImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionRedirectBodyImpl extends AMQMethodBodyImpl implements ConnectionRedirectBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionRedirectBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 42; - - // Fields declared in specification - private final AMQShortString _host; // [host] - private final AMQShortString _knownHosts; // [knownHosts] - - // Constructor - public ConnectionRedirectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _host = readAMQShortString( buffer ); - _knownHosts = readAMQShortString( buffer ); - } - - public ConnectionRedirectBodyImpl( - AMQShortString host, - AMQShortString knownHosts - ) - { - _host = host; - _knownHosts = knownHosts; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final AMQShortString getHost() - { - return _host; - } - public final AMQShortString getKnownHosts() - { - return _knownHosts; - } - - protected int getBodySize() - { - int size = 0; - size += getSizeOf( _host ); - size += getSizeOf( _knownHosts ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeAMQShortString( buffer, _host ); - writeAMQShortString( buffer, _knownHosts ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchConnectionRedirect(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionRedirectBodyImpl: "); - buf.append( "host=" ); - buf.append( getHost() ); - buf.append( ", " ); - buf.append( "knownHosts=" ); - buf.append( getKnownHosts() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java deleted file mode 100644 index e473ce7926..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.BasicPublishBody; -import org.apache.qpid.framing.abstraction.AbstractMethodConverter; -import org.apache.qpid.framing.abstraction.MessagePublishInfo; -import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; - - -public class MethodConverter_0_9 extends AbstractMethodConverter implements ProtocolVersionMethodConverter -{ - - public MethodConverter_0_9() - { - super((byte)0,(byte)9); - } - - - public MessagePublishInfo convertToInfo(AMQMethodBody methodBody) - { - final BasicPublishBody publishBody = ((BasicPublishBody) methodBody); - - final AMQShortString exchange = publishBody.getExchange(); - final AMQShortString routingKey = publishBody.getRoutingKey(); - - return new MessagePublishInfoImpl(exchange, - publishBody.getImmediate(), - publishBody.getMandatory(), - routingKey); - - } - - public AMQMethodBody convertToBody(MessagePublishInfo info) - { - - return new BasicPublishBody(0, - info.getExchange(), - info.getRoutingKey(), - info.isMandatory(), - info.isImmediate()) ; - - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java deleted file mode 100644 index 6b016d316c..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodRegistry_0_9.java +++ /dev/null @@ -1,921 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import java.io.IOException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.*; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; -import org.apache.qpid.protocol.AMQConstant; - - -public class MethodRegistry_0_9 extends MethodRegistry -{ - - private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class); - - private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_0_9(); - - private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[91][]; - - public MethodRegistry_0_9() - { - this(new ProtocolVersion((byte)0,(byte)9)); - } - - public MethodRegistry_0_9(ProtocolVersion pv) - { - super(pv); - - - - // Register method body instance factories for the Connection class. - - _factories[10] = new AMQMethodBodyInstanceFactory[52]; - - _factories[10][10] = ConnectionStartBody.getFactory(); - _factories[10][11] = ConnectionStartOkBody.getFactory(); - _factories[10][20] = ConnectionSecureBody.getFactory(); - _factories[10][21] = ConnectionSecureOkBody.getFactory(); - _factories[10][30] = ConnectionTuneBody.getFactory(); - _factories[10][31] = ConnectionTuneOkBody.getFactory(); - _factories[10][40] = ConnectionOpenBody.getFactory(); - _factories[10][41] = ConnectionOpenOkBody.getFactory(); - _factories[10][42] = ConnectionRedirectBodyImpl.getFactory(); - _factories[10][50] = ConnectionCloseBodyImpl.getFactory(); - _factories[10][51] = ConnectionCloseOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Channel class. - - _factories[20] = new AMQMethodBodyInstanceFactory[81]; - - _factories[20][10] = ChannelOpenBody.getFactory(); - _factories[20][11] = ChannelOpenOkBodyImpl.getFactory(); - _factories[20][20] = ChannelFlowBody.getFactory(); - _factories[20][21] = ChannelFlowOkBody.getFactory(); - _factories[20][40] = ChannelCloseBody.getFactory(); - _factories[20][41] = ChannelCloseOkBody.getFactory(); - - - - // Register method body instance factories for the Access class. - - _factories[30] = new AMQMethodBodyInstanceFactory[12]; - - _factories[30][10] = AccessRequestBodyImpl.getFactory(); - _factories[30][11] = AccessRequestOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Exchange class. - - _factories[40] = new AMQMethodBodyInstanceFactory[24]; - - _factories[40][10] = ExchangeDeclareBody.getFactory(); - _factories[40][11] = ExchangeDeclareOkBody.getFactory(); - _factories[40][20] = ExchangeDeleteBody.getFactory(); - _factories[40][21] = ExchangeDeleteOkBody.getFactory(); - _factories[40][22] = ExchangeBoundBody.getFactory(); - _factories[40][23] = ExchangeBoundOkBody.getFactory(); - - - - // Register method body instance factories for the Queue class. - - _factories[50] = new AMQMethodBodyInstanceFactory[52]; - - _factories[50][10] = QueueDeclareBody.getFactory(); - _factories[50][11] = QueueDeclareOkBody.getFactory(); - _factories[50][20] = QueueBindBody.getFactory(); - _factories[50][21] = QueueBindOkBody.getFactory(); - _factories[50][30] = QueuePurgeBody.getFactory(); - _factories[50][31] = QueuePurgeOkBody.getFactory(); - _factories[50][40] = QueueDeleteBody.getFactory(); - _factories[50][41] = QueueDeleteOkBody.getFactory(); - _factories[50][50] = QueueUnbindBodyImpl.getFactory(); - _factories[50][51] = QueueUnbindOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Basic class. - - _factories[60] = new AMQMethodBodyInstanceFactory[103]; - - _factories[60][10] = BasicQosBody.getFactory(); - _factories[60][11] = BasicQosOkBody.getFactory(); - _factories[60][20] = BasicConsumeBody.getFactory(); - _factories[60][21] = BasicConsumeOkBody.getFactory(); - _factories[60][30] = BasicCancelBody.getFactory(); - _factories[60][31] = BasicCancelOkBody.getFactory(); - _factories[60][40] = BasicPublishBody.getFactory(); - _factories[60][50] = BasicReturnBody.getFactory(); - _factories[60][60] = BasicDeliverBody.getFactory(); - _factories[60][70] = BasicGetBody.getFactory(); - _factories[60][71] = BasicGetOkBody.getFactory(); - _factories[60][72] = BasicGetEmptyBody.getFactory(); - _factories[60][80] = BasicAckBody.getFactory(); - _factories[60][90] = BasicRejectBody.getFactory(); - _factories[60][100] = BasicRecoverBody.getFactory(); - _factories[60][101] = BasicRecoverSyncOkBodyImpl.getFactory(); - _factories[60][102] = BasicRecoverSyncBodyImpl.getFactory(); - - - - // Register method body instance factories for the Tx class. - - _factories[90] = new AMQMethodBodyInstanceFactory[32]; - - _factories[90][10] = TxSelectBody.getFactory(); - _factories[90][11] = TxSelectOkBody.getFactory(); - _factories[90][20] = TxCommitBody.getFactory(); - _factories[90][21] = TxCommitOkBody.getFactory(); - _factories[90][30] = TxRollbackBody.getFactory(); - _factories[90][31] = TxRollbackOkBody.getFactory(); - - } - - public AMQMethodBody convertToBody(MarkableDataInput in, long size) - throws AMQFrameDecodingException, IOException - { - int classId = in.readUnsignedShort(); - int methodId = in.readUnsignedShort(); - - AMQMethodBodyInstanceFactory bodyFactory; - try - { - bodyFactory = _factories[classId][methodId]; - } - catch(NullPointerException e) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 0-9" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - catch(IndexOutOfBoundsException e) - { - if(classId >= _factories.length) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 0-9" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - else - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 0-9" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - } - - if (bodyFactory == null) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 0-9" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - - return bodyFactory.newInstance(in, size); - } - - public int getMaxClassId() - { - return 120; - } - - public int getMaxMethodId(int classId) - { - return _factories[classId].length - 1; - } - - - - public ConnectionStartBody createConnectionStartBody( - final short versionMajor, - final short versionMinor, - final FieldTable serverProperties, - final byte[] mechanisms, - final byte[] locales - ) - { - return new ConnectionStartBody( - versionMajor, - versionMinor, - serverProperties, - mechanisms, - locales - ); - } - - public ConnectionStartOkBody createConnectionStartOkBody( - final FieldTable clientProperties, - final AMQShortString mechanism, - final byte[] response, - final AMQShortString locale - ) - { - return new ConnectionStartOkBody( - clientProperties, - mechanism, - response, - locale - ); - } - - public ConnectionSecureBody createConnectionSecureBody( - final byte[] challenge - ) - { - return new ConnectionSecureBody( - challenge - ); - } - - public ConnectionSecureOkBody createConnectionSecureOkBody( - final byte[] response - ) - { - return new ConnectionSecureOkBody( - response - ); - } - - public ConnectionTuneBody createConnectionTuneBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionTuneOkBody createConnectionTuneOkBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneOkBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionOpenBody createConnectionOpenBody( - final AMQShortString virtualHost, - final AMQShortString capabilities, - final boolean insist - ) - { - return new ConnectionOpenBody( - virtualHost, - capabilities, - insist - ); - } - - public ConnectionOpenOkBody createConnectionOpenOkBody( - final AMQShortString knownHosts - ) - { - return new ConnectionOpenOkBody( - knownHosts - ); - } - - public ConnectionRedirectBody createConnectionRedirectBody( - final AMQShortString host, - final AMQShortString knownHosts - ) - { - return new ConnectionRedirectBodyImpl( - host, - knownHosts - ); - } - - public ConnectionCloseBody createConnectionCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ConnectionCloseBodyImpl( - replyCode, - replyText, - classId, - methodId - ); - } - - public ConnectionCloseOkBody createConnectionCloseOkBody( - ) - { - return new ConnectionCloseOkBodyImpl( - ); - } - - - - - public ChannelOpenBody createChannelOpenBody( - final AMQShortString outOfBand - ) - { - return new ChannelOpenBody( - outOfBand - ); - } - - public ChannelOpenOkBody createChannelOpenOkBody( - final byte[] channelId - ) - { - return new ChannelOpenOkBodyImpl( - channelId - ); - } - - public ChannelFlowBody createChannelFlowBody( - final boolean active - ) - { - return new ChannelFlowBody( - active - ); - } - - public ChannelFlowOkBody createChannelFlowOkBody( - final boolean active - ) - { - return new ChannelFlowOkBody( - active - ); - } - - public ChannelCloseBody createChannelCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ChannelCloseBody( - replyCode, - replyText, - classId, - methodId - ); - } - - public ChannelCloseOkBody createChannelCloseOkBody( - ) - { - return new ChannelCloseOkBody( - ); - } - - - public AccessRequestBody createAccessRequestBody( - final AMQShortString realm, - final boolean exclusive, - final boolean passive, - final boolean active, - final boolean write, - final boolean read - ) - { - return new AccessRequestBodyImpl( - realm, - exclusive, - passive, - active, - write, - read - ); - } - - public AccessRequestOkBody createAccessRequestOkBody( - final int ticket - ) - { - return new AccessRequestOkBodyImpl( - ticket - ); - } - - - - - public ExchangeDeclareBody createExchangeDeclareBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString type, - final boolean passive, - final boolean durable, - final boolean autoDelete, - final boolean internal, - final boolean nowait, - final FieldTable arguments - ) - { - return new ExchangeDeclareBody( - ticket, - exchange, - type, - passive, - durable, - autoDelete, - internal, - nowait, - arguments - ); - } - - public ExchangeDeclareOkBody createExchangeDeclareOkBody( - ) - { - return new ExchangeDeclareOkBody( - ); - } - - public ExchangeDeleteBody createExchangeDeleteBody( - final int ticket, - final AMQShortString exchange, - final boolean ifUnused, - final boolean nowait - ) - { - return new ExchangeDeleteBody( - ticket, - exchange, - ifUnused, - nowait - ); - } - - public ExchangeDeleteOkBody createExchangeDeleteOkBody( - ) - { - return new ExchangeDeleteOkBody( - ); - } - - public ExchangeBoundBody createExchangeBoundBody( - final AMQShortString exchange, - final AMQShortString routingKey, - final AMQShortString queue - ) - { - return new ExchangeBoundBody( - exchange, - routingKey, - queue - ); - } - - public ExchangeBoundOkBody createExchangeBoundOkBody( - final int replyCode, - final AMQShortString replyText - ) - { - return new ExchangeBoundOkBody( - replyCode, - replyText - ); - } - - - - - public QueueDeclareBody createQueueDeclareBody( - final int ticket, - final AMQShortString queue, - final boolean passive, - final boolean durable, - final boolean exclusive, - final boolean autoDelete, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueDeclareBody( - ticket, - queue, - passive, - durable, - exclusive, - autoDelete, - nowait, - arguments - ); - } - - public QueueDeclareOkBody createQueueDeclareOkBody( - final AMQShortString queue, - final long messageCount, - final long consumerCount - ) - { - return new QueueDeclareOkBody( - queue, - messageCount, - consumerCount - ); - } - - public QueueBindBody createQueueBindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueBindBody( - ticket, - queue, - exchange, - routingKey, - nowait, - arguments - ); - } - - public QueueBindOkBody createQueueBindOkBody( - ) - { - return new QueueBindOkBody( - ); - } - - public QueuePurgeBody createQueuePurgeBody( - final int ticket, - final AMQShortString queue, - final boolean nowait - ) - { - return new QueuePurgeBody( - ticket, - queue, - nowait - ); - } - - public QueuePurgeOkBody createQueuePurgeOkBody( - final long messageCount - ) - { - return new QueuePurgeOkBody( - messageCount - ); - } - - public QueueDeleteBody createQueueDeleteBody( - final int ticket, - final AMQShortString queue, - final boolean ifUnused, - final boolean ifEmpty, - final boolean nowait - ) - { - return new QueueDeleteBody( - ticket, - queue, - ifUnused, - ifEmpty, - nowait - ); - } - - public QueueDeleteOkBody createQueueDeleteOkBody( - final long messageCount - ) - { - return new QueueDeleteOkBody( - messageCount - ); - } - - public QueueUnbindBody createQueueUnbindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final FieldTable arguments - ) - { - return new QueueUnbindBodyImpl( - ticket, - queue, - exchange, - routingKey, - arguments - ); - } - - public QueueUnbindOkBody createQueueUnbindOkBody( - ) - { - return new QueueUnbindOkBodyImpl( - ); - } - - - - - public BasicQosBody createBasicQosBody( - final long prefetchSize, - final int prefetchCount, - final boolean global - ) - { - return new BasicQosBody( - prefetchSize, - prefetchCount, - global - ); - } - - public BasicQosOkBody createBasicQosOkBody( - ) - { - return new BasicQosOkBody( - ); - } - - public BasicConsumeBody createBasicConsumeBody( - final int ticket, - final AMQShortString queue, - final AMQShortString consumerTag, - final boolean noLocal, - final boolean noAck, - final boolean exclusive, - final boolean nowait, - final FieldTable arguments - ) - { - return new BasicConsumeBody( - ticket, - queue, - consumerTag, - noLocal, - noAck, - exclusive, - nowait, - arguments - ); - } - - public BasicConsumeOkBody createBasicConsumeOkBody( - final AMQShortString consumerTag - ) - { - return new BasicConsumeOkBody( - consumerTag - ); - } - - public BasicCancelBody createBasicCancelBody( - final AMQShortString consumerTag, - final boolean nowait - ) - { - return new BasicCancelBody( - consumerTag, - nowait - ); - } - - public BasicCancelOkBody createBasicCancelOkBody( - final AMQShortString consumerTag - ) - { - return new BasicCancelOkBody( - consumerTag - ); - } - - public BasicPublishBody createBasicPublishBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean mandatory, - final boolean immediate - ) - { - return new BasicPublishBody( - ticket, - exchange, - routingKey, - mandatory, - immediate - ); - } - - public BasicReturnBody createBasicReturnBody( - final int replyCode, - final AMQShortString replyText, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicReturnBody( - replyCode, - replyText, - exchange, - routingKey - ); - } - - public BasicDeliverBody createBasicDeliverBody( - final AMQShortString consumerTag, - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicDeliverBody( - consumerTag, - deliveryTag, - redelivered, - exchange, - routingKey - ); - } - - public BasicGetBody createBasicGetBody( - final int ticket, - final AMQShortString queue, - final boolean noAck - ) - { - return new BasicGetBody( - ticket, - queue, - noAck - ); - } - - public BasicGetOkBody createBasicGetOkBody( - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey, - final long messageCount - ) - { - return new BasicGetOkBody( - deliveryTag, - redelivered, - exchange, - routingKey, - messageCount - ); - } - - public BasicGetEmptyBody createBasicGetEmptyBody( - final AMQShortString clusterId - ) - { - return new BasicGetEmptyBody( - clusterId - ); - } - - public BasicAckBody createBasicAckBody( - final long deliveryTag, - final boolean multiple - ) - { - return new BasicAckBody( - deliveryTag, - multiple - ); - } - - public BasicRejectBody createBasicRejectBody( - final long deliveryTag, - final boolean requeue - ) - { - return new BasicRejectBody( - deliveryTag, - requeue - ); - } - - public BasicRecoverBody createBasicRecoverBody( - final boolean requeue - ) - { - return new BasicRecoverBody( - requeue - ); - } - - public BasicRecoverSyncOkBody createBasicRecoverSyncOkBody( - ) - { - return new BasicRecoverSyncOkBodyImpl( - ); - } - - public BasicRecoverSyncBody createBasicRecoverSyncBody( - final boolean requeue - ) - { - return new BasicRecoverSyncBodyImpl( - requeue - ); - } - - public TxSelectBody createTxSelectBody( - ) - { - return new TxSelectBody( - ); - } - - public TxSelectOkBody createTxSelectOkBody( - ) - { - return new TxSelectOkBody( - ); - } - - public TxCommitBody createTxCommitBody( - ) - { - return new TxCommitBody( - ); - } - - public TxCommitOkBody createTxCommitOkBody( - ) - { - return new TxCommitOkBody( - ); - } - - public TxRollbackBody createTxRollbackBody( - ) - { - return new TxRollbackBody( - ); - } - - public TxRollbackOkBody createTxRollbackOkBody( - ) - { - return new TxRollbackOkBody( - ); - } - - public ProtocolVersionMethodConverter getProtocolVersionMethodConverter() - { - return _protocolVersionConverter; - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java deleted file mode 100644 index 1ecbe2c6fd..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindBodyImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class QueueUnbindBodyImpl extends AMQMethodBodyImpl implements QueueUnbindBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueUnbindBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 50; - public static final int METHOD_ID = 50; - - // Fields declared in specification - private final int _ticket; // [ticket] - private final AMQShortString _queue; // [queue] - private final AMQShortString _exchange; // [exchange] - private final AMQShortString _routingKey; // [routingKey] - private final FieldTable _arguments; // [arguments] - - // Constructor - public QueueUnbindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _ticket = readUnsignedShort( buffer ); - _queue = readAMQShortString( buffer ); - _exchange = readAMQShortString( buffer ); - _routingKey = readAMQShortString( buffer ); - _arguments = readFieldTable( buffer ); - } - - public QueueUnbindBodyImpl( - int ticket, - AMQShortString queue, - AMQShortString exchange, - AMQShortString routingKey, - FieldTable arguments - ) - { - _ticket = ticket; - _queue = queue; - _exchange = exchange; - _routingKey = routingKey; - _arguments = arguments; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getTicket() - { - return _ticket; - } - public final AMQShortString getQueue() - { - return _queue; - } - public final AMQShortString getExchange() - { - return _exchange; - } - public final AMQShortString getRoutingKey() - { - return _routingKey; - } - public final FieldTable getArguments() - { - return _arguments; - } - - protected int getBodySize() - { - int size = 2; - size += getSizeOf( _queue ); - size += getSizeOf( _exchange ); - size += getSizeOf( _routingKey ); - size += getSizeOf( _arguments ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _ticket ); - writeAMQShortString( buffer, _queue ); - writeAMQShortString( buffer, _exchange ); - writeAMQShortString( buffer, _routingKey ); - writeFieldTable( buffer, _arguments ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchQueueUnbind(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[QueueUnbindBodyImpl: "); - buf.append( "ticket=" ); - buf.append( getTicket() ); - buf.append( ", " ); - buf.append( "queue=" ); - buf.append( getQueue() ); - buf.append( ", " ); - buf.append( "exchange=" ); - buf.append( getExchange() ); - buf.append( ", " ); - buf.append( "routingKey=" ); - buf.append( getRoutingKey() ); - buf.append( ", " ); - buf.append( "arguments=" ); - buf.append( getArguments() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java deleted file mode 100644 index 24e70bd5ca..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/QueueUnbindOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-9 - */ - -package org.apache.qpid.framing.amqp_0_9; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class QueueUnbindOkBodyImpl extends AMQMethodBodyImpl implements QueueUnbindOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueUnbindOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 50; - public static final int METHOD_ID = 51; - - // Fields declared in specification - - // Constructor - public QueueUnbindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public QueueUnbindOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_9)dispatcher).dispatchQueueUnbindOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[QueueUnbindOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java deleted file mode 100644 index 595876a8e3..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncBodyImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class BasicRecoverSyncBodyImpl extends AMQMethodBodyImpl implements BasicRecoverSyncBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverSyncBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 60; - public static final int METHOD_ID = 110; - - // Fields declared in specification - private final byte _bitfield0; // [requeue] - - // Constructor - public BasicRecoverSyncBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _bitfield0 = readBitfield( buffer ); - } - - public BasicRecoverSyncBodyImpl( - boolean requeue - ) - { - byte bitfield0 = (byte)0; - if( requeue ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); - } - _bitfield0 = bitfield0; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final boolean getRequeue() - { - return (((int)(_bitfield0)) & ( 1 << 0)) != 0; - } - - protected int getBodySize() - { - int size = 1; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeBitfield( buffer, _bitfield0 ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecoverSync(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[BasicRecoverSyncBodyImpl: "); - buf.append( "requeue=" ); - buf.append( getRequeue() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java deleted file mode 100644 index da906a4a10..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/BasicRecoverSyncOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class BasicRecoverSyncOkBodyImpl extends AMQMethodBodyImpl implements BasicRecoverSyncOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverSyncOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 60; - public static final int METHOD_ID = 111; - - // Fields declared in specification - - // Constructor - public BasicRecoverSyncOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public BasicRecoverSyncOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchBasicRecoverSyncOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[BasicRecoverSyncOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java deleted file mode 100644 index b00769dc64..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ChannelOpenOkBodyImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ChannelOpenOkBodyImpl extends AMQMethodBodyImpl implements ChannelOpenOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelOpenOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 20; - public static final int METHOD_ID = 11; - - // Fields declared in specification - private final byte[] _channelId; // [channelId] - - // Constructor - public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _channelId = readBytes( buffer ); - } - - public ChannelOpenOkBodyImpl( - byte[] channelId - ) - { - _channelId = channelId; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final byte[] getChannelId() - { - return _channelId; - } - - protected int getBodySize() - { - int size = 0; - size += getSizeOf( _channelId ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeBytes( buffer, _channelId ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchChannelOpenOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: "); - buf.append( "channelId=" ); - buf.append( getChannelId() == null ? "null" : java.util.Arrays.toString( getChannelId() ) ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java deleted file mode 100644 index c63d33b48a..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseBodyImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 50; - - // Fields declared in specification - private final int _replyCode; // [replyCode] - private final AMQShortString _replyText; // [replyText] - private final int _classId; // [classId] - private final int _methodId; // [methodId] - - // Constructor - public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _replyCode = readUnsignedShort( buffer ); - _replyText = readAMQShortString( buffer ); - _classId = readUnsignedShort( buffer ); - _methodId = readUnsignedShort( buffer ); - } - - public ConnectionCloseBodyImpl( - int replyCode, - AMQShortString replyText, - int classId, - int methodId - ) - { - _replyCode = replyCode; - _replyText = replyText; - _classId = classId; - _methodId = methodId; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getReplyCode() - { - return _replyCode; - } - public final AMQShortString getReplyText() - { - return _replyText; - } - public final int getClassId() - { - return _classId; - } - public final int getMethodId() - { - return _methodId; - } - - protected int getBodySize() - { - int size = 6; - size += getSizeOf( _replyText ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _replyCode ); - writeAMQShortString( buffer, _replyText ); - writeUnsignedShort( buffer, _classId ); - writeUnsignedShort( buffer, _methodId ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionClose(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: "); - buf.append( "replyCode=" ); - buf.append( getReplyCode() ); - buf.append( ", " ); - buf.append( "replyText=" ); - buf.append( getReplyText() ); - buf.append( ", " ); - buf.append( "classId=" ); - buf.append( getClassId() ); - buf.append( ", " ); - buf.append( "methodId=" ); - buf.append( getMethodId() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java deleted file mode 100644 index 4f9c5dabde..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/ConnectionCloseOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseOkBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 51; - - // Fields declared in specification - - // Constructor - public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public ConnectionCloseOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchConnectionCloseOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java deleted file mode 100644 index d6a4a2e78a..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodConverter_0_91.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.BasicPublishBody; -import org.apache.qpid.framing.abstraction.AbstractMethodConverter; -import org.apache.qpid.framing.abstraction.MessagePublishInfo; -import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; - -public class MethodConverter_0_91 extends AbstractMethodConverter implements ProtocolVersionMethodConverter -{ - - public MethodConverter_0_91() - { - super((byte)0,(byte)9); - } - - - public MessagePublishInfo convertToInfo(AMQMethodBody methodBody) - { - final BasicPublishBody publishBody = ((BasicPublishBody) methodBody); - - final AMQShortString exchange = publishBody.getExchange(); - final AMQShortString routingKey = publishBody.getRoutingKey(); - - return new MessagePublishInfoImpl(exchange, - publishBody.getImmediate(), - publishBody.getMandatory(), - routingKey); - - } - - public AMQMethodBody convertToBody(MessagePublishInfo info) - { - - return new BasicPublishBody(0, - info.getExchange(), - info.getRoutingKey(), - info.isMandatory(), - info.isImmediate()) ; - - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java deleted file mode 100644 index 0e0b1502df..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/MethodRegistry_0_91.java +++ /dev/null @@ -1,875 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import java.io.IOException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.*; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; -import org.apache.qpid.protocol.AMQConstant; - - -public class MethodRegistry_0_91 extends MethodRegistry -{ - - private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class); - - private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_0_91(); - - private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[91][]; - - public MethodRegistry_0_91() - { - this(new ProtocolVersion((byte)0,(byte)91)); - } - - public MethodRegistry_0_91(ProtocolVersion pv) - { - super(pv); - - - - // Register method body instance factories for the Connection class. - - _factories[10] = new AMQMethodBodyInstanceFactory[52]; - - _factories[10][10] = ConnectionStartBody.getFactory(); - _factories[10][11] = ConnectionStartOkBody.getFactory(); - _factories[10][20] = ConnectionSecureBody.getFactory(); - _factories[10][21] = ConnectionSecureOkBody.getFactory(); - _factories[10][30] = ConnectionTuneBody.getFactory(); - _factories[10][31] = ConnectionTuneOkBody.getFactory(); - _factories[10][40] = ConnectionOpenBody.getFactory(); - _factories[10][41] = ConnectionOpenOkBody.getFactory(); - _factories[10][50] = ConnectionCloseBodyImpl.getFactory(); - _factories[10][51] = ConnectionCloseOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Channel class. - - _factories[20] = new AMQMethodBodyInstanceFactory[42]; - - _factories[20][10] = ChannelOpenBody.getFactory(); - _factories[20][11] = ChannelOpenOkBodyImpl.getFactory(); - _factories[20][20] = ChannelFlowBody.getFactory(); - _factories[20][21] = ChannelFlowOkBody.getFactory(); - _factories[20][40] = ChannelCloseBody.getFactory(); - _factories[20][41] = ChannelCloseOkBody.getFactory(); - - - - // Register method body instance factories for the Exchange class. - - _factories[40] = new AMQMethodBodyInstanceFactory[24]; - - _factories[40][10] = ExchangeDeclareBody.getFactory(); - _factories[40][11] = ExchangeDeclareOkBody.getFactory(); - _factories[40][20] = ExchangeDeleteBody.getFactory(); - _factories[40][21] = ExchangeDeleteOkBody.getFactory(); - _factories[40][22] = ExchangeBoundBody.getFactory(); - _factories[40][23] = ExchangeBoundOkBody.getFactory(); - - - - // Register method body instance factories for the Queue class. - - _factories[50] = new AMQMethodBodyInstanceFactory[52]; - - _factories[50][10] = QueueDeclareBody.getFactory(); - _factories[50][11] = QueueDeclareOkBody.getFactory(); - _factories[50][20] = QueueBindBody.getFactory(); - _factories[50][21] = QueueBindOkBody.getFactory(); - _factories[50][30] = QueuePurgeBody.getFactory(); - _factories[50][31] = QueuePurgeOkBody.getFactory(); - _factories[50][40] = QueueDeleteBody.getFactory(); - _factories[50][41] = QueueDeleteOkBody.getFactory(); - _factories[50][50] = QueueUnbindBodyImpl.getFactory(); - _factories[50][51] = QueueUnbindOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Basic class. - - _factories[60] = new AMQMethodBodyInstanceFactory[112]; - - _factories[60][10] = BasicQosBody.getFactory(); - _factories[60][11] = BasicQosOkBody.getFactory(); - _factories[60][20] = BasicConsumeBody.getFactory(); - _factories[60][21] = BasicConsumeOkBody.getFactory(); - _factories[60][30] = BasicCancelBody.getFactory(); - _factories[60][31] = BasicCancelOkBody.getFactory(); - _factories[60][40] = BasicPublishBody.getFactory(); - _factories[60][50] = BasicReturnBody.getFactory(); - _factories[60][60] = BasicDeliverBody.getFactory(); - _factories[60][70] = BasicGetBody.getFactory(); - _factories[60][71] = BasicGetOkBody.getFactory(); - _factories[60][72] = BasicGetEmptyBody.getFactory(); - _factories[60][80] = BasicAckBody.getFactory(); - _factories[60][90] = BasicRejectBody.getFactory(); - _factories[60][100] = BasicRecoverBody.getFactory(); - _factories[60][110] = BasicRecoverSyncBodyImpl.getFactory(); - _factories[60][111] = BasicRecoverSyncOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Tx class. - - _factories[90] = new AMQMethodBodyInstanceFactory[32]; - - _factories[90][10] = TxSelectBody.getFactory(); - _factories[90][11] = TxSelectOkBody.getFactory(); - _factories[90][20] = TxCommitBody.getFactory(); - _factories[90][21] = TxCommitOkBody.getFactory(); - _factories[90][30] = TxRollbackBody.getFactory(); - _factories[90][31] = TxRollbackOkBody.getFactory(); - } - - public AMQMethodBody convertToBody(MarkableDataInput in, long size) - throws AMQFrameDecodingException, IOException - { - int classId = in.readUnsignedShort(); - int methodId = in.readUnsignedShort(); - - AMQMethodBodyInstanceFactory bodyFactory; - try - { - bodyFactory = _factories[classId][methodId]; - } - catch(NullPointerException e) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 0-91" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - catch(IndexOutOfBoundsException e) - { - if(classId >= _factories.length) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 0-91" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - else - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 0-91" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - } - - if (bodyFactory == null) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 0-91" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - - return bodyFactory.newInstance(in, size); - } - - public int getMaxClassId() - { - return 90; - } - - public int getMaxMethodId(int classId) - { - return _factories[classId].length - 1; - } - - - - public ConnectionStartBody createConnectionStartBody( - final short versionMajor, - final short versionMinor, - final FieldTable serverProperties, - final byte[] mechanisms, - final byte[] locales - ) - { - return new ConnectionStartBody( - versionMajor, - versionMinor, - serverProperties, - mechanisms, - locales - ); - } - - public ConnectionStartOkBody createConnectionStartOkBody( - final FieldTable clientProperties, - final AMQShortString mechanism, - final byte[] response, - final AMQShortString locale - ) - { - return new ConnectionStartOkBody( - clientProperties, - mechanism, - response, - locale - ); - } - - public ConnectionSecureBody createConnectionSecureBody( - final byte[] challenge - ) - { - return new ConnectionSecureBody( - challenge - ); - } - - public ConnectionSecureOkBody createConnectionSecureOkBody( - final byte[] response - ) - { - return new ConnectionSecureOkBody( - response - ); - } - - public ConnectionTuneBody createConnectionTuneBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionTuneOkBody createConnectionTuneOkBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneOkBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionOpenBody createConnectionOpenBody( - final AMQShortString virtualHost, - final AMQShortString capabilities, - final boolean insist - ) - { - return new ConnectionOpenBody( - virtualHost, - capabilities, - insist - ); - } - - public ConnectionOpenOkBody createConnectionOpenOkBody( - final AMQShortString knownHosts - ) - { - return new ConnectionOpenOkBody( - knownHosts - ); - } - - public ConnectionCloseBody createConnectionCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ConnectionCloseBodyImpl( - replyCode, - replyText, - classId, - methodId - ); - } - - public ConnectionCloseOkBody createConnectionCloseOkBody( - ) - { - return new ConnectionCloseOkBodyImpl( - ); - } - - - - - public ChannelOpenBody createChannelOpenBody( - final AMQShortString outOfBand - ) - { - return new ChannelOpenBody( - outOfBand - ); - } - - public ChannelOpenOkBody createChannelOpenOkBody( - final byte[] channelId - ) - { - return new ChannelOpenOkBodyImpl( - channelId - ); - } - - public ChannelFlowBody createChannelFlowBody( - final boolean active - ) - { - return new ChannelFlowBody( - active - ); - } - - public ChannelFlowOkBody createChannelFlowOkBody( - final boolean active - ) - { - return new ChannelFlowOkBody( - active - ); - } - - public ChannelCloseBody createChannelCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ChannelCloseBody( - replyCode, - replyText, - classId, - methodId - ); - } - - public ChannelCloseOkBody createChannelCloseOkBody( - ) - { - return new ChannelCloseOkBody( - ); - } - - - - - public ExchangeDeclareBody createExchangeDeclareBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString type, - final boolean passive, - final boolean durable, - final boolean autoDelete, - final boolean internal, - final boolean nowait, - final FieldTable arguments - ) - { - return new ExchangeDeclareBody( - ticket, - exchange, - type, - passive, - durable, - autoDelete, - internal, - nowait, - arguments - ); - } - - public ExchangeDeclareOkBody createExchangeDeclareOkBody( - ) - { - return new ExchangeDeclareOkBody( - ); - } - - public ExchangeDeleteBody createExchangeDeleteBody( - final int ticket, - final AMQShortString exchange, - final boolean ifUnused, - final boolean nowait - ) - { - return new ExchangeDeleteBody( - ticket, - exchange, - ifUnused, - nowait - ); - } - - public ExchangeDeleteOkBody createExchangeDeleteOkBody( - ) - { - return new ExchangeDeleteOkBody( - ); - } - - public ExchangeBoundBody createExchangeBoundBody( - final AMQShortString exchange, - final AMQShortString routingKey, - final AMQShortString queue - ) - { - return new ExchangeBoundBody( - exchange, - routingKey, - queue - ); - } - - public ExchangeBoundOkBody createExchangeBoundOkBody( - final int replyCode, - final AMQShortString replyText - ) - { - return new ExchangeBoundOkBody( - replyCode, - replyText - ); - } - - - - - public QueueDeclareBody createQueueDeclareBody( - final int ticket, - final AMQShortString queue, - final boolean passive, - final boolean durable, - final boolean exclusive, - final boolean autoDelete, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueDeclareBody( - ticket, - queue, - passive, - durable, - exclusive, - autoDelete, - nowait, - arguments - ); - } - - public QueueDeclareOkBody createQueueDeclareOkBody( - final AMQShortString queue, - final long messageCount, - final long consumerCount - ) - { - return new QueueDeclareOkBody( - queue, - messageCount, - consumerCount - ); - } - - public QueueBindBody createQueueBindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueBindBody( - ticket, - queue, - exchange, - routingKey, - nowait, - arguments - ); - } - - public QueueBindOkBody createQueueBindOkBody( - ) - { - return new QueueBindOkBody( - ); - } - - public QueuePurgeBody createQueuePurgeBody( - final int ticket, - final AMQShortString queue, - final boolean nowait - ) - { - return new QueuePurgeBody( - ticket, - queue, - nowait - ); - } - - public QueuePurgeOkBody createQueuePurgeOkBody( - final long messageCount - ) - { - return new QueuePurgeOkBody( - messageCount - ); - } - - public QueueDeleteBody createQueueDeleteBody( - final int ticket, - final AMQShortString queue, - final boolean ifUnused, - final boolean ifEmpty, - final boolean nowait - ) - { - return new QueueDeleteBody( - ticket, - queue, - ifUnused, - ifEmpty, - nowait - ); - } - - public QueueDeleteOkBody createQueueDeleteOkBody( - final long messageCount - ) - { - return new QueueDeleteOkBody( - messageCount - ); - } - - public QueueUnbindBody createQueueUnbindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final FieldTable arguments - ) - { - return new QueueUnbindBodyImpl( - ticket, - queue, - exchange, - routingKey, - arguments - ); - } - - public QueueUnbindOkBody createQueueUnbindOkBody( - ) - { - return new QueueUnbindOkBodyImpl( - ); - } - - - - - public BasicQosBody createBasicQosBody( - final long prefetchSize, - final int prefetchCount, - final boolean global - ) - { - return new BasicQosBody( - prefetchSize, - prefetchCount, - global - ); - } - - public BasicQosOkBody createBasicQosOkBody( - ) - { - return new BasicQosOkBody( - ); - } - - public BasicConsumeBody createBasicConsumeBody( - final int ticket, - final AMQShortString queue, - final AMQShortString consumerTag, - final boolean noLocal, - final boolean noAck, - final boolean exclusive, - final boolean nowait, - final FieldTable arguments - ) - { - return new BasicConsumeBody( - ticket, - queue, - consumerTag, - noLocal, - noAck, - exclusive, - nowait, - arguments - ); - } - - public BasicConsumeOkBody createBasicConsumeOkBody( - final AMQShortString consumerTag - ) - { - return new BasicConsumeOkBody( - consumerTag - ); - } - - public BasicCancelBody createBasicCancelBody( - final AMQShortString consumerTag, - final boolean nowait - ) - { - return new BasicCancelBody( - consumerTag, - nowait - ); - } - - public BasicCancelOkBody createBasicCancelOkBody( - final AMQShortString consumerTag - ) - { - return new BasicCancelOkBody( - consumerTag - ); - } - - public BasicPublishBody createBasicPublishBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean mandatory, - final boolean immediate - ) - { - return new BasicPublishBody( - ticket, - exchange, - routingKey, - mandatory, - immediate - ); - } - - public BasicReturnBody createBasicReturnBody( - final int replyCode, - final AMQShortString replyText, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicReturnBody( - replyCode, - replyText, - exchange, - routingKey - ); - } - - public BasicDeliverBody createBasicDeliverBody( - final AMQShortString consumerTag, - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicDeliverBody( - consumerTag, - deliveryTag, - redelivered, - exchange, - routingKey - ); - } - - public BasicGetBody createBasicGetBody( - final int ticket, - final AMQShortString queue, - final boolean noAck - ) - { - return new BasicGetBody( - ticket, - queue, - noAck - ); - } - - public BasicGetOkBody createBasicGetOkBody( - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey, - final long messageCount - ) - { - return new BasicGetOkBody( - deliveryTag, - redelivered, - exchange, - routingKey, - messageCount - ); - } - - public BasicGetEmptyBody createBasicGetEmptyBody( - final AMQShortString clusterId - ) - { - return new BasicGetEmptyBody( - clusterId - ); - } - - public BasicAckBody createBasicAckBody( - final long deliveryTag, - final boolean multiple - ) - { - return new BasicAckBody( - deliveryTag, - multiple - ); - } - - public BasicRejectBody createBasicRejectBody( - final long deliveryTag, - final boolean requeue - ) - { - return new BasicRejectBody( - deliveryTag, - requeue - ); - } - - public BasicRecoverBody createBasicRecoverBody( - final boolean requeue - ) - { - return new BasicRecoverBody( - requeue - ); - } - - public BasicRecoverSyncBody createBasicRecoverSyncBody( - final boolean requeue - ) - { - return new BasicRecoverSyncBodyImpl( - requeue - ); - } - - public BasicRecoverSyncOkBody createBasicRecoverSyncOkBody( - ) - { - return new BasicRecoverSyncOkBodyImpl( - ); - } - - - - - public TxSelectBody createTxSelectBody( - ) - { - return new TxSelectBody( - ); - } - - public TxSelectOkBody createTxSelectOkBody( - ) - { - return new TxSelectOkBody( - ); - } - - public TxCommitBody createTxCommitBody( - ) - { - return new TxCommitBody( - ); - } - - public TxCommitOkBody createTxCommitOkBody( - ) - { - return new TxCommitOkBody( - ); - } - - public TxRollbackBody createTxRollbackBody( - ) - { - return new TxRollbackBody( - ); - } - - public TxRollbackOkBody createTxRollbackOkBody( - ) - { - return new TxRollbackOkBody( - ); - } - - - - public ProtocolVersionMethodConverter getProtocolVersionMethodConverter() - { - return _protocolVersionConverter; - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java deleted file mode 100644 index 6a64e59d24..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindBodyImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class QueueUnbindBodyImpl extends AMQMethodBodyImpl implements QueueUnbindBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueUnbindBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 50; - public static final int METHOD_ID = 50; - - // Fields declared in specification - private final int _ticket; // [ticket] - private final AMQShortString _queue; // [queue] - private final AMQShortString _exchange; // [exchange] - private final AMQShortString _routingKey; // [routingKey] - private final FieldTable _arguments; // [arguments] - - // Constructor - public QueueUnbindBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _ticket = readUnsignedShort( buffer ); - _queue = readAMQShortString( buffer ); - _exchange = readAMQShortString( buffer ); - _routingKey = readAMQShortString( buffer ); - _arguments = readFieldTable( buffer ); - } - - public QueueUnbindBodyImpl( - int ticket, - AMQShortString queue, - AMQShortString exchange, - AMQShortString routingKey, - FieldTable arguments - ) - { - _ticket = ticket; - _queue = queue; - _exchange = exchange; - _routingKey = routingKey; - _arguments = arguments; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getTicket() - { - return _ticket; - } - public final AMQShortString getQueue() - { - return _queue; - } - public final AMQShortString getExchange() - { - return _exchange; - } - public final AMQShortString getRoutingKey() - { - return _routingKey; - } - public final FieldTable getArguments() - { - return _arguments; - } - - protected int getBodySize() - { - int size = 2; - size += getSizeOf( _queue ); - size += getSizeOf( _exchange ); - size += getSizeOf( _routingKey ); - size += getSizeOf( _arguments ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _ticket ); - writeAMQShortString( buffer, _queue ); - writeAMQShortString( buffer, _exchange ); - writeAMQShortString( buffer, _routingKey ); - writeFieldTable( buffer, _arguments ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchQueueUnbind(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[QueueUnbindBodyImpl: "); - buf.append( "ticket=" ); - buf.append( getTicket() ); - buf.append( ", " ); - buf.append( "queue=" ); - buf.append( getQueue() ); - buf.append( ", " ); - buf.append( "exchange=" ); - buf.append( getExchange() ); - buf.append( ", " ); - buf.append( "routingKey=" ); - buf.append( getRoutingKey() ); - buf.append( ", " ); - buf.append( "arguments=" ); - buf.append( getArguments() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java deleted file mode 100644 index 6efd2fd596..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_0_91/QueueUnbindOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 0-91 - */ - -package org.apache.qpid.framing.amqp_0_91; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class QueueUnbindOkBodyImpl extends AMQMethodBodyImpl implements QueueUnbindOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new QueueUnbindOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 50; - public static final int METHOD_ID = 51; - - // Fields declared in specification - - // Constructor - public QueueUnbindOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public QueueUnbindOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_0_91)dispatcher).dispatchQueueUnbindOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[QueueUnbindOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java deleted file mode 100644 index 8f1f6ffab6..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestBodyImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.AMQFrameDecodingException; -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQMethodBodyImpl; -import org.apache.qpid.framing.AMQMethodBodyInstanceFactory; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.AccessRequestBody; -import org.apache.qpid.framing.MethodDispatcher; - -public class AccessRequestBodyImpl extends AMQMethodBodyImpl implements AccessRequestBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new AccessRequestBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 30; - public static final int METHOD_ID = 10; - - // Fields declared in specification - private final AMQShortString _realm; // [realm] - private final byte _bitfield0; // [exclusive, passive, active, write, read] - - // Constructor - public AccessRequestBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _realm = readAMQShortString( buffer ); - _bitfield0 = readBitfield( buffer ); - } - - public AccessRequestBodyImpl( - AMQShortString realm, - boolean exclusive, - boolean passive, - boolean active, - boolean write, - boolean read - ) - { - _realm = realm; - byte bitfield0 = (byte)0; - if( exclusive ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 0)); - } - - if( passive ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 1)); - } - - if( active ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 2)); - } - - if( write ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 3)); - } - - if( read ) - { - bitfield0 = (byte) (((int) bitfield0) | (1 << 4)); - } - _bitfield0 = bitfield0; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final AMQShortString getRealm() - { - return _realm; - } - public final boolean getExclusive() - { - return (((int)(_bitfield0)) & ( 1 << 0)) != 0; - } - public final boolean getPassive() - { - return (((int)(_bitfield0)) & ( 1 << 1)) != 0; - } - public final boolean getActive() - { - return (((int)(_bitfield0)) & ( 1 << 2)) != 0; - } - public final boolean getWrite() - { - return (((int)(_bitfield0)) & ( 1 << 3)) != 0; - } - public final boolean getRead() - { - return (((int)(_bitfield0)) & ( 1 << 4)) != 0; - } - - protected int getBodySize() - { - int size = 1; - size += getSizeOf( _realm ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeAMQShortString( buffer, _realm ); - writeBitfield( buffer, _bitfield0 ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchAccessRequest(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[AccessRequestBodyImpl: "); - buf.append( "realm=" ); - buf.append( getRealm() ); - buf.append( ", " ); - buf.append( "exclusive=" ); - buf.append( getExclusive() ); - buf.append( ", " ); - buf.append( "passive=" ); - buf.append( getPassive() ); - buf.append( ", " ); - buf.append( "active=" ); - buf.append( getActive() ); - buf.append( ", " ); - buf.append( "write=" ); - buf.append( getWrite() ); - buf.append( ", " ); - buf.append( "read=" ); - buf.append( getRead() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java deleted file mode 100644 index 6f28c88015..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AccessRequestOkBodyImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class AccessRequestOkBodyImpl extends AMQMethodBodyImpl implements AccessRequestOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new AccessRequestOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 30; - public static final int METHOD_ID = 11; - - // Fields declared in specification - private final int _ticket; // [ticket] - - // Constructor - public AccessRequestOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _ticket = readUnsignedShort( buffer ); - } - - public AccessRequestOkBodyImpl( - int ticket - ) - { - _ticket = ticket; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getTicket() - { - return _ticket; - } - - protected int getBodySize() - { - int size = 2; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _ticket ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchAccessRequestOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[AccessRequestOkBodyImpl: "); - buf.append( "ticket=" ); - buf.append( getTicket() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java deleted file mode 100644 index 28b13920b7..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/BasicRecoverOkBodyImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.AMQException; -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.AMQFrameDecodingException; -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQMethodBodyImpl; -import org.apache.qpid.framing.AMQMethodBodyInstanceFactory; -import org.apache.qpid.framing.BasicRecoverOkBody; -import org.apache.qpid.framing.MethodDispatcher; - -public class BasicRecoverOkBodyImpl extends AMQMethodBodyImpl implements BasicRecoverOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new BasicRecoverOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 60; - public static final int METHOD_ID = 101; - - // Fields declared in specification - - // Constructor - public BasicRecoverOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public BasicRecoverOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchBasicRecoverOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[BasicRecoverOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java deleted file mode 100644 index 14f4515ff4..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelAlertBodyImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ChannelAlertBodyImpl extends AMQMethodBodyImpl implements ChannelAlertBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelAlertBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 20; - public static final int METHOD_ID = 30; - - // Fields declared in specification - private final int _replyCode; // [replyCode] - private final AMQShortString _replyText; // [replyText] - private final FieldTable _details; // [details] - - // Constructor - public ChannelAlertBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _replyCode = readUnsignedShort( buffer ); - _replyText = readAMQShortString( buffer ); - _details = readFieldTable( buffer ); - } - - public ChannelAlertBodyImpl( - int replyCode, - AMQShortString replyText, - FieldTable details - ) - { - _replyCode = replyCode; - _replyText = replyText; - _details = details; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getReplyCode() - { - return _replyCode; - } - public final AMQShortString getReplyText() - { - return _replyText; - } - public final FieldTable getDetails() - { - return _details; - } - - protected int getBodySize() - { - int size = 2; - size += getSizeOf( _replyText ); - size += getSizeOf( _details ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _replyCode ); - writeAMQShortString( buffer, _replyText ); - writeFieldTable( buffer, _details ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchChannelAlert(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ChannelAlertBodyImpl: "); - buf.append( "replyCode=" ); - buf.append( getReplyCode() ); - buf.append( ", " ); - buf.append( "replyText=" ); - buf.append( getReplyText() ); - buf.append( ", " ); - buf.append( "details=" ); - buf.append( getDetails() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java deleted file mode 100644 index 991c682c9d..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ChannelOpenOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ChannelOpenOkBodyImpl extends AMQMethodBodyImpl implements ChannelOpenOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ChannelOpenOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 20; - public static final int METHOD_ID = 11; - - // Fields declared in specification - - // Constructor - public ChannelOpenOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public ChannelOpenOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchChannelOpenOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ChannelOpenOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java index bcc43a6987..7274e4c3bd 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java +++ b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ClientMethodDispatcher_8_0.java @@ -34,7 +34,6 @@ public interface ClientMethodDispatcher_8_0 extends ClientMethodDispatcher { public boolean dispatchAccessRequestOk(AccessRequestOkBody body, int channelId) throws AMQException; - public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException; public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException; public boolean dispatchConnectionRedirect(ConnectionRedirectBody body, int channelId) throws AMQException; diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java deleted file mode 100644 index 4d6ba149a6..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseBodyImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 60; - - // Fields declared in specification - private final int _replyCode; // [replyCode] - private final AMQShortString _replyText; // [replyText] - private final int _classId; // [classId] - private final int _methodId; // [methodId] - - // Constructor - public ConnectionCloseBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _replyCode = readUnsignedShort( buffer ); - _replyText = readAMQShortString( buffer ); - _classId = readUnsignedShort( buffer ); - _methodId = readUnsignedShort( buffer ); - } - - public ConnectionCloseBodyImpl( - int replyCode, - AMQShortString replyText, - int classId, - int methodId - ) - { - _replyCode = replyCode; - _replyText = replyText; - _classId = classId; - _methodId = methodId; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final int getReplyCode() - { - return _replyCode; - } - public final AMQShortString getReplyText() - { - return _replyText; - } - public final int getClassId() - { - return _classId; - } - public final int getMethodId() - { - return _methodId; - } - - protected int getBodySize() - { - int size = 6; - size += getSizeOf( _replyText ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeUnsignedShort( buffer, _replyCode ); - writeAMQShortString( buffer, _replyText ); - writeUnsignedShort( buffer, _classId ); - writeUnsignedShort( buffer, _methodId ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionClose(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseBodyImpl: "); - buf.append( "replyCode=" ); - buf.append( getReplyCode() ); - buf.append( ", " ); - buf.append( "replyText=" ); - buf.append( getReplyText() ); - buf.append( ", " ); - buf.append( "classId=" ); - buf.append( getClassId() ); - buf.append( ", " ); - buf.append( "methodId=" ); - buf.append( getMethodId() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java deleted file mode 100644 index 97154c7f94..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionCloseOkBodyImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionCloseOkBodyImpl extends AMQMethodBodyImpl implements ConnectionCloseOkBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionCloseOkBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 61; - - // Fields declared in specification - - // Constructor - public ConnectionCloseOkBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - } - - public ConnectionCloseOkBodyImpl( - ) - { - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - - protected int getBodySize() - { - int size = 0; - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionCloseOk(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionCloseOkBodyImpl: "); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java deleted file mode 100644 index 19ff78dee4..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/ConnectionRedirectBodyImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.codec.MarkableDataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.qpid.framing.*; -import org.apache.qpid.AMQException; - -public class ConnectionRedirectBodyImpl extends AMQMethodBodyImpl implements ConnectionRedirectBody -{ - private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() - { - public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException - { - return new ConnectionRedirectBodyImpl(in); - } - }; - - public static AMQMethodBodyInstanceFactory getFactory() - { - return FACTORY_INSTANCE; - } - - public static final int CLASS_ID = 10; - public static final int METHOD_ID = 50; - - // Fields declared in specification - private final AMQShortString _host; // [host] - private final AMQShortString _knownHosts; // [knownHosts] - - // Constructor - public ConnectionRedirectBodyImpl(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException - { - _host = readAMQShortString( buffer ); - _knownHosts = readAMQShortString( buffer ); - } - - public ConnectionRedirectBodyImpl( - AMQShortString host, - AMQShortString knownHosts - ) - { - _host = host; - _knownHosts = knownHosts; - } - - public int getClazz() - { - return CLASS_ID; - } - - public int getMethod() - { - return METHOD_ID; - } - - public final AMQShortString getHost() - { - return _host; - } - public final AMQShortString getKnownHosts() - { - return _knownHosts; - } - - protected int getBodySize() - { - int size = 0; - size += getSizeOf( _host ); - size += getSizeOf( _knownHosts ); - return size; - } - - public void writeMethodPayload(DataOutput buffer) throws IOException - { - writeAMQShortString( buffer, _host ); - writeAMQShortString( buffer, _knownHosts ); - } - - public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException - { - return ((MethodDispatcher_8_0)dispatcher).dispatchConnectionRedirect(this, channelId); - } - - public String toString() - { - StringBuilder buf = new StringBuilder("[ConnectionRedirectBodyImpl: "); - buf.append( "host=" ); - buf.append( getHost() ); - buf.append( ", " ); - buf.append( "knownHosts=" ); - buf.append( getKnownHosts() ); - buf.append("]"); - return buf.toString(); - } - -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java deleted file mode 100644 index 2432160001..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.framing.amqp_8_0; - -import org.apache.qpid.framing.AMQMethodBody; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.BasicPublishBody; -import org.apache.qpid.framing.abstraction.AbstractMethodConverter; -import org.apache.qpid.framing.abstraction.MessagePublishInfo; -import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; - -public class MethodConverter_8_0 extends AbstractMethodConverter implements ProtocolVersionMethodConverter -{ - public MethodConverter_8_0() - { - super((byte)8,(byte)0); - } - - - public MessagePublishInfo convertToInfo(AMQMethodBody methodBody) - { - final BasicPublishBody publishBody = ((BasicPublishBody) methodBody); - - final AMQShortString exchange = publishBody.getExchange(); - final AMQShortString routingKey = publishBody.getRoutingKey(); - - return new MessagePublishInfoImpl(exchange == null ? null : exchange.intern(), - publishBody.getImmediate(), - publishBody.getMandatory(), - routingKey == null ? null : routingKey.intern(false)); - - } - - public AMQMethodBody convertToBody(MessagePublishInfo info) - { - - return new BasicPublishBody(0, - info.getExchange(), - info.getRoutingKey(), - info.isMandatory(), - info.isImmediate()) ; - - } -} diff --git a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java b/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java deleted file mode 100644 index b075b84c55..0000000000 --- a/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodRegistry_8_0.java +++ /dev/null @@ -1,904 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/* - * This file is auto-generated by Qpid Gentools v.0.1 - do not modify. - * Supported AMQP version: - * 8-0 - */ - -package org.apache.qpid.framing.amqp_8_0; - -import java.io.IOException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.qpid.codec.MarkableDataInput; -import org.apache.qpid.framing.*; -import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter; -import org.apache.qpid.protocol.AMQConstant; - - -public class MethodRegistry_8_0 extends MethodRegistry -{ - - private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class); - - private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_8_0(); - - private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[91][]; - - public MethodRegistry_8_0() - { - this(new ProtocolVersion((byte)8,(byte)0)); - } - - public MethodRegistry_8_0(ProtocolVersion pv) - { - super(pv); - - - - // Register method body instance factories for the Connection class. - - _factories[10] = new AMQMethodBodyInstanceFactory[62]; - - _factories[10][10] = ConnectionStartBody.getFactory(); - _factories[10][11] = ConnectionStartOkBody.getFactory(); - _factories[10][20] = ConnectionSecureBody.getFactory(); - _factories[10][21] = ConnectionSecureOkBody.getFactory(); - _factories[10][30] = ConnectionTuneBody.getFactory(); - _factories[10][31] = ConnectionTuneOkBody.getFactory(); - _factories[10][40] = ConnectionOpenBody.getFactory(); - _factories[10][41] = ConnectionOpenOkBody.getFactory(); - _factories[10][50] = ConnectionRedirectBodyImpl.getFactory(); - _factories[10][60] = ConnectionCloseBodyImpl.getFactory(); - _factories[10][61] = ConnectionCloseOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Channel class. - - _factories[20] = new AMQMethodBodyInstanceFactory[42]; - - _factories[20][10] = ChannelOpenBody.getFactory(); - _factories[20][11] = ChannelOpenOkBodyImpl.getFactory(); - _factories[20][20] = ChannelFlowBody.getFactory(); - _factories[20][21] = ChannelFlowOkBody.getFactory(); - _factories[20][30] = ChannelAlertBodyImpl.getFactory(); - _factories[20][40] = ChannelCloseBody.getFactory(); - _factories[20][41] = ChannelCloseOkBody.getFactory(); - - - - // Register method body instance factories for the Access class. - - _factories[30] = new AMQMethodBodyInstanceFactory[12]; - - _factories[30][10] = AccessRequestBodyImpl.getFactory(); - _factories[30][11] = AccessRequestOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Exchange class. - - _factories[40] = new AMQMethodBodyInstanceFactory[24]; - - _factories[40][10] = ExchangeDeclareBody.getFactory(); - _factories[40][11] = ExchangeDeclareOkBody.getFactory(); - _factories[40][20] = ExchangeDeleteBody.getFactory(); - _factories[40][21] = ExchangeDeleteOkBody.getFactory(); - _factories[40][22] = ExchangeBoundBody.getFactory(); - _factories[40][23] = ExchangeBoundOkBody.getFactory(); - - - - // Register method body instance factories for the Queue class. - - _factories[50] = new AMQMethodBodyInstanceFactory[42]; - - _factories[50][10] = QueueDeclareBody.getFactory(); - _factories[50][11] = QueueDeclareOkBody.getFactory(); - _factories[50][20] = QueueBindBody.getFactory(); - _factories[50][21] = QueueBindOkBody.getFactory(); - _factories[50][30] = QueuePurgeBody.getFactory(); - _factories[50][31] = QueuePurgeOkBody.getFactory(); - _factories[50][40] = QueueDeleteBody.getFactory(); - _factories[50][41] = QueueDeleteOkBody.getFactory(); - - - - // Register method body instance factories for the Basic class. - - _factories[60] = new AMQMethodBodyInstanceFactory[102]; - - _factories[60][10] = BasicQosBody.getFactory(); - _factories[60][11] = BasicQosOkBody.getFactory(); - _factories[60][20] = BasicConsumeBody.getFactory(); - _factories[60][21] = BasicConsumeOkBody.getFactory(); - _factories[60][30] = BasicCancelBody.getFactory(); - _factories[60][31] = BasicCancelOkBody.getFactory(); - _factories[60][40] = BasicPublishBody.getFactory(); - _factories[60][50] = BasicReturnBody.getFactory(); - _factories[60][60] = BasicDeliverBody.getFactory(); - _factories[60][70] = BasicGetBody.getFactory(); - _factories[60][71] = BasicGetOkBody.getFactory(); - _factories[60][72] = BasicGetEmptyBody.getFactory(); - _factories[60][80] = BasicAckBody.getFactory(); - _factories[60][90] = BasicRejectBody.getFactory(); - _factories[60][100] = BasicRecoverBody.getFactory(); - _factories[60][101] = BasicRecoverOkBodyImpl.getFactory(); - - - - // Register method body instance factories for the Tx class. - - _factories[90] = new AMQMethodBodyInstanceFactory[32]; - - _factories[90][10] = TxSelectBody.getFactory(); - _factories[90][11] = TxSelectOkBody.getFactory(); - _factories[90][20] = TxCommitBody.getFactory(); - _factories[90][21] = TxCommitOkBody.getFactory(); - _factories[90][30] = TxRollbackBody.getFactory(); - _factories[90][31] = TxRollbackOkBody.getFactory(); - - } - - public AMQMethodBody convertToBody(MarkableDataInput in, long size) - throws AMQFrameDecodingException, IOException - { - int classId = in.readUnsignedShort(); - int methodId = in.readUnsignedShort(); - - AMQMethodBodyInstanceFactory bodyFactory; - try - { - bodyFactory = _factories[classId][methodId]; - } - catch(NullPointerException e) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 8-0" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - catch(IndexOutOfBoundsException e) - { - if(classId >= _factories.length) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Class " + classId + " unknown in AMQP version 8-0" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - else - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 8-0" - + " (while trying to decode class " + classId + " method " + methodId + "."); - - } - } - - if (bodyFactory == null) - { - throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID, - "Method " + methodId + " unknown in AMQP version 8-0" - + " (while trying to decode class " + classId + " method " + methodId + "."); - } - - return bodyFactory.newInstance(in, size); - } - - public int getMaxClassId() - { - return 120; - } - - public int getMaxMethodId(int classId) - { - return _factories[classId].length - 1; - } - - - - public ConnectionStartBody createConnectionStartBody( - final short versionMajor, - final short versionMinor, - final FieldTable serverProperties, - final byte[] mechanisms, - final byte[] locales - ) - { - return new ConnectionStartBody( - versionMajor, - versionMinor, - serverProperties, - mechanisms, - locales - ); - } - - public ConnectionStartOkBody createConnectionStartOkBody( - final FieldTable clientProperties, - final AMQShortString mechanism, - final byte[] response, - final AMQShortString locale - ) - { - return new ConnectionStartOkBody( - clientProperties, - mechanism, - response, - locale - ); - } - - public ConnectionSecureBody createConnectionSecureBody( - final byte[] challenge - ) - { - return new ConnectionSecureBody( - challenge - ); - } - - public ConnectionSecureOkBody createConnectionSecureOkBody( - final byte[] response - ) - { - return new ConnectionSecureOkBody( - response - ); - } - - public ConnectionTuneBody createConnectionTuneBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionTuneOkBody createConnectionTuneOkBody( - final int channelMax, - final long frameMax, - final int heartbeat - ) - { - return new ConnectionTuneOkBody( - channelMax, - frameMax, - heartbeat - ); - } - - public ConnectionOpenBody createConnectionOpenBody( - final AMQShortString virtualHost, - final AMQShortString capabilities, - final boolean insist - ) - { - return new ConnectionOpenBody( - virtualHost, - capabilities, - insist - ); - } - - public ConnectionOpenOkBody createConnectionOpenOkBody( - final AMQShortString knownHosts - ) - { - return new ConnectionOpenOkBody( - knownHosts - ); - } - - public ConnectionRedirectBody createConnectionRedirectBody( - final AMQShortString host, - final AMQShortString knownHosts - ) - { - return new ConnectionRedirectBodyImpl( - host, - knownHosts - ); - } - - public ConnectionCloseBody createConnectionCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ConnectionCloseBodyImpl( - replyCode, - replyText, - classId, - methodId - ); - } - - public ConnectionCloseOkBody createConnectionCloseOkBody( - ) - { - return new ConnectionCloseOkBodyImpl( - ); - } - - - - - public ChannelOpenBody createChannelOpenBody( - final AMQShortString outOfBand - ) - { - return new ChannelOpenBody( - outOfBand - ); - } - - public ChannelOpenOkBody createChannelOpenOkBody( - ) - { - return new ChannelOpenOkBodyImpl( - ); - } - - public ChannelFlowBody createChannelFlowBody( - final boolean active - ) - { - return new ChannelFlowBody( - active - ); - } - - public ChannelFlowOkBody createChannelFlowOkBody( - final boolean active - ) - { - return new ChannelFlowOkBody( - active - ); - } - - public ChannelAlertBody createChannelAlertBody( - final int replyCode, - final AMQShortString replyText, - final FieldTable details - ) - { - return new ChannelAlertBodyImpl( - replyCode, - replyText, - details - ); - } - - public ChannelCloseBody createChannelCloseBody( - final int replyCode, - final AMQShortString replyText, - final int classId, - final int methodId - ) - { - return new ChannelCloseBody( - replyCode, - replyText, - classId, - methodId - ); - } - - public ChannelCloseOkBody createChannelCloseOkBody( - ) - { - return new ChannelCloseOkBody( - ); - } - - - - - public AccessRequestBody createAccessRequestBody( - final AMQShortString realm, - final boolean exclusive, - final boolean passive, - final boolean active, - final boolean write, - final boolean read - ) - { - return new AccessRequestBodyImpl( - realm, - exclusive, - passive, - active, - write, - read - ); - } - - public AccessRequestOkBody createAccessRequestOkBody( - final int ticket - ) - { - return new AccessRequestOkBodyImpl( - ticket - ); - } - - - - - public ExchangeDeclareBody createExchangeDeclareBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString type, - final boolean passive, - final boolean durable, - final boolean autoDelete, - final boolean internal, - final boolean nowait, - final FieldTable arguments - ) - { - return new ExchangeDeclareBody( - ticket, - exchange, - type, - passive, - durable, - autoDelete, - internal, - nowait, - arguments - ); - } - - public ExchangeDeclareOkBody createExchangeDeclareOkBody( - ) - { - return new ExchangeDeclareOkBody( - ); - } - - public ExchangeDeleteBody createExchangeDeleteBody( - final int ticket, - final AMQShortString exchange, - final boolean ifUnused, - final boolean nowait - ) - { - return new ExchangeDeleteBody( - ticket, - exchange, - ifUnused, - nowait - ); - } - - public ExchangeDeleteOkBody createExchangeDeleteOkBody( - ) - { - return new ExchangeDeleteOkBody( - ); - } - - public ExchangeBoundBody createExchangeBoundBody( - final AMQShortString exchange, - final AMQShortString routingKey, - final AMQShortString queue - ) - { - return new ExchangeBoundBody( - exchange, - routingKey, - queue - ); - } - - public ExchangeBoundOkBody createExchangeBoundOkBody( - final int replyCode, - final AMQShortString replyText - ) - { - return new ExchangeBoundOkBody( - replyCode, - replyText - ); - } - - - - - public QueueDeclareBody createQueueDeclareBody( - final int ticket, - final AMQShortString queue, - final boolean passive, - final boolean durable, - final boolean exclusive, - final boolean autoDelete, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueDeclareBody( - ticket, - queue, - passive, - durable, - exclusive, - autoDelete, - nowait, - arguments - ); - } - - public QueueDeclareOkBody createQueueDeclareOkBody( - final AMQShortString queue, - final long messageCount, - final long consumerCount - ) - { - return new QueueDeclareOkBody( - queue, - messageCount, - consumerCount - ); - } - - public QueueBindBody createQueueBindBody( - final int ticket, - final AMQShortString queue, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean nowait, - final FieldTable arguments - ) - { - return new QueueBindBody( - ticket, - queue, - exchange, - routingKey, - nowait, - arguments - ); - } - - public QueueBindOkBody createQueueBindOkBody( - ) - { - return new QueueBindOkBody( - ); - } - - public QueuePurgeBody createQueuePurgeBody( - final int ticket, - final AMQShortString queue, - final boolean nowait - ) - { - return new QueuePurgeBody( - ticket, - queue, - nowait - ); - } - - public QueuePurgeOkBody createQueuePurgeOkBody( - final long messageCount - ) - { - return new QueuePurgeOkBody( - messageCount - ); - } - - public QueueDeleteBody createQueueDeleteBody( - final int ticket, - final AMQShortString queue, - final boolean ifUnused, - final boolean ifEmpty, - final boolean nowait - ) - { - return new QueueDeleteBody( - ticket, - queue, - ifUnused, - ifEmpty, - nowait - ); - } - - public QueueDeleteOkBody createQueueDeleteOkBody( - final long messageCount - ) - { - return new QueueDeleteOkBody( - messageCount - ); - } - - - - - public BasicQosBody createBasicQosBody( - final long prefetchSize, - final int prefetchCount, - final boolean global - ) - { - return new BasicQosBody( - prefetchSize, - prefetchCount, - global - ); - } - - public BasicQosOkBody createBasicQosOkBody( - ) - { - return new BasicQosOkBody( - ); - } - - public BasicConsumeBody createBasicConsumeBody( - final int ticket, - final AMQShortString queue, - final AMQShortString consumerTag, - final boolean noLocal, - final boolean noAck, - final boolean exclusive, - final boolean nowait, - final FieldTable arguments - ) - { - return new BasicConsumeBody( - ticket, - queue, - consumerTag, - noLocal, - noAck, - exclusive, - nowait, - arguments - ); - } - - public BasicConsumeOkBody createBasicConsumeOkBody( - final AMQShortString consumerTag - ) - { - return new BasicConsumeOkBody( - consumerTag - ); - } - - public BasicCancelBody createBasicCancelBody( - final AMQShortString consumerTag, - final boolean nowait - ) - { - return new BasicCancelBody( - consumerTag, - nowait - ); - } - - public BasicCancelOkBody createBasicCancelOkBody( - final AMQShortString consumerTag - ) - { - return new BasicCancelOkBody( - consumerTag - ); - } - - public BasicPublishBody createBasicPublishBody( - final int ticket, - final AMQShortString exchange, - final AMQShortString routingKey, - final boolean mandatory, - final boolean immediate - ) - { - return new BasicPublishBody( - ticket, - exchange, - routingKey, - mandatory, - immediate - ); - } - - public BasicReturnBody createBasicReturnBody( - final int replyCode, - final AMQShortString replyText, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicReturnBody( - replyCode, - replyText, - exchange, - routingKey - ); - } - - public BasicDeliverBody createBasicDeliverBody( - final AMQShortString consumerTag, - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey - ) - { - return new BasicDeliverBody( - consumerTag, - deliveryTag, - redelivered, - exchange, - routingKey - ); - } - - public BasicGetBody createBasicGetBody( - final int ticket, - final AMQShortString queue, - final boolean noAck - ) - { - return new BasicGetBody( - ticket, - queue, - noAck - ); - } - - public BasicGetOkBody createBasicGetOkBody( - final long deliveryTag, - final boolean redelivered, - final AMQShortString exchange, - final AMQShortString routingKey, - final long messageCount - ) - { - return new BasicGetOkBody( - deliveryTag, - redelivered, - exchange, - routingKey, - messageCount - ); - } - - public BasicGetEmptyBody createBasicGetEmptyBody( - final AMQShortString clusterId - ) - { - return new BasicGetEmptyBody( - clusterId - ); - } - - public BasicAckBody createBasicAckBody( - final long deliveryTag, - final boolean multiple - ) - { - return new BasicAckBody( - deliveryTag, - multiple - ); - } - - public BasicRejectBody createBasicRejectBody( - final long deliveryTag, - final boolean requeue - ) - { - return new BasicRejectBody( - deliveryTag, - requeue - ); - } - - public BasicRecoverBody createBasicRecoverBody( - final boolean requeue - ) - { - return new BasicRecoverBody( - requeue - ); - } - - public BasicRecoverOkBody createBasicRecoverOkBody( - ) - { - return new BasicRecoverOkBodyImpl( - ); - } - - - public TxSelectBody createTxSelectBody( - ) - { - return new TxSelectBody( - ); - } - - public TxSelectOkBody createTxSelectOkBody( - ) - { - return new TxSelectOkBody( - ); - } - - public TxCommitBody createTxCommitBody( - ) - { - return new TxCommitBody( - ); - } - - public TxCommitOkBody createTxCommitOkBody( - ) - { - return new TxCommitOkBody( - ); - } - - public TxRollbackBody createTxRollbackBody( - ) - { - return new TxRollbackBody( - ); - } - - public TxRollbackOkBody createTxRollbackOkBody( - ) - { - return new TxRollbackOkBody( - ); - } - - - - - - public ProtocolVersionMethodConverter getProtocolVersionMethodConverter() - { - return _protocolVersionConverter; - } - -} diff --git a/java/systests/src/test/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java b/java/systests/src/test/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java index edffa7c0c0..d8a1427875 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java +++ b/java/systests/src/test/java/org/apache/qpid/server/logging/ExchangeLoggingTest.java @@ -20,14 +20,8 @@ */ package org.apache.qpid.server.logging; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.client.AMQSession_0_10; -import org.apache.qpid.framing.AMQFrame; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.framing.ExchangeDeleteBody; -import org.apache.qpid.framing.ExchangeDeleteOkBody; -import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0; +import java.io.IOException; +import java.util.List; import javax.jms.Connection; import javax.jms.JMSException; @@ -35,8 +29,15 @@ import javax.jms.MessageProducer; import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; -import java.io.IOException; -import java.util.List; + +import org.apache.qpid.client.AMQConnection; +import org.apache.qpid.client.AMQSession; +import org.apache.qpid.client.AMQSession_0_10; +import org.apache.qpid.framing.AMQFrame; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.framing.ExchangeDeleteBody; +import org.apache.qpid.framing.ExchangeDeleteOkBody; +import org.apache.qpid.framing.MethodRegistry; /** * Exchange @@ -191,7 +192,7 @@ public class ExchangeLoggingTest extends AbstractTestLogging } else { - MethodRegistry_8_0 registry = new MethodRegistry_8_0(); + MethodRegistry registry = MethodRegistry.registry_8_0; ExchangeDeleteBody body = registry.createExchangeDeleteBody(0, new AMQShortString(_name), false, true); diff --git a/java/systests/src/test/java/org/apache/qpid/transport/MaxFrameSizeTest.java b/java/systests/src/test/java/org/apache/qpid/transport/MaxFrameSizeTest.java index 639f53e0b6..32396158e5 100644 --- a/java/systests/src/test/java/org/apache/qpid/transport/MaxFrameSizeTest.java +++ b/java/systests/src/test/java/org/apache/qpid/transport/MaxFrameSizeTest.java @@ -54,7 +54,7 @@ import org.apache.qpid.framing.ConnectionCloseBody; import org.apache.qpid.framing.ConnectionStartOkBody; import org.apache.qpid.framing.ConnectionTuneOkBody; import org.apache.qpid.framing.FieldTable; -import org.apache.qpid.framing.amqp_0_91.MethodRegistry_0_91; +import org.apache.qpid.framing.MethodRegistry; import org.apache.qpid.jms.BrokerDetails; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Broker; @@ -238,7 +238,7 @@ public class MaxFrameSizeTest extends QpidBrokerTestCase byte[] serverData = baos.toByteArray(); ByteArrayDataInput badi = new ByteArrayDataInput(serverData); AMQDataBlockDecoder datablockDecoder = new AMQDataBlockDecoder(); - final MethodRegistry_0_91 methodRegistry_0_91 = new MethodRegistry_0_91(); + final MethodRegistry methodRegistry_0_91 = MethodRegistry.registry_0_91; BodyFactory methodBodyFactory = new BodyFactory() { @Override |