You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2013/09/29 19:45:25 UTC
svn commit: r1527366 [24/29] - in /qpid/trunk/qpid/java:
broker-core/src/main/java/org/apache/qpid/server/logging/messages/
common/src/main/java/org/apache/qpid/filter/selector/
common/src/main/java/org/apache/qpid/framing/ common/src/main/java/org/apa...
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionTuneOk.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ConnectionTuneOk extends Method {
+
+ public static final int TYPE = 262;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return true;
+ }
+
+ private short packing_flags = 0;
+ private int channelMax;
+ private int maxFrameSize;
+ private int heartbeat;
+
+
+ public ConnectionTuneOk() {}
+
+
+ public ConnectionTuneOk(int channelMax, int maxFrameSize, int heartbeat, Option ... _options) {
+ setChannelMax(channelMax);
+ setMaxFrameSize(maxFrameSize);
+ setHeartbeat(heartbeat);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.connectionTuneOk(context, this);
+ }
+
+
+ public final boolean hasChannelMax() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ConnectionTuneOk clearChannelMax() {
+ packing_flags &= ~256;
+ this.channelMax = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getChannelMax() {
+ return channelMax;
+ }
+
+ public final ConnectionTuneOk setChannelMax(int value) {
+ this.channelMax = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk channelMax(int value) {
+ return setChannelMax(value);
+ }
+
+ public final boolean hasMaxFrameSize() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ConnectionTuneOk clearMaxFrameSize() {
+ packing_flags &= ~512;
+ this.maxFrameSize = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getMaxFrameSize() {
+ return maxFrameSize;
+ }
+
+ public final ConnectionTuneOk setMaxFrameSize(int value) {
+ this.maxFrameSize = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk maxFrameSize(int value) {
+ return setMaxFrameSize(value);
+ }
+
+ public final boolean hasHeartbeat() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ConnectionTuneOk clearHeartbeat() {
+ packing_flags &= ~1024;
+ this.heartbeat = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getHeartbeat() {
+ return heartbeat;
+ }
+
+ public final ConnectionTuneOk setHeartbeat(int value) {
+ this.heartbeat = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ConnectionTuneOk heartbeat(int value) {
+ return setHeartbeat(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeUint16(this.channelMax);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint16(this.maxFrameSize);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeUint16(this.heartbeat);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.channelMax = dec.readUint16();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.maxFrameSize = dec.readUint16();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.heartbeat = dec.readUint16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("channelMax", getChannelMax());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("maxFrameSize", getMaxFrameSize());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("heartbeat", getHeartbeat());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Constant.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,29 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+
+
+public interface Constant
+{
+ public static final int MIN_MAX_FRAME_SIZE = 4096;
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DeliveryProperties.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,593 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+
+
+public final class DeliveryProperties extends Struct {
+
+ public static final int TYPE = 1025;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 4;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private MessageDeliveryPriority priority;
+ private MessageDeliveryMode deliveryMode;
+ private long ttl;
+ private long timestamp;
+ private long expiration;
+ private String exchange;
+ private String routingKey;
+ private String resumeId;
+ private long resumeTtl;
+
+
+ public DeliveryProperties() {}
+
+
+ public DeliveryProperties(MessageDeliveryPriority priority, MessageDeliveryMode deliveryMode, long ttl, long timestamp, long expiration, String exchange, String routingKey, String resumeId, long resumeTtl, Option ... _options) {
+ if(priority != null) {
+ setPriority(priority);
+ }
+ if(deliveryMode != null) {
+ setDeliveryMode(deliveryMode);
+ }
+ setTtl(ttl);
+ setTimestamp(timestamp);
+ setExpiration(expiration);
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(routingKey != null) {
+ setRoutingKey(routingKey);
+ }
+ if(resumeId != null) {
+ setResumeId(resumeId);
+ }
+ setResumeTtl(resumeTtl);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case DISCARD_UNROUTABLE: packing_flags |= 256; break;
+ case IMMEDIATE: packing_flags |= 512; break;
+ case REDELIVERED: packing_flags |= 1024; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasDiscardUnroutable() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DeliveryProperties clearDiscardUnroutable() {
+ packing_flags &= ~256;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDiscardUnroutable() {
+ return hasDiscardUnroutable();
+ }
+
+ public final DeliveryProperties setDiscardUnroutable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 256;
+ }
+ else
+ {
+ packing_flags &= ~256;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties discardUnroutable(boolean value) {
+ return setDiscardUnroutable(value);
+ }
+
+ public final boolean hasImmediate() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DeliveryProperties clearImmediate() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getImmediate() {
+ return hasImmediate();
+ }
+
+ public final DeliveryProperties setImmediate(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties immediate(boolean value) {
+ return setImmediate(value);
+ }
+
+ public final boolean hasRedelivered() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DeliveryProperties clearRedelivered() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getRedelivered() {
+ return hasRedelivered();
+ }
+
+ public final DeliveryProperties setRedelivered(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties redelivered(boolean value) {
+ return setRedelivered(value);
+ }
+
+ public final boolean hasPriority() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final DeliveryProperties clearPriority() {
+ packing_flags &= ~2048;
+ this.priority = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageDeliveryPriority getPriority() {
+ return priority;
+ }
+
+ public final DeliveryProperties setPriority(MessageDeliveryPriority value) {
+ this.priority = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties priority(MessageDeliveryPriority value) {
+ return setPriority(value);
+ }
+
+ public final boolean hasDeliveryMode() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final DeliveryProperties clearDeliveryMode() {
+ packing_flags &= ~4096;
+ this.deliveryMode = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final MessageDeliveryMode getDeliveryMode() {
+ return deliveryMode;
+ }
+
+ public final DeliveryProperties setDeliveryMode(MessageDeliveryMode value) {
+ this.deliveryMode = value;
+ packing_flags |= 4096;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties deliveryMode(MessageDeliveryMode value) {
+ return setDeliveryMode(value);
+ }
+
+ public final boolean hasTtl() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final DeliveryProperties clearTtl() {
+ packing_flags &= ~8192;
+ this.ttl = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTtl() {
+ return ttl;
+ }
+
+ public final DeliveryProperties setTtl(long value) {
+ this.ttl = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties ttl(long value) {
+ return setTtl(value);
+ }
+
+ public final boolean hasTimestamp() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final DeliveryProperties clearTimestamp() {
+ packing_flags &= ~16384;
+ this.timestamp = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimestamp() {
+ return timestamp;
+ }
+
+ public final DeliveryProperties setTimestamp(long value) {
+ this.timestamp = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties timestamp(long value) {
+ return setTimestamp(value);
+ }
+
+ public final boolean hasExpiration() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final DeliveryProperties clearExpiration() {
+ packing_flags &= ~32768;
+ this.expiration = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getExpiration() {
+ return expiration;
+ }
+
+ public final DeliveryProperties setExpiration(long value) {
+ this.expiration = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties expiration(long value) {
+ return setExpiration(value);
+ }
+
+ public final boolean hasExchange() {
+ return (packing_flags & 1) != 0;
+ }
+
+ public final DeliveryProperties clearExchange() {
+ packing_flags &= ~1;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final DeliveryProperties setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 1;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasRoutingKey() {
+ return (packing_flags & 2) != 0;
+ }
+
+ public final DeliveryProperties clearRoutingKey() {
+ packing_flags &= ~2;
+ this.routingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getRoutingKey() {
+ return routingKey;
+ }
+
+ public final DeliveryProperties setRoutingKey(String value) {
+ this.routingKey = value;
+ packing_flags |= 2;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties routingKey(String value) {
+ return setRoutingKey(value);
+ }
+
+ public final boolean hasResumeId() {
+ return (packing_flags & 4) != 0;
+ }
+
+ public final DeliveryProperties clearResumeId() {
+ packing_flags &= ~4;
+ this.resumeId = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getResumeId() {
+ return resumeId;
+ }
+
+ public final DeliveryProperties setResumeId(String value) {
+ this.resumeId = value;
+ packing_flags |= 4;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties resumeId(String value) {
+ return setResumeId(value);
+ }
+
+ public final boolean hasResumeTtl() {
+ return (packing_flags & 8) != 0;
+ }
+
+ public final DeliveryProperties clearResumeTtl() {
+ packing_flags &= ~8;
+ this.resumeTtl = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getResumeTtl() {
+ return resumeTtl;
+ }
+
+ public final DeliveryProperties setResumeTtl(long value) {
+ this.resumeTtl = value;
+ packing_flags |= 8;
+ setDirty(true);
+ return this;
+ }
+
+ public final DeliveryProperties resumeTtl(long value) {
+ return setResumeTtl(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeUint8(this.priority.getValue());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ enc.writeUint8(this.deliveryMode.getValue());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeUint64(this.ttl);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeDatetime(this.timestamp);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeDatetime(this.expiration);
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ enc.writeStr8(this.routingKey);
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ enc.writeStr16(this.resumeId);
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ enc.writeUint64(this.resumeTtl);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 2048) != 0)
+ {
+ this.priority = MessageDeliveryPriority.get(dec.readUint8());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ this.deliveryMode = MessageDeliveryMode.get(dec.readUint8());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.ttl = dec.readUint64();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.timestamp = dec.readDatetime();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.expiration = dec.readDatetime();
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ this.routingKey = dec.readStr8();
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ this.resumeId = dec.readStr16();
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ this.resumeTtl = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("discardUnroutable", getDiscardUnroutable());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("immediate", getImmediate());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("redelivered", getRedelivered());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("priority", getPriority());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("deliveryMode", getDeliveryMode());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("ttl", getTtl());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("timestamp", getTimestamp());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("expiration", getExpiration());
+ }
+ if ((packing_flags & 1) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 2) != 0)
+ {
+ result.put("routingKey", getRoutingKey());
+ }
+ if ((packing_flags & 4) != 0)
+ {
+ result.put("resumeId", getResumeId());
+ }
+ if ((packing_flags & 8) != 0)
+ {
+ result.put("resumeTtl", getResumeTtl());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxCommit.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,193 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxCommit extends Method {
+
+ public static final int TYPE = 1540;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxCommit() {}
+
+
+ public DtxCommit(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case ONE_PHASE: packing_flags |= 512; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxCommit(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxCommit clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxCommit setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxCommit xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasOnePhase() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxCommit clearOnePhase() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getOnePhase() {
+ return hasOnePhase();
+ }
+
+ public final DtxCommit setOnePhase(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxCommit onePhase(boolean value) {
+ return setOnePhase(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("onePhase", getOnePhase());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxEnd.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxEnd extends Method {
+
+ public static final int TYPE = 1539;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxEnd() {}
+
+
+ public DtxEnd(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case FAIL: packing_flags |= 512; break;
+ case SUSPEND: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxEnd(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxEnd clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxEnd setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasFail() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxEnd clearFail() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getFail() {
+ return hasFail();
+ }
+
+ public final DtxEnd setFail(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd fail(boolean value) {
+ return setFail(value);
+ }
+
+ public final boolean hasSuspend() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DtxEnd clearSuspend() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getSuspend() {
+ return hasSuspend();
+ }
+
+ public final DtxEnd setSuspend(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxEnd suspend(boolean value) {
+ return setSuspend(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("fail", getFail());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("suspend", getSuspend());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxForget.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxForget extends Method {
+
+ public static final int TYPE = 1541;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxForget() {}
+
+
+ public DtxForget(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxForget(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxForget clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxForget setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxForget xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxGetTimeout.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxGetTimeout extends Method {
+
+ public static final int TYPE = 1542;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxGetTimeout() {}
+
+
+ public DtxGetTimeout(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxGetTimeout(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxGetTimeout clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxGetTimeout setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxGetTimeout xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxPrepare.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxPrepare extends Method {
+
+ public static final int TYPE = 1543;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxPrepare() {}
+
+
+ public DtxPrepare(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxPrepare(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxPrepare clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxPrepare setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxPrepare xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRecover.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxRecover extends Method {
+
+ public static final int TYPE = 1544;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public DtxRecover(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxRecover(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxRollback.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,154 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxRollback extends Method {
+
+ public static final int TYPE = 1545;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxRollback() {}
+
+
+ public DtxRollback(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxRollback(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxRollback clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxRollback setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxRollback xid(Xid value) {
+ return setXid(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSelect.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,111 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxSelect extends Method {
+
+ public static final int TYPE = 1537;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+
+
+
+
+ public DtxSelect(Option ... _options) {
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxSelect(context, this);
+ }
+
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxSetTimeout.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,194 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxSetTimeout extends Method {
+
+ public static final int TYPE = 1546;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+ private long timeout;
+
+
+ public DtxSetTimeout() {}
+
+
+ public DtxSetTimeout(Xid xid, long timeout, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+ setTimeout(timeout);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxSetTimeout(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxSetTimeout clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxSetTimeout setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxSetTimeout xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasTimeout() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxSetTimeout clearTimeout() {
+ packing_flags &= ~512;
+ this.timeout = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getTimeout() {
+ return timeout;
+ }
+
+ public final DtxSetTimeout setTimeout(long value) {
+ this.timeout = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxSetTimeout timeout(long value) {
+ return setTimeout(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint32(this.timeout);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.timeout = dec.readUint32();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("timeout", getTimeout());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxStart.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,232 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class DtxStart extends Method {
+
+ public static final int TYPE = 1538;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private Xid xid;
+
+
+ public DtxStart() {}
+
+
+ public DtxStart(Xid xid, Option ... _options) {
+ if(xid != null) {
+ setXid(xid);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case JOIN: packing_flags |= 512; break;
+ case RESUME: packing_flags |= 1024; break;
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.dtxStart(context, this);
+ }
+
+
+ public final boolean hasXid() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final DtxStart clearXid() {
+ packing_flags &= ~256;
+ this.xid = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Xid getXid() {
+ return xid;
+ }
+
+ public final DtxStart setXid(Xid value) {
+ this.xid = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart xid(Xid value) {
+ return setXid(value);
+ }
+
+ public final boolean hasJoin() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final DtxStart clearJoin() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getJoin() {
+ return hasJoin();
+ }
+
+ public final DtxStart setJoin(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart join(boolean value) {
+ return setJoin(value);
+ }
+
+ public final boolean hasResume() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final DtxStart clearResume() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getResume() {
+ return hasResume();
+ }
+
+ public final DtxStart setResume(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final DtxStart resume(boolean value) {
+ return setResume(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStruct(Xid.TYPE, this.xid);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.xid = (Xid)dec.readStruct(Xid.TYPE);
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("xid", getXid());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("join", getJoin());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("resume", getResume());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/DtxXaStatus.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,62 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+public enum DtxXaStatus {
+
+ XA_OK((int) 0),
+ XA_RBROLLBACK((int) 1),
+ XA_RBTIMEOUT((int) 2),
+ XA_HEURHAZ((int) 3),
+ XA_HEURCOM((int) 4),
+ XA_HEURRB((int) 5),
+ XA_HEURMIX((int) 6),
+ XA_RDONLY((int) 7);
+
+ private final int value;
+
+ DtxXaStatus(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public static DtxXaStatus get(int value)
+ {
+ switch (value)
+ {
+ case (int) 0: return XA_OK;
+ case (int) 1: return XA_RBROLLBACK;
+ case (int) 2: return XA_RBTIMEOUT;
+ case (int) 3: return XA_HEURHAZ;
+ case (int) 4: return XA_HEURCOM;
+ case (int) 5: return XA_HEURRB;
+ case (int) 6: return XA_HEURMIX;
+ case (int) 7: return XA_RDONLY;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBind.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,280 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeBind extends Method {
+
+ public static final int TYPE = 1796;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String queue;
+ private String exchange;
+ private String bindingKey;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeBind() {}
+
+
+ public ExchangeBind(String queue, String exchange, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(bindingKey != null) {
+ setBindingKey(bindingKey);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeBind(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeBind clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final ExchangeBind setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeBind clearExchange() {
+ packing_flags &= ~512;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeBind setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasBindingKey() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeBind clearBindingKey() {
+ packing_flags &= ~1024;
+ this.bindingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getBindingKey() {
+ return bindingKey;
+ }
+
+ public final ExchangeBind setBindingKey(String value) {
+ this.bindingKey = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind bindingKey(String value) {
+ return setBindingKey(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeBind clearArguments() {
+ packing_flags &= ~2048;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeBind setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBind arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.bindingKey);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.bindingKey = dec.readStr8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("bindingKey", getBindingKey());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ExchangeBound.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,280 @@
+package org.apache.qpid.transport;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.qpid.transport.codec.Decoder;
+import org.apache.qpid.transport.codec.Encoder;
+
+import org.apache.qpid.transport.network.Frame;
+
+
+public final class ExchangeBound extends Method {
+
+ public static final int TYPE = 1798;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 2;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return Frame.L4;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private String exchange;
+ private String queue;
+ private String bindingKey;
+ private Map<String,Object> arguments;
+
+
+ public ExchangeBound() {}
+
+
+ public ExchangeBound(String exchange, String queue, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(bindingKey != null) {
+ setBindingKey(bindingKey);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case SYNC: this.setSync(true); break;
+ case BATCH: this.setBatch(true); break;
+ case UNRELIABLE: this.setUnreliable(true); break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+ public <C> void dispatch(C context, MethodDelegate<C> delegate) {
+ delegate.exchangeBound(context, this);
+ }
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ExchangeBound clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ExchangeBound setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasQueue() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ExchangeBound clearQueue() {
+ packing_flags &= ~512;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final ExchangeBound setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasBindingKey() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final ExchangeBound clearBindingKey() {
+ packing_flags &= ~1024;
+ this.bindingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getBindingKey() {
+ return bindingKey;
+ }
+
+ public final ExchangeBound setBindingKey(String value) {
+ this.bindingKey = value;
+ packing_flags |= 1024;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound bindingKey(String value) {
+ return setBindingKey(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final ExchangeBound clearArguments() {
+ packing_flags &= ~2048;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final ExchangeBound setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 2048;
+ setDirty(true);
+ return this;
+ }
+
+ public final ExchangeBound arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.exchange);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ enc.writeStr8(this.bindingKey);
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.exchange = dec.readStr8();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ this.bindingKey = dec.readStr8();
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("exchange", getExchange());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("bindingKey", getBindingKey());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org