http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Received.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Received.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Received.java deleted file mode 100644 index b8a7ee5..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Received.java +++ /dev/null @@ -1,158 +0,0 @@ - -/* -* -* 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.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Received - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000023L), Symbol.valueOf("amqp:received:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000023L); - private final ReceivedWrapper _wrapper = new ReceivedWrapper(); - - private UnsignedInteger _sectionNumber; - private UnsignedLong _sectionOffset; - - public UnsignedInteger getSectionNumber() - { - return _sectionNumber; - } - - public void setSectionNumber(UnsignedInteger sectionNumber) - { - _sectionNumber = sectionNumber; - } - - public UnsignedLong getSectionOffset() - { - return _sectionOffset; - } - - public void setSectionOffset(UnsignedLong sectionOffset) - { - _sectionOffset = sectionOffset; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _sectionNumber; - case 1: - return _sectionOffset; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _sectionOffset != null - ? 2 - : _sectionNumber != null - ? 1 - : 0; - - } - - - public final class ReceivedWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Received.this.get(index); - } - - @Override - public int size() - { - return Received.this.size(); - } - } - - private static class ReceivedConstructor implements DescribedTypeConstructor<Received> - { - public Received newInstance(Object described) - { - List l = (List) described; - - Received o = new Received(); - - - switch(2 - l.size()) - { - - case 0: - o.setSectionOffset( (UnsignedLong) l.get( 1 ) ); - case 1: - o.setSectionNumber( (UnsignedInteger) l.get( 0 ) ); - } - - - return o; - } - - public Class<Received> getTypeClass() - { - return Received.class; - } - } - - - public static void register(Decoder decoder) - { - ReceivedConstructor constructor = new ReceivedConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Rejected.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Rejected.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Rejected.java deleted file mode 100644 index 98a3986..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Rejected.java +++ /dev/null @@ -1,141 +0,0 @@ - -/* -* -* 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.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Rejected - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState, Outcome -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000025L), Symbol.valueOf("amqp:rejected:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000025L); - private final RejectedWrapper _wrapper = new RejectedWrapper(); - - private List _error; - - public List getError() - { - return _error; - } - - public void setError(List error) - { - _error = error; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _error; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _error != null - ? 1 - : 0; - - } - - - public final class RejectedWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Rejected.this.get(index); - } - - @Override - public int size() - { - return Rejected.this.size(); - } - } - - private static class RejectedConstructor implements DescribedTypeConstructor<Rejected> - { - public Rejected newInstance(Object described) - { - List l = (List) described; - - Rejected o = new Rejected(); - - - switch(1 - l.size()) - { - - case 0: - o.setError( (List) l.get( 0 ) ); - } - - - return o; - } - - public Class<Rejected> getTypeClass() - { - return Rejected.class; - } - } - - - public static void register(Decoder decoder) - { - RejectedConstructor constructor = new RejectedConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Released.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Released.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Released.java deleted file mode 100644 index eb242cc..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Released.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* 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.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Released - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState, Outcome -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000026L), Symbol.valueOf("amqp:released:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000026L); - private final ReleasedWrapper _wrapper = new ReleasedWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class ReleasedWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Released.this.get(index); - } - - @Override - public int size() - { - return Released.this.size(); - } - } - - private static class ReleasedConstructor implements DescribedTypeConstructor<Released> - { - public Released newInstance(Object described) - { - List l = (List) described; - - Released o = new Released(); - - - return o; - } - - public Class<Released> getTypeClass() - { - return Released.class; - } - } - - - public static void register(Decoder decoder) - { - ReleasedConstructor constructor = new ReleasedConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Section.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Section.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Section.java deleted file mode 100644 index a051b04..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Section.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * 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.proton.type.messaging; - -public interface Section -{ -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Source.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Source.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Source.java deleted file mode 100644 index 2101b4e..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Source.java +++ /dev/null @@ -1,354 +0,0 @@ - -/* -* -* 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.proton.type.messaging; - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.DescribedType; -import org.apache.qpid.proton.type.Symbol; -import org.apache.qpid.proton.type.UnsignedInteger; -import org.apache.qpid.proton.type.UnsignedLong; - -import java.util.AbstractList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - - -public class Source - implements DescribedType , org.apache.qpid.proton.type.transport.Source -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000028L), Symbol.valueOf("amqp:source:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000028L); - private final SourceWrapper _wrapper = new SourceWrapper(); - - private String _address; - private UnsignedInteger _durable = UnsignedInteger.valueOf(0); - private Symbol _expiryPolicy = Symbol.valueOf("session-end"); - private UnsignedInteger _timeout = UnsignedInteger.valueOf(0); - private boolean _dynamic; - private Map _dynamicNodeProperties; - private Symbol _distributionMode; - private Map _filter; - private Outcome _defaultOutcome; - private Symbol[] _outcomes; - private Symbol[] _capabilities; - - public String getAddress() - { - return _address; - } - - public void setAddress(String address) - { - _address = address; - } - - public UnsignedInteger getDurable() - { - return _durable; - } - - public void setDurable(UnsignedInteger durable) - { - _durable = durable; - } - - public Symbol getExpiryPolicy() - { - return _expiryPolicy; - } - - public void setExpiryPolicy(Symbol expiryPolicy) - { - _expiryPolicy = expiryPolicy; - } - - public UnsignedInteger getTimeout() - { - return _timeout; - } - - public void setTimeout(UnsignedInteger timeout) - { - _timeout = timeout; - } - - public boolean getDynamic() - { - return _dynamic; - } - - public void setDynamic(boolean dynamic) - { - _dynamic = dynamic; - } - - public Map getDynamicNodeProperties() - { - return _dynamicNodeProperties; - } - - public void setDynamicNodeProperties(Map dynamicNodeProperties) - { - _dynamicNodeProperties = dynamicNodeProperties; - } - - public Symbol getDistributionMode() - { - return _distributionMode; - } - - public void setDistributionMode(Symbol distributionMode) - { - _distributionMode = distributionMode; - } - - public Map getFilter() - { - return _filter; - } - - public void setFilter(Map filter) - { - _filter = filter; - } - - public Outcome getDefaultOutcome() - { - return _defaultOutcome; - } - - public void setDefaultOutcome(Outcome defaultOutcome) - { - _defaultOutcome = defaultOutcome; - } - - public Symbol[] getOutcomes() - { - return _outcomes; - } - - public void setOutcomes(Symbol... outcomes) - { - _outcomes = outcomes; - } - - public Symbol[] getCapabilities() - { - return _capabilities; - } - - public void setCapabilities(Symbol... capabilities) - { - _capabilities = capabilities; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _address; - case 1: - return _durable; - case 2: - return _expiryPolicy; - case 3: - return _timeout; - case 4: - return _dynamic; - case 5: - return _dynamicNodeProperties; - case 6: - return _distributionMode; - case 7: - return _filter; - case 8: - return _defaultOutcome; - case 9: - return _outcomes; - case 10: - return _capabilities; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _capabilities != null - ? 11 - : _outcomes != null - ? 10 - : _defaultOutcome != null - ? 9 - : _filter != null - ? 8 - : _distributionMode != null - ? 7 - : _dynamicNodeProperties != null - ? 6 - : (_dynamic != false) - ? 5 - : (_timeout != null && !_timeout.equals(UnsignedInteger.ZERO)) - ? 4 - : (_expiryPolicy != null && !_expiryPolicy.equals(TerminusExpiryPolicy.SESSION_END)) - ? 3 - : (_durable != null && !_durable.equals(TerminusDurability.NONE)) - ? 2 - : _address != null - ? 1 - : 0; - - } - - - public final class SourceWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Source.this.get(index); - } - - @Override - public int size() - { - return Source.this.size(); - } - } - - private static class SourceConstructor implements DescribedTypeConstructor<Source> - { - public Source newInstance(Object described) - { - List l = (List) described; - - Source o = new Source(); - - - switch(11 - l.size()) - { - - case 0: - Object val0 = l.get( 10 ); - if( val0 == null || val0.getClass().isArray() ) - { - o.setCapabilities( (Symbol[]) val0 ); - } - else - { - o.setCapabilities( (Symbol) val0 ); - } - case 1: - Object val1 = l.get( 9 ); - if( val1 == null || val1.getClass().isArray() ) - { - o.setOutcomes( (Symbol[]) val1 ); - } - else - { - o.setOutcomes( (Symbol) val1 ); - } - case 2: - o.setDefaultOutcome( (Outcome) l.get( 8 ) ); - case 3: - o.setFilter( (Map) l.get( 7 ) ); - case 4: - o.setDistributionMode( (Symbol) l.get( 6 ) ); - case 5: - o.setDynamicNodeProperties( (Map) l.get( 5 ) ); - case 6: - Boolean dynamic = (Boolean) l.get(4); - o.setDynamic(dynamic == null ? false : dynamic); - case 7: - UnsignedInteger timeout = (UnsignedInteger) l.get(3); - o.setTimeout(timeout == null ? UnsignedInteger.ZERO : timeout); - case 8: - Symbol expiryPolicy = (Symbol) l.get(2); - o.setExpiryPolicy(expiryPolicy == null ? TerminusExpiryPolicy.SESSION_END : expiryPolicy); - case 9: - UnsignedInteger durable = (UnsignedInteger) l.get(1); - o.setDurable(durable == null ? TerminusDurability.NONE : durable); - case 10: - o.setAddress( (String) l.get( 0 ) ); - } - - - return o; - } - - public Class<Source> getTypeClass() - { - return Source.class; - } - } - - - public static void register(Decoder decoder) - { - SourceConstructor constructor = new SourceConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } - - @Override - public String toString() - { - return "Source{" + - "address='" + _address + '\'' + - ", durable=" + _durable + - ", expiryPolicy=" + _expiryPolicy + - ", timeout=" + _timeout + - ", dynamic=" + _dynamic + - ", dynamicNodeProperties=" + _dynamicNodeProperties + - ", distributionMode=" + _distributionMode + - ", filter=" + _filter + - ", defaultOutcome=" + _defaultOutcome + - ", outcomes=" + (_outcomes == null ? null : Arrays.asList(_outcomes)) + - ", capabilities=" + (_capabilities == null ? null : Arrays.asList(_capabilities)) + - '}'; - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/StdDistMode.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/StdDistMode.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/StdDistMode.java deleted file mode 100644 index d2feca6..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/StdDistMode.java +++ /dev/null @@ -1,34 +0,0 @@ - -/* -* -* 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.proton.type.messaging; - -import org.apache.qpid.proton.type.*; - -public interface StdDistMode -{ - final static Symbol MOVE = Symbol.valueOf("move"); - - final static Symbol COPY = Symbol.valueOf("copy"); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Target.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Target.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Target.java deleted file mode 100644 index 172b5f6..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Target.java +++ /dev/null @@ -1,274 +0,0 @@ - -/* -* -* 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.proton.type.messaging; - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.DescribedType; -import org.apache.qpid.proton.type.Symbol; -import org.apache.qpid.proton.type.UnsignedInteger; -import org.apache.qpid.proton.type.UnsignedLong; - -import java.util.AbstractList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - - -public class Target - implements DescribedType , org.apache.qpid.proton.type.transport.Target -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000029L), Symbol.valueOf("amqp:target:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000029L); - private final TargetWrapper _wrapper = new TargetWrapper(); - - private String _address; - private UnsignedInteger _durable = UnsignedInteger.valueOf(0); - private Symbol _expiryPolicy = Symbol.valueOf("session-end"); - private UnsignedInteger _timeout = UnsignedInteger.valueOf(0); - private boolean _dynamic; - private Map _dynamicNodeProperties; - private Symbol[] _capabilities; - - public String getAddress() - { - return _address; - } - - public void setAddress(String address) - { - _address = address; - } - - public UnsignedInteger getDurable() - { - return _durable; - } - - public void setDurable(UnsignedInteger durable) - { - _durable = durable; - } - - public Symbol getExpiryPolicy() - { - return _expiryPolicy; - } - - public void setExpiryPolicy(Symbol expiryPolicy) - { - _expiryPolicy = expiryPolicy; - } - - public UnsignedInteger getTimeout() - { - return _timeout; - } - - public void setTimeout(UnsignedInteger timeout) - { - _timeout = timeout; - } - - public boolean getDynamic() - { - return _dynamic; - } - - public void setDynamic(boolean dynamic) - { - _dynamic = dynamic; - } - - public Map getDynamicNodeProperties() - { - return _dynamicNodeProperties; - } - - public void setDynamicNodeProperties(Map dynamicNodeProperties) - { - _dynamicNodeProperties = dynamicNodeProperties; - } - - public Symbol[] getCapabilities() - { - return _capabilities; - } - - public void setCapabilities(Symbol... capabilities) - { - _capabilities = capabilities; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _address; - case 1: - return _durable; - case 2: - return _expiryPolicy; - case 3: - return _timeout; - case 4: - return _dynamic; - case 5: - return _dynamicNodeProperties; - case 6: - return _capabilities; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _capabilities != null - ? 7 - : _dynamicNodeProperties != null - ? 6 - : (_dynamic != false) - ? 5 - : (_timeout != null && !_timeout.equals(UnsignedInteger.ZERO)) - ? 4 - : (_expiryPolicy != null && !_expiryPolicy.equals(TerminusExpiryPolicy.SESSION_END)) - ? 3 - : (_durable != null && !_durable.equals(TerminusDurability.NONE)) - ? 2 - : _address != null - ? 1 - : 0; - - } - - - public final class TargetWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Target.this.get(index); - } - - @Override - public int size() - { - return Target.this.size(); - } - } - - private static class TargetConstructor implements DescribedTypeConstructor<Target> - { - public Target newInstance(Object described) - { - List l = (List) described; - - Target o = new Target(); - - - switch(7 - l.size()) - { - - case 0: - Object val0 = l.get( 6 ); - if( val0 == null || val0.getClass().isArray() ) - { - o.setCapabilities( (Symbol[]) val0 ); - } - else - { - o.setCapabilities( (Symbol) val0 ); - } - case 1: - o.setDynamicNodeProperties( (Map) l.get( 5 ) ); - case 2: - Boolean dynamic = (Boolean) l.get(4); - o.setDynamic(dynamic == null ? false : dynamic); - case 3: - UnsignedInteger timeout = (UnsignedInteger) l.get(3); - o.setTimeout(timeout == null ? UnsignedInteger.ZERO : timeout); - case 4: - Symbol expiryPolicy = (Symbol) l.get(2); - o.setExpiryPolicy(expiryPolicy == null ? TerminusExpiryPolicy.SESSION_END : expiryPolicy); - case 5: - UnsignedInteger durable = (UnsignedInteger) l.get(1); - o.setDurable(durable == null ? TerminusDurability.NONE : durable); - case 6: - o.setAddress( (String) l.get( 0 ) ); - } - - - return o; - } - - public Class<Target> getTypeClass() - { - return Target.class; - } - } - - - public static void register(Decoder decoder) - { - TargetConstructor constructor = new TargetConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } - - @Override - public String toString() - { - return "Target{" + - "address='" + _address + '\'' + - ", durable=" + _durable + - ", expiryPolicy=" + _expiryPolicy + - ", timeout=" + _timeout + - ", dynamic=" + _dynamic + - ", dynamicNodeProperties=" + _dynamicNodeProperties + - ", capabilities=" + (_capabilities == null ? null : Arrays.asList(_capabilities)) + - '}'; - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusDurability.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusDurability.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusDurability.java deleted file mode 100644 index cee49fe..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusDurability.java +++ /dev/null @@ -1,36 +0,0 @@ - -/* -* -* 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.proton.type.messaging; - -import org.apache.qpid.proton.type.*; - -public interface TerminusDurability -{ - final static UnsignedInteger NONE = UnsignedInteger.ZERO; - - final static UnsignedInteger CONFIGURATION = UnsignedInteger.ONE; - - final static UnsignedInteger UNSETTLED_STATE = UnsignedInteger.valueOf(2); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusExpiryPolicy.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusExpiryPolicy.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusExpiryPolicy.java deleted file mode 100644 index 661d47c..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/TerminusExpiryPolicy.java +++ /dev/null @@ -1,38 +0,0 @@ - -/* -* -* 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.proton.type.messaging; - -import org.apache.qpid.proton.type.*; - -public interface TerminusExpiryPolicy -{ - final static Symbol LINK_DETACH = Symbol.valueOf("link-detach"); - - final static Symbol SESSION_END = Symbol.valueOf("session-end"); - - final static Symbol CONNECTION_CLOSE = Symbol.valueOf("connection-close"); - - final static Symbol NEVER = Symbol.valueOf("never"); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/package-info.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/package-info.java b/proton-j/codec/src/org/apache/qpid/proton/type/package-info.java deleted file mode 100644 index e5d157d..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/package-info.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * 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. - * - */ - - /** - * Provides the classes necessary to implement primitive types present - * in the AMQP 1.0 type system with no direct equivalents in the Java - * type system. - * - * AMQP Type | Java Type - * ============|=========== - * null | - - * boolean | boolean / java.lang.Boolean - * ubyte | org.apache.qpid.proton.type.UByte - * ushort | - * uint | - * ulong | - * byte | - * short | - * int | - * long | - * float | - * double | - * decimal32 | - * decimal64 | - * decimal128 | - * char | - * timestamp | - * uuid | - * binary | - * string | - * symbol | - * list | - * map | - * array | - */ - -package org.apache.qpid.proton.type; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslChallenge.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslChallenge.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslChallenge.java deleted file mode 100644 index 292c109..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslChallenge.java +++ /dev/null @@ -1,149 +0,0 @@ - -/* -* -* 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.proton.type.security; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class SaslChallenge - implements DescribedType , SaslFrameBody -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000042L), Symbol.valueOf("amqp:sasl-challenge:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000042L); - private final SaslChallengeWrapper _wrapper = new SaslChallengeWrapper(); - - private Binary _challenge; - - public Binary getChallenge() - { - return _challenge; - } - - public void setChallenge(Binary challenge) - { - if( challenge == null ) - { - throw new NullPointerException("the challenge field is mandatory"); - } - - _challenge = challenge; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _challenge; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 1; - - } - - - public final class SaslChallengeWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return SaslChallenge.this.get(index); - } - - @Override - public int size() - { - return SaslChallenge.this.size(); - } - } - - private static class SaslChallengeConstructor implements DescribedTypeConstructor<SaslChallenge> - { - public SaslChallenge newInstance(Object described) - { - List l = (List) described; - - SaslChallenge o = new SaslChallenge(); - - if(l.size() <= 0) - { - throw new DecodeException("The challenge field cannot be omitted"); - } - - switch(1 - l.size()) - { - - case 0: - o.setChallenge( (Binary) l.get( 0 ) ); - } - - - return o; - } - - public Class<SaslChallenge> getTypeClass() - { - return SaslChallenge.class; - } - } - - - public static void register(Decoder decoder) - { - SaslChallengeConstructor constructor = new SaslChallengeConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslCode.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslCode.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslCode.java deleted file mode 100644 index 230ba8f..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslCode.java +++ /dev/null @@ -1,40 +0,0 @@ - -/* -* -* 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.proton.type.security; - -import org.apache.qpid.proton.type.*; - -public interface SaslCode -{ - final static UnsignedByte OK = UnsignedByte.valueOf((byte) 0); - - final static UnsignedByte AUTH = UnsignedByte.valueOf((byte) 1); - - final static UnsignedByte SYS = UnsignedByte.valueOf((byte) 2); - - final static UnsignedByte SYS_PERM = UnsignedByte.valueOf((byte) 3); - - final static UnsignedByte SYS_TEMP = UnsignedByte.valueOf((byte) 4); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslFrameBody.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslFrameBody.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslFrameBody.java deleted file mode 100644 index 920565e..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslFrameBody.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * 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.proton.type.security; - -public interface SaslFrameBody -{ -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslInit.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslInit.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslInit.java deleted file mode 100644 index 29ebfad..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslInit.java +++ /dev/null @@ -1,183 +0,0 @@ - -/* -* -* 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.proton.type.security; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class SaslInit - implements DescribedType , SaslFrameBody -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000041L), Symbol.valueOf("amqp:sasl-init:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000041L); - private final SaslInitWrapper _wrapper = new SaslInitWrapper(); - - private Symbol _mechanism; - private Binary _initialResponse; - private String _hostname; - - public Symbol getMechanism() - { - return _mechanism; - } - - public void setMechanism(Symbol mechanism) - { - if( mechanism == null ) - { - throw new NullPointerException("the mechanism field is mandatory"); - } - - _mechanism = mechanism; - } - - public Binary getInitialResponse() - { - return _initialResponse; - } - - public void setInitialResponse(Binary initialResponse) - { - _initialResponse = initialResponse; - } - - public String getHostname() - { - return _hostname; - } - - public void setHostname(String hostname) - { - _hostname = hostname; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _mechanism; - case 1: - return _initialResponse; - case 2: - return _hostname; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _hostname != null - ? 3 - : _initialResponse != null - ? 2 - : 1; - - } - - - public final class SaslInitWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return SaslInit.this.get(index); - } - - @Override - public int size() - { - return SaslInit.this.size(); - } - } - - private static class SaslInitConstructor implements DescribedTypeConstructor<SaslInit> - { - public SaslInit newInstance(Object described) - { - List l = (List) described; - - SaslInit o = new SaslInit(); - - if(l.size() <= 0) - { - throw new DecodeException("The mechanism field cannot be omitted"); - } - - switch(3 - l.size()) - { - - case 0: - o.setHostname( (String) l.get( 2 ) ); - case 1: - o.setInitialResponse( (Binary) l.get( 1 ) ); - case 2: - o.setMechanism( (Symbol) l.get( 0 ) ); - } - - - return o; - } - - public Class<SaslInit> getTypeClass() - { - return SaslInit.class; - } - } - - - public static void register(Decoder decoder) - { - SaslInitConstructor constructor = new SaslInitConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslMechanisms.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslMechanisms.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslMechanisms.java deleted file mode 100644 index 27d1637..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslMechanisms.java +++ /dev/null @@ -1,157 +0,0 @@ - -/* -* -* 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.proton.type.security; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class SaslMechanisms - implements DescribedType , SaslFrameBody -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000040L), Symbol.valueOf("amqp:sasl-mechanisms:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000040L); - private final SaslMechanismsWrapper _wrapper = new SaslMechanismsWrapper(); - - private Symbol[] _saslServerMechanisms; - - public Symbol[] getSaslServerMechanisms() - { - return _saslServerMechanisms; - } - - public void setSaslServerMechanisms(Symbol... saslServerMechanisms) - { - if( saslServerMechanisms == null ) - { - throw new NullPointerException("the sasl-server-mechanisms field is mandatory"); - } - - _saslServerMechanisms = saslServerMechanisms; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _saslServerMechanisms; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 1; - - } - - - public final class SaslMechanismsWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return SaslMechanisms.this.get(index); - } - - @Override - public int size() - { - return SaslMechanisms.this.size(); - } - } - - private static class SaslMechanismsConstructor implements DescribedTypeConstructor<SaslMechanisms> - { - public SaslMechanisms newInstance(Object described) - { - List l = (List) described; - - SaslMechanisms o = new SaslMechanisms(); - - if(l.size() <= 0) - { - throw new DecodeException("The sasl-server-mechanisms field cannot be omitted"); - } - - switch(1 - l.size()) - { - - case 0: - Object val0 = l.get( 0 ); - if( val0 == null || val0.getClass().isArray() ) - { - o.setSaslServerMechanisms( (Symbol[]) val0 ); - } - else - { - o.setSaslServerMechanisms( (Symbol) val0 ); - } - } - - - return o; - } - - public Class<SaslMechanisms> getTypeClass() - { - return SaslMechanisms.class; - } - } - - - public static void register(Decoder decoder) - { - SaslMechanismsConstructor constructor = new SaslMechanismsConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslOutcome.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslOutcome.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslOutcome.java deleted file mode 100644 index 4c4726c..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslOutcome.java +++ /dev/null @@ -1,166 +0,0 @@ - -/* -* -* 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.proton.type.security; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class SaslOutcome - implements DescribedType , SaslFrameBody -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000044L), Symbol.valueOf("amqp:sasl-outcome:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000044L); - private final SaslOutcomeWrapper _wrapper = new SaslOutcomeWrapper(); - - private UnsignedByte _code; - private Binary _additionalData; - - public UnsignedByte getCode() - { - return _code; - } - - public void setCode(UnsignedByte code) - { - if( code == null ) - { - throw new NullPointerException("the code field is mandatory"); - } - - _code = code; - } - - public Binary getAdditionalData() - { - return _additionalData; - } - - public void setAdditionalData(Binary additionalData) - { - _additionalData = additionalData; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _code; - case 1: - return _additionalData; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _additionalData != null - ? 2 - : 1; - - } - - - public final class SaslOutcomeWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return SaslOutcome.this.get(index); - } - - @Override - public int size() - { - return SaslOutcome.this.size(); - } - } - - private static class SaslOutcomeConstructor implements DescribedTypeConstructor<SaslOutcome> - { - public SaslOutcome newInstance(Object described) - { - List l = (List) described; - - SaslOutcome o = new SaslOutcome(); - - if(l.size() <= 0) - { - throw new DecodeException("The code field cannot be omitted"); - } - - switch(2 - l.size()) - { - - case 0: - o.setAdditionalData( (Binary) l.get( 1 ) ); - case 1: - o.setCode( (UnsignedByte) l.get( 0 ) ); - } - - - return o; - } - - public Class<SaslOutcome> getTypeClass() - { - return SaslOutcome.class; - } - } - - - public static void register(Decoder decoder) - { - SaslOutcomeConstructor constructor = new SaslOutcomeConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslResponse.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslResponse.java b/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslResponse.java deleted file mode 100644 index f1883fd..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/security/SaslResponse.java +++ /dev/null @@ -1,149 +0,0 @@ - -/* -* -* 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.proton.type.security; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class SaslResponse - implements DescribedType , SaslFrameBody -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000043L), Symbol.valueOf("amqp:sasl-response:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000043L); - private final SaslResponseWrapper _wrapper = new SaslResponseWrapper(); - - private Binary _response; - - public Binary getResponse() - { - return _response; - } - - public void setResponse(Binary response) - { - if( response == null ) - { - throw new NullPointerException("the response field is mandatory"); - } - - _response = response; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _response; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 1; - - } - - - public final class SaslResponseWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return SaslResponse.this.get(index); - } - - @Override - public int size() - { - return SaslResponse.this.size(); - } - } - - private static class SaslResponseConstructor implements DescribedTypeConstructor<SaslResponse> - { - public SaslResponse newInstance(Object described) - { - List l = (List) described; - - SaslResponse o = new SaslResponse(); - - if(l.size() <= 0) - { - throw new DecodeException("The response field cannot be omitted"); - } - - switch(1 - l.size()) - { - - case 0: - o.setResponse( (Binary) l.get( 0 ) ); - } - - - return o; - } - - public Class<SaslResponse> getTypeClass() - { - return SaslResponse.class; - } - } - - - public static void register(Decoder decoder) - { - SaslResponseConstructor constructor = new SaslResponseConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Coordinator.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Coordinator.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Coordinator.java deleted file mode 100644 index 656b45c..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Coordinator.java +++ /dev/null @@ -1,149 +0,0 @@ - -/* -* -* 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.proton.type.transaction; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Coordinator - implements DescribedType , org.apache.qpid.proton.type.transport.Target -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000030L), Symbol.valueOf("amqp:coordinator:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000030L); - private final CoordinatorWrapper _wrapper = new CoordinatorWrapper(); - - private Symbol[] _capabilities; - - public Symbol[] getCapabilities() - { - return _capabilities; - } - - public void setCapabilities(Symbol... capabilities) - { - _capabilities = capabilities; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _capabilities; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _capabilities != null - ? 1 - : 0; - - } - - - public final class CoordinatorWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Coordinator.this.get(index); - } - - @Override - public int size() - { - return Coordinator.this.size(); - } - } - - private static class CoordinatorConstructor implements DescribedTypeConstructor<Coordinator> - { - public Coordinator newInstance(Object described) - { - List l = (List) described; - - Coordinator o = new Coordinator(); - - - switch(1 - l.size()) - { - - case 0: - Object val0 = l.get( 0 ); - if( val0 == null || val0.getClass().isArray() ) - { - o.setCapabilities( (Symbol[]) val0 ); - } - else - { - o.setCapabilities( (Symbol) val0 ); - } - } - - - return o; - } - - public Class<Coordinator> getTypeClass() - { - return Coordinator.class; - } - } - - - public static void register(Decoder decoder) - { - CoordinatorConstructor constructor = new CoordinatorConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declare.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declare.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declare.java deleted file mode 100644 index 38a5856..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declare.java +++ /dev/null @@ -1,141 +0,0 @@ - -/* -* -* 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.proton.type.transaction; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Declare - implements DescribedType -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000031L), Symbol.valueOf("amqp:declare:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000031L); - private final DeclareWrapper _wrapper = new DeclareWrapper(); - - private GlobalTxId _globalId; - - public GlobalTxId getGlobalId() - { - return _globalId; - } - - public void setGlobalId(GlobalTxId globalId) - { - _globalId = globalId; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _globalId; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _globalId != null - ? 1 - : 0; - - } - - - public final class DeclareWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Declare.this.get(index); - } - - @Override - public int size() - { - return Declare.this.size(); - } - } - - private static class DeclareConstructor implements DescribedTypeConstructor<Declare> - { - public Declare newInstance(Object described) - { - List l = (List) described; - - Declare o = new Declare(); - - - switch(1 - l.size()) - { - - case 0: - o.setGlobalId( (GlobalTxId) l.get( 0 ) ); - } - - - return o; - } - - public Class<Declare> getTypeClass() - { - return Declare.class; - } - } - - - public static void register(Decoder decoder) - { - DeclareConstructor constructor = new DeclareConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declared.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declared.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declared.java deleted file mode 100644 index dc6c69f..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Declared.java +++ /dev/null @@ -1,149 +0,0 @@ - -/* -* -* 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.proton.type.transaction; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Declared - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState, org.apache.qpid.proton.type.messaging.Outcome -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000033L), Symbol.valueOf("amqp:declared:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000033L); - private final DeclaredWrapper _wrapper = new DeclaredWrapper(); - - private Binary _txnId; - - public Binary getTxnId() - { - return _txnId; - } - - public void setTxnId(Binary txnId) - { - if( txnId == null ) - { - throw new NullPointerException("the txn-id field is mandatory"); - } - - _txnId = txnId; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _txnId; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 1; - - } - - - public final class DeclaredWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Declared.this.get(index); - } - - @Override - public int size() - { - return Declared.this.size(); - } - } - - private static class DeclaredConstructor implements DescribedTypeConstructor<Declared> - { - public Declared newInstance(Object described) - { - List l = (List) described; - - Declared o = new Declared(); - - if(l.size() <= 0) - { - throw new DecodeException("The txn-id field cannot be omitted"); - } - - switch(1 - l.size()) - { - - case 0: - o.setTxnId( (Binary) l.get( 0 ) ); - } - - - return o; - } - - public Class<Declared> getTypeClass() - { - return Declared.class; - } - } - - - public static void register(Decoder decoder) - { - DeclaredConstructor constructor = new DeclaredConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Discharge.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Discharge.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Discharge.java deleted file mode 100644 index 072eff6..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/Discharge.java +++ /dev/null @@ -1,166 +0,0 @@ - -/* -* -* 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.proton.type.transaction; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Discharge - implements DescribedType -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000032L), Symbol.valueOf("amqp:discharge:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000032L); - private final DischargeWrapper _wrapper = new DischargeWrapper(); - - private Binary _txnId; - private Boolean _fail; - - public Binary getTxnId() - { - return _txnId; - } - - public void setTxnId(Binary txnId) - { - if( txnId == null ) - { - throw new NullPointerException("the txn-id field is mandatory"); - } - - _txnId = txnId; - } - - public Boolean getFail() - { - return _fail; - } - - public void setFail(Boolean fail) - { - _fail = fail; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _txnId; - case 1: - return _fail; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _fail != null - ? 2 - : 1; - - } - - - public final class DischargeWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Discharge.this.get(index); - } - - @Override - public int size() - { - return Discharge.this.size(); - } - } - - private static class DischargeConstructor implements DescribedTypeConstructor<Discharge> - { - public Discharge newInstance(Object described) - { - List l = (List) described; - - Discharge o = new Discharge(); - - if(l.size() <= 0) - { - throw new DecodeException("The txn-id field cannot be omitted"); - } - - switch(2 - l.size()) - { - - case 0: - o.setFail( (Boolean) l.get( 1 ) ); - case 1: - o.setTxnId( (Binary) l.get( 0 ) ); - } - - - return o; - } - - public Class<Discharge> getTypeClass() - { - return Discharge.class; - } - } - - - public static void register(Decoder decoder) - { - DischargeConstructor constructor = new DischargeConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/GlobalTxId.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/GlobalTxId.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/GlobalTxId.java deleted file mode 100644 index db55d4c..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/GlobalTxId.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * 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.proton.type.transaction; - -public class GlobalTxId -{ -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/transaction/TransactionErrors.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/TransactionErrors.java b/proton-j/codec/src/org/apache/qpid/proton/type/transaction/TransactionErrors.java deleted file mode 100644 index 1e64172..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/transaction/TransactionErrors.java +++ /dev/null @@ -1,36 +0,0 @@ - -/* -* -* 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.proton.type.transaction; - -import org.apache.qpid.proton.type.*; - -public interface TransactionErrors -{ - final static Symbol UNKNOWN_ID = Symbol.valueOf("amqp:transaction:unknown-id"); - - final static Symbol TRANSACTION_ROLLBACK = Symbol.valueOf("amqp:transaction:rollback"); - - final static Symbol TRANSACTION_TIMEOUT = Symbol.valueOf("amqp:transaction:timeout"); - -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
