qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1157566 [17/23] - in /qpid: branches/rg-amqp-1-0-sandbox/qpid/java/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/...
Date Sun, 14 Aug 2011 17:15:08 GMT
Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,107 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class TransactionErrors
+  implements ErrorCondition, RestrictedType<Symbol>
+  
+  {
+
+
+
+    private final Symbol _val;
+
+    
+    public static final TransactionErrors UNKNOWN_ID = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:unknown-id"));
+    
+    public static final TransactionErrors TRANSACTION_ROLLBACK = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:rollback"));
+    
+    public static final TransactionErrors TRANSACTION_TIMEOUT = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:timeout"));
+    
+
+
+    private TransactionErrors(Symbol val)
+    {
+        _val = val;
+    }
+
+    public Symbol getValue()
+    {
+        return _val;
+    }
+
+    public String toString()
+    {
+        
+        if(this == UNKNOWN_ID)
+        {
+            return "unknown-id";
+        }
+        
+        if(this == TRANSACTION_ROLLBACK)
+        {
+            return "transaction-rollback";
+        }
+        
+        if(this == TRANSACTION_TIMEOUT)
+        {
+            return "transaction-timeout";
+        }
+        
+        else
+        {
+            return String.valueOf(_val);
+        }
+    }
+
+    public static TransactionErrors valueOf(Object obj)
+    {
+        Symbol val = (Symbol) obj;
+
+        if(UNKNOWN_ID._val.equals(val))
+        {
+            return UNKNOWN_ID;
+        }
+    
+        if(TRANSACTION_ROLLBACK._val.equals(val))
+        {
+            return TRANSACTION_ROLLBACK;
+        }
+    
+        if(TRANSACTION_TIMEOUT._val.equals(val))
+        {
+            return TRANSACTION_TIMEOUT;
+        }
+    
+        // TODO ERROR
+        return null;
+    }
+
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionalState.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionalState.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionalState.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionalState.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,88 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class TransactionalState
+  implements DeliveryState
+  {
+
+
+    private Binary _txnId;
+
+    private Outcome _outcome;
+
+    public Binary getTxnId()
+    {
+        return _txnId;
+    }
+
+    public void setTxnId(Binary txnId)
+    {
+        _txnId = txnId;
+    }
+
+    public Outcome getOutcome()
+    {
+        return _outcome;
+    }
+
+    public void setOutcome(Outcome outcome)
+    {
+        _outcome = outcome;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder("TransactionalState{");
+        final int origLength = builder.length();
+
+        if(_txnId != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("txnId=").append(_txnId);
+        }
+
+        if(_outcome != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("outcome=").append(_outcome);
+        }
+
+        builder.append('}');
+        return builder.toString();
+    }
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,144 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.TxnCapability;
+
+public class TxnCapabilities
+  implements TxnCapability, RestrictedType<Symbol>
+  
+  {
+
+
+
+    private final Symbol _val;
+
+    
+    public static final TxnCapabilities LOCAL_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:local-transactions"));
+    
+    public static final TxnCapabilities DISTRIBUTED_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:distributed-transactions"));
+    
+    public static final TxnCapabilities PROMOTABLE_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:promotable-transactions"));
+    
+    public static final TxnCapabilities MULTI_TXNS_PER_SSN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-txns-per-ssn"));
+    
+    public static final TxnCapabilities MULTI_SSNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-ssns-per-txn"));
+    
+    public static final TxnCapabilities MULTI_CONNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-conns-per-txn"));
+    
+
+
+    private TxnCapabilities(Symbol val)
+    {
+        _val = val;
+    }
+
+    public Symbol getValue()
+    {
+        return _val;
+    }
+
+    public String toString()
+    {
+        
+        if(this == LOCAL_TXN)
+        {
+            return "local-txn";
+        }
+        
+        if(this == DISTRIBUTED_TXN)
+        {
+            return "distributed-txn";
+        }
+        
+        if(this == PROMOTABLE_TXN)
+        {
+            return "promotable-txn";
+        }
+        
+        if(this == MULTI_TXNS_PER_SSN)
+        {
+            return "multi-txns-per-ssn";
+        }
+        
+        if(this == MULTI_SSNS_PER_TXN)
+        {
+            return "multi-ssns-per-txn";
+        }
+        
+        if(this == MULTI_CONNS_PER_TXN)
+        {
+            return "multi-conns-per-txn";
+        }
+        
+        else
+        {
+            return String.valueOf(_val);
+        }
+    }
+
+    public static TxnCapabilities valueOf(Object obj)
+    {
+        Symbol val = (Symbol) obj;
+
+        if(LOCAL_TXN._val.equals(val))
+        {
+            return LOCAL_TXN;
+        }
+    
+        if(DISTRIBUTED_TXN._val.equals(val))
+        {
+            return DISTRIBUTED_TXN;
+        }
+    
+        if(PROMOTABLE_TXN._val.equals(val))
+        {
+            return PROMOTABLE_TXN;
+        }
+    
+        if(MULTI_TXNS_PER_SSN._val.equals(val))
+        {
+            return MULTI_TXNS_PER_SSN;
+        }
+    
+        if(MULTI_SSNS_PER_TXN._val.equals(val))
+        {
+            return MULTI_SSNS_PER_TXN;
+        }
+    
+        if(MULTI_CONNS_PER_TXN._val.equals(val))
+        {
+            return MULTI_CONNS_PER_TXN;
+        }
+    
+        // TODO ERROR
+        return null;
+    }
+
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,131 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class TxnCapability
+  implements org.apache.qpid.amqp_1_0.type.TxnCapability, RestrictedType<Symbol>
+  
+  {
+
+
+
+    private final Symbol _val;
+
+    
+    public static final TxnCapability LOCAL_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:local-transactions"));
+    
+    public static final TxnCapability DISTRIBUTED_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:distributed-transactions"));
+    
+    public static final TxnCapability PROMOTABLE_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:promotable-transactions"));
+    
+    public static final TxnCapability MULTI_TXNS_PER_SSN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:multi-txns-per-ssn"));
+    
+    public static final TxnCapability MULTI_SSNS_PER_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:multi-ssns-per-txn"));
+    
+
+
+    private TxnCapability(Symbol val)
+    {
+        _val = val;
+    }
+
+    public Symbol getValue()
+    {
+        return _val;
+    }
+
+    public String toString()
+    {
+        
+        if(this == LOCAL_TXN)
+        {
+            return "local-txn";
+        }
+        
+        if(this == DISTRIBUTED_TXN)
+        {
+            return "distributed-txn";
+        }
+        
+        if(this == PROMOTABLE_TXN)
+        {
+            return "promotable-txn";
+        }
+        
+        if(this == MULTI_TXNS_PER_SSN)
+        {
+            return "multi-txns-per-ssn";
+        }
+        
+        if(this == MULTI_SSNS_PER_TXN)
+        {
+            return "multi-ssns-per-txn";
+        }
+        
+        else
+        {
+            return String.valueOf(_val);
+        }
+    }
+
+    public static TxnCapability valueOf(Object obj)
+    {
+        Symbol val = (Symbol) obj;
+
+        if(LOCAL_TXN._val.equals(val))
+        {
+            return LOCAL_TXN;
+        }
+    
+        if(DISTRIBUTED_TXN._val.equals(val))
+        {
+            return DISTRIBUTED_TXN;
+        }
+    
+        if(PROMOTABLE_TXN._val.equals(val))
+        {
+            return PROMOTABLE_TXN;
+        }
+    
+        if(MULTI_TXNS_PER_SSN._val.equals(val))
+        {
+            return MULTI_TXNS_PER_SSN;
+        }
+    
+        if(MULTI_SSNS_PER_TXN._val.equals(val))
+        {
+            return MULTI_SSNS_PER_TXN;
+        }
+    
+        // TODO ERROR
+        return null;
+    }
+
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,117 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transaction.*;
+import org.apache.qpid.amqp_1_0.type.transaction.Coordinator;
+import org.apache.qpid.amqp_1_0.type.transaction.TxnCapability;
+
+import java.util.List;
+
+public class CoordinatorConstructor extends DescribedTypeConstructor<Coordinator>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:coordinator:list"),UnsignedLong.valueOf(0x0000000000000030L),
+    };
+
+    private static final CoordinatorConstructor INSTANCE = new CoordinatorConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Coordinator construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Coordinator obj = new Coordinator();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+
+                    if (val instanceof TxnCapability[] )
+                    {
+                        obj.setCapabilities( (TxnCapability[]) val );
+                    }
+                    else if (val instanceof Symbol[])
+                    {
+                        Symbol[] symVal = (Symbol[]) val;
+                        TxnCapability[] cap = new TxnCapability[symVal.length];
+                        int i = 0;
+                        for(Symbol sym : symVal)
+                        {
+                            cap[i++] = TxnCapability.valueOf(sym);
+                        }
+                        obj.setCapabilities(cap);
+                    }
+                    else
+		            {
+                        try
+                        {
+                            obj.setCapabilities( new TxnCapability[] { (TxnCapability) val } );
+                        }
+                        catch(ClassCastException e)
+                        {
+                            // TODO Error
+                        }
+                    }
+                    
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,150 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transaction.Coordinator;
+
+public class CoordinatorWriter extends AbstractDescribedTypeWriter<Coordinator>
+{
+    private Coordinator _value;
+    private int _count = -1;
+
+    public CoordinatorWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Coordinator value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getCapabilities() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000030L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Coordinator>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Coordinator value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getCapabilities();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Coordinator> FACTORY = new Factory<Coordinator>()
+    {
+
+        public ValueWriter<Coordinator> newInstance(Registry registry)
+        {
+            return new CoordinatorWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Coordinator.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,99 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transaction.*;
+import org.apache.qpid.amqp_1_0.type.transaction.Declare;
+
+
+import java.util.List;
+
+public class DeclareConstructor extends DescribedTypeConstructor<Declare>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:declare:list"),UnsignedLong.valueOf(0x0000000000000031L),
+    };
+
+    private static final DeclareConstructor INSTANCE = new DeclareConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Declare construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Declare obj = new Declare();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setGlobalId( (GlobalTxId) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,150 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transaction.Declare;
+
+public class DeclareWriter extends AbstractDescribedTypeWriter<Declare>
+{
+    private Declare _value;
+    private int _count = -1;
+
+    public DeclareWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Declare value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getGlobalId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000031L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Declare>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Declare value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getGlobalId();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Declare> FACTORY = new Factory<Declare>()
+    {
+
+        public ValueWriter<Declare> newInstance(Registry registry)
+        {
+            return new DeclareWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Declare.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,99 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transaction.*;
+import org.apache.qpid.amqp_1_0.type.transaction.Declared;
+
+
+import java.util.List;
+
+public class DeclaredConstructor extends DescribedTypeConstructor<Declared>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:declared:list"),UnsignedLong.valueOf(0x0000000000000033L),
+    };
+
+    private static final DeclaredConstructor INSTANCE = new DeclaredConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Declared construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Declared obj = new Declared();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setTxnId( (Binary) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,150 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transaction.Declared;
+
+public class DeclaredWriter extends AbstractDescribedTypeWriter<Declared>
+{
+    private Declared _value;
+    private int _count = -1;
+
+    public DeclaredWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Declared value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getTxnId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000033L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Declared>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Declared value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getTxnId();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Declared> FACTORY = new Factory<Declared>()
+    {
+
+        public ValueWriter<Declared> newInstance(Registry registry)
+        {
+            return new DeclaredWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Declared.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,126 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transaction.*;
+import org.apache.qpid.amqp_1_0.type.transaction.Discharge;
+
+
+import java.util.List;
+
+public class DischargeConstructor extends DescribedTypeConstructor<Discharge>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:discharge:list"),UnsignedLong.valueOf(0x0000000000000032L),
+    };
+
+    private static final DischargeConstructor INSTANCE = new DischargeConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Discharge construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Discharge obj = new Discharge();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setTxnId( (Binary) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setFail( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,158 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transaction.Discharge;
+
+public class DischargeWriter extends AbstractDescribedTypeWriter<Discharge>
+{
+    private Discharge _value;
+    private int _count = -1;
+
+    public DischargeWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Discharge value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getFail() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getTxnId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000032L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Discharge>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Discharge value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getTxnId();
+
+                case 1:
+                    return _value.getFail();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Discharge> FACTORY = new Factory<Discharge>()
+    {
+
+        public ValueWriter<Discharge> newInstance(Registry registry)
+        {
+            return new DischargeWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Discharge.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,126 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transaction.*;
+import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
+
+
+import java.util.List;
+
+public class TransactionalStateConstructor extends DescribedTypeConstructor<TransactionalState>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:transactional-state:list"),UnsignedLong.valueOf(0x0000000000000034L),
+    };
+
+    private static final TransactionalStateConstructor INSTANCE = new TransactionalStateConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public TransactionalState construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            TransactionalState obj = new TransactionalState();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setTxnId( (Binary) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setOutcome( (Outcome) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,158 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transaction.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
+
+public class TransactionalStateWriter extends AbstractDescribedTypeWriter<TransactionalState>
+{
+    private TransactionalState _value;
+    private int _count = -1;
+
+    public TransactionalStateWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final TransactionalState value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getOutcome() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getTxnId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000034L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<TransactionalState>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final TransactionalState value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getTxnId();
+
+                case 1:
+                    return _value.getOutcome();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<TransactionalState> FACTORY = new Factory<TransactionalState>()
+    {
+
+        public ValueWriter<TransactionalState> newInstance(Registry registry)
+        {
+            return new TransactionalStateWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(TransactionalState.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,227 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class AmqpError
+  implements ErrorCondition, RestrictedType<Symbol>
+  
+  {
+
+
+
+    private final Symbol _val;
+
+    
+    public static final AmqpError INTERNAL_ERROR = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:internal-error"));
+    
+    public static final AmqpError NOT_FOUND = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-found"));
+    
+    public static final AmqpError UNAUTHORIZED_ACCESS = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:unauthorized-access"));
+    
+    public static final AmqpError DECODE_ERROR = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:decode-error"));
+    
+    public static final AmqpError RESOURCE_LIMIT_EXCEEDED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-limit-exceeded"));
+    
+    public static final AmqpError NOT_ALLOWED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-allowed"));
+    
+    public static final AmqpError INVALID_FIELD = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:invalid-field"));
+    
+    public static final AmqpError NOT_IMPLEMENTED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-implemented"));
+    
+    public static final AmqpError RESOURCE_LOCKED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-locked"));
+    
+    public static final AmqpError PRECONDITION_FAILED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:precondition-failed"));
+    
+    public static final AmqpError RESOURCE_DELETED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-deleted"));
+    
+    public static final AmqpError ILLEGAL_STATE = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:illegal-state"));
+    
+    public static final AmqpError FRAME_SIZE_TOO_SMALL = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:frame-size-too-small"));
+    
+
+
+    private AmqpError(Symbol val)
+    {
+        _val = val;
+    }
+
+    public Symbol getValue()
+    {
+        return _val;
+    }
+
+    public String toString()
+    {
+        
+        if(this == INTERNAL_ERROR)
+        {
+            return "internal-error";
+        }
+        
+        if(this == NOT_FOUND)
+        {
+            return "not-found";
+        }
+        
+        if(this == UNAUTHORIZED_ACCESS)
+        {
+            return "unauthorized-access";
+        }
+        
+        if(this == DECODE_ERROR)
+        {
+            return "decode-error";
+        }
+        
+        if(this == RESOURCE_LIMIT_EXCEEDED)
+        {
+            return "resource-limit-exceeded";
+        }
+        
+        if(this == NOT_ALLOWED)
+        {
+            return "not-allowed";
+        }
+        
+        if(this == INVALID_FIELD)
+        {
+            return "invalid-field";
+        }
+        
+        if(this == NOT_IMPLEMENTED)
+        {
+            return "not-implemented";
+        }
+        
+        if(this == RESOURCE_LOCKED)
+        {
+            return "resource-locked";
+        }
+        
+        if(this == PRECONDITION_FAILED)
+        {
+            return "precondition-failed";
+        }
+        
+        if(this == RESOURCE_DELETED)
+        {
+            return "resource-deleted";
+        }
+        
+        if(this == ILLEGAL_STATE)
+        {
+            return "illegal-state";
+        }
+        
+        if(this == FRAME_SIZE_TOO_SMALL)
+        {
+            return "frame-size-too-small";
+        }
+        
+        else
+        {
+            return String.valueOf(_val);
+        }
+    }
+
+    public static AmqpError valueOf(Object obj)
+    {
+        Symbol val = (Symbol) obj;
+
+        if(INTERNAL_ERROR._val.equals(val))
+        {
+            return INTERNAL_ERROR;
+        }
+    
+        if(NOT_FOUND._val.equals(val))
+        {
+            return NOT_FOUND;
+        }
+    
+        if(UNAUTHORIZED_ACCESS._val.equals(val))
+        {
+            return UNAUTHORIZED_ACCESS;
+        }
+    
+        if(DECODE_ERROR._val.equals(val))
+        {
+            return DECODE_ERROR;
+        }
+    
+        if(RESOURCE_LIMIT_EXCEEDED._val.equals(val))
+        {
+            return RESOURCE_LIMIT_EXCEEDED;
+        }
+    
+        if(NOT_ALLOWED._val.equals(val))
+        {
+            return NOT_ALLOWED;
+        }
+    
+        if(INVALID_FIELD._val.equals(val))
+        {
+            return INVALID_FIELD;
+        }
+    
+        if(NOT_IMPLEMENTED._val.equals(val))
+        {
+            return NOT_IMPLEMENTED;
+        }
+    
+        if(RESOURCE_LOCKED._val.equals(val))
+        {
+            return RESOURCE_LOCKED;
+        }
+    
+        if(PRECONDITION_FAILED._val.equals(val))
+        {
+            return PRECONDITION_FAILED;
+        }
+    
+        if(RESOURCE_DELETED._val.equals(val))
+        {
+            return RESOURCE_DELETED;
+        }
+    
+        if(ILLEGAL_STATE._val.equals(val))
+        {
+            return ILLEGAL_STATE;
+        }
+    
+        if(FRAME_SIZE_TOO_SMALL._val.equals(val))
+        {
+            return FRAME_SIZE_TOO_SMALL;
+        }
+    
+        // TODO ERROR
+        return null;
+    }
+
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Attach.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Attach.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Attach.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Attach.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,365 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
+
+
+import java.util.Map;
+
+
+import java.nio.ByteBuffer;
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class Attach
+  implements FrameBody
+  {
+
+
+    private ByteBuffer _payload;
+
+    private String _name;
+
+    private UnsignedInteger _handle;
+
+    private Role _role;
+
+    private SenderSettleMode _sndSettleMode;
+
+    private ReceiverSettleMode _rcvSettleMode;
+
+    private Source _source;
+
+    private Target _target;
+
+    private Map _unsettled;
+
+    private Boolean _incompleteUnsettled;
+
+    private UnsignedInteger _initialDeliveryCount;
+
+    private UnsignedLong _maxMessageSize;
+
+    private Symbol[] _offeredCapabilities;
+
+    private Symbol[] _desiredCapabilities;
+
+    private Map _properties;
+
+    public String getName()
+    {
+        return _name;
+    }
+
+    public void setName(String name)
+    {
+        _name = name;
+    }
+
+    public UnsignedInteger getHandle()
+    {
+        return _handle;
+    }
+
+    public void setHandle(UnsignedInteger handle)
+    {
+        _handle = handle;
+    }
+
+    public Role getRole()
+    {
+        return _role;
+    }
+
+    public void setRole(Role role)
+    {
+        _role = role;
+    }
+
+    public SenderSettleMode getSndSettleMode()
+    {
+        return _sndSettleMode;
+    }
+
+    public void setSndSettleMode(SenderSettleMode sndSettleMode)
+    {
+        _sndSettleMode = sndSettleMode;
+    }
+
+    public ReceiverSettleMode getRcvSettleMode()
+    {
+        return _rcvSettleMode;
+    }
+
+    public void setRcvSettleMode(ReceiverSettleMode rcvSettleMode)
+    {
+        _rcvSettleMode = rcvSettleMode;
+    }
+
+    public Source getSource()
+    {
+        return _source;
+    }
+
+    public void setSource(Source source)
+    {
+        _source = source;
+    }
+
+    public Target getTarget()
+    {
+        return _target;
+    }
+
+    public void setTarget(Target target)
+    {
+        _target = target;
+    }
+
+    public Map getUnsettled()
+    {
+        return _unsettled;
+    }
+
+    public void setUnsettled(Map unsettled)
+    {
+        _unsettled = unsettled;
+    }
+
+    public Boolean getIncompleteUnsettled()
+    {
+        return _incompleteUnsettled;
+    }
+
+    public void setIncompleteUnsettled(Boolean incompleteUnsettled)
+    {
+        _incompleteUnsettled = incompleteUnsettled;
+    }
+
+    public UnsignedInteger getInitialDeliveryCount()
+    {
+        return _initialDeliveryCount;
+    }
+
+    public void setInitialDeliveryCount(UnsignedInteger initialDeliveryCount)
+    {
+        _initialDeliveryCount = initialDeliveryCount;
+    }
+
+    public UnsignedLong getMaxMessageSize()
+    {
+        return _maxMessageSize;
+    }
+
+    public void setMaxMessageSize(UnsignedLong maxMessageSize)
+    {
+        _maxMessageSize = maxMessageSize;
+    }
+
+    public Symbol[] getOfferedCapabilities()
+    {
+        return _offeredCapabilities;
+    }
+
+    public void setOfferedCapabilities(Symbol[] offeredCapabilities)
+    {
+        _offeredCapabilities = offeredCapabilities;
+    }
+
+    public Symbol[] getDesiredCapabilities()
+    {
+        return _desiredCapabilities;
+    }
+
+    public void setDesiredCapabilities(Symbol[] desiredCapabilities)
+    {
+        _desiredCapabilities = desiredCapabilities;
+    }
+
+    public Map getProperties()
+    {
+        return _properties;
+    }
+
+    public void setProperties(Map properties)
+    {
+        _properties = properties;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder("Attach{");
+        final int origLength = builder.length();
+
+        if(_name != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("name=").append(_name);
+        }
+
+        if(_handle != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("handle=").append(_handle);
+        }
+
+        if(_role != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("role=").append(_role);
+        }
+
+        if(_sndSettleMode != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("sndSettleMode=").append(_sndSettleMode);
+        }
+
+        if(_rcvSettleMode != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("rcvSettleMode=").append(_rcvSettleMode);
+        }
+
+        if(_source != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("source=").append(_source);
+        }
+
+        if(_target != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("target=").append(_target);
+        }
+
+        if(_unsettled != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("unsettled=").append(_unsettled);
+        }
+
+        if(_incompleteUnsettled != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("incompleteUnsettled=").append(_incompleteUnsettled);
+        }
+
+        if(_initialDeliveryCount != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("initialDeliveryCount=").append(_initialDeliveryCount);
+        }
+
+        if(_maxMessageSize != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("maxMessageSize=").append(_maxMessageSize);
+        }
+
+        if(_offeredCapabilities != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("offeredCapabilities=").append(_offeredCapabilities);
+        }
+
+        if(_desiredCapabilities != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("desiredCapabilities=").append(_desiredCapabilities);
+        }
+
+        if(_properties != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("properties=").append(_properties);
+        }
+
+        builder.append('}');
+        return builder.toString();
+    }
+
+    public void invoke(short channel, ConnectionEndpoint conn)
+    {
+        conn.receiveAttach(channel, this);
+    }
+
+    public void setPayload(ByteBuffer payload)
+    {
+        _payload = payload;
+    }
+
+    public ByteBuffer getPayload()
+    {
+        return _payload;
+    }
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Begin.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Begin.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Begin.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Begin.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,239 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
+
+
+import java.util.Map;
+
+
+import java.nio.ByteBuffer;
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class Begin
+  implements FrameBody
+  {
+
+
+    private ByteBuffer _payload;
+
+    private UnsignedShort _remoteChannel;
+
+    private UnsignedInteger _nextOutgoingId;
+
+    private UnsignedInteger _incomingWindow;
+
+    private UnsignedInteger _outgoingWindow;
+
+    private UnsignedInteger _handleMax;
+
+    private Symbol[] _offeredCapabilities;
+
+    private Symbol[] _desiredCapabilities;
+
+    private Map _properties;
+
+    public UnsignedShort getRemoteChannel()
+    {
+        return _remoteChannel;
+    }
+
+    public void setRemoteChannel(UnsignedShort remoteChannel)
+    {
+        _remoteChannel = remoteChannel;
+    }
+
+    public UnsignedInteger getNextOutgoingId()
+    {
+        return _nextOutgoingId;
+    }
+
+    public void setNextOutgoingId(UnsignedInteger nextOutgoingId)
+    {
+        _nextOutgoingId = nextOutgoingId;
+    }
+
+    public UnsignedInteger getIncomingWindow()
+    {
+        return _incomingWindow;
+    }
+
+    public void setIncomingWindow(UnsignedInteger incomingWindow)
+    {
+        _incomingWindow = incomingWindow;
+    }
+
+    public UnsignedInteger getOutgoingWindow()
+    {
+        return _outgoingWindow;
+    }
+
+    public void setOutgoingWindow(UnsignedInteger outgoingWindow)
+    {
+        _outgoingWindow = outgoingWindow;
+    }
+
+    public UnsignedInteger getHandleMax()
+    {
+        return _handleMax;
+    }
+
+    public void setHandleMax(UnsignedInteger handleMax)
+    {
+        _handleMax = handleMax;
+    }
+
+    public Symbol[] getOfferedCapabilities()
+    {
+        return _offeredCapabilities;
+    }
+
+    public void setOfferedCapabilities(Symbol[] offeredCapabilities)
+    {
+        _offeredCapabilities = offeredCapabilities;
+    }
+
+    public Symbol[] getDesiredCapabilities()
+    {
+        return _desiredCapabilities;
+    }
+
+    public void setDesiredCapabilities(Symbol[] desiredCapabilities)
+    {
+        _desiredCapabilities = desiredCapabilities;
+    }
+
+    public Map getProperties()
+    {
+        return _properties;
+    }
+
+    public void setProperties(Map properties)
+    {
+        _properties = properties;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder("Begin{");
+        final int origLength = builder.length();
+
+        if(_remoteChannel != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("remoteChannel=").append(_remoteChannel);
+        }
+
+        if(_nextOutgoingId != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("nextOutgoingId=").append(_nextOutgoingId);
+        }
+
+        if(_incomingWindow != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("incomingWindow=").append(_incomingWindow);
+        }
+
+        if(_outgoingWindow != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("outgoingWindow=").append(_outgoingWindow);
+        }
+
+        if(_handleMax != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("handleMax=").append(_handleMax);
+        }
+
+        if(_offeredCapabilities != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("offeredCapabilities=").append(_offeredCapabilities);
+        }
+
+        if(_desiredCapabilities != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("desiredCapabilities=").append(_desiredCapabilities);
+        }
+
+        if(_properties != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("properties=").append(_properties);
+        }
+
+        builder.append('}');
+        return builder.toString();
+    }
+
+    public void invoke(short channel, ConnectionEndpoint conn)
+    {
+        conn.receiveBegin(channel, this);
+    }
+
+    public void setPayload(ByteBuffer payload)
+    {
+        _payload = payload;
+    }
+
+    public ByteBuffer getPayload()
+    {
+        return _payload;
+    }
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Close.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Close.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Close.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Close.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,89 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
+
+
+import java.nio.ByteBuffer;
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class Close
+  implements FrameBody
+  {
+
+
+    private ByteBuffer _payload;
+
+    private Error _error;
+
+    public Error getError()
+    {
+        return _error;
+    }
+
+    public void setError(Error error)
+    {
+        _error = error;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder("Close{");
+        final int origLength = builder.length();
+
+        if(_error != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("error=").append(_error);
+        }
+
+        builder.append('}');
+        return builder.toString();
+    }
+
+    public void invoke(short channel, ConnectionEndpoint conn)
+    {
+        conn.receiveClose(channel, this);
+    }
+
+    public void setPayload(ByteBuffer payload)
+    {
+        _payload = payload;
+    }
+
+    public ByteBuffer getPayload()
+    {
+        return _payload;
+    }
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,107 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class ConnectionError
+  implements ErrorCondition, RestrictedType<Symbol>
+  
+  {
+
+
+
+    private final Symbol _val;
+
+    
+    public static final ConnectionError CONNECTION_FORCED = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:forced"));
+    
+    public static final ConnectionError FRAMING_ERROR = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:framing-error"));
+    
+    public static final ConnectionError REDIRECT = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:redirect"));
+    
+
+
+    private ConnectionError(Symbol val)
+    {
+        _val = val;
+    }
+
+    public Symbol getValue()
+    {
+        return _val;
+    }
+
+    public String toString()
+    {
+        
+        if(this == CONNECTION_FORCED)
+        {
+            return "connection-forced";
+        }
+        
+        if(this == FRAMING_ERROR)
+        {
+            return "framing-error";
+        }
+        
+        if(this == REDIRECT)
+        {
+            return "redirect";
+        }
+        
+        else
+        {
+            return String.valueOf(_val);
+        }
+    }
+
+    public static ConnectionError valueOf(Object obj)
+    {
+        Symbol val = (Symbol) obj;
+
+        if(CONNECTION_FORCED._val.equals(val))
+        {
+            return CONNECTION_FORCED;
+        }
+    
+        if(FRAMING_ERROR._val.equals(val))
+        {
+            return FRAMING_ERROR;
+        }
+    
+        if(REDIRECT._val.equals(val))
+        {
+            return REDIRECT;
+        }
+    
+        // TODO ERROR
+        return null;
+    }
+
+
+
+  }

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Detach.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Detach.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Detach.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/Detach.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,131 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport;
+
+
+import org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint;
+
+
+import java.nio.ByteBuffer;
+
+
+import org.apache.qpid.amqp_1_0.type.*;
+
+public class Detach
+  implements FrameBody
+  {
+
+
+    private ByteBuffer _payload;
+
+    private UnsignedInteger _handle;
+
+    private Boolean _closed;
+
+    private Error _error;
+
+    public UnsignedInteger getHandle()
+    {
+        return _handle;
+    }
+
+    public void setHandle(UnsignedInteger handle)
+    {
+        _handle = handle;
+    }
+
+    public Boolean getClosed()
+    {
+        return _closed;
+    }
+
+    public void setClosed(Boolean closed)
+    {
+        _closed = closed;
+    }
+
+    public Error getError()
+    {
+        return _error;
+    }
+
+    public void setError(Error error)
+    {
+        _error = error;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder("Detach{");
+        final int origLength = builder.length();
+
+        if(_handle != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("handle=").append(_handle);
+        }
+
+        if(_closed != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("closed=").append(_closed);
+        }
+
+        if(_error != null)
+        {
+            if(builder.length() != origLength)
+            {
+                builder.append(',');
+            }
+            builder.append("error=").append(_error);
+        }
+
+        builder.append('}');
+        return builder.toString();
+    }
+
+    public void invoke(short channel, ConnectionEndpoint conn)
+    {
+        conn.receiveDetach(channel, this);
+    }
+
+    public void setPayload(ByteBuffer payload)
+    {
+        _payload = payload;
+    }
+
+    public ByteBuffer getPayload()
+    {
+        return _payload;
+    }
+
+
+  }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message