qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1527366 [28/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...
Date Sun, 29 Sep 2013 17:45:25 GMT
Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetach.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 SessionDetach extends Method {
+
+    public static final int TYPE = 515;
+
+    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 SessionDetach() {}
+
+
+    public SessionDetach(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.sessionDetach(context, this);
+    }
+
+
+    public final boolean hasName() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionDetach clearName() {
+        packing_flags &= ~256;
+        this.name = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final byte[] getName() {
+        return name;
+    }
+
+    public final SessionDetach setName(byte[] value) {
+        this.name = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionDetach 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/SessionDetachCode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetachCode.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,56 @@
+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 SessionDetachCode {
+
+    NORMAL((short) 0),
+    SESSION_BUSY((short) 1),
+    TRANSPORT_BUSY((short) 2),
+    NOT_ATTACHED((short) 3),
+    UNKNOWN_IDS((short) 4);
+
+    private final short value;
+
+    SessionDetachCode(short value)
+    {
+        this.value = value;
+    }
+
+    public short getValue()
+    {
+        return value;
+    }
+
+    public static SessionDetachCode get(short value)
+    {
+        switch (value)
+        {
+        case (short) 0: return NORMAL;
+        case (short) 1: return SESSION_BUSY;
+        case (short) 2: return TRANSPORT_BUSY;
+        case (short) 3: return NOT_ATTACHED;
+        case (short) 4: return UNKNOWN_IDS;
+        default: throw new IllegalArgumentException("no such value: " + value);
+        }
+    }
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDetached.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 SessionDetached extends Method {
+
+    public static final int TYPE = 516;
+
+    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;
+    private SessionDetachCode code;
+
+
+    public SessionDetached() {}
+
+
+    public SessionDetached(byte[] name, SessionDetachCode code, Option ... _options) {
+        if(name != null) {
+            setName(name);
+        }
+        if(code != null) {
+            setCode(code);
+        }
+
+        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.sessionDetached(context, this);
+    }
+
+
+    public final boolean hasName() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionDetached clearName() {
+        packing_flags &= ~256;
+        this.name = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final byte[] getName() {
+        return name;
+    }
+
+    public final SessionDetached setName(byte[] value) {
+        this.name = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionDetached name(byte[] value) {
+        return setName(value);
+    }
+
+    public final boolean hasCode() {
+        return (packing_flags & 512) != 0;
+    }
+
+    public final SessionDetached clearCode() {
+        packing_flags &= ~512;
+        this.code = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionDetachCode getCode() {
+        return code;
+    }
+
+    public final SessionDetached setCode(SessionDetachCode value) {
+        this.code = value;
+        packing_flags |= 512;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionDetached code(SessionDetachCode value) {
+        return setCode(value);
+    }
+
+
+
+
+    public void write(Encoder enc)
+    {
+        enc.writeUint16(packing_flags);
+        if ((packing_flags & 256) != 0)
+        {
+            enc.writeVbin16(this.name);
+        }
+        if ((packing_flags & 512) != 0)
+        {
+            enc.writeUint8(this.code.getValue());
+        }
+
+    }
+
+    public void read(Decoder dec)
+    {
+        packing_flags = (short) dec.readUint16();
+        if ((packing_flags & 256) != 0)
+        {
+            this.name = dec.readVbin16();
+        }
+        if ((packing_flags & 512) != 0)
+        {
+            this.code = SessionDetachCode.get(dec.readUint8());
+        }
+
+    }
+
+    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("code", getCode());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionExpected.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 SessionExpected extends Method {
+
+    public static final int TYPE = 520;
+
+    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 SessionExpected() {}
+
+
+    public SessionExpected(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.sessionExpected(context, this);
+    }
+
+
+    public final boolean hasCommands() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionExpected clearCommands() {
+        packing_flags &= ~256;
+        this.commands = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final RangeSet getCommands() {
+        return commands;
+    }
+
+    public final SessionExpected setCommands(RangeSet value) {
+        this.commands = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionExpected commands(RangeSet value) {
+        return setCommands(value);
+    }
+
+    public final boolean hasFragments() {
+        return (packing_flags & 512) != 0;
+    }
+
+    public final SessionExpected clearFragments() {
+        packing_flags &= ~512;
+        this.fragments = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final java.util.List<Object> getFragments() {
+        return fragments;
+    }
+
+    public final SessionExpected setFragments(java.util.List<Object> value) {
+        this.fragments = value;
+        packing_flags |= 512;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionExpected 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;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionFlush.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,229 @@
+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 SessionFlush extends Method {
+
+    public static final int TYPE = 524;
+
+    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;
+
+
+    public SessionFlush() {}
+
+
+    public SessionFlush(Option ... _options) {
+
+        for (int i=0; i < _options.length; i++) {
+            switch (_options[i]) {
+            case EXPECTED: packing_flags |= 256; break;
+            case CONFIRMED: packing_flags |= 512; break;
+            case COMPLETED: 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.sessionFlush(context, this);
+    }
+
+
+    public final boolean hasExpected() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionFlush clearExpected() {
+        packing_flags &= ~256;
+
+        setDirty(true);
+        return this;
+    }
+
+    public final boolean getExpected() {
+        return hasExpected();
+    }
+
+    public final SessionFlush setExpected(boolean value) {
+
+        if (value)
+        {
+            packing_flags |= 256;
+        }
+        else
+        {
+            packing_flags &= ~256;
+        }
+
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionFlush expected(boolean value) {
+        return setExpected(value);
+    }
+
+    public final boolean hasConfirmed() {
+        return (packing_flags & 512) != 0;
+    }
+
+    public final SessionFlush clearConfirmed() {
+        packing_flags &= ~512;
+
+        setDirty(true);
+        return this;
+    }
+
+    public final boolean getConfirmed() {
+        return hasConfirmed();
+    }
+
+    public final SessionFlush setConfirmed(boolean value) {
+
+        if (value)
+        {
+            packing_flags |= 512;
+        }
+        else
+        {
+            packing_flags &= ~512;
+        }
+
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionFlush confirmed(boolean value) {
+        return setConfirmed(value);
+    }
+
+    public final boolean hasCompleted() {
+        return (packing_flags & 1024) != 0;
+    }
+
+    public final SessionFlush clearCompleted() {
+        packing_flags &= ~1024;
+
+        setDirty(true);
+        return this;
+    }
+
+    public final boolean getCompleted() {
+        return hasCompleted();
+    }
+
+    public final SessionFlush setCompleted(boolean value) {
+
+        if (value)
+        {
+            packing_flags |= 1024;
+        }
+        else
+        {
+            packing_flags &= ~1024;
+        }
+
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionFlush completed(boolean value) {
+        return setCompleted(value);
+    }
+
+
+
+
+    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>();
+
+        if ((packing_flags & 256) != 0)
+        {
+            result.put("expected", getExpected());
+        }
+        if ((packing_flags & 512) != 0)
+        {
+            result.put("confirmed", getConfirmed());
+        }
+        if ((packing_flags & 1024) != 0)
+        {
+            result.put("completed", getCompleted());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionGap.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 SessionGap extends Method {
+
+    public static final int TYPE = 525;
+
+    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 SessionGap() {}
+
+
+    public SessionGap(RangeSet commands, Option ... _options) {
+        if(commands != null) {
+            setCommands(commands);
+        }
+
+        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.sessionGap(context, this);
+    }
+
+
+    public final boolean hasCommands() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionGap clearCommands() {
+        packing_flags &= ~256;
+        this.commands = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final RangeSet getCommands() {
+        return commands;
+    }
+
+    public final SessionGap setCommands(RangeSet value) {
+        this.commands = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionGap commands(RangeSet value) {
+        return setCommands(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());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionHeader.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,145 @@
+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 SessionHeader extends Struct {
+
+    public static final int TYPE = -1;
+
+    public final int getStructType() {
+        return TYPE;
+    }
+
+    public final int getSizeWidth() {
+        return 1;
+    }
+
+    public final int getPackWidth() {
+        return 1;
+    }
+
+    public final boolean hasPayload() {
+        return false;
+    }
+
+    public final byte getEncodedTrack() {
+        return -1;
+    }
+
+    public final boolean isConnectionControl()
+    {
+        return false;
+    }
+
+    private byte packing_flags = 0;
+
+
+    public SessionHeader() {}
+
+
+    public SessionHeader(Option ... _options) {
+
+        for (int i=0; i < _options.length; i++) {
+            switch (_options[i]) {
+            case SYNC: packing_flags |= 1; break;
+            case NONE: break;
+            default: throw new IllegalArgumentException("invalid option: " + _options[i]);
+            }
+        }
+
+    }
+
+
+
+
+    public final boolean hasSync() {
+        return (packing_flags & 1) != 0;
+    }
+
+    public final SessionHeader clearSync() {
+        packing_flags &= ~1;
+
+        setDirty(true);
+        return this;
+    }
+
+    public final boolean getSync() {
+        return hasSync();
+    }
+
+    public final SessionHeader setSync(boolean value) {
+
+        if (value)
+        {
+            packing_flags |= 1;
+        }
+        else
+        {
+            packing_flags &= ~1;
+        }
+
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionHeader sync(boolean value) {
+        return setSync(value);
+    }
+
+
+
+
+    public void write(Encoder enc)
+    {
+        enc.writeUint8(packing_flags);
+
+    }
+
+    public void read(Decoder dec)
+    {
+        packing_flags = (byte) dec.readUint8();
+
+    }
+
+    public Map<String,Object> getFields()
+    {
+        Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+        if ((packing_flags & 1) != 0)
+        {
+            result.put("sync", getSync());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionInvoker.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,236 @@
+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.Map;
+
+public abstract class SessionInvoker {
+
+    final void sessionAttach(byte[] name, Option ... _options) {
+        invoke(new SessionAttach(name, _options));
+    }
+
+    final void sessionAttached(byte[] name, Option ... _options) {
+        invoke(new SessionAttached(name, _options));
+    }
+
+    final void sessionDetach(byte[] name, Option ... _options) {
+        invoke(new SessionDetach(name, _options));
+    }
+
+    final void sessionDetached(byte[] name, SessionDetachCode code, Option ... _options) {
+        invoke(new SessionDetached(name, code, _options));
+    }
+
+    final void sessionRequestTimeout(long timeout, Option ... _options) {
+        invoke(new SessionRequestTimeout(timeout, _options));
+    }
+
+    final void sessionTimeout(long timeout, Option ... _options) {
+        invoke(new SessionTimeout(timeout, _options));
+    }
+
+    final void sessionCommandPoint(int commandId, long commandOffset, Option ... _options) {
+        invoke(new SessionCommandPoint(commandId, commandOffset, _options));
+    }
+
+    final void sessionExpected(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+        invoke(new SessionExpected(commands, fragments, _options));
+    }
+
+    final void sessionConfirmed(RangeSet commands, java.util.List<Object> fragments, Option ... _options) {
+        invoke(new SessionConfirmed(commands, fragments, _options));
+    }
+
+    final void sessionCompleted(RangeSet commands, Option ... _options) {
+        invoke(new SessionCompleted(commands, _options));
+    }
+
+    final void sessionKnownCompleted(RangeSet commands, Option ... _options) {
+        invoke(new SessionKnownCompleted(commands, _options));
+    }
+
+    final void sessionFlush(Option ... _options) {
+        invoke(new SessionFlush(_options));
+    }
+
+    final void sessionGap(RangeSet commands, Option ... _options) {
+        invoke(new SessionGap(commands, _options));
+    }
+
+    public final void executionSync(Option ... _options) {
+        invoke(new ExecutionSync(_options));
+    }
+
+    public final void executionResult(int commandId, Struct value, Option ... _options) {
+        invoke(new ExecutionResult(commandId, value, _options));
+    }
+
+    public final void executionException(ExecutionErrorCode errorCode, int commandId, short classCode, short commandCode, short fieldIndex, String description, Map<String,Object> errorInfo, Option ... _options) {
+        invoke(new ExecutionException(errorCode, commandId, classCode, commandCode, fieldIndex, description, errorInfo, _options));
+    }
+
+    public final void messageTransfer(String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, Header header, java.nio.ByteBuffer body, Option ... _options) {
+        invoke(new MessageTransfer(destination, acceptMode, acquireMode, header, body, _options));
+    }
+
+    public final void messageAccept(RangeSet transfers, Option ... _options) {
+        invoke(new MessageAccept(transfers, _options));
+    }
+
+    public final void messageReject(RangeSet transfers, MessageRejectCode code, String text, Option ... _options) {
+        invoke(new MessageReject(transfers, code, text, _options));
+    }
+
+    public final void messageRelease(RangeSet transfers, Option ... _options) {
+        invoke(new MessageRelease(transfers, _options));
+    }
+
+    public final Future<Acquired> messageAcquire(RangeSet transfers, Option ... _options) {
+        return invoke(new MessageAcquire(transfers, _options), Acquired.class);
+    }
+
+    public final Future<MessageResumeResult> messageResume(String destination, String resumeId, Option ... _options) {
+        return invoke(new MessageResume(destination, resumeId, _options), MessageResumeResult.class);
+    }
+
+    public final void messageSubscribe(String queue, String destination, MessageAcceptMode acceptMode, MessageAcquireMode acquireMode, String resumeId, long resumeTtl, Map<String,Object> arguments, Option ... _options) {
+        invoke(new MessageSubscribe(queue, destination, acceptMode, acquireMode, resumeId, resumeTtl, arguments, _options));
+    }
+
+    public final void messageCancel(String destination, Option ... _options) {
+        invoke(new MessageCancel(destination, _options));
+    }
+
+    public final void messageSetFlowMode(String destination, MessageFlowMode flowMode, Option ... _options) {
+        invoke(new MessageSetFlowMode(destination, flowMode, _options));
+    }
+
+    public final void messageFlow(String destination, MessageCreditUnit unit, long value, Option ... _options) {
+        invoke(new MessageFlow(destination, unit, value, _options));
+    }
+
+    public final void messageFlush(String destination, Option ... _options) {
+        invoke(new MessageFlush(destination, _options));
+    }
+
+    public final void messageStop(String destination, Option ... _options) {
+        invoke(new MessageStop(destination, _options));
+    }
+
+    public final void txSelect(Option ... _options) {
+        invoke(new TxSelect(_options));
+    }
+
+    public final void txCommit(Option ... _options) {
+        invoke(new TxCommit(_options));
+    }
+
+    public final void txRollback(Option ... _options) {
+        invoke(new TxRollback(_options));
+    }
+
+    public final void dtxSelect(Option ... _options) {
+        invoke(new DtxSelect(_options));
+    }
+
+    public final Future<XaResult> dtxStart(Xid xid, Option ... _options) {
+        return invoke(new DtxStart(xid, _options), XaResult.class);
+    }
+
+    public final Future<XaResult> dtxEnd(Xid xid, Option ... _options) {
+        return invoke(new DtxEnd(xid, _options), XaResult.class);
+    }
+
+    public final Future<XaResult> dtxCommit(Xid xid, Option ... _options) {
+        return invoke(new DtxCommit(xid, _options), XaResult.class);
+    }
+
+    public final void dtxForget(Xid xid, Option ... _options) {
+        invoke(new DtxForget(xid, _options));
+    }
+
+    public final Future<GetTimeoutResult> dtxGetTimeout(Xid xid, Option ... _options) {
+        return invoke(new DtxGetTimeout(xid, _options), GetTimeoutResult.class);
+    }
+
+    public final Future<XaResult> dtxPrepare(Xid xid, Option ... _options) {
+        return invoke(new DtxPrepare(xid, _options), XaResult.class);
+    }
+
+    public final Future<RecoverResult> dtxRecover(Option ... _options) {
+        return invoke(new DtxRecover(_options), RecoverResult.class);
+    }
+
+    public final Future<XaResult> dtxRollback(Xid xid, Option ... _options) {
+        return invoke(new DtxRollback(xid, _options), XaResult.class);
+    }
+
+    public final void dtxSetTimeout(Xid xid, long timeout, Option ... _options) {
+        invoke(new DtxSetTimeout(xid, timeout, _options));
+    }
+
+    public final void exchangeDeclare(String exchange, String type, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+        invoke(new ExchangeDeclare(exchange, type, alternateExchange, arguments, _options));
+    }
+
+    public final void exchangeDelete(String exchange, Option ... _options) {
+        invoke(new ExchangeDelete(exchange, _options));
+    }
+
+    public final Future<ExchangeQueryResult> exchangeQuery(String name, Option ... _options) {
+        return invoke(new ExchangeQuery(name, _options), ExchangeQueryResult.class);
+    }
+
+    public final void exchangeBind(String queue, String exchange, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+        invoke(new ExchangeBind(queue, exchange, bindingKey, arguments, _options));
+    }
+
+    public final void exchangeUnbind(String queue, String exchange, String bindingKey, Option ... _options) {
+        invoke(new ExchangeUnbind(queue, exchange, bindingKey, _options));
+    }
+
+    public final Future<ExchangeBoundResult> exchangeBound(String exchange, String queue, String bindingKey, Map<String,Object> arguments, Option ... _options) {
+        return invoke(new ExchangeBound(exchange, queue, bindingKey, arguments, _options), ExchangeBoundResult.class);
+    }
+
+    public final void queueDeclare(String queue, String alternateExchange, Map<String,Object> arguments, Option ... _options) {
+        invoke(new QueueDeclare(queue, alternateExchange, arguments, _options));
+    }
+
+    public final void queueDelete(String queue, Option ... _options) {
+        invoke(new QueueDelete(queue, _options));
+    }
+
+    public final void queuePurge(String queue, Option ... _options) {
+        invoke(new QueuePurge(queue, _options));
+    }
+
+    public final Future<QueueQueryResult> queueQuery(String queue, Option ... _options) {
+        return invoke(new QueueQuery(queue, _options), QueueQueryResult.class);
+    }
+
+    protected abstract void invoke(Method method);
+
+    protected abstract <T> Future<T> invoke(Method method, Class<T> resultClass);
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionKnownCompleted.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 SessionKnownCompleted extends Method {
+
+    public static final int TYPE = 523;
+
+    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 SessionKnownCompleted() {}
+
+
+    public SessionKnownCompleted(RangeSet commands, Option ... _options) {
+        if(commands != null) {
+            setCommands(commands);
+        }
+
+        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.sessionKnownCompleted(context, this);
+    }
+
+
+    public final boolean hasCommands() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionKnownCompleted clearCommands() {
+        packing_flags &= ~256;
+        this.commands = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final RangeSet getCommands() {
+        return commands;
+    }
+
+    public final SessionKnownCompleted setCommands(RangeSet value) {
+        this.commands = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionKnownCompleted commands(RangeSet value) {
+        return setCommands(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());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionRequestTimeout.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,152 @@
+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 SessionRequestTimeout extends Method {
+
+    public static final int TYPE = 517;
+
+    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 long timeout;
+
+
+    public SessionRequestTimeout() {}
+
+
+    public SessionRequestTimeout(long timeout, Option ... _options) {
+        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.sessionRequestTimeout(context, this);
+    }
+
+
+    public final boolean hasTimeout() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionRequestTimeout clearTimeout() {
+        packing_flags &= ~256;
+        this.timeout = 0;
+        setDirty(true);
+        return this;
+    }
+
+    public final long getTimeout() {
+        return timeout;
+    }
+
+    public final SessionRequestTimeout setTimeout(long value) {
+        this.timeout = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionRequestTimeout timeout(long value) {
+        return setTimeout(value);
+    }
+
+
+
+
+    public void write(Encoder enc)
+    {
+        enc.writeUint16(packing_flags);
+        if ((packing_flags & 256) != 0)
+        {
+            enc.writeUint32(this.timeout);
+        }
+
+    }
+
+    public void read(Decoder dec)
+    {
+        packing_flags = (short) dec.readUint16();
+        if ((packing_flags & 256) != 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("timeout", getTimeout());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionTimeout.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,152 @@
+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 SessionTimeout extends Method {
+
+    public static final int TYPE = 518;
+
+    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 long timeout;
+
+
+    public SessionTimeout() {}
+
+
+    public SessionTimeout(long timeout, Option ... _options) {
+        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.sessionTimeout(context, this);
+    }
+
+
+    public final boolean hasTimeout() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final SessionTimeout clearTimeout() {
+        packing_flags &= ~256;
+        this.timeout = 0;
+        setDirty(true);
+        return this;
+    }
+
+    public final long getTimeout() {
+        return timeout;
+    }
+
+    public final SessionTimeout setTimeout(long value) {
+        this.timeout = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final SessionTimeout timeout(long value) {
+        return setTimeout(value);
+    }
+
+
+
+
+    public void write(Encoder enc)
+    {
+        enc.writeUint16(packing_flags);
+        if ((packing_flags & 256) != 0)
+        {
+            enc.writeUint32(this.timeout);
+        }
+
+    }
+
+    public void read(Decoder dec)
+    {
+        packing_flags = (short) dec.readUint16();
+        if ((packing_flags & 256) != 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("timeout", getTimeout());
+        }
+
+
+        return result;
+    }
+
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StreamReturnCode.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,52 @@
+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 StreamReturnCode {
+
+    CONTENT_TOO_LARGE((int) 311),
+    NO_ROUTE((int) 312),
+    NO_CONSUMERS((int) 313);
+
+    private final int value;
+
+    StreamReturnCode(int value)
+    {
+        this.value = value;
+    }
+
+    public int getValue()
+    {
+        return value;
+    }
+
+    public static StreamReturnCode get(int value)
+    {
+        switch (value)
+        {
+        case (int) 311: return CONTENT_TOO_LARGE;
+        case (int) 312: return NO_ROUTE;
+        case (int) 313: return NO_CONSUMERS;
+        default: throw new IllegalArgumentException("no such value: " + value);
+        }
+    }
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/StructFactory.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.
+ *
+ */
+
+
+class StructFactory {
+
+    public static Struct create(int type)
+    {
+        switch (type)
+        {
+        case SessionHeader.TYPE:
+            return new SessionHeader();
+        case SessionCommandFragment.TYPE:
+            return new SessionCommandFragment();
+        case DeliveryProperties.TYPE:
+            return new DeliveryProperties();
+        case FragmentProperties.TYPE:
+            return new FragmentProperties();
+        case ReplyTo.TYPE:
+            return new ReplyTo();
+        case MessageProperties.TYPE:
+            return new MessageProperties();
+        case XaResult.TYPE:
+            return new XaResult();
+        case Xid.TYPE:
+            return new Xid();
+        case Acquired.TYPE:
+            return new Acquired();
+        case MessageResumeResult.TYPE:
+            return new MessageResumeResult();
+        case GetTimeoutResult.TYPE:
+            return new GetTimeoutResult();
+        case RecoverResult.TYPE:
+            return new RecoverResult();
+        case ExchangeQueryResult.TYPE:
+            return new ExchangeQueryResult();
+        case ExchangeBoundResult.TYPE:
+            return new ExchangeBoundResult();
+        case QueueQueryResult.TYPE:
+            return new QueueQueryResult();
+        default:
+            throw new IllegalArgumentException("type: " + type);
+        }
+    }
+
+    public static Struct createInstruction(int type)
+    {
+        switch (type)
+        {
+        case ConnectionStart.TYPE:
+            return new ConnectionStart();
+        case ConnectionStartOk.TYPE:
+            return new ConnectionStartOk();
+        case ConnectionSecure.TYPE:
+            return new ConnectionSecure();
+        case ConnectionSecureOk.TYPE:
+            return new ConnectionSecureOk();
+        case ConnectionTune.TYPE:
+            return new ConnectionTune();
+        case ConnectionTuneOk.TYPE:
+            return new ConnectionTuneOk();
+        case ConnectionOpen.TYPE:
+            return new ConnectionOpen();
+        case ConnectionOpenOk.TYPE:
+            return new ConnectionOpenOk();
+        case ConnectionRedirect.TYPE:
+            return new ConnectionRedirect();
+        case ConnectionHeartbeat.TYPE:
+            return new ConnectionHeartbeat();
+        case ConnectionClose.TYPE:
+            return new ConnectionClose();
+        case ConnectionCloseOk.TYPE:
+            return new ConnectionCloseOk();
+        case SessionAttach.TYPE:
+            return new SessionAttach();
+        case SessionAttached.TYPE:
+            return new SessionAttached();
+        case SessionDetach.TYPE:
+            return new SessionDetach();
+        case SessionDetached.TYPE:
+            return new SessionDetached();
+        case SessionRequestTimeout.TYPE:
+            return new SessionRequestTimeout();
+        case SessionTimeout.TYPE:
+            return new SessionTimeout();
+        case SessionCommandPoint.TYPE:
+            return new SessionCommandPoint();
+        case SessionExpected.TYPE:
+            return new SessionExpected();
+        case SessionConfirmed.TYPE:
+            return new SessionConfirmed();
+        case SessionCompleted.TYPE:
+            return new SessionCompleted();
+        case SessionKnownCompleted.TYPE:
+            return new SessionKnownCompleted();
+        case SessionFlush.TYPE:
+            return new SessionFlush();
+        case SessionGap.TYPE:
+            return new SessionGap();
+        case ExecutionSync.TYPE:
+            return new ExecutionSync();
+        case ExecutionResult.TYPE:
+            return new ExecutionResult();
+        case ExecutionException.TYPE:
+            return new ExecutionException();
+        case MessageTransfer.TYPE:
+            return new MessageTransfer();
+        case MessageAccept.TYPE:
+            return new MessageAccept();
+        case MessageReject.TYPE:
+            return new MessageReject();
+        case MessageRelease.TYPE:
+            return new MessageRelease();
+        case MessageAcquire.TYPE:
+            return new MessageAcquire();
+        case MessageResume.TYPE:
+            return new MessageResume();
+        case MessageSubscribe.TYPE:
+            return new MessageSubscribe();
+        case MessageCancel.TYPE:
+            return new MessageCancel();
+        case MessageSetFlowMode.TYPE:
+            return new MessageSetFlowMode();
+        case MessageFlow.TYPE:
+            return new MessageFlow();
+        case MessageFlush.TYPE:
+            return new MessageFlush();
+        case MessageStop.TYPE:
+            return new MessageStop();
+        case TxSelect.TYPE:
+            return new TxSelect();
+        case TxCommit.TYPE:
+            return new TxCommit();
+        case TxRollback.TYPE:
+            return new TxRollback();
+        case DtxSelect.TYPE:
+            return new DtxSelect();
+        case DtxStart.TYPE:
+            return new DtxStart();
+        case DtxEnd.TYPE:
+            return new DtxEnd();
+        case DtxCommit.TYPE:
+            return new DtxCommit();
+        case DtxForget.TYPE:
+            return new DtxForget();
+        case DtxGetTimeout.TYPE:
+            return new DtxGetTimeout();
+        case DtxPrepare.TYPE:
+            return new DtxPrepare();
+        case DtxRecover.TYPE:
+            return new DtxRecover();
+        case DtxRollback.TYPE:
+            return new DtxRollback();
+        case DtxSetTimeout.TYPE:
+            return new DtxSetTimeout();
+        case ExchangeDeclare.TYPE:
+            return new ExchangeDeclare();
+        case ExchangeDelete.TYPE:
+            return new ExchangeDelete();
+        case ExchangeQuery.TYPE:
+            return new ExchangeQuery();
+        case ExchangeBind.TYPE:
+            return new ExchangeBind();
+        case ExchangeUnbind.TYPE:
+            return new ExchangeUnbind();
+        case ExchangeBound.TYPE:
+            return new ExchangeBound();
+        case QueueDeclare.TYPE:
+            return new QueueDeclare();
+        case QueueDelete.TYPE:
+            return new QueueDelete();
+        case QueuePurge.TYPE:
+            return new QueuePurge();
+        case QueueQuery.TYPE:
+            return new QueueQuery();
+        default:
+            throw new IllegalArgumentException("type: " + type);
+        }
+    }
+
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Track.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,50 @@
+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 Track {
+
+    CONTROL((short) 0),
+    COMMAND((short) 1);
+
+    private final short value;
+
+    Track(short value)
+    {
+        this.value = value;
+    }
+
+    public short getValue()
+    {
+        return value;
+    }
+
+    public static Track get(short value)
+    {
+        switch (value)
+        {
+        case (short) 0: return CONTROL;
+        case (short) 1: return COMMAND;
+        default: throw new IllegalArgumentException("no such value: " + value);
+        }
+    }
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxCommit.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 TxCommit extends Method {
+
+    public static final int TYPE = 1282;
+
+    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 TxCommit(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.txCommit(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/TxRollback.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxRollback.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 TxRollback extends Method {
+
+    public static final int TYPE = 1283;
+
+    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 TxRollback(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.txRollback(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/TxSelect.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TxSelect.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 TxSelect extends Method {
+
+    public static final int TYPE = 1281;
+
+    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 TxSelect(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.txSelect(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/Type.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Type.java Sun Sep 29 17:45:16 2013
@@ -0,0 +1,148 @@
+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 Type
+{
+
+    BIN8((byte) 0x00, 1, true),
+    INT8((byte) 0x01, 1, true),
+    UINT8((byte) 0x02, 1, true),
+    CHAR((byte) 0x04, 1, true),
+    BOOLEAN((byte) 0x08, 1, true),
+    BIN16((byte) 0x10, 2, true),
+    INT16((byte) 0x11, 2, true),
+    UINT16((byte) 0x12, 2, true),
+    BIN32((byte) 0x20, 4, true),
+    INT32((byte) 0x21, 4, true),
+    UINT32((byte) 0x22, 4, true),
+    FLOAT((byte) 0x23, 4, true),
+    CHAR_UTF32((byte) 0x27, 4, true),
+    BIN64((byte) 0x30, 8, true),
+    INT64((byte) 0x31, 8, true),
+    UINT64((byte) 0x32, 8, true),
+    DOUBLE((byte) 0x33, 8, true),
+    DATETIME((byte) 0x38, 8, true),
+    BIN128((byte) 0x40, 16, true),
+    UUID((byte) 0x48, 16, true),
+    BIN256((byte) 0x50, 32, true),
+    BIN512((byte) 0x60, 64, true),
+    BIN1024((byte) 0x70, 128, true),
+    VBIN8((byte) 0x80, 1, false),
+    STR8_LATIN((byte) 0x84, 1, false),
+    STR8((byte) 0x85, 1, false),
+    STR8_UTF16((byte) 0x86, 1, false),
+    VBIN16((byte) 0x90, 2, false),
+    STR16_LATIN((byte) 0x94, 2, false),
+    STR16((byte) 0x95, 2, false),
+    STR16_UTF16((byte) 0x96, 2, false),
+    VBIN32((byte) 0xa0, 4, false),
+    MAP((byte) 0xa8, 4, false),
+    LIST((byte) 0xa9, 4, false),
+    ARRAY((byte) 0xaa, 4, false),
+    STRUCT32((byte) 0xab, 4, false),
+    BIN40((byte) 0xc0, 5, true),
+    DEC32((byte) 0xc8, 5, true),
+    BIN72((byte) 0xd0, 9, true),
+    DEC64((byte) 0xd8, 9, true),
+    VOID((byte) 0xf0, 0, true),
+    BIT((byte) 0xf1, 0, true);
+
+    private final byte code;
+    private final int width;
+    private final boolean fixed;
+
+    Type(byte code, int width, boolean fixed)
+    {
+        this.code = code;
+        this.width = width;
+        this.fixed = fixed;
+    }
+
+    public byte getCode()
+    {
+        return code;
+    }
+
+    public int getWidth()
+    {
+        return width;
+    }
+
+    public boolean isFixed()
+    {
+        return fixed;
+    }
+
+    public static Type get(byte code)
+    {
+        switch (code)
+        {
+        case (byte) 0x00: return BIN8;
+        case (byte) 0x01: return INT8;
+        case (byte) 0x02: return UINT8;
+        case (byte) 0x04: return CHAR;
+        case (byte) 0x08: return BOOLEAN;
+        case (byte) 0x10: return BIN16;
+        case (byte) 0x11: return INT16;
+        case (byte) 0x12: return UINT16;
+        case (byte) 0x20: return BIN32;
+        case (byte) 0x21: return INT32;
+        case (byte) 0x22: return UINT32;
+        case (byte) 0x23: return FLOAT;
+        case (byte) 0x27: return CHAR_UTF32;
+        case (byte) 0x30: return BIN64;
+        case (byte) 0x31: return INT64;
+        case (byte) 0x32: return UINT64;
+        case (byte) 0x33: return DOUBLE;
+        case (byte) 0x38: return DATETIME;
+        case (byte) 0x40: return BIN128;
+        case (byte) 0x48: return UUID;
+        case (byte) 0x50: return BIN256;
+        case (byte) 0x60: return BIN512;
+        case (byte) 0x70: return BIN1024;
+        case (byte) 0x80: return VBIN8;
+        case (byte) 0x84: return STR8_LATIN;
+        case (byte) 0x85: return STR8;
+        case (byte) 0x86: return STR8_UTF16;
+        case (byte) 0x90: return VBIN16;
+        case (byte) 0x94: return STR16_LATIN;
+        case (byte) 0x95: return STR16;
+        case (byte) 0x96: return STR16_UTF16;
+        case (byte) 0xa0: return VBIN32;
+        case (byte) 0xa8: return MAP;
+        case (byte) 0xa9: return LIST;
+        case (byte) 0xaa: return ARRAY;
+        case (byte) 0xab: return STRUCT32;
+        case (byte) 0xc0: return BIN40;
+        case (byte) 0xc8: return DEC32;
+        case (byte) 0xd0: return BIN72;
+        case (byte) 0xd8: return DEC64;
+        case (byte) 0xf0: return VOID;
+        case (byte) 0xf1: return BIT;
+
+        default: return null;
+        }
+    }
+}

Added: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java?rev=1527366&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.java (added)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/XaResult.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 XaResult extends Struct {
+
+    public static final int TYPE = 1537;
+
+    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 DtxXaStatus status;
+
+
+    public XaResult() {}
+
+
+    public XaResult(DtxXaStatus status) {
+        if(status != null) {
+            setStatus(status);
+        }
+
+    }
+
+
+
+
+    public final boolean hasStatus() {
+        return (packing_flags & 256) != 0;
+    }
+
+    public final XaResult clearStatus() {
+        packing_flags &= ~256;
+        this.status = null;
+        setDirty(true);
+        return this;
+    }
+
+    public final DtxXaStatus getStatus() {
+        return status;
+    }
+
+    public final XaResult setStatus(DtxXaStatus value) {
+        this.status = value;
+        packing_flags |= 256;
+        setDirty(true);
+        return this;
+    }
+
+    public final XaResult status(DtxXaStatus value) {
+        return setStatus(value);
+    }
+
+
+
+
+    public void write(Encoder enc)
+    {
+        enc.writeUint16(packing_flags);
+        if ((packing_flags & 256) != 0)
+        {
+            enc.writeUint16(this.status.getValue());
+        }
+
+    }
+
+    public void read(Decoder dec)
+    {
+        packing_flags = (short) dec.readUint16();
+        if ((packing_flags & 256) != 0)
+        {
+            this.status = DtxXaStatus.get(dec.readUint16());
+        }
+
+    }
+
+    public Map<String,Object> getFields()
+    {
+        Map<String,Object> result = new LinkedHashMap<String,Object>();
+
+        if ((packing_flags & 256) != 0)
+        {
+            result.put("status", getStatus());
+        }
+
+
+        return result;
+    }
+
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message