summaryrefslogtreecommitdiff
path: root/java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java')
-rw-r--r--java/common/src/main/java/org/apache/qpid/framing/ConnectionTuneBody.java110
1 files changed, 102 insertions, 8 deletions
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 82a1b2f04b..cc5618db27 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
@@ -22,19 +22,113 @@
/*
* 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 ConnectionTuneBody extends EncodableAMQDataBlock, AMQMethodBody
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.qpid.AMQException;
+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;
+
+ // Fields declared in specification
+ private final int _channelMax; // [channelMax]
+ private final long _frameMax; // [frameMax]
+ private final int _heartbeat; // [heartbeat]
+
+ // Constructor
+ public ConnectionTuneBody(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException
+ {
+ _channelMax = readUnsignedShort( buffer );
+ _frameMax = readUnsignedInteger( buffer );
+ _heartbeat = readUnsignedShort( buffer );
+ }
+
+ public ConnectionTuneBody(
+ int channelMax,
+ long frameMax,
+ int heartbeat
+ )
+ {
+ _channelMax = channelMax;
+ _frameMax = frameMax;
+ _heartbeat = heartbeat;
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+ public final int getChannelMax()
+ {
+ return _channelMax;
+ }
+ public final long getFrameMax()
+ {
+ return _frameMax;
+ }
+ public final int getHeartbeat()
+ {
+ return _heartbeat;
+ }
+
+ protected int getBodySize()
+ {
+ int size = 8;
+ return size;
+ }
+
+ public void writeMethodPayload(DataOutput buffer) throws IOException
+ {
+ writeUnsignedShort( buffer, _channelMax );
+ writeUnsignedInteger( buffer, _frameMax );
+ writeUnsignedShort( buffer, _heartbeat );
+ }
- public int getChannelMax();
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+ return dispatcher.dispatchConnectionTune(this, channelId);
+ }
- public long getFrameMax();
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[ConnectionTuneBodyImpl: ");
+ buf.append( "channelMax=" );
+ buf.append( getChannelMax() );
+ buf.append( ", " );
+ buf.append( "frameMax=" );
+ buf.append( getFrameMax() );
+ buf.append( ", " );
+ buf.append( "heartbeat=" );
+ buf.append( getHeartbeat() );
+ buf.append("]");
+ return buf.toString();
+ }
- public int getHeartbeat();
}