Package org.apache.qpid.proton.amqp.messaging

Examples of org.apache.qpid.proton.amqp.messaging.MessageAnnotations


         long messageFormat = message.getLongProperty(MESSAGE_FORMAT);
         Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);

         Header header = populateHeader(message, deliveryCount);
         DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
         MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
         Properties props = populateProperties(message);
         ApplicationProperties applicationProperties = populateApplicationProperties(message);
         Section section = populateBody(message);
         Footer footer = populateFooter(message);
         Set<SimpleString> propertyNames = message.getPropertyNames();
         for (SimpleString propertyName : propertyNames)
         {
            TypedProperties typedProperties = message.getTypedProperties();
            String realName = propertyName.toString();
            if (realName.startsWith(MESSAGE_ANNOTATIONS))
            {

               SimpleString value = (SimpleString) typedProperties.getProperty(propertyName);
               Symbol symbol = Symbol.getSymbol(realName.replace(MESSAGE_ANNOTATIONS, ""));
               messageAnnotations.getValue().put(symbol, value.toString());
            }
         }
         MessageImpl protonMessage = new MessageImpl(header, deliveryAnnotations, messageAnnotations, props, applicationProperties, section, footer);
         protonMessage.setMessageFormat(getMessageFormat(message.getLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT))));
         ByteBuffer buffer = ByteBuffer.wrap(new byte[size]);
View Full Code Here


      }

      private static MessageAnnotations populateMessageAnnotations(ServerMessage message)
      {
         HashMap actualValues = new HashMap();
         MessageAnnotations messageAnnotations =  new MessageAnnotations(actualValues);
         for (SimpleString name : message.getPropertyNames())
         {
            String sName = name.toString();
            if(sName.startsWith(MESSAGE_ANNOTATIONS))
            {
View Full Code Here

         long messageFormat = message.getLongProperty(MESSAGE_FORMAT);
         Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);

         Header header = populateHeader(message, deliveryCount);
         DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
         MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
         Properties props = populateProperties(message);
         ApplicationProperties applicationProperties = populateApplicationProperties(message);
         Section section = populateBody(message);
         Footer footer = populateFooter(message);
         Set<SimpleString> propertyNames = message.getPropertyNames();
         for (SimpleString propertyName : propertyNames)
         {
            TypedProperties typedProperties = message.getTypedProperties();
            String realName = propertyName.toString();
            if (realName.startsWith(MESSAGE_ANNOTATIONS))
            {

               SimpleString value = (SimpleString) typedProperties.getProperty(propertyName);
               Symbol symbol = Symbol.getSymbol(realName.replace(MESSAGE_ANNOTATIONS, ""));
               messageAnnotations.getValue().put(symbol, value.toString());
            }
         }
         MessageImpl protonMessage = new MessageImpl(header, deliveryAnnotations, messageAnnotations, props, applicationProperties, section, footer);
         protonMessage.setMessageFormat(getMessageFormat(message.getLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT))));
         ByteBuffer buffer = ByteBuffer.wrap(new byte[size]);
View Full Code Here

      }

      private static MessageAnnotations populateMessageAnnotations(ServerMessage message)
      {
         HashMap actualValues = new HashMap();
         MessageAnnotations messageAnnotations =  new MessageAnnotations(actualValues);
         for (SimpleString name : message.getPropertyNames())
         {
            String sName = name.toString();
            if(sName.startsWith(MESSAGE_ANNOTATIONS))
            {
View Full Code Here

    {
        JNIData data = new JNIData(Proton.pn_message_annotations(_impl));
        if(data.next() == DataType.MAP)
        {
            Map map = data.getJavaMap();
            _messageAnnotations = new MessageAnnotations(map);
        }
        else
        {
            _messageAnnotations = null;
        }
View Full Code Here

        }

        Class<? extends Destination> toAttributes = Destination.class;
        Class<? extends Destination> replyToAttributes = Destination.class;

        final MessageAnnotations ma = amqp.getMessageAnnotations();
        if( ma!=null ) {
            for (Map.Entry entry : (Set<Map.Entry>)ma.getValue().entrySet()) {
                String key = entry.getKey().toString();
                if( "x-opt-jms-type".equals(key) ) {
                    jms.setJMSType(entry.getValue().toString());
                } else if( "x-opt-to-type".equals(key) ) {
                    toAttributes = toClassFromAttributes(entry.getValue().toString());
View Full Code Here

        }

        Class<? extends Destination> toAttributes = Destination.class;
        Class<? extends Destination> replyToAttributes = Destination.class;

        final MessageAnnotations ma = amqp.getMessageAnnotations();
        if( ma!=null ) {
            for (Map.Entry entry : (Set<Map.Entry>)ma.getValue().entrySet()) {
                String key = entry.getKey().toString();
                if( "x-opt-jms-type".equals(key) ) {
                    jms.setJMSType(entry.getValue().toString());
                } else if( "x-opt-to-type".equals(key) ) {
                    toAttributes = toClassFromAttributes(entry.getValue().toString());
View Full Code Here

    {
        JNIData data = new JNIData(Proton.pn_message_annotations(_impl));
        if(data.next() == DataType.MAP)
        {
            Map map = data.getJavaMap();
            _messageAnnotations = new MessageAnnotations(map);
        }
        else
        {
            _messageAnnotations = null;
        }
View Full Code Here

    }


    public MessageAnnotations newInstance(Object described)
    {
        return new MessageAnnotations( (Map) described );
    }
View Full Code Here

         long messageFormat = message.getLongProperty(MESSAGE_FORMAT);
         Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);

         Header header = populateHeader(message, deliveryCount);
         DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
         MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
         Properties props = populateProperties(message);
         ApplicationProperties applicationProperties = populateApplicationProperties(message);
         Section section = populateBody(message);
         Footer footer = populateFooter(message);
         Set<SimpleString> propertyNames = message.getPropertyNames();
         for (SimpleString propertyName : propertyNames)
         {
            TypedProperties typedProperties = message.getTypedProperties();
            String realName = propertyName.toString();
            if (realName.startsWith(MESSAGE_ANNOTATIONS))
            {

               SimpleString value = (SimpleString) typedProperties.getProperty(propertyName);
               Symbol symbol = Symbol.getSymbol(realName.replace(MESSAGE_ANNOTATIONS, ""));
               messageAnnotations.getValue().put(symbol, value.toString());
            }
         }
         MessageImpl protonMessage = new MessageImpl(header, deliveryAnnotations, messageAnnotations, props, applicationProperties, section, footer);
         protonMessage.setMessageFormat(getMessageFormat(message.getLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT))));
         ByteBuffer buffer = ByteBuffer.wrap(new byte[size]);
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.amqp.messaging.MessageAnnotations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.