You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2015/08/14 21:07:41 UTC
[08/50] [abbrv] qpid-proton git commit: Taking the opportunity to
reorganize the packaging structure to make it as closely aligned with C.
Taking the opportunity to reorganize the packaging structure to make it as closely aligned with C.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/06ab7d1b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/06ab7d1b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/06ab7d1b
Branch: refs/heads/rajith-codec
Commit: 06ab7d1bf31c9691845454be27004802a74717f5
Parents: 469f52a
Author: Rajith Attapattu <ra...@apache.org>
Authored: Thu Feb 5 16:58:59 2015 -0500
Committer: Rajith Attapattu <ra...@apache.org>
Committed: Thu Jul 9 09:12:37 2015 -0400
----------------------------------------------------------------------
.../qpid/proton/amqp/transport2/Flow.java | 247 -----------------
.../qpid/proton/amqp/transport2/Open.java | 266 -------------------
.../org/apache/qpid/proton/transport/Flow.java | 247 +++++++++++++++++
.../org/apache/qpid/proton/transport/Open.java | 266 +++++++++++++++++++
4 files changed, 513 insertions(+), 513 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/06ab7d1b/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Flow.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Flow.java b/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Flow.java
deleted file mode 100644
index bc5eafb..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Flow.java
+++ /dev/null
@@ -1,247 +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.amqp.transport2;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.proton.codec2.CodecHelper;
-import org.apache.qpid.proton.codec2.DecodeException;
-import org.apache.qpid.proton.codec2.Encodable;
-import org.apache.qpid.proton.codec2.Encoder;
-import org.apache.qpid.proton.codec2.DescribedTypeFactory;
-
-public class Flow implements Encodable
-{
- public final static long DESCRIPTOR_LONG = 0x0000000000000013L;
-
- public final static String DESCRIPTOR_STRING = "amqp:flow:list";
-
- private long _nextIncomingId;
-
- private long _incomingWindow;
-
- private long _nextOutgoingId;
-
- private long _outgoingWindow;
-
- private long _handle;
-
- private long _deliveryCount;
-
- private long _linkCredit;
-
- private long _available;
-
- private boolean _drain;
-
- private boolean _echo;
-
- private Map<Object, Object> _properties;
-
- public long getNextIncomingId()
- {
- return _nextIncomingId;
- }
-
- public void setNextIncomingId(long nextIncomingId)
- {
- _nextIncomingId = nextIncomingId;
- }
-
- public long getIncomingWindow()
- {
- return _incomingWindow;
- }
-
- public void setIncomingWindow(long incomingWindow)
- {
- _incomingWindow = incomingWindow;
- }
-
- public long getNextOutgoingId()
- {
- return _nextOutgoingId;
- }
-
- public void setNextOutgoingId(long nextOutgoingId)
- {
- _nextOutgoingId = nextOutgoingId;
- }
-
- public long getOutgoingWindow()
- {
- return _outgoingWindow;
- }
-
- public void setOutgoingWindow(long outgoingWindow)
- {
- _outgoingWindow = outgoingWindow;
- }
-
- public long getHandle()
- {
- return _handle;
- }
-
- public void setHandle(long handle)
- {
- _handle = handle;
- }
-
- public long getDeliveryCount()
- {
- return _deliveryCount;
- }
-
- public void setDeliveryCount(long deliveryCount)
- {
- _deliveryCount = deliveryCount;
- }
-
- public long getLinkCredit()
- {
- return _linkCredit;
- }
-
- public void setLinkCredit(long linkCredit)
- {
- _linkCredit = linkCredit;
- }
-
- public long getAvailable()
- {
- return _available;
- }
-
- public void setAvailable(long available)
- {
- _available = available;
- }
-
- public boolean getDrain()
- {
- return _drain;
- }
-
- public void setDrain(boolean drain)
- {
- _drain = drain;
- }
-
- public boolean getEcho()
- {
- return _echo;
- }
-
- public void setEcho(boolean echo)
- {
- _echo = echo;
- }
-
- public Map<Object, Object> getProperties()
- {
- return _properties;
- }
-
- public void setProperties(Map<Object, Object> properties)
- {
- _properties = properties;
- }
-
- @Override
- public String toString()
- {
- return "Flow{" + "nextIncomingId=" + _nextIncomingId + ", incomingWindow=" + _incomingWindow
- + ", nextOutgoingId=" + _nextOutgoingId + ", outgoingWindow=" + _outgoingWindow + ", handle=" + _handle
- + ", deliveryCount=" + _deliveryCount + ", linkCredit=" + _linkCredit + ", available=" + _available
- + ", drain=" + _drain + ", echo=" + _echo + ", properties=" + _properties + '}';
- }
-
- @Override
- public void encode(Encoder encoder)
- {
- encoder.putDescriptor();
- encoder.putUlong(DESCRIPTOR_LONG);
- encoder.putList();
- encoder.putLong(_nextIncomingId);
- encoder.putLong(_incomingWindow);
- encoder.putLong(_nextOutgoingId);
- encoder.putLong(_outgoingWindow);
- encoder.putLong(_handle);
- encoder.putLong(_deliveryCount);
- encoder.putLong(_linkCredit);
- encoder.putLong(_available);
- if (_drain)
- {
- encoder.putBoolean(true);
- }
- if (_echo)
- {
- encoder.putBoolean(true);
- }
- if (_properties != null && _properties.size() > 0)
- {
- CodecHelper.encodeMap(encoder, _properties);
- }
- encoder.end();
- }
-
- public static final class Factory implements DescribedTypeFactory
- {
- public Object create(Object in) throws DecodeException
- {
- List<Object> l = (List<Object>) in;
-
- Flow flow = new Flow();
-
- switch (11 - l.size())
- {
-
- case 0:
- flow.setProperties(((Map<Object, Object>) l.get(10)));
- case 1:
- flow.setEcho(l.get(9) == null ? false : (Boolean) l.get(9));
- case 2:
- flow.setDrain(l.get(8) == null ? false : (Boolean) l.get(8));
- case 3:
- flow.setAvailable((int) l.get(7));
- case 4:
- flow.setLinkCredit((int) l.get(6));
- case 5:
- flow.setDeliveryCount((int) l.get(5));
- case 6:
- flow.setHandle((int) l.get(4));
- case 7:
- flow.setOutgoingWindow((int) l.get(3));
- case 8:
- flow.setNextOutgoingId((int) l.get(2));
- case 9:
- flow.setIncomingWindow((int) l.get(1));
- case 10:
- flow.setNextIncomingId((int) l.get(0));
- }
-
- return flow;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/06ab7d1b/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Open.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Open.java b/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Open.java
deleted file mode 100644
index fdb05d4..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/amqp/transport2/Open.java
+++ /dev/null
@@ -1,266 +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.amqp.transport2;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.proton.codec2.CodecHelper;
-import org.apache.qpid.proton.codec2.DecodeException;
-import org.apache.qpid.proton.codec2.DescribedTypeFactory;
-import org.apache.qpid.proton.codec2.Encodable;
-import org.apache.qpid.proton.codec2.Encoder;
-import org.apache.qpid.proton.codec2.Type;
-
-public final class Open implements Encodable
-{
- public final static long DESCRIPTOR_LONG = 0x0000000000000010L;
-
- public final static String DESCRIPTOR_STRING = "amqp:open:list";
-
- private String _containerId;
-
- private String _hostname;
-
- private int _maxFrameSize = 0xffffffff;
-
- private int _channelMax = 65535;
-
- private long _idleTimeOut;
-
- private String[] _outgoingLocales;
-
- private String[] _incomingLocales;
-
- private String[] _offeredCapabilities;
-
- private String[] _desiredCapabilities;
-
- private Map<Object, Object> _properties;
-
- public String getContainerId()
- {
- return _containerId;
- }
-
- public void setContainerId(String containerId)
- {
- if (containerId == null)
- {
- throw new NullPointerException("the container-id field is mandatory");
- }
-
- _containerId = containerId;
- }
-
- public String getHostname()
- {
- return _hostname;
- }
-
- public void setHostname(String hostname)
- {
- _hostname = hostname;
- }
-
- public int getMaxFrameSize()
- {
- return _maxFrameSize;
- }
-
- public void setMaxFrameSize(int maxFrameSize)
- {
- _maxFrameSize = maxFrameSize;
- }
-
- public int getChannelMax()
- {
- return _channelMax;
- }
-
- public void setChannelMax(int channelMax)
- {
- _channelMax = channelMax;
- }
-
- public long getIdleTimeOut()
- {
- return _idleTimeOut;
- }
-
- public void setIdleTimeOut(long idleTimeOut)
- {
- _idleTimeOut = idleTimeOut;
- }
-
- public String[] getOutgoingLocales()
- {
- return _outgoingLocales;
- }
-
- public void setOutgoingLocales(String... outgoingLocales)
- {
- _outgoingLocales = outgoingLocales;
- }
-
- public String[] getIncomingLocales()
- {
- return _incomingLocales;
- }
-
- public void setIncomingLocales(String... incomingLocales)
- {
- _incomingLocales = incomingLocales;
- }
-
- public String[] getOfferedCapabilities()
- {
- return _offeredCapabilities;
- }
-
- public void setOfferedCapabilities(String... offeredCapabilities)
- {
- _offeredCapabilities = offeredCapabilities;
- }
-
- public String[] getDesiredCapabilities()
- {
- return _desiredCapabilities;
- }
-
- public void setDesiredCapabilities(String... desiredCapabilities)
- {
- _desiredCapabilities = desiredCapabilities;
- }
-
- public Map<Object, Object> getProperties()
- {
- return _properties;
- }
-
- public void setProperties(Map<Object, Object> properties)
- {
- _properties = properties;
- }
-
- @Override
- public String toString()
- {
- return "Open{" + " containerId='" + _containerId + '\'' + ", hostname='" + _hostname + '\'' + ", maxFrameSize="
- + _maxFrameSize + ", channelMax=" + _channelMax + ", idleTimeOut=" + _idleTimeOut
- + ", outgoingLocales=" + (_outgoingLocales == null ? null : Arrays.asList(_outgoingLocales))
- + ", incomingLocales=" + (_incomingLocales == null ? null : Arrays.asList(_incomingLocales))
- + ", offeredCapabilities="
- + (_offeredCapabilities == null ? null : Arrays.asList(_offeredCapabilities))
- + ", desiredCapabilities="
- + (_desiredCapabilities == null ? null : Arrays.asList(_desiredCapabilities)) + ", properties="
- + _properties + '}';
- }
-
- @Override
- public void encode(Encoder encoder)
- {
- encoder.putDescriptor();
- encoder.putUlong(DESCRIPTOR_LONG);
- encoder.putList();
- encoder.putString(_containerId);
- encoder.putString(_hostname);
- encoder.putUint(_maxFrameSize);
- encoder.putUint(_channelMax);
- encoder.putLong(_idleTimeOut);
- encoder.putArray(Type.STRING);
- CodecHelper.encodeSymbolArray(encoder, _outgoingLocales);
- CodecHelper.encodeSymbolArray(encoder, _incomingLocales);
- CodecHelper.encodeSymbolArray(encoder, _offeredCapabilities);
- CodecHelper.encodeSymbolArray(encoder, _desiredCapabilities);
- encoder.end();
- }
-
- public static final class Factory implements DescribedTypeFactory
- {
- public Object create(Object in) throws DecodeException
- {
- List<Object> l = (List<Object>) in;
-
- Open open = new Open();
-
- switch (10 - l.size())
- {
- case 0:
- open.setProperties((Map) l.get(9));
- case 1:
- Object val1 = l.get(8);
- if (val1 == null || val1.getClass().isArray())
- {
- open.setDesiredCapabilities((String[]) val1);
- }
- else
- {
- open.setDesiredCapabilities((String) val1);
- }
- case 2:
- Object val2 = l.get(7);
- if (val2 == null || val2.getClass().isArray())
- {
- open.setOfferedCapabilities((String[]) val2);
- }
- else
- {
- open.setOfferedCapabilities((String) val2);
- }
- case 3:
- Object val3 = l.get(6);
- if (val3 == null || val3.getClass().isArray())
- {
- open.setIncomingLocales((String[]) val3);
- }
- else
- {
- open.setIncomingLocales((String) val3);
- }
- case 4:
- Object val4 = l.get(5);
- if (val4 == null || val4.getClass().isArray())
- {
- open.setOutgoingLocales((String[]) val4);
- }
- else
- {
- open.setOutgoingLocales((String) val4);
- }
- case 5:
- open.setIdleTimeOut((long) l.get(4));
- case 6:
- open.setChannelMax(l.get(3) == null ? Integer.MAX_VALUE : (int) l.get(3));
- case 7:
- open.setMaxFrameSize(l.get(2) == null ? Integer.MAX_VALUE : (int) l.get(2));
- case 8:
- open.setHostname((String) l.get(1));
- case 9:
- open.setContainerId((String) l.get(0));
- }
-
- return open;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/06ab7d1b/proton-j/src/main/java/org/apache/qpid/proton/transport/Flow.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/transport/Flow.java b/proton-j/src/main/java/org/apache/qpid/proton/transport/Flow.java
new file mode 100644
index 0000000..bc5eafb
--- /dev/null
+++ b/proton-j/src/main/java/org/apache/qpid/proton/transport/Flow.java
@@ -0,0 +1,247 @@
+/*
+ *
+ * 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.amqp.transport2;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.qpid.proton.codec2.CodecHelper;
+import org.apache.qpid.proton.codec2.DecodeException;
+import org.apache.qpid.proton.codec2.Encodable;
+import org.apache.qpid.proton.codec2.Encoder;
+import org.apache.qpid.proton.codec2.DescribedTypeFactory;
+
+public class Flow implements Encodable
+{
+ public final static long DESCRIPTOR_LONG = 0x0000000000000013L;
+
+ public final static String DESCRIPTOR_STRING = "amqp:flow:list";
+
+ private long _nextIncomingId;
+
+ private long _incomingWindow;
+
+ private long _nextOutgoingId;
+
+ private long _outgoingWindow;
+
+ private long _handle;
+
+ private long _deliveryCount;
+
+ private long _linkCredit;
+
+ private long _available;
+
+ private boolean _drain;
+
+ private boolean _echo;
+
+ private Map<Object, Object> _properties;
+
+ public long getNextIncomingId()
+ {
+ return _nextIncomingId;
+ }
+
+ public void setNextIncomingId(long nextIncomingId)
+ {
+ _nextIncomingId = nextIncomingId;
+ }
+
+ public long getIncomingWindow()
+ {
+ return _incomingWindow;
+ }
+
+ public void setIncomingWindow(long incomingWindow)
+ {
+ _incomingWindow = incomingWindow;
+ }
+
+ public long getNextOutgoingId()
+ {
+ return _nextOutgoingId;
+ }
+
+ public void setNextOutgoingId(long nextOutgoingId)
+ {
+ _nextOutgoingId = nextOutgoingId;
+ }
+
+ public long getOutgoingWindow()
+ {
+ return _outgoingWindow;
+ }
+
+ public void setOutgoingWindow(long outgoingWindow)
+ {
+ _outgoingWindow = outgoingWindow;
+ }
+
+ public long getHandle()
+ {
+ return _handle;
+ }
+
+ public void setHandle(long handle)
+ {
+ _handle = handle;
+ }
+
+ public long getDeliveryCount()
+ {
+ return _deliveryCount;
+ }
+
+ public void setDeliveryCount(long deliveryCount)
+ {
+ _deliveryCount = deliveryCount;
+ }
+
+ public long getLinkCredit()
+ {
+ return _linkCredit;
+ }
+
+ public void setLinkCredit(long linkCredit)
+ {
+ _linkCredit = linkCredit;
+ }
+
+ public long getAvailable()
+ {
+ return _available;
+ }
+
+ public void setAvailable(long available)
+ {
+ _available = available;
+ }
+
+ public boolean getDrain()
+ {
+ return _drain;
+ }
+
+ public void setDrain(boolean drain)
+ {
+ _drain = drain;
+ }
+
+ public boolean getEcho()
+ {
+ return _echo;
+ }
+
+ public void setEcho(boolean echo)
+ {
+ _echo = echo;
+ }
+
+ public Map<Object, Object> getProperties()
+ {
+ return _properties;
+ }
+
+ public void setProperties(Map<Object, Object> properties)
+ {
+ _properties = properties;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Flow{" + "nextIncomingId=" + _nextIncomingId + ", incomingWindow=" + _incomingWindow
+ + ", nextOutgoingId=" + _nextOutgoingId + ", outgoingWindow=" + _outgoingWindow + ", handle=" + _handle
+ + ", deliveryCount=" + _deliveryCount + ", linkCredit=" + _linkCredit + ", available=" + _available
+ + ", drain=" + _drain + ", echo=" + _echo + ", properties=" + _properties + '}';
+ }
+
+ @Override
+ public void encode(Encoder encoder)
+ {
+ encoder.putDescriptor();
+ encoder.putUlong(DESCRIPTOR_LONG);
+ encoder.putList();
+ encoder.putLong(_nextIncomingId);
+ encoder.putLong(_incomingWindow);
+ encoder.putLong(_nextOutgoingId);
+ encoder.putLong(_outgoingWindow);
+ encoder.putLong(_handle);
+ encoder.putLong(_deliveryCount);
+ encoder.putLong(_linkCredit);
+ encoder.putLong(_available);
+ if (_drain)
+ {
+ encoder.putBoolean(true);
+ }
+ if (_echo)
+ {
+ encoder.putBoolean(true);
+ }
+ if (_properties != null && _properties.size() > 0)
+ {
+ CodecHelper.encodeMap(encoder, _properties);
+ }
+ encoder.end();
+ }
+
+ public static final class Factory implements DescribedTypeFactory
+ {
+ public Object create(Object in) throws DecodeException
+ {
+ List<Object> l = (List<Object>) in;
+
+ Flow flow = new Flow();
+
+ switch (11 - l.size())
+ {
+
+ case 0:
+ flow.setProperties(((Map<Object, Object>) l.get(10)));
+ case 1:
+ flow.setEcho(l.get(9) == null ? false : (Boolean) l.get(9));
+ case 2:
+ flow.setDrain(l.get(8) == null ? false : (Boolean) l.get(8));
+ case 3:
+ flow.setAvailable((int) l.get(7));
+ case 4:
+ flow.setLinkCredit((int) l.get(6));
+ case 5:
+ flow.setDeliveryCount((int) l.get(5));
+ case 6:
+ flow.setHandle((int) l.get(4));
+ case 7:
+ flow.setOutgoingWindow((int) l.get(3));
+ case 8:
+ flow.setNextOutgoingId((int) l.get(2));
+ case 9:
+ flow.setIncomingWindow((int) l.get(1));
+ case 10:
+ flow.setNextIncomingId((int) l.get(0));
+ }
+
+ return flow;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/06ab7d1b/proton-j/src/main/java/org/apache/qpid/proton/transport/Open.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/transport/Open.java b/proton-j/src/main/java/org/apache/qpid/proton/transport/Open.java
new file mode 100644
index 0000000..fdb05d4
--- /dev/null
+++ b/proton-j/src/main/java/org/apache/qpid/proton/transport/Open.java
@@ -0,0 +1,266 @@
+/*
+ *
+ * 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.amqp.transport2;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.qpid.proton.codec2.CodecHelper;
+import org.apache.qpid.proton.codec2.DecodeException;
+import org.apache.qpid.proton.codec2.DescribedTypeFactory;
+import org.apache.qpid.proton.codec2.Encodable;
+import org.apache.qpid.proton.codec2.Encoder;
+import org.apache.qpid.proton.codec2.Type;
+
+public final class Open implements Encodable
+{
+ public final static long DESCRIPTOR_LONG = 0x0000000000000010L;
+
+ public final static String DESCRIPTOR_STRING = "amqp:open:list";
+
+ private String _containerId;
+
+ private String _hostname;
+
+ private int _maxFrameSize = 0xffffffff;
+
+ private int _channelMax = 65535;
+
+ private long _idleTimeOut;
+
+ private String[] _outgoingLocales;
+
+ private String[] _incomingLocales;
+
+ private String[] _offeredCapabilities;
+
+ private String[] _desiredCapabilities;
+
+ private Map<Object, Object> _properties;
+
+ public String getContainerId()
+ {
+ return _containerId;
+ }
+
+ public void setContainerId(String containerId)
+ {
+ if (containerId == null)
+ {
+ throw new NullPointerException("the container-id field is mandatory");
+ }
+
+ _containerId = containerId;
+ }
+
+ public String getHostname()
+ {
+ return _hostname;
+ }
+
+ public void setHostname(String hostname)
+ {
+ _hostname = hostname;
+ }
+
+ public int getMaxFrameSize()
+ {
+ return _maxFrameSize;
+ }
+
+ public void setMaxFrameSize(int maxFrameSize)
+ {
+ _maxFrameSize = maxFrameSize;
+ }
+
+ public int getChannelMax()
+ {
+ return _channelMax;
+ }
+
+ public void setChannelMax(int channelMax)
+ {
+ _channelMax = channelMax;
+ }
+
+ public long getIdleTimeOut()
+ {
+ return _idleTimeOut;
+ }
+
+ public void setIdleTimeOut(long idleTimeOut)
+ {
+ _idleTimeOut = idleTimeOut;
+ }
+
+ public String[] getOutgoingLocales()
+ {
+ return _outgoingLocales;
+ }
+
+ public void setOutgoingLocales(String... outgoingLocales)
+ {
+ _outgoingLocales = outgoingLocales;
+ }
+
+ public String[] getIncomingLocales()
+ {
+ return _incomingLocales;
+ }
+
+ public void setIncomingLocales(String... incomingLocales)
+ {
+ _incomingLocales = incomingLocales;
+ }
+
+ public String[] getOfferedCapabilities()
+ {
+ return _offeredCapabilities;
+ }
+
+ public void setOfferedCapabilities(String... offeredCapabilities)
+ {
+ _offeredCapabilities = offeredCapabilities;
+ }
+
+ public String[] getDesiredCapabilities()
+ {
+ return _desiredCapabilities;
+ }
+
+ public void setDesiredCapabilities(String... desiredCapabilities)
+ {
+ _desiredCapabilities = desiredCapabilities;
+ }
+
+ public Map<Object, Object> getProperties()
+ {
+ return _properties;
+ }
+
+ public void setProperties(Map<Object, Object> properties)
+ {
+ _properties = properties;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Open{" + " containerId='" + _containerId + '\'' + ", hostname='" + _hostname + '\'' + ", maxFrameSize="
+ + _maxFrameSize + ", channelMax=" + _channelMax + ", idleTimeOut=" + _idleTimeOut
+ + ", outgoingLocales=" + (_outgoingLocales == null ? null : Arrays.asList(_outgoingLocales))
+ + ", incomingLocales=" + (_incomingLocales == null ? null : Arrays.asList(_incomingLocales))
+ + ", offeredCapabilities="
+ + (_offeredCapabilities == null ? null : Arrays.asList(_offeredCapabilities))
+ + ", desiredCapabilities="
+ + (_desiredCapabilities == null ? null : Arrays.asList(_desiredCapabilities)) + ", properties="
+ + _properties + '}';
+ }
+
+ @Override
+ public void encode(Encoder encoder)
+ {
+ encoder.putDescriptor();
+ encoder.putUlong(DESCRIPTOR_LONG);
+ encoder.putList();
+ encoder.putString(_containerId);
+ encoder.putString(_hostname);
+ encoder.putUint(_maxFrameSize);
+ encoder.putUint(_channelMax);
+ encoder.putLong(_idleTimeOut);
+ encoder.putArray(Type.STRING);
+ CodecHelper.encodeSymbolArray(encoder, _outgoingLocales);
+ CodecHelper.encodeSymbolArray(encoder, _incomingLocales);
+ CodecHelper.encodeSymbolArray(encoder, _offeredCapabilities);
+ CodecHelper.encodeSymbolArray(encoder, _desiredCapabilities);
+ encoder.end();
+ }
+
+ public static final class Factory implements DescribedTypeFactory
+ {
+ public Object create(Object in) throws DecodeException
+ {
+ List<Object> l = (List<Object>) in;
+
+ Open open = new Open();
+
+ switch (10 - l.size())
+ {
+ case 0:
+ open.setProperties((Map) l.get(9));
+ case 1:
+ Object val1 = l.get(8);
+ if (val1 == null || val1.getClass().isArray())
+ {
+ open.setDesiredCapabilities((String[]) val1);
+ }
+ else
+ {
+ open.setDesiredCapabilities((String) val1);
+ }
+ case 2:
+ Object val2 = l.get(7);
+ if (val2 == null || val2.getClass().isArray())
+ {
+ open.setOfferedCapabilities((String[]) val2);
+ }
+ else
+ {
+ open.setOfferedCapabilities((String) val2);
+ }
+ case 3:
+ Object val3 = l.get(6);
+ if (val3 == null || val3.getClass().isArray())
+ {
+ open.setIncomingLocales((String[]) val3);
+ }
+ else
+ {
+ open.setIncomingLocales((String) val3);
+ }
+ case 4:
+ Object val4 = l.get(5);
+ if (val4 == null || val4.getClass().isArray())
+ {
+ open.setOutgoingLocales((String[]) val4);
+ }
+ else
+ {
+ open.setOutgoingLocales((String) val4);
+ }
+ case 5:
+ open.setIdleTimeOut((long) l.get(4));
+ case 6:
+ open.setChannelMax(l.get(3) == null ? Integer.MAX_VALUE : (int) l.get(3));
+ case 7:
+ open.setMaxFrameSize(l.get(2) == null ? Integer.MAX_VALUE : (int) l.get(2));
+ case 8:
+ open.setHostname((String) l.get(1));
+ case 9:
+ open.setContainerId((String) l.get(0));
+ }
+
+ return open;
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org