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 [27/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/MethodDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/MethodDelegate.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,217 @@
+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 abstract class MethodDelegate<C> {
+
+ public abstract void handle(C context, Method method);
+
+ public void connectionStart(C context, ConnectionStart method) {
+ handle(context, method);
+ }
+ public void connectionStartOk(C context, ConnectionStartOk method) {
+ handle(context, method);
+ }
+ public void connectionSecure(C context, ConnectionSecure method) {
+ handle(context, method);
+ }
+ public void connectionSecureOk(C context, ConnectionSecureOk method) {
+ handle(context, method);
+ }
+ public void connectionTune(C context, ConnectionTune method) {
+ handle(context, method);
+ }
+ public void connectionTuneOk(C context, ConnectionTuneOk method) {
+ handle(context, method);
+ }
+ public void connectionOpen(C context, ConnectionOpen method) {
+ handle(context, method);
+ }
+ public void connectionOpenOk(C context, ConnectionOpenOk method) {
+ handle(context, method);
+ }
+ public void connectionRedirect(C context, ConnectionRedirect method) {
+ handle(context, method);
+ }
+ public void connectionHeartbeat(C context, ConnectionHeartbeat method) {
+ handle(context, method);
+ }
+ public void connectionClose(C context, ConnectionClose method) {
+ handle(context, method);
+ }
+ public void connectionCloseOk(C context, ConnectionCloseOk method) {
+ handle(context, method);
+ }
+ public void sessionAttach(C context, SessionAttach method) {
+ handle(context, method);
+ }
+ public void sessionAttached(C context, SessionAttached method) {
+ handle(context, method);
+ }
+ public void sessionDetach(C context, SessionDetach method) {
+ handle(context, method);
+ }
+ public void sessionDetached(C context, SessionDetached method) {
+ handle(context, method);
+ }
+ public void sessionRequestTimeout(C context, SessionRequestTimeout method) {
+ handle(context, method);
+ }
+ public void sessionTimeout(C context, SessionTimeout method) {
+ handle(context, method);
+ }
+ public void sessionCommandPoint(C context, SessionCommandPoint method) {
+ handle(context, method);
+ }
+ public void sessionExpected(C context, SessionExpected method) {
+ handle(context, method);
+ }
+ public void sessionConfirmed(C context, SessionConfirmed method) {
+ handle(context, method);
+ }
+ public void sessionCompleted(C context, SessionCompleted method) {
+ handle(context, method);
+ }
+ public void sessionKnownCompleted(C context, SessionKnownCompleted method) {
+ handle(context, method);
+ }
+ public void sessionFlush(C context, SessionFlush method) {
+ handle(context, method);
+ }
+ public void sessionGap(C context, SessionGap method) {
+ handle(context, method);
+ }
+ public void executionSync(C context, ExecutionSync method) {
+ handle(context, method);
+ }
+ public void executionResult(C context, ExecutionResult method) {
+ handle(context, method);
+ }
+ public void executionException(C context, ExecutionException method) {
+ handle(context, method);
+ }
+ public void messageTransfer(C context, MessageTransfer method) {
+ handle(context, method);
+ }
+ public void messageAccept(C context, MessageAccept method) {
+ handle(context, method);
+ }
+ public void messageReject(C context, MessageReject method) {
+ handle(context, method);
+ }
+ public void messageRelease(C context, MessageRelease method) {
+ handle(context, method);
+ }
+ public void messageAcquire(C context, MessageAcquire method) {
+ handle(context, method);
+ }
+ public void messageResume(C context, MessageResume method) {
+ handle(context, method);
+ }
+ public void messageSubscribe(C context, MessageSubscribe method) {
+ handle(context, method);
+ }
+ public void messageCancel(C context, MessageCancel method) {
+ handle(context, method);
+ }
+ public void messageSetFlowMode(C context, MessageSetFlowMode method) {
+ handle(context, method);
+ }
+ public void messageFlow(C context, MessageFlow method) {
+ handle(context, method);
+ }
+ public void messageFlush(C context, MessageFlush method) {
+ handle(context, method);
+ }
+ public void messageStop(C context, MessageStop method) {
+ handle(context, method);
+ }
+ public void txSelect(C context, TxSelect method) {
+ handle(context, method);
+ }
+ public void txCommit(C context, TxCommit method) {
+ handle(context, method);
+ }
+ public void txRollback(C context, TxRollback method) {
+ handle(context, method);
+ }
+ public void dtxSelect(C context, DtxSelect method) {
+ handle(context, method);
+ }
+ public void dtxStart(C context, DtxStart method) {
+ handle(context, method);
+ }
+ public void dtxEnd(C context, DtxEnd method) {
+ handle(context, method);
+ }
+ public void dtxCommit(C context, DtxCommit method) {
+ handle(context, method);
+ }
+ public void dtxForget(C context, DtxForget method) {
+ handle(context, method);
+ }
+ public void dtxGetTimeout(C context, DtxGetTimeout method) {
+ handle(context, method);
+ }
+ public void dtxPrepare(C context, DtxPrepare method) {
+ handle(context, method);
+ }
+ public void dtxRecover(C context, DtxRecover method) {
+ handle(context, method);
+ }
+ public void dtxRollback(C context, DtxRollback method) {
+ handle(context, method);
+ }
+ public void dtxSetTimeout(C context, DtxSetTimeout method) {
+ handle(context, method);
+ }
+ public void exchangeDeclare(C context, ExchangeDeclare method) {
+ handle(context, method);
+ }
+ public void exchangeDelete(C context, ExchangeDelete method) {
+ handle(context, method);
+ }
+ public void exchangeQuery(C context, ExchangeQuery method) {
+ handle(context, method);
+ }
+ public void exchangeBind(C context, ExchangeBind method) {
+ handle(context, method);
+ }
+ public void exchangeUnbind(C context, ExchangeUnbind method) {
+ handle(context, method);
+ }
+ public void exchangeBound(C context, ExchangeBound method) {
+ handle(context, method);
+ }
+ public void queueDeclare(C context, QueueDeclare method) {
+ handle(context, method);
+ }
+ public void queueDelete(C context, QueueDelete method) {
+ handle(context, method);
+ }
+ public void queuePurge(C context, QueuePurge method) {
+ handle(context, method);
+ }
+ public void queueQuery(C context, QueueQuery method) {
+ handle(context, method);
+ }
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Option.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,60 @@
+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 Option {
+
+ SYNC,
+ DISCARD_UNROUTABLE,
+ IMMEDIATE,
+ REDELIVERED,
+ FIRST,
+ LAST,
+ DURABLE,
+ NOT_FOUND,
+ EXCHANGE_NOT_FOUND,
+ QUEUE_NOT_FOUND,
+ QUEUE_NOT_MATCHED,
+ KEY_NOT_MATCHED,
+ ARGS_NOT_MATCHED,
+ EXCLUSIVE,
+ AUTO_DELETE,
+ INSIST,
+ FORCE,
+ TIMELY_REPLY,
+ EXPECTED,
+ CONFIRMED,
+ COMPLETED,
+ SET_REDELIVERED,
+ JOIN,
+ RESUME,
+ FAIL,
+ SUSPEND,
+ ONE_PHASE,
+ PASSIVE,
+ IF_UNUSED,
+ IF_EMPTY,
+
+ BATCH,
+ UNRELIABLE,
+ NONE
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDeclare.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,394 @@
+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 QueueDeclare extends Method {
+
+ public static final int TYPE = 2049;
+
+ 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 alternateExchange;
+ private Map<String,Object> arguments;
+
+
+ public QueueDeclare() {}
+
+
+ public QueueDeclare(String queue, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(alternateExchange != null) {
+ setAlternateExchange(alternateExchange);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case PASSIVE: packing_flags |= 1024; break;
+ case DURABLE: packing_flags |= 2048; break;
+ case EXCLUSIVE: packing_flags |= 4096; break;
+ case AUTO_DELETE: packing_flags |= 8192; 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.queueDeclare(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueDeclare clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueDeclare setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasAlternateExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueDeclare clearAlternateExchange() {
+ packing_flags &= ~512;
+ this.alternateExchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getAlternateExchange() {
+ return alternateExchange;
+ }
+
+ public final QueueDeclare setAlternateExchange(String value) {
+ this.alternateExchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare alternateExchange(String value) {
+ return setAlternateExchange(value);
+ }
+
+ public final boolean hasPassive() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueDeclare clearPassive() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getPassive() {
+ return hasPassive();
+ }
+
+ public final QueueDeclare setPassive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare passive(boolean value) {
+ return setPassive(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final QueueDeclare clearDurable() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final QueueDeclare setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasExclusive() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final QueueDeclare clearExclusive() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExclusive() {
+ return hasExclusive();
+ }
+
+ public final QueueDeclare setExclusive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare exclusive(boolean value) {
+ return setExclusive(value);
+ }
+
+ public final boolean hasAutoDelete() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final QueueDeclare clearAutoDelete() {
+ packing_flags &= ~8192;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getAutoDelete() {
+ return hasAutoDelete();
+ }
+
+ public final QueueDeclare setAutoDelete(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 8192;
+ }
+ else
+ {
+ packing_flags &= ~8192;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare autoDelete(boolean value) {
+ return setAutoDelete(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final QueueDeclare clearArguments() {
+ packing_flags &= ~16384;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final QueueDeclare setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDeclare 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.alternateExchange);
+ }
+ if ((packing_flags & 16384) != 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.alternateExchange = dec.readStr8();
+ }
+ if ((packing_flags & 16384) != 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("alternateExchange", getAlternateExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("passive", getPassive());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("exclusive", getExclusive());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("autoDelete", getAutoDelete());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueDelete.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 QueueDelete extends Method {
+
+ public static final int TYPE = 2050;
+
+ 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;
+
+
+ public QueueDelete() {}
+
+
+ public QueueDelete(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case IF_UNUSED: packing_flags |= 512; break;
+ case IF_EMPTY: 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.queueDelete(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueDelete clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueDelete setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasIfUnused() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueDelete clearIfUnused() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getIfUnused() {
+ return hasIfUnused();
+ }
+
+ public final QueueDelete setIfUnused(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete ifUnused(boolean value) {
+ return setIfUnused(value);
+ }
+
+ public final boolean hasIfEmpty() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueDelete clearIfEmpty() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getIfEmpty() {
+ return hasIfEmpty();
+ }
+
+ public final QueueDelete setIfEmpty(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueDelete ifEmpty(boolean value) {
+ return setIfEmpty(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ 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("ifUnused", getIfUnused());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("ifEmpty", getIfEmpty());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueuePurge.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 QueuePurge extends Method {
+
+ public static final int TYPE = 2051;
+
+ 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;
+
+
+ public QueuePurge() {}
+
+
+ public QueuePurge(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ 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.queuePurge(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueuePurge clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueuePurge setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueuePurge queue(String value) {
+ return setQueue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQuery.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 QueueQuery extends Method {
+
+ public static final int TYPE = 2052;
+
+ 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;
+
+
+ public QueueQuery() {}
+
+
+ public QueueQuery(String queue, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+
+ 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.queueQuery(context, this);
+ }
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueQuery clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueQuery setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQuery queue(String value) {
+ return setQueue(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeStr8(this.queue);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.queue = dec.readStr8();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("queue", getQueue());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/QueueQueryResult.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,429 @@
+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 QueueQueryResult extends Struct {
+
+ public static final int TYPE = 2049;
+
+ 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 String queue;
+ private String alternateExchange;
+ private Map<String,Object> arguments;
+ private long messageCount;
+ private long subscriberCount;
+
+
+ public QueueQueryResult() {}
+
+
+ public QueueQueryResult(String queue, String alternateExchange, Map<String,Object> arguments, long messageCount, long subscriberCount, Option ... _options) {
+ if(queue != null) {
+ setQueue(queue);
+ }
+ if(alternateExchange != null) {
+ setAlternateExchange(alternateExchange);
+ }
+ if(arguments != null) {
+ setArguments(arguments);
+ }
+ setMessageCount(messageCount);
+ setSubscriberCount(subscriberCount);
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case DURABLE: packing_flags |= 1024; break;
+ case EXCLUSIVE: packing_flags |= 2048; break;
+ case AUTO_DELETE: packing_flags |= 4096; break;
+ case NONE: break;
+ default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+ }
+ }
+
+ }
+
+
+
+
+ public final boolean hasQueue() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final QueueQueryResult clearQueue() {
+ packing_flags &= ~256;
+ this.queue = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getQueue() {
+ return queue;
+ }
+
+ public final QueueQueryResult setQueue(String value) {
+ this.queue = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult queue(String value) {
+ return setQueue(value);
+ }
+
+ public final boolean hasAlternateExchange() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final QueueQueryResult clearAlternateExchange() {
+ packing_flags &= ~512;
+ this.alternateExchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getAlternateExchange() {
+ return alternateExchange;
+ }
+
+ public final QueueQueryResult setAlternateExchange(String value) {
+ this.alternateExchange = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult alternateExchange(String value) {
+ return setAlternateExchange(value);
+ }
+
+ public final boolean hasDurable() {
+ return (packing_flags & 1024) != 0;
+ }
+
+ public final QueueQueryResult clearDurable() {
+ packing_flags &= ~1024;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getDurable() {
+ return hasDurable();
+ }
+
+ public final QueueQueryResult setDurable(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 1024;
+ }
+ else
+ {
+ packing_flags &= ~1024;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult durable(boolean value) {
+ return setDurable(value);
+ }
+
+ public final boolean hasExclusive() {
+ return (packing_flags & 2048) != 0;
+ }
+
+ public final QueueQueryResult clearExclusive() {
+ packing_flags &= ~2048;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getExclusive() {
+ return hasExclusive();
+ }
+
+ public final QueueQueryResult setExclusive(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 2048;
+ }
+ else
+ {
+ packing_flags &= ~2048;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult exclusive(boolean value) {
+ return setExclusive(value);
+ }
+
+ public final boolean hasAutoDelete() {
+ return (packing_flags & 4096) != 0;
+ }
+
+ public final QueueQueryResult clearAutoDelete() {
+ packing_flags &= ~4096;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getAutoDelete() {
+ return hasAutoDelete();
+ }
+
+ public final QueueQueryResult setAutoDelete(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 4096;
+ }
+ else
+ {
+ packing_flags &= ~4096;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult autoDelete(boolean value) {
+ return setAutoDelete(value);
+ }
+
+ public final boolean hasArguments() {
+ return (packing_flags & 8192) != 0;
+ }
+
+ public final QueueQueryResult clearArguments() {
+ packing_flags &= ~8192;
+ this.arguments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final Map<String,Object> getArguments() {
+ return arguments;
+ }
+
+ public final QueueQueryResult setArguments(Map<String,Object> value) {
+ this.arguments = value;
+ packing_flags |= 8192;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult arguments(Map<String,Object> value) {
+ return setArguments(value);
+ }
+
+ public final boolean hasMessageCount() {
+ return (packing_flags & 16384) != 0;
+ }
+
+ public final QueueQueryResult clearMessageCount() {
+ packing_flags &= ~16384;
+ this.messageCount = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getMessageCount() {
+ return messageCount;
+ }
+
+ public final QueueQueryResult setMessageCount(long value) {
+ this.messageCount = value;
+ packing_flags |= 16384;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult messageCount(long value) {
+ return setMessageCount(value);
+ }
+
+ public final boolean hasSubscriberCount() {
+ return (packing_flags & 32768) != 0;
+ }
+
+ public final QueueQueryResult clearSubscriberCount() {
+ packing_flags &= ~32768;
+ this.subscriberCount = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getSubscriberCount() {
+ return subscriberCount;
+ }
+
+ public final QueueQueryResult setSubscriberCount(long value) {
+ this.subscriberCount = value;
+ packing_flags |= 32768;
+ setDirty(true);
+ return this;
+ }
+
+ public final QueueQueryResult subscriberCount(long value) {
+ return setSubscriberCount(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.alternateExchange);
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ enc.writeMap(this.arguments);
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ enc.writeUint32(this.messageCount);
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ enc.writeUint32(this.subscriberCount);
+ }
+
+ }
+
+ 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.alternateExchange = dec.readStr8();
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ this.arguments = dec.readMap();
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ this.messageCount = dec.readUint32();
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ this.subscriberCount = dec.readUint32();
+ }
+
+ }
+
+ 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("alternateExchange", getAlternateExchange());
+ }
+ if ((packing_flags & 1024) != 0)
+ {
+ result.put("durable", getDurable());
+ }
+ if ((packing_flags & 2048) != 0)
+ {
+ result.put("exclusive", getExclusive());
+ }
+ if ((packing_flags & 4096) != 0)
+ {
+ result.put("autoDelete", getAutoDelete());
+ }
+ if ((packing_flags & 8192) != 0)
+ {
+ result.put("arguments", getArguments());
+ }
+ if ((packing_flags & 16384) != 0)
+ {
+ result.put("messageCount", getMessageCount());
+ }
+ if ((packing_flags & 32768) != 0)
+ {
+ result.put("subscriberCount", getSubscriberCount());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/RecoverResult.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,141 @@
+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 RecoverResult extends Struct {
+
+ public static final int TYPE = 1539;
+
+ 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 java.util.List<Object> inDoubt;
+
+
+ public RecoverResult() {}
+
+
+ public RecoverResult(java.util.List<Object> inDoubt) {
+ if(inDoubt != null) {
+ setInDoubt(inDoubt);
+ }
+
+ }
+
+
+
+
+ public final boolean hasInDoubt() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final RecoverResult clearInDoubt() {
+ packing_flags &= ~256;
+ this.inDoubt = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getInDoubt() {
+ return inDoubt;
+ }
+
+ public final RecoverResult setInDoubt(java.util.List<Object> value) {
+ this.inDoubt = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final RecoverResult inDoubt(java.util.List<Object> value) {
+ return setInDoubt(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeArray(this.inDoubt);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.inDoubt = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("inDoubt", getInDoubt());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ReplyTo.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,200 @@
+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 ReplyTo extends Struct {
+
+ public static final int TYPE = -3;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 2;
+ }
+
+ 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 String exchange;
+ private String routingKey;
+
+
+ public ReplyTo() {}
+
+
+ public ReplyTo(String exchange, String routingKey) {
+ if(exchange != null) {
+ setExchange(exchange);
+ }
+ if(routingKey != null) {
+ setRoutingKey(routingKey);
+ }
+
+ }
+
+
+
+
+ public final boolean hasExchange() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final ReplyTo clearExchange() {
+ packing_flags &= ~256;
+ this.exchange = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getExchange() {
+ return exchange;
+ }
+
+ public final ReplyTo setExchange(String value) {
+ this.exchange = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final ReplyTo exchange(String value) {
+ return setExchange(value);
+ }
+
+ public final boolean hasRoutingKey() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final ReplyTo clearRoutingKey() {
+ packing_flags &= ~512;
+ this.routingKey = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final String getRoutingKey() {
+ return routingKey;
+ }
+
+ public final ReplyTo setRoutingKey(String value) {
+ this.routingKey = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final ReplyTo routingKey(String value) {
+ return setRoutingKey(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.routingKey);
+ }
+
+ }
+
+ 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.routingKey = dec.readStr8();
+ }
+
+ }
+
+ 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("routingKey", getRoutingKey());
+ }
+
+
+ return result;
+ }
+
+ public boolean equals(final Object obj){
+ if (this == obj){
+ return true;
+ }
+
+ if(!(obj instanceof ReplyTo)){
+ return false;
+ }
+
+ final ReplyTo reply = (ReplyTo) obj;
+ return (routingKey == null ? reply.getRoutingKey() == null : routingKey.equals(reply.getRoutingKey()))
+ && (exchange == null ? reply.getExchange() == null : exchange.equals(reply.getExchange()));
+ }
+
+ public int hashCode(){
+ int result = routingKey == null ? 1 : routingKey.hashCode();
+ return 31 * result + (exchange == null ? 5 : exchange.hashCode());
+ }
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SegmentType.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,54 @@
+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 SegmentType {
+
+ CONTROL((short) 0),
+ COMMAND((short) 1),
+ HEADER((short) 2),
+ BODY((short) 3);
+
+ private final short value;
+
+ SegmentType(short value)
+ {
+ this.value = value;
+ }
+
+ public short getValue()
+ {
+ return value;
+ }
+
+ public static SegmentType get(short value)
+ {
+ switch (value)
+ {
+ case (short) 0: return CONTROL;
+ case (short) 1: return COMMAND;
+ case (short) 2: return HEADER;
+ case (short) 3: return BODY;
+ default: throw new IllegalArgumentException("no such value: " + value);
+ }
+ }
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttach.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 SessionAttach extends Method {
+
+ public static final int TYPE = 513;
+
+ 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.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+
+
+ public SessionAttach() {}
+
+
+ public SessionAttach(byte[] name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case FORCE: 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.sessionAttach(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionAttach clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionAttach setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttach name(byte[] value) {
+ return setName(value);
+ }
+
+ public final boolean hasForce() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionAttach clearForce() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getForce() {
+ return hasForce();
+ }
+
+ public final SessionAttach setForce(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttach force(boolean value) {
+ return setForce(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("force", getForce());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionAttached.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 SessionAttached extends Method {
+
+ public static final int TYPE = 514;
+
+ 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.L2;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private byte[] name;
+
+
+ public SessionAttached() {}
+
+
+ public SessionAttached(byte[] name, Option ... _options) {
+ if(name != null) {
+ setName(name);
+ }
+
+ 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.sessionAttached(context, this);
+ }
+
+
+ public final boolean hasName() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionAttached clearName() {
+ packing_flags &= ~256;
+ this.name = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final byte[] getName() {
+ return name;
+ }
+
+ public final SessionAttached setName(byte[] value) {
+ this.name = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionAttached name(byte[] value) {
+ return setName(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeVbin16(this.name);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.name = dec.readVbin16();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("name", getName());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandFragment.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,138 @@
+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 SessionCommandFragment extends Struct {
+
+ public static final int TYPE = -2;
+
+ public final int getStructType() {
+ return TYPE;
+ }
+
+ public final int getSizeWidth() {
+ return 0;
+ }
+
+ public final int getPackWidth() {
+ return 0;
+ }
+
+ public final boolean hasPayload() {
+ return false;
+ }
+
+ public final byte getEncodedTrack() {
+ return -1;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private int commandId;
+ private RangeSet byteRanges;
+
+
+ public SessionCommandFragment() {}
+
+
+ public SessionCommandFragment(int commandId, RangeSet byteRanges) {
+ setCommandId(commandId);
+ if(byteRanges != null) {
+ setByteRanges(byteRanges);
+ }
+
+ }
+
+
+
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final SessionCommandFragment setCommandId(int value) {
+ this.commandId = value;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandFragment commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final RangeSet getByteRanges() {
+ return byteRanges;
+ }
+
+ public final SessionCommandFragment setByteRanges(RangeSet value) {
+ this.byteRanges = value;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandFragment byteRanges(RangeSet value) {
+ return setByteRanges(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeSequenceNo(this.commandId);
+ enc.writeByteRanges(this.byteRanges);
+
+ }
+
+ public void read(Decoder dec)
+ {
+ this.commandId = dec.readSequenceNo();
+ this.byteRanges = dec.readByteRanges();
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ result.put("commandId", getCommandId());
+ result.put("byteRanges", getByteRanges());
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCommandPoint.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,192 @@
+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 SessionCommandPoint extends Method {
+
+ public static final int TYPE = 519;
+
+ 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.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private int commandId;
+ private long commandOffset;
+
+
+ public SessionCommandPoint() {}
+
+
+ public SessionCommandPoint(int commandId, long commandOffset, Option ... _options) {
+ setCommandId(commandId);
+ setCommandOffset(commandOffset);
+
+ 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.sessionCommandPoint(context, this);
+ }
+
+
+ public final boolean hasCommandId() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionCommandPoint clearCommandId() {
+ packing_flags &= ~256;
+ this.commandId = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final int getCommandId() {
+ return commandId;
+ }
+
+ public final SessionCommandPoint setCommandId(int value) {
+ this.commandId = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandPoint commandId(int value) {
+ return setCommandId(value);
+ }
+
+ public final boolean hasCommandOffset() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionCommandPoint clearCommandOffset() {
+ packing_flags &= ~512;
+ this.commandOffset = 0;
+ setDirty(true);
+ return this;
+ }
+
+ public final long getCommandOffset() {
+ return commandOffset;
+ }
+
+ public final SessionCommandPoint setCommandOffset(long value) {
+ this.commandOffset = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCommandPoint commandOffset(long value) {
+ return setCommandOffset(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceNo(this.commandId);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeUint64(this.commandOffset);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commandId = dec.readSequenceNo();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.commandOffset = dec.readUint64();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commandId", getCommandId());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("commandOffset", getCommandOffset());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionCompleted.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 SessionCompleted extends Method {
+
+ public static final int TYPE = 522;
+
+ 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.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+
+
+ public SessionCompleted() {}
+
+
+ public SessionCompleted(RangeSet commands, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+
+ for (int i=0; i < _options.length; i++) {
+ switch (_options[i]) {
+ case TIMELY_REPLY: 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.sessionCompleted(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionCompleted clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionCompleted setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCompleted commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+ public final boolean hasTimelyReply() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionCompleted clearTimelyReply() {
+ packing_flags &= ~512;
+
+ setDirty(true);
+ return this;
+ }
+
+ public final boolean getTimelyReply() {
+ return hasTimelyReply();
+ }
+
+ public final SessionCompleted setTimelyReply(boolean value) {
+
+ if (value)
+ {
+ packing_flags |= 512;
+ }
+ else
+ {
+ packing_flags &= ~512;
+ }
+
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionCompleted timelyReply(boolean value) {
+ return setTimelyReply(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("timelyReply", getTimelyReply());
+ }
+
+
+ return result;
+ }
+
+
+}
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionConfirmed.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,196 @@
+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 SessionConfirmed extends Method {
+
+ public static final int TYPE = 521;
+
+ 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.L3;
+ }
+
+ public final boolean isConnectionControl()
+ {
+ return false;
+ }
+
+ private short packing_flags = 0;
+ private RangeSet commands;
+ private java.util.List<Object> fragments;
+
+
+ public SessionConfirmed() {}
+
+
+ public SessionConfirmed(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+ if(commands != null) {
+ setCommands(commands);
+ }
+ if(fragments != null) {
+ setFragments(fragments);
+ }
+
+ 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.sessionConfirmed(context, this);
+ }
+
+
+ public final boolean hasCommands() {
+ return (packing_flags & 256) != 0;
+ }
+
+ public final SessionConfirmed clearCommands() {
+ packing_flags &= ~256;
+ this.commands = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final RangeSet getCommands() {
+ return commands;
+ }
+
+ public final SessionConfirmed setCommands(RangeSet value) {
+ this.commands = value;
+ packing_flags |= 256;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionConfirmed commands(RangeSet value) {
+ return setCommands(value);
+ }
+
+ public final boolean hasFragments() {
+ return (packing_flags & 512) != 0;
+ }
+
+ public final SessionConfirmed clearFragments() {
+ packing_flags &= ~512;
+ this.fragments = null;
+ setDirty(true);
+ return this;
+ }
+
+ public final java.util.List<Object> getFragments() {
+ return fragments;
+ }
+
+ public final SessionConfirmed setFragments(java.util.List<Object> value) {
+ this.fragments = value;
+ packing_flags |= 512;
+ setDirty(true);
+ return this;
+ }
+
+ public final SessionConfirmed fragments(java.util.List<Object> value) {
+ return setFragments(value);
+ }
+
+
+
+
+ public void write(Encoder enc)
+ {
+ enc.writeUint16(packing_flags);
+ if ((packing_flags & 256) != 0)
+ {
+ enc.writeSequenceSet(this.commands);
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ enc.writeArray(this.fragments);
+ }
+
+ }
+
+ public void read(Decoder dec)
+ {
+ packing_flags = (short) dec.readUint16();
+ if ((packing_flags & 256) != 0)
+ {
+ this.commands = dec.readSequenceSet();
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ this.fragments = dec.readArray();
+ }
+
+ }
+
+ public Map<String,Object> getFields()
+ {
+ Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+ if ((packing_flags & 256) != 0)
+ {
+ result.put("commands", getCommands());
+ }
+ if ((packing_flags & 512) != 0)
+ {
+ result.put("fragments", getFragments());
+ }
+
+
+ return result;
+ }
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org