You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ph...@apache.org on 2012/12/17 15:20:43 UTC
svn commit: r1422941 [1/2] - in /qpid/proton/branches/kgiusti-proton-136: ./
proton-c/ proton-c/examples/messenger/c/ proton-c/src/ proton-c/src/codec/
proton-c/src/framing/ proton-j/
proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/p...
Author: philharveyonline
Date: Mon Dec 17 14:20:38 2012
New Revision: 1422941
URL: http://svn.apache.org/viewvc?rev=1422941&view=rev
Log:
PROTON-136: up-merged from trunk revision 1420994. This required SslDomain.java and SslPeerDetails.java to be
moved to proton-j/proton-api/ directory to conform to new layout.
The svn merge command was:
svn merge -r1419512:HEAD https://svn.apache.org/repos/asf/qpid/proton/trunk .
Added:
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/
- copied from r1421338, qpid/proton/trunk/proton-j/proton-api/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslDomain.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslEngineFacade.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/amqp/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/amqp/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/AMQPDefinedTypes.java
- copied unchanged from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/AMQPDefinedTypes.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/AbstractDescribedType.java
- copied unchanged from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/AbstractDescribedType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/messaging/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/messaging/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/security/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/security/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/transaction/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/transaction/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/transport/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/transport/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/impl/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/message/impl/
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/
- copied from r1421338, qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/
Removed:
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/Connector.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/Driver.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/Listener.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Connection.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Delivery.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Endpoint.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/EndpointError.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/EndpointState.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Link.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/ProtonException.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Receiver.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Sasl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Sender.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Session.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Ssl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/SslDomain.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/Transport.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/TransportException.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslEngineFacade.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/AMQPMessageFormat.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/Message.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/MessageError.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/MessageFormat.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/message/MessageFormatException.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/type/
Modified:
qpid/proton/branches/kgiusti-proton-136/ (props changed)
qpid/proton/branches/kgiusti-proton-136/proton-c/CMakeLists.txt
qpid/proton/branches/kgiusti-proton-136/proton-c/examples/messenger/c/recv.c
qpid/proton/branches/kgiusti-proton-136/proton-c/src/codec/codec.c
qpid/proton/branches/kgiusti-proton-136/proton-c/src/driver.c
qpid/proton/branches/kgiusti-proton-136/proton-c/src/framing/framing.c
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpReceiver.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSender.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSession.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/MessageDelivery.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/EncodedMessage.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformer.java
qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
qpid/proton/branches/kgiusti-proton-136/proton-j/pom.xml
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Ssl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Transport.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/pom.xml
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/BinaryType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Data.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal128Type.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal32Type.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal64Type.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decoder.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DecoderImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DescribedTypeConstructor.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DynamicDescribedType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Encoder.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/EncoderImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/PrimitiveTypeEncoding.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/SymbolType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/TypeEncoding.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/UnsignedByteType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/UnsignedIntegerType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/UnsignedLongType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/UnsignedShortType.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/impl/ConnectorImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/impl/DriverImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/driver/impl/ListenerImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/FrameParser.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/LinkImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ProtocolTracer.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/SaslFrameParser.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/SaslImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportDelivery.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportLink.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportReceiver.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportSender.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/TransportSession.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ssl/DefaultSslEngineFacade.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslDomainImpl.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslEngineFacadeFactory.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/framing/TransportFrame.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/scripts/proton.py
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/test/java/org/apache/qpid/proton/engine/impl/ssl/ByteHolderTest.java
qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/test/java/org/apache/qpid/proton/engine/impl/ssl/CapitalisingDummySslEngine.java
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/messenger.py
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/README.txt
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/bad-server-certificate.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/bad-server-private-key.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/ca-certificate.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/client-certificate.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/client-private-key.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/server-certificate.pem
qpid/proton/branches/kgiusti-proton-136/tests/proton_tests/ssl_db/server-private-key.pem
Propchange: qpid/proton/branches/kgiusti-proton-136/
------------------------------------------------------------------------------
Merged /qpid/proton/trunk:r1419688-1421338
Modified: qpid/proton/branches/kgiusti-proton-136/proton-c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-c/CMakeLists.txt?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-c/CMakeLists.txt (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-c/CMakeLists.txt Mon Dec 17 14:20:38 2012
@@ -269,6 +269,11 @@ install (FILES LICENSE README TODO
DESTINATION ${PROTON_SHARE})
# Pkg config file
+# Compatible variable names used in the pkg config files also for autoconf
+get_filename_component (PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE)
+get_filename_component (EXEC_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE)
+get_filename_component (LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} ABSOLUTE)
+get_filename_component (INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR} ABSOLUTE)
configure_file(${PROJECT_SOURCE_DIR}/src/libqpid-proton.pc.in
${PROJECT_BINARY_DIR}/libqpid-proton.pc @ONLY)
Modified: qpid/proton/branches/kgiusti-proton-136/proton-c/examples/messenger/c/recv.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-c/examples/messenger/c/recv.c?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-c/examples/messenger/c/recv.c (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-c/examples/messenger/c/recv.c Mon Dec 17 14:20:38 2012
@@ -142,7 +142,7 @@ int main(int argc, char** argv)
printf("Address: %s\n", pn_message_get_address(message));
const char* subject = pn_message_get_subject(message);
- printf("Subject: %s\n", !subject ? subject : "(no subject)");
+ printf("Subject: %s\n", subject ? subject : "(no subject)");
printf("Content: %s\n", buffer);
}
}
Modified: qpid/proton/branches/kgiusti-proton-136/proton-c/src/codec/codec.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-c/src/codec/codec.c?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-c/src/codec/codec.c (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-c/src/codec/codec.c Mon Dec 17 14:20:38 2012
@@ -28,7 +28,6 @@
#include <stdarg.h>
#include <stdlib.h>
#include <inttypes.h>
-#include <arpa/inet.h>
#include <ctype.h>
#include "encodings.h"
#include "../util.h"
@@ -485,7 +484,7 @@ uint8_t pn_type2code(pn_type_t type)
}
}
-int pn_bytes_writef8(pn_bytes_t *bytes, uint8_t value)
+static inline int pn_i_bytes_writef8(pn_bytes_t *bytes, uint8_t value)
{
if (bytes->size) {
bytes->start[0] = value;
@@ -496,42 +495,50 @@ int pn_bytes_writef8(pn_bytes_t *bytes,
}
}
-int pn_bytes_writef16(pn_bytes_t *bytes, uint16_t value)
+static inline int pn_i_bytes_writef16(pn_bytes_t *bytes, uint16_t value)
{
if (bytes->size < 2) {
return PN_OVERFLOW;
} else {
- *((uint16_t *) (bytes->start)) = htons(value);
+ bytes->start[0] = 0xFF & (value >> 8);
+ bytes->start[1] = 0xFF & (value );
pn_bytes_ltrim(bytes, 2);
return 0;
}
}
-int pn_bytes_writef32(pn_bytes_t *bytes, uint32_t value)
+static inline int pn_i_bytes_writef32(pn_bytes_t *bytes, uint32_t value)
{
if (bytes->size < 4) {
return PN_OVERFLOW;
} else {
- *((uint32_t *) (bytes->start)) = htonl(value);
- pn_bytes_ltrim(bytes, 4);
+ bytes->start[0] = 0xFF & (value >> 24);
+ bytes->start[1] = 0xFF & (value >> 16);
+ bytes->start[2] = 0xFF & (value >> 8);
+ bytes->start[3] = 0xFF & (value );
+ pn_bytes_ltrim(bytes, 4);
return 0;
}
}
-int pn_bytes_writef64(pn_bytes_t *bytes, uint64_t value) {
+static inline int pn_i_bytes_writef64(pn_bytes_t *bytes, uint64_t value) {
if (bytes->size < 8) {
return PN_OVERFLOW;
} else {
- uint32_t hi = value >> 32;
- uint32_t lo = value;
- *((uint32_t *) (bytes->start)) = htonl(hi);
- *((uint32_t *) (bytes->start + 4)) = htonl(lo);
- pn_bytes_ltrim(bytes, 8);
+ bytes->start[0] = 0xFF & (value >> 56);
+ bytes->start[1] = 0xFF & (value >> 48);
+ bytes->start[2] = 0xFF & (value >> 40);
+ bytes->start[3] = 0xFF & (value >> 32);
+ bytes->start[4] = 0xFF & (value >> 24);
+ bytes->start[5] = 0xFF & (value >> 16);
+ bytes->start[6] = 0xFF & (value >> 8);
+ bytes->start[7] = 0xFF & (value );
+ pn_bytes_ltrim(bytes, 8);
return 0;
}
}
-int pn_bytes_writef128(pn_bytes_t *bytes, char *value) {
+static inline int pn_i_bytes_writef128(pn_bytes_t *bytes, char *value) {
if (bytes->size < 16) {
return PN_OVERFLOW;
} else {
@@ -541,12 +548,12 @@ int pn_bytes_writef128(pn_bytes_t *bytes
}
}
-int pn_bytes_writev8(pn_bytes_t *bytes, const pn_bytes_t *value)
+static inline int pn_i_bytes_writev8(pn_bytes_t *bytes, const pn_bytes_t *value)
{
if (bytes->size < 1 + value->size) {
return PN_OVERFLOW;
} else {
- int e = pn_bytes_writef8(bytes, value->size);
+ int e = pn_i_bytes_writef8(bytes, value->size);
if (e) return e;
memmove(bytes->start, value->start, value->size);
pn_bytes_ltrim(bytes, value->size);
@@ -554,12 +561,12 @@ int pn_bytes_writev8(pn_bytes_t *bytes,
}
}
-int pn_bytes_writev32(pn_bytes_t *bytes, const pn_bytes_t *value)
+static inline int pn_i_bytes_writev32(pn_bytes_t *bytes, const pn_bytes_t *value)
{
if (bytes->size < 4 + value->size) {
return PN_OVERFLOW;
} else {
- int e = pn_bytes_writef32(bytes, value->size);
+ int e = pn_i_bytes_writef32(bytes, value->size);
if (e) return e;
memmove(bytes->start, value->start, value->size);
pn_bytes_ltrim(bytes, value->size);
@@ -662,6 +669,44 @@ pn_type_t pn_code2type(uint8_t code)
}
}
+static inline uint8_t pn_i_bytes_readf8(pn_bytes_t *bytes)
+{
+ uint8_t r = bytes->start[0];
+ pn_bytes_ltrim(bytes, 1);
+ return r;
+}
+
+static inline uint16_t pn_i_bytes_readf16(pn_bytes_t *bytes)
+{
+ uint16_t a = (uint8_t) bytes->start[0];
+ uint16_t b = (uint8_t) bytes->start[1];
+ uint16_t r = a << 8
+ | b;
+ pn_bytes_ltrim(bytes, 2);
+ return r;
+}
+
+static inline uint32_t pn_i_bytes_readf32(pn_bytes_t *bytes)
+{
+ uint32_t a = (uint8_t) bytes->start[0];
+ uint32_t b = (uint8_t) bytes->start[1];
+ uint32_t c = (uint8_t) bytes->start[2];
+ uint32_t d = (uint8_t) bytes->start[3];
+ uint32_t r = a << 24
+ | b << 16
+ | c << 8
+ | d;
+ pn_bytes_ltrim(bytes, 4);
+ return r;
+}
+
+static inline uint64_t pn_i_bytes_readf64(pn_bytes_t *bytes)
+{
+ uint64_t a = pn_i_bytes_readf32(bytes);
+ uint64_t b = pn_i_bytes_readf32(bytes);
+ return a << 32 | b;
+}
+
int pn_decode_value(pn_bytes_t *bytes, pn_atoms_t *atoms, uint8_t code)
{
size_t size;
@@ -687,118 +732,89 @@ int pn_decode_value(pn_bytes_t *bytes, p
break;
case PNE_BOOLEAN:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_BOOL, atom.u.as_bool=(*(bytes->start) != 0);
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_BOOL, atom.u.as_bool=(pn_i_bytes_readf8(bytes) != 0);
break;
case PNE_UBYTE:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_UBYTE, atom.u.as_ubyte=*((uint8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_UBYTE, atom.u.as_ubyte=pn_i_bytes_readf8(bytes);
break;
case PNE_BYTE:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_BYTE, atom.u.as_byte=*((int8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_BYTE, atom.u.as_byte=(int8_t) pn_i_bytes_readf8(bytes);
break;
case PNE_USHORT:
if (bytes->size < 2) return PN_UNDERFLOW;
- atom.type=PN_USHORT, atom.u.as_ushort=ntohs(*((uint16_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 2);
+ atom.type=PN_USHORT, atom.u.as_ushort=pn_i_bytes_readf16(bytes);
break;
case PNE_SHORT:
if (bytes->size < 2) return PN_UNDERFLOW;
- atom.type=PN_SHORT, atom.u.as_short=ntohs(*((int16_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 2);
+ atom.type=PN_SHORT, atom.u.as_short=(int16_t) pn_i_bytes_readf16(bytes);
break;
case PNE_UINT:
if (bytes->size < 4) return PN_UNDERFLOW;
- atom.type=PN_UINT, atom.u.as_uint=ntohl(*((uint32_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 4);
+ atom.type=PN_UINT, atom.u.as_uint=pn_i_bytes_readf32(bytes);
break;
case PNE_UINT0:
atom.type=PN_UINT, atom.u.as_uint=0;
break;
case PNE_SMALLUINT:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_UINT, atom.u.as_uint=*((uint8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_UINT, atom.u.as_uint=pn_i_bytes_readf8(bytes);
break;
case PNE_SMALLINT:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_INT, atom.u.as_uint=*((int8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_INT, atom.u.as_int=pn_i_bytes_readf8(bytes);
break;
case PNE_INT:
if (bytes->size < 4) return PN_UNDERFLOW;
- atom.type=PN_INT, atom.u.as_int=ntohl(*((uint32_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 4);
+ atom.type=PN_INT, atom.u.as_int=(int32_t) pn_i_bytes_readf32(bytes);
break;
case PNE_UTF32:
if (bytes->size < 4) return PN_UNDERFLOW;
- atom.type=PN_CHAR, atom.u.as_char=ntohl(*((uint32_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 4);
+ atom.type=PN_CHAR, atom.u.as_char=pn_i_bytes_readf32(bytes);
break;
case PNE_FLOAT:
if (bytes->size < 4) return PN_UNDERFLOW;
// XXX: this assumes the platform uses IEEE floats
- conv.i = ntohl(*((uint32_t *) (bytes->start)));
+ conv.i = pn_i_bytes_readf32(bytes);
atom.type=PN_FLOAT, atom.u.as_float=conv.f;
- pn_bytes_ltrim(bytes, 4);
break;
case PNE_DECIMAL32:
if (bytes->size < 4) return PN_UNDERFLOW;
- atom.type=PN_DECIMAL32, atom.u.as_decimal32=ntohl(*((uint32_t *) (bytes->start)));
- pn_bytes_ltrim(bytes, 4);
+ atom.type=PN_DECIMAL32, atom.u.as_decimal32=pn_i_bytes_readf32(bytes);
break;
case PNE_ULONG:
+ if (bytes->size < 8) return PN_UNDERFLOW;
+ atom.type=PN_ULONG, atom.u.as_ulong=pn_i_bytes_readf64(bytes);
+ break;
case PNE_LONG:
+ if (bytes->size < 8) return PN_UNDERFLOW;
+ atom.type=PN_LONG, atom.u.as_long=(int64_t) pn_i_bytes_readf64(bytes);
+ break;
case PNE_MS64:
+ if (bytes->size < 8) return PN_UNDERFLOW;
+ atom.type=PN_TIMESTAMP, atom.u.as_timestamp=(pn_timestamp_t) pn_i_bytes_readf64(bytes);
+ break;
case PNE_DOUBLE:
+ // XXX: this assumes the platform uses IEEE floats
+ if (bytes->size < 8) return PN_UNDERFLOW;
+ conv.l = pn_i_bytes_readf64(bytes);
+ atom.type=PN_DOUBLE, atom.u.as_double=conv.d;
+ break;
case PNE_DECIMAL64:
if (bytes->size < 8) return PN_UNDERFLOW;
-
- {
- uint32_t hi = ntohl(*((uint32_t *) (bytes->start)));
- uint32_t lo = ntohl(*((uint32_t *) (bytes->start + 4)));
- conv.l = (((uint64_t) hi) << 32) | lo;
- }
-
- switch (code)
- {
- case PNE_ULONG:
- atom.type=PN_ULONG, atom.u.as_ulong=conv.l;
- break;
- case PNE_LONG:
- atom.type=PN_LONG, atom.u.as_long=(int64_t) conv.l;
- break;
- case PNE_MS64:
- atom.type=PN_TIMESTAMP, atom.u.as_timestamp=(pn_timestamp_t) conv.l;
- break;
- case PNE_DOUBLE:
- // XXX: this assumes the platform uses IEEE floats
- atom.type=PN_DOUBLE, atom.u.as_double=conv.d;
- break;
- case PNE_DECIMAL64:
- atom.type=PN_DECIMAL64, atom.u.as_decimal64=conv.l;
- break;
- default:
- return PN_ARG_ERR;
- }
-
- pn_bytes_ltrim(bytes, 8);
+ atom.type=PN_DECIMAL64, atom.u.as_decimal64=pn_i_bytes_readf64(bytes);
break;
case PNE_ULONG0:
atom.type=PN_ULONG, atom.u.as_ulong=0;
break;
case PNE_SMALLULONG:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_ULONG, atom.u.as_ulong=*((uint8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_ULONG, atom.u.as_ulong=pn_i_bytes_readf8(bytes);
break;
case PNE_SMALLLONG:
if (!bytes->size) return PN_UNDERFLOW;
- atom.type=PN_LONG, atom.u.as_long=*((int8_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 1);
+ atom.type=PN_LONG, atom.u.as_long=(int8_t) pn_i_bytes_readf8(bytes);
break;
case PNE_DECIMAL128:
if (bytes->size < 16) return PN_UNDERFLOW;
@@ -822,13 +838,11 @@ int pn_decode_value(pn_bytes_t *bytes, p
{
case 0xA0:
if (!bytes->size) return PN_UNDERFLOW;
- size = *(uint8_t *) (bytes->start);
- pn_bytes_ltrim(bytes, 1);
+ size = pn_i_bytes_readf8(bytes);
break;
case 0xB0:
if (bytes->size < 4) return PN_UNDERFLOW;
- size = ntohl(*(uint32_t *) (bytes->start));
- pn_bytes_ltrim(bytes, 4);
+ size = pn_i_bytes_readf32(bytes);
break;
default:
return PN_ARG_ERR;
@@ -871,16 +885,14 @@ int pn_decode_value(pn_bytes_t *bytes, p
case PNE_LIST8:
case PNE_MAP8:
if (bytes->size < 2) return PN_UNDERFLOW;
- size = *(uint8_t *) (bytes->start);
- count = *(uint8_t *) (bytes->start + 1);
- pn_bytes_ltrim(bytes, 2);
+ size = pn_i_bytes_readf8(bytes);
+ count = pn_i_bytes_readf8(bytes);
break;
case PNE_ARRAY32:
case PNE_LIST32:
case PNE_MAP32:
- size = ntohl(*(uint32_t *) (bytes->start));
- count = ntohl(*(uint32_t *) (bytes->start + 4));
- pn_bytes_ltrim(bytes, 8);
+ size = pn_i_bytes_readf32(bytes);
+ count = pn_i_bytes_readf32(bytes);
break;
default:
return PN_ARG_ERR;
@@ -2087,12 +2099,12 @@ static int pn_data_encode_node(pn_data_t
if (parent && parent->atom.type == PN_ARRAY) {
code = pn_type2code(parent->type);
if (!node->prev || (node->prev && parent->described && !pn_data_node(data, node->prev)->prev)) {
- err = pn_bytes_writef8(bytes, code);
+ err = pn_i_bytes_writef8(bytes, code);
if (err) return err;
}
} else {
code = pn_node2code(node);
- err = pn_bytes_writef8(bytes, code);
+ err = pn_i_bytes_writef8(bytes, code);
if (err) return err;
}
@@ -2101,33 +2113,33 @@ static int pn_data_encode_node(pn_data_t
case PNE_NULL:
case PNE_TRUE:
case PNE_FALSE: return 0;
- case PNE_BOOLEAN: return pn_bytes_writef8(bytes, atom->u.as_bool);
- case PNE_UBYTE: return pn_bytes_writef8(bytes, atom->u.as_ubyte);
- case PNE_BYTE: return pn_bytes_writef8(bytes, atom->u.as_byte);
- case PNE_USHORT: return pn_bytes_writef16(bytes, atom->u.as_ushort);
- case PNE_SHORT: return pn_bytes_writef16(bytes, atom->u.as_short);
+ case PNE_BOOLEAN: return pn_i_bytes_writef8(bytes, atom->u.as_bool);
+ case PNE_UBYTE: return pn_i_bytes_writef8(bytes, atom->u.as_ubyte);
+ case PNE_BYTE: return pn_i_bytes_writef8(bytes, atom->u.as_byte);
+ case PNE_USHORT: return pn_i_bytes_writef16(bytes, atom->u.as_ushort);
+ case PNE_SHORT: return pn_i_bytes_writef16(bytes, atom->u.as_short);
case PNE_UINT0: return 0;
- case PNE_SMALLUINT: return pn_bytes_writef8(bytes, atom->u.as_uint);
- case PNE_UINT: return pn_bytes_writef32(bytes, atom->u.as_uint);
- case PNE_SMALLINT: pn_bytes_writef8(bytes, atom->u.as_int);
- case PNE_INT: return pn_bytes_writef32(bytes, atom->u.as_int);
- case PNE_UTF32: return pn_bytes_writef32(bytes, atom->u.as_char);
- case PNE_ULONG: return pn_bytes_writef64(bytes, atom->u.as_ulong);
- case PNE_SMALLULONG: return pn_bytes_writef8(bytes, atom->u.as_ulong);
- case PNE_LONG: return pn_bytes_writef64(bytes, atom->u.as_long);
- case PNE_MS64: return pn_bytes_writef64(bytes, atom->u.as_timestamp);
- case PNE_FLOAT: c.f = atom->u.as_float; return pn_bytes_writef32(bytes, c.i);
- case PNE_DOUBLE: c.d = atom->u.as_double; return pn_bytes_writef64(bytes, c.l);
- case PNE_DECIMAL32: return pn_bytes_writef32(bytes, atom->u.as_decimal32);
- case PNE_DECIMAL64: return pn_bytes_writef64(bytes, atom->u.as_decimal64);
- case PNE_DECIMAL128: return pn_bytes_writef128(bytes, atom->u.as_decimal128.bytes);
- case PNE_UUID: return pn_bytes_writef128(bytes, atom->u.as_uuid.bytes);
- case PNE_VBIN8: return pn_bytes_writev8(bytes, &atom->u.as_binary);
- case PNE_VBIN32: return pn_bytes_writev32(bytes, &atom->u.as_binary);
- case PNE_STR8_UTF8: return pn_bytes_writev8(bytes, &atom->u.as_string);
- case PNE_STR32_UTF8: return pn_bytes_writev32(bytes, &atom->u.as_string);
- case PNE_SYM8: return pn_bytes_writev8(bytes, &atom->u.as_symbol);
- case PNE_SYM32: return pn_bytes_writev32(bytes, &atom->u.as_symbol);
+ case PNE_SMALLUINT: return pn_i_bytes_writef8(bytes, atom->u.as_uint);
+ case PNE_UINT: return pn_i_bytes_writef32(bytes, atom->u.as_uint);
+ case PNE_SMALLINT: return pn_i_bytes_writef8(bytes, atom->u.as_int);
+ case PNE_INT: return pn_i_bytes_writef32(bytes, atom->u.as_int);
+ case PNE_UTF32: return pn_i_bytes_writef32(bytes, atom->u.as_char);
+ case PNE_ULONG: return pn_i_bytes_writef64(bytes, atom->u.as_ulong);
+ case PNE_SMALLULONG: return pn_i_bytes_writef8(bytes, atom->u.as_ulong);
+ case PNE_LONG: return pn_i_bytes_writef64(bytes, atom->u.as_long);
+ case PNE_MS64: return pn_i_bytes_writef64(bytes, atom->u.as_timestamp);
+ case PNE_FLOAT: c.f = atom->u.as_float; return pn_i_bytes_writef32(bytes, c.i);
+ case PNE_DOUBLE: c.d = atom->u.as_double; return pn_i_bytes_writef64(bytes, c.l);
+ case PNE_DECIMAL32: return pn_i_bytes_writef32(bytes, atom->u.as_decimal32);
+ case PNE_DECIMAL64: return pn_i_bytes_writef64(bytes, atom->u.as_decimal64);
+ case PNE_DECIMAL128: return pn_i_bytes_writef128(bytes, atom->u.as_decimal128.bytes);
+ case PNE_UUID: return pn_i_bytes_writef128(bytes, atom->u.as_uuid.bytes);
+ case PNE_VBIN8: return pn_i_bytes_writev8(bytes, &atom->u.as_binary);
+ case PNE_VBIN32: return pn_i_bytes_writev32(bytes, &atom->u.as_binary);
+ case PNE_STR8_UTF8: return pn_i_bytes_writev8(bytes, &atom->u.as_string);
+ case PNE_STR32_UTF8: return pn_i_bytes_writev32(bytes, &atom->u.as_string);
+ case PNE_SYM8: return pn_i_bytes_writev8(bytes, &atom->u.as_symbol);
+ case PNE_SYM32: return pn_i_bytes_writev32(bytes, &atom->u.as_symbol);
case PNE_ARRAY32:
node->start = bytes->start;
node->small = false;
@@ -2135,11 +2147,11 @@ static int pn_data_encode_node(pn_data_t
if (bytes->size < 4) return PN_OVERFLOW;
pn_bytes_ltrim(bytes, 4);
- err = pn_bytes_writef32(bytes, node->described ? node->children - 1 : node->children);
+ err = pn_i_bytes_writef32(bytes, node->described ? node->children - 1 : node->children);
if (err) return err;
if (node->described) {
- err = pn_bytes_writef8(bytes, 0);
+ err = pn_i_bytes_writef8(bytes, 0);
if (err) return err;
}
return 0;
@@ -2150,7 +2162,7 @@ static int pn_data_encode_node(pn_data_t
// we'll backfill the size later
if (bytes->size < 4) return PN_OVERFLOW;
pn_bytes_ltrim(bytes, 4);
- return pn_bytes_writef32(bytes, node->children);
+ return pn_i_bytes_writef32(bytes, node->children);
default:
return pn_error_format(data->error, PN_ERR, "unrecognized encoding: %u", code);
}
@@ -2163,7 +2175,7 @@ static int pn_data_encode_node_exit(pn_d
case PN_ARRAY:
if ((node->described && node->children == 1) ||
(!node->described && node->children == 0)) {
- int err = pn_bytes_writef8(bytes, pn_type2code(node->type));
+ int err = pn_i_bytes_writef8(bytes, pn_type2code(node->type));
if (err) return err;
}
case PN_LIST:
@@ -2172,12 +2184,12 @@ static int pn_data_encode_node_exit(pn_d
// backfill size
size_t size = bytes->start - node->start - 1;
pn_bytes_t size_bytes = {1, node->start};
- return pn_bytes_writef8(&size_bytes, size);
+ return pn_i_bytes_writef8(&size_bytes, size);
} else {
// backfill size
size_t size = bytes->start - node->start - 4;
pn_bytes_t size_bytes = {4, node->start};
- return pn_bytes_writef32(&size_bytes, size);
+ return pn_i_bytes_writef32(&size_bytes, size);
}
default:
return 0;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-c/src/driver.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-c/src/driver.c?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-c/src/driver.c (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-c/src/driver.c Mon Dec 17 14:20:38 2012
@@ -354,13 +354,16 @@ pn_connector_t *pn_connector(pn_driver_t
return NULL;
}
+ pn_configure_sock(sock);
+
if (connect(sock, addr->ai_addr, addr->ai_addrlen) == -1) {
- pn_error_from_errno(driver->error, "connect");
- freeaddrinfo(addr);
- return NULL;
+ if (errno != EINPROGRESS) {
+ pn_error_from_errno(driver->error, "connect");
+ freeaddrinfo(addr);
+ return NULL;
+ }
}
- pn_configure_sock(sock);
freeaddrinfo(addr);
pn_connector_t *c = pn_connector_fd(driver, sock, context);
@@ -796,6 +799,8 @@ void pn_driver_wait_3(pn_driver_t *d)
c->pending_read = (idx && d->fds[idx].revents & POLLIN);
c->pending_write = (idx && d->fds[idx].revents & POLLOUT);
c->pending_tick = (c->wakeup && c->wakeup <= now);
+ if (idx && d->fds[idx].revents & POLLERR)
+ pn_connector_close(c);
}
c = c->connector_next;
}
Modified: qpid/proton/branches/kgiusti-proton-136/proton-c/src/framing/framing.c
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-c/src/framing/framing.c?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-c/src/framing/framing.c (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-c/src/framing/framing.c Mon Dec 17 14:20:38 2012
@@ -21,20 +21,59 @@
#include <stdio.h>
#include <string.h>
-#include <arpa/inet.h>
#include <proton/framing.h>
+// TODO: These are near duplicates of code in codec.c - they should be
+// deduplicated.
+static inline void pn_i_write16(char *bytes, uint16_t value)
+{
+ bytes[0] = 0xFF & (value >> 8);
+ bytes[1] = 0xFF & (value );
+}
+
+
+static inline void pn_i_write32(char *bytes, uint32_t value)
+{
+ bytes[0] = 0xFF & (value >> 24);
+ bytes[1] = 0xFF & (value >> 16);
+ bytes[2] = 0xFF & (value >> 8);
+ bytes[3] = 0xFF & (value );
+}
+
+static inline uint16_t pn_i_read16(const char *bytes)
+{
+ uint16_t a = (uint8_t) bytes[0];
+ uint16_t b = (uint8_t) bytes[1];
+ uint16_t r = a << 8
+ | b;
+ return r;
+}
+
+static inline uint32_t pn_i_read32(const char *bytes)
+{
+ uint32_t a = (uint8_t) bytes[0];
+ uint32_t b = (uint8_t) bytes[1];
+ uint32_t c = (uint8_t) bytes[2];
+ uint32_t d = (uint8_t) bytes[3];
+ uint32_t r = a << 24
+ | b << 16
+ | c << 8
+ | d;
+ return r;
+}
+
+
size_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available)
{
if (available >= AMQP_HEADER_SIZE) {
- size_t size = htonl(*((uint32_t *) bytes));
+ size_t size = pn_i_read32(&bytes[0]);
if (available >= size)
{
int doff = bytes[4]*4;
frame->size = size - doff;
frame->ex_size = doff - AMQP_HEADER_SIZE;
frame->type = bytes[5];
- frame->channel = htons(*((uint16_t *) (bytes + 6)));
+ frame->channel = pn_i_read16(&bytes[6]);
frame->extended = bytes + AMQP_HEADER_SIZE;
frame->payload = bytes + doff;
@@ -50,11 +89,11 @@ size_t pn_write_frame(char *bytes, size_
size_t size = AMQP_HEADER_SIZE + frame.ex_size + frame.size;
if (size <= available)
{
- *((uint32_t *) bytes) = ntohl(size);
+ pn_i_write32(&bytes[0], size);
int doff = (frame.ex_size + AMQP_HEADER_SIZE - 1)/4 + 1;
bytes[4] = doff;
bytes[5] = frame.type;
- *((uint16_t *) (bytes + 6)) = ntohs(frame.channel);
+ pn_i_write16(&bytes[6], frame.channel);
memmove(bytes + AMQP_HEADER_SIZE, frame.extended, frame.ex_size);
memmove(bytes + 4*doff, frame.payload, frame.size);
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpReceiver.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpReceiver.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpReceiver.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpReceiver.java Mon Dec 17 14:20:38 2012
@@ -21,7 +21,7 @@ import org.apache.qpid.proton.hawtdispat
import org.apache.qpid.proton.engine.Delivery;
import org.apache.qpid.proton.engine.impl.DeliveryImpl;
import org.apache.qpid.proton.engine.impl.ReceiverImpl;
-import org.apache.qpid.proton.type.messaging.Accepted;
+import org.apache.qpid.proton.amqp.messaging.Accepted;
import org.fusesource.hawtbuf.Buffer;
import org.fusesource.hawtbuf.ByteArrayOutputStream;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSender.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSender.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSender.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSender.java Mon Dec 17 14:20:38 2012
@@ -23,11 +23,12 @@ import org.apache.qpid.proton.engine.Del
import org.apache.qpid.proton.engine.impl.DeliveryImpl;
import org.apache.qpid.proton.engine.impl.SenderImpl;
import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.type.messaging.Accepted;
-import org.apache.qpid.proton.type.messaging.Modified;
-import org.apache.qpid.proton.type.messaging.Rejected;
-import org.apache.qpid.proton.type.messaging.Released;
-import org.apache.qpid.proton.type.transport.DeliveryState;
+import org.apache.qpid.proton.amqp.messaging.Accepted;
+import org.apache.qpid.proton.amqp.messaging.Modified;
+import org.apache.qpid.proton.amqp.messaging.Rejected;
+import org.apache.qpid.proton.amqp.messaging.Released;
+import org.apache.qpid.proton.amqp.transport.DeliveryState;
+import org.apache.qpid.proton.message.impl.MessageImpl;
import org.fusesource.hawtbuf.Buffer;
import java.io.UnsupportedEncodingException;
@@ -75,7 +76,7 @@ public class AmqpSender extends AmqpLink
final LinkedList<MessageDelivery> outbound = new LinkedList<MessageDelivery>();
long outboundBufferSize;
- public MessageDelivery send(Message message) {
+ public MessageDelivery send(MessageImpl message) {
assertExecuting();
MessageDelivery rc = new MessageDelivery(message) {
@Override
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSession.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSession.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSession.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/AmqpSession.java Mon Dec 17 14:20:38 2012
@@ -17,17 +17,20 @@
package org.apache.qpid.proton.hawtdispatch.api;
+import org.apache.qpid.proton.amqp.messaging.Section;
+import org.apache.qpid.proton.amqp.transport.ReceiverSettleMode;
import org.apache.qpid.proton.engine.Endpoint;
import org.apache.qpid.proton.engine.Link;
import org.apache.qpid.proton.engine.impl.ReceiverImpl;
import org.apache.qpid.proton.engine.impl.SenderImpl;
import org.apache.qpid.proton.engine.impl.SessionImpl;
import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.type.Binary;
-import org.apache.qpid.proton.type.messaging.*;
-import org.apache.qpid.proton.type.transport.SenderSettleMode;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.messaging.*;
+import org.apache.qpid.proton.amqp.transport.SenderSettleMode;
import java.util.UUID;
+import org.apache.qpid.proton.message.impl.MessageImpl;
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -106,21 +109,21 @@ public class AmqpSession extends AmqpEnd
switch (qos) {
case AT_MOST_ONCE:
link.setSenderSettleMode(SenderSettleMode.SETTLED);
- link.setReceiverSettleMode(SenderSettleMode.UNSETTLED);
+ link.setReceiverSettleMode(ReceiverSettleMode.FIRST);
break;
case AT_LEAST_ONCE:
link.setSenderSettleMode(SenderSettleMode.UNSETTLED);
- link.setReceiverSettleMode(SenderSettleMode.SETTLED);
+ link.setReceiverSettleMode(ReceiverSettleMode.FIRST);
break;
case EXACTLY_ONCE:
link.setSenderSettleMode(SenderSettleMode.UNSETTLED);
- link.setReceiverSettleMode(SenderSettleMode.MIXED);
+ link.setReceiverSettleMode(ReceiverSettleMode.SECOND);
break;
}
}
public Message createTextMessage(String value) {
- Message msg = new Message();
+ Message msg = new MessageImpl();
Section body = new AmqpValue(value);
msg.setBody(body);
return msg;
@@ -131,7 +134,7 @@ public class AmqpSession extends AmqpEnd
}
public Message createBinaryMessage(byte value[], int offset, int len) {
- Message msg = new Message();
+ Message msg = new MessageImpl();
Data body = new Data(new Binary(value, offset,len));
msg.setBody(body);
return msg;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/MessageDelivery.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/MessageDelivery.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/MessageDelivery.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-hawtdispatch/src/main/java/org/apache/qpid/proton/hawtdispatch/api/MessageDelivery.java Mon Dec 17 14:20:38 2012
@@ -24,7 +24,8 @@ import org.apache.qpid.proton.codec.Comp
import org.apache.qpid.proton.codec.WritableBuffer;
import org.apache.qpid.proton.engine.impl.DeliveryImpl;
import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.type.transport.DeliveryState;
+import org.apache.qpid.proton.amqp.transport.DeliveryState;
+import org.apache.qpid.proton.message.impl.MessageImpl;
import org.fusesource.hawtbuf.Buffer;
import org.fusesource.hawtdispatch.Task;
@@ -36,12 +37,12 @@ import java.nio.ByteBuffer;
public abstract class MessageDelivery extends WatchBase {
final int initialSize;
- private Message message;
+ private MessageImpl message;
private Buffer encoded;
public DeliveryImpl delivery;
private int sizeHint = 1024*4;
- static Buffer encode(Message message, int sizeHint) {
+ static Buffer encode(MessageImpl message, int sizeHint) {
ByteBuffer buffer = ByteBuffer.wrap(new byte[sizeHint]);
DroppingWritableBuffer overflow = new DroppingWritableBuffer();
int c = message.encode(new CompositeWritableBuffer(new WritableBuffer.ByteBufferWrapper(buffer), overflow));
@@ -52,8 +53,8 @@ public abstract class MessageDelivery ex
return new Buffer(buffer.array(), 0, c);
}
- static Message decode(Buffer buffer) {
- Message msg = new Message();
+ static MessageImpl decode(Buffer buffer) {
+ MessageImpl msg = new MessageImpl();
int offset = buffer.offset;
int len = buffer.length;
while( len > 0 ) {
@@ -65,7 +66,7 @@ public abstract class MessageDelivery ex
return msg;
}
- public MessageDelivery(Message message) {
+ public MessageDelivery(MessageImpl message) {
this(message, encode(message, 1024*4));
}
@@ -73,7 +74,7 @@ public abstract class MessageDelivery ex
this(null, encoded);
}
- public MessageDelivery(Message message, Buffer encoded) {
+ public MessageDelivery(MessageImpl message, Buffer encoded) {
this.message = message;
this.encoded = encoded;
sizeHint = this.encoded.length;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AMQPNativeOutboundTransformer.java Mon Dec 17 14:20:38 2012
@@ -18,13 +18,14 @@ package org.apache.qpid.proton.jms;
import org.apache.qpid.proton.codec.CompositeWritableBuffer;
import org.apache.qpid.proton.codec.WritableBuffer;
-import org.apache.qpid.proton.type.UnsignedInteger;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageFormatException;
import java.nio.ByteBuffer;
+import org.apache.qpid.proton.message.impl.MessageImpl;
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -68,7 +69,7 @@ public class AMQPNativeOutboundTransform
if( count > 1 ) {
// decode...
- org.apache.qpid.proton.message.Message amqp = new org.apache.qpid.proton.message.Message();
+ MessageImpl amqp = new MessageImpl();
int offset = 0;
int len = data.length;
while( len > 0 ) {
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/EncodedMessage.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/EncodedMessage.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/EncodedMessage.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/EncodedMessage.java Mon Dec 17 14:20:38 2012
@@ -17,17 +17,20 @@
package org.apache.qpid.proton.jms;
import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.type.Binary;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.message.impl.MessageImpl;
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
-public class EncodedMessage extends Binary {
+public class EncodedMessage
+{
+ private final Binary data;
final long messageFormat;
public EncodedMessage(long messageFormat, byte[] data, int offset, int length) {
- super(data, offset, length);
+ this.data = new Binary(data, offset, length);
this.messageFormat = messageFormat;
}
@@ -36,7 +39,7 @@ public class EncodedMessage extends Bina
}
public Message decode() throws Exception {
- Message amqp = new Message();
+ Message amqp = new MessageImpl();
int offset = getArrayOffset();
int len = getLength();
@@ -49,4 +52,25 @@ public class EncodedMessage extends Bina
return amqp;
}
+
+ public int getLength()
+ {
+ return data.getLength();
+ }
+
+ public int getArrayOffset()
+ {
+ return data.getArrayOffset();
+ }
+
+ public byte[] getArray()
+ {
+ return data.getArray();
+ }
+
+ @Override
+ public String toString()
+ {
+ return data.toString();
+ }
}
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java Mon Dec 17 14:20:38 2012
@@ -16,13 +16,13 @@
*/
package org.apache.qpid.proton.jms;
-import org.apache.qpid.proton.type.Binary;
-import org.apache.qpid.proton.type.messaging.ApplicationProperties;
-import org.apache.qpid.proton.type.messaging.DeliveryAnnotations;
-import org.apache.qpid.proton.type.messaging.Footer;
-import org.apache.qpid.proton.type.messaging.Header;
-import org.apache.qpid.proton.type.messaging.MessageAnnotations;
-import org.apache.qpid.proton.type.messaging.Properties;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
+import org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations;
+import org.apache.qpid.proton.amqp.messaging.Footer;
+import org.apache.qpid.proton.amqp.messaging.Header;
+import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
+import org.apache.qpid.proton.amqp.messaging.Properties;
import javax.jms.*;
import javax.jms.JMSException;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformer.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformer.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformer.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformer.java Mon Dec 17 14:20:38 2012
@@ -16,8 +16,9 @@
*/
package org.apache.qpid.proton.jms;
-import org.apache.qpid.proton.type.Binary;
-import org.apache.qpid.proton.type.messaging.*;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.messaging.Section;
+import org.apache.qpid.proton.amqp.messaging.*;
import javax.jms.*;
import java.io.Serializable;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java Mon Dec 17 14:20:38 2012
@@ -16,13 +16,14 @@
*/
package org.apache.qpid.proton.jms;
+import org.apache.qpid.proton.amqp.messaging.Section;
import org.apache.qpid.proton.codec.CompositeWritableBuffer;
import org.apache.qpid.proton.codec.WritableBuffer;
-import org.apache.qpid.proton.type.Binary;
-import org.apache.qpid.proton.type.Symbol;
-import org.apache.qpid.proton.type.UnsignedByte;
-import org.apache.qpid.proton.type.UnsignedInteger;
-import org.apache.qpid.proton.type.messaging.*;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.UnsignedByte;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.messaging.*;
import javax.jms.*;
import java.io.UnsupportedEncodingException;
@@ -31,6 +32,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
+import org.apache.qpid.proton.message.impl.MessageImpl;
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -206,7 +208,7 @@ public class JMSMappingOutboundTransform
Footer footer=null;
if( footerMap!=null ) footer = new Footer(footerMap);
- org.apache.qpid.proton.message.Message amqp = new org.apache.qpid.proton.message.Message(header, da, ma, props, ap, body, footer);
+ MessageImpl amqp = new MessageImpl(header, da, ma, props, ap, body, footer);
ByteBuffer buffer = ByteBuffer.wrap(new byte[1024*4]);
final DroppingWritableBuffer overflow = new DroppingWritableBuffer();
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/pom.xml
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/pom.xml?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/pom.xml (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/pom.xml Mon Dec 17 14:20:38 2012
@@ -63,6 +63,7 @@
</build>
<modules>
+ <module>proton-api</module>
<module>proton</module>
<module>contrib/proton-jms</module>
<module>contrib/proton-hawtdispatch</module>
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Ssl.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Ssl.java?rev=1422941&r1=1421338&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Ssl.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Ssl.java Mon Dec 17 14:20:38 2012
@@ -1,6 +1,4 @@
-package org.apache.qpid.proton.engine;
/*
- *
* 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
@@ -19,130 +17,31 @@ package org.apache.qpid.proton.engine;
* under the License.
*
*/
+package org.apache.qpid.proton.engine;
+/**
+ * I represent the details of a particular SSL session.
+ */
public interface Ssl
{
- public enum Mode
- {
- CLIENT, /** Local connection endpoint is an SSL client */
- SERVER /** Local connection endpoint is an SSL server */
- }
-
-
- /** Initialize the pn_ssl_t object.
- *
- * An SSL object be either an SSL server or an SSL client. It cannot be both. Those
- * transports that will be used to accept incoming connection requests must be configured
- * as an SSL server. Those transports that will be used to initiate outbound connections
- * must be configured as an SSL client.
- *
- */
- void init(Mode mode);
-
- Mode getMode();
-
- /** Set the certificate that identifies the local node to the remote.
- *
- * This certificate establishes the identity for the local node. It will be sent to the
- * remote if the remote needs to verify the identity of this node. This may be used for
- * both SSL servers and SSL clients (if client authentication is required by the server).
- *
- * @param certificate_file path to file/database containing the identifying
- * certificate.
- * @param private_key_file path to file/database containing the private key used to
- * sign the certificate
- * @param password the password used to sign the key, else NULL if key is not
- * protected.
- */
- void setCredentials( String certificate_file,
- String private_key_file,
- String password);
-
- String getPrivateKeyFile(); // TODO
- String getPrivateKeyPassword();
-
- String getCertificateFile();
-
- /** Configure the set of trusted CA certificates used by this node to verify peers.
- *
- * If the local SSL client/server needs to verify the identity of the remote, it must
- * validate the signature of the remote's certificate. This function sets the database of
- * trusted CAs that will be used to verify the signature of the remote's certificate.
- *
- * @param certificate_db database of trusted CAs, used to authenticate the peer.
- */
-
- void setTrustedCaDb(String certificate_db);
-
- String getTrustedCaDb();
-
- /** Permit a server to accept connection requests from non-SSL clients.
- *
- * This configures the server to "sniff" the incoming client data stream, and dynamically
- * determine whether SSL/TLS is being used. This option is disabled by default: only
- * clients using SSL/TLS are accepted.
- *
- */
- void allowUnsecuredClient(boolean allowUnsecured);
-
- /** Determines the level of peer validation.
- *
- * VERIFY_PEER will only connect to those peers that provide a valid identifying
- * certificate signed by a trusted CA and are using an authenticated cipher.
- * ANONYMOUS_PEER does not require a valid certificate, and permits use of ciphers that
- * do not provide authentication.
- *
- * ANONYMOUS_PEER is configured by default.
- *
- * These settings can be changed via ::pn_ssl_set_peer_authentication()
- */
- public enum VerifyMode
- {
- VERIFY_PEER, /** require peer to provide a valid identifying certificate */
- ANONYMOUS_PEER, /** do not require a certificate nor cipher authorization */
- }
-
-
- /** Configure the level of verification used on the peer certificate.
- *
- * This method controls how the peer's certificate is validated, if at all. By default,
- * neither servers nor clients attempt to verify their peers (PN_SSL_ANONYMOUS_PEER).
- * Once certificates and trusted CAs are configured, peer verification can be enabled.
- *
- * In order to verify a peer, a trusted CA must be configured. See
- * #setTrustedCaDb().
- *
- * @note Servers must provide their own certificate when verifying a peer. See
- * #setCredentials().
- *
- * @param mode the level of validation to apply to the peer
- */
- void setPeerAuthentication(VerifyMode mode);
-
- VerifyMode getPeerAuthentication();
-
- /** Get the name of the Cipher that is currently in use.
+ /**
+ * Get the name of the Cipher that is currently in use.
*
* Gets a text description of the cipher that is currently active, or returns null if SSL
- * is not active (no cipher). Note that the cipher in use may change over time due to
+ * is not active (no cipher). Note that the cipher in use may change over time due to
* renegotiation or other changes to the SSL state.
*
* @return the name of the cipher in use, or null if none
*/
String getCipherName();
- /** Get the name of the SSL protocol that is currently in use.
+ /**
+ * Get the name of the SSL protocol that is currently in use.
*
* Gets a text description of the SSL protocol that is currently active, or null if SSL
- * is not active. Note that the protocol may change over time due to renegotiation.
+ * is not active. Note that the protocol may change over time due to renegotiation.
*
* @return the name of the protocol in use, or null if none
*/
String getProtocolName();
-
-
-
-
-
-
}
Added: qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslDomain.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslDomain.java?rev=1422941&view=auto
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslDomain.java (added)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslDomain.java Mon Dec 17 14:20:38 2012
@@ -0,0 +1,142 @@
+/*
+ * 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.engine;
+
+/**
+ * I store the details used to create SSL sessions.
+ */
+public interface SslDomain
+{
+ /**
+ * Determines whether the endpoint acts as a client or server.
+ */
+ public enum Mode
+ {
+ /** Local connection endpoint is an SSL client */
+ CLIENT,
+
+ /** Local connection endpoint is an SSL server */
+ SERVER
+ }
+
+ /**
+ * Determines the level of peer validation.
+ *
+ * {@link #ANONYMOUS_PEER} is configured by default.
+ */
+ public enum VerifyMode
+ {
+ /**
+ * will only connect to those peers that provide a valid identifying certificate signed
+ * by a trusted CA and are using an authenticated cipher
+ */
+ VERIFY_PEER,
+
+ /**
+ * does not require a valid certificate, and permits use of ciphers that
+ * do not provide authentication
+ */
+ ANONYMOUS_PEER,
+ }
+
+ /**
+ * Initialize the ssl domain object.
+ *
+ * An SSL object be either an SSL server or an SSL client. It cannot be both. Those
+ * transports that will be used to accept incoming connection requests must be configured
+ * as an SSL server. Those transports that will be used to initiate outbound connections
+ * must be configured as an SSL client.
+ *
+ */
+ void init(Mode mode);
+
+ Mode getMode();
+
+ /**
+ * Set the certificate that identifies the local node to the remote.
+ *
+ * This certificate establishes the identity for the local node. It will be sent to the
+ * remote if the remote needs to verify the identity of this node. This may be used for
+ * both SSL servers and SSL clients (if client authentication is required by the server).
+ *
+ * @param certificateFile path to file/database containing the identifying
+ * certificate.
+ * @param privateKeyFile path to file/database containing the private key used to
+ * sign the certificate
+ * @param password the password used to sign the key, else null if key is not
+ * protected.
+ */
+ void setCredentials(String certificateFile, String privateKeyFile, String password);
+
+ String getPrivateKeyFile();
+
+ String getPrivateKeyPassword();
+
+ String getCertificateFile();
+
+ /**
+ * Configure the set of trusted CA certificates used by this node to verify peers.
+ *
+ * If the local SSL client/server needs to verify the identity of the remote, it must
+ * validate the signature of the remote's certificate. This function sets the database of
+ * trusted CAs that will be used to verify the signature of the remote's certificate.
+ *
+ * @param certificateDb database of trusted CAs, used to authenticate the peer.
+ */
+ void setTrustedCaDb(String certificateDb);
+
+ String getTrustedCaDb();
+
+ /**
+ * Configure the level of verification used on the peer certificate.
+ *
+ * This method controls how the peer's certificate is validated, if at all. By default,
+ * neither servers nor clients attempt to verify their peers ({@link VerifyMode#ANONYMOUS_PEER}).
+ * Once certificates and trusted CAs are configured, peer verification can be enabled.
+ *
+ * In order to verify a peer, a trusted CA must be configured. See
+ * {@link #setTrustedCaDb(String)}.
+ *
+ * @note Servers must provide their own certificate when verifying a peer. See
+ * {@link #setCredentials(String, String, String)}).
+ *
+ * @param mode the level of validation to apply to the peer
+ */
+ void setPeerAuthentication(VerifyMode mode);
+
+ VerifyMode getPeerAuthentication();
+
+ /**
+ * Permit a server to accept connection requests from non-SSL clients.
+ *
+ * This configures the server to "sniff" the incoming client data stream, and dynamically
+ * determine whether SSL/TLS is being used. This option is disabled by default: only
+ * clients using SSL/TLS are accepted.
+ */
+ void allowUnsecuredClient(boolean allowUnsecured);
+
+ boolean allowUnsecuredClient();
+
+ /**
+ * Returns an SSL engine. Only intended to be used inside {@link Transport#ssl(SslDomain, SslPeerDetailsImpl)}.
+ *
+ * @param sslPeerDetails the details of the remote peer. If non-null, may be used to assist SSL session resumption.
+ */
+ SslEngineFacade createSslEngine(SslPeerDetails sslPeerDetails);
+}
Added: qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslEngineFacade.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslEngineFacade.java?rev=1422941&view=auto
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslEngineFacade.java (added)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslEngineFacade.java Mon Dec 17 14:20:38 2012
@@ -0,0 +1,64 @@
+/*
+ * 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.engine;
+
+import java.nio.ByteBuffer;
+
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.net.ssl.SSLEngineResult.Status;
+import javax.net.ssl.SSLException;
+
+/**
+ * Thin wrapper around an {@link SSLEngine}.
+ */
+public interface SslEngineFacade
+{
+ /**
+ * @see SSLEngine#wrap(ByteBuffer, ByteBuffer)
+ *
+ * Note that wrap really does write <em>one</em> packet worth of data to the
+ * dst byte buffer. If dst byte buffer is insufficiently large the
+ * pointers within both src and dst are unchanged and the bytesConsumed and
+ * bytesProduced on the returned result are zero.
+ */
+ SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException;
+
+ /**
+ * @see SSLEngine#unwrap(ByteBuffer, ByteBuffer)
+ *
+ * Note that unwrap does read exactly one packet of encoded data from src
+ * and write to dst. If src contains insufficient bytes to read a complete
+ * packet {@link Status#BUFFER_UNDERFLOW} occurs. If underflow occurs the
+ * pointers within both src and dst are unchanged and the bytesConsumed and
+ * bytesProduced on the returned result are zero.
+ */
+ SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException;
+
+ Runnable getDelegatedTask();
+ HandshakeStatus getHandshakeStatus();
+
+ int getApplicationBufferSize();
+ int getPacketBufferSize();
+ String getCipherSuite();
+ String getProtocol();
+ boolean getUseClientMode();
+}
Added: qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java?rev=1422941&view=auto
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java (added)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java Mon Dec 17 14:20:38 2012
@@ -0,0 +1,33 @@
+/*
+ * 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.engine;
+
+/**
+ * The details of the remote peer involved in an SSL session.
+ *
+ * Used when creating an SSL session to hint that the underlying SSL implementation
+ * should attempt to resume a previous session if one exists for the same peer details,
+ * e.g. using session identifiers (http://tools.ietf.org/html/rfc5246) or session tickets
+ * (http://tools.ietf.org/html/rfc5077).
+ */
+public interface SslPeerDetails
+{
+ String getHostname();
+ int getPort();
+}
\ No newline at end of file
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Transport.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Transport.java?rev=1422941&r1=1421338&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Transport.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Transport.java Mon Dec 17 14:20:38 2012
@@ -59,6 +59,16 @@ public interface Transport extends Endpo
Sasl sasl();
- Ssl ssl();
+ /**
+ * Wrap this transport's output and input to apply SSL encryption and decryption respectively.
+ *
+ * @param sslPeerDetails may be null, in which case SSL session resume will not be attempted
+ * @return an {@link Ssl} object representing the SSL session.
+ */
+ Ssl ssl(SslDomain sslDomain, SslPeerDetails sslPeerDetails);
+ /**
+ * As per {@link #ssl(SslDomain, SslPeerDetails)} but no attempt is made to resume a previous SSL session.
+ */
+ Ssl ssl(SslDomain sslDomain);
}
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/pom.xml
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/pom.xml?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/pom.xml (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/pom.xml Mon Dec 17 14:20:38 2012
@@ -29,6 +29,12 @@
<dependencies>
<dependency>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>proton-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.47</version>
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/BinaryType.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/BinaryType.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/BinaryType.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/BinaryType.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.Binary;
+import org.apache.qpid.proton.amqp.Binary;
import java.util.Arrays;
import java.util.Collection;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Data.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Data.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Data.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Data.java Mon Dec 17 14:20:38 2012
@@ -20,12 +20,12 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.Binary;
-import org.apache.qpid.proton.type.Symbol;
-import org.apache.qpid.proton.type.UnsignedByte;
-import org.apache.qpid.proton.type.UnsignedInteger;
-import org.apache.qpid.proton.type.UnsignedLong;
-import org.apache.qpid.proton.type.UnsignedShort;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.UnsignedByte;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.UnsignedLong;
+import org.apache.qpid.proton.amqp.UnsignedShort;
public interface Data
{
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal128Type.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal128Type.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal128Type.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal128Type.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.Decimal128;
+import org.apache.qpid.proton.amqp.Decimal128;
import java.util.Collection;
import java.util.Collections;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal32Type.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal32Type.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal32Type.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal32Type.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.Decimal32;
+import org.apache.qpid.proton.amqp.Decimal32;
import java.util.Collection;
import java.util.Collections;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal64Type.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal64Type.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal64Type.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decimal64Type.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.Decimal64;
+import org.apache.qpid.proton.amqp.Decimal64;
import java.util.Collection;
import java.util.Collections;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decoder.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decoder.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decoder.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Decoder.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,15 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.*;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.Decimal128;
+import org.apache.qpid.proton.amqp.Decimal32;
+import org.apache.qpid.proton.amqp.Decimal64;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.UnsignedByte;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.UnsignedLong;
+import org.apache.qpid.proton.amqp.UnsignedShort;
import java.util.Date;
import java.util.List;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DecoderImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DecoderImpl.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DecoderImpl.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DecoderImpl.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,16 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.*;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.Decimal128;
+import org.apache.qpid.proton.amqp.Decimal32;
+import org.apache.qpid.proton.amqp.Decimal64;
+import org.apache.qpid.proton.amqp.DescribedType;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.UnsignedByte;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.UnsignedLong;
+import org.apache.qpid.proton.amqp.UnsignedShort;
import java.lang.reflect.Array;
import java.nio.ByteBuffer;
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DescribedTypeConstructor.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DescribedTypeConstructor.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DescribedTypeConstructor.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DescribedTypeConstructor.java Mon Dec 17 14:20:38 2012
@@ -20,9 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.DescribedType;
-
-public interface DescribedTypeConstructor<V extends DescribedType>
+public interface DescribedTypeConstructor<V>
{
V newInstance(Object described);
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DynamicDescribedType.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DynamicDescribedType.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DynamicDescribedType.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/DynamicDescribedType.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,7 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.DescribedType;
+import org.apache.qpid.proton.amqp.DescribedType;
import java.util.Collection;
import java.util.Collections;
@@ -119,7 +119,7 @@ public class DynamicDescribedType implem
public int getValueSize(final Object val)
{
- return _underlyingEncoding.getValueSize(((DescribedType)val).getDescribed());
+ return _underlyingEncoding.getValueSize(((DescribedType) val).getDescribed());
}
public boolean isFixedSizeVal()
@@ -134,19 +134,11 @@ public class DynamicDescribedType implem
._underlyingEncoding));
}
- public Object readValue()
- {
- return _underlyingEncoding.readValue();
- }
-
+ @Override
public boolean encodesJavaPrimitive()
{
return false;
}
- public Class getTypeClass()
- {
- return _underlyingEncoding.getTypeClass();
- }
}
}
Modified: qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Encoder.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Encoder.java?rev=1422941&r1=1422940&r2=1422941&view=diff
==============================================================================
--- qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Encoder.java (original)
+++ qpid/proton/branches/kgiusti-proton-136/proton-j/proton/src/main/java/org/apache/qpid/proton/codec/Encoder.java Mon Dec 17 14:20:38 2012
@@ -20,7 +20,16 @@
*/
package org.apache.qpid.proton.codec;
-import org.apache.qpid.proton.type.*;
+import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.Decimal128;
+import org.apache.qpid.proton.amqp.Decimal32;
+import org.apache.qpid.proton.amqp.Decimal64;
+import org.apache.qpid.proton.amqp.DescribedType;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.UnsignedByte;
+import org.apache.qpid.proton.amqp.UnsignedInteger;
+import org.apache.qpid.proton.amqp.UnsignedLong;
+import org.apache.qpid.proton.amqp.UnsignedShort;
import java.util.Date;
import java.util.List;
@@ -106,4 +115,7 @@ public interface Encoder
void writeObject(Object o);
+ <V> void register(AMQPType<V> type);
+
+ AMQPType getType(Object element);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org