本文整理汇总了Java中org.apache.qpid.proton.amqp.messaging.ApplicationProperties.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationProperties.getValue方法的具体用法?Java ApplicationProperties.getValue怎么用?Java ApplicationProperties.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.qpid.proton.amqp.messaging.ApplicationProperties
的用法示例。
在下文中一共展示了ApplicationProperties.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getApplicationPropertiesMap
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Map<String, Object> getApplicationPropertiesMap() {
ApplicationProperties appMap = getApplicationProperties();
Map<String, Object> map = null;
if (appMap != null) {
map = appMap.getValue();
}
if (map == null) {
map = new HashMap<>();
this.applicationProperties = new ApplicationProperties(map);
}
return map;
}
示例2: testJSON_to_AMQP_VerifyMessageApplicationProperties
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@Test
public void testJSON_to_AMQP_VerifyMessageApplicationProperties() {
String testPropKeyA = "testPropKeyA";
String testPropValueA = "testPropValueA";
String testPropKeyB = "testPropKeyB";
String testPropValueB = "testPropValueB";
JsonObject jsonAppProps = new JsonObject();
jsonAppProps.put(testPropKeyA, testPropValueA);
jsonAppProps.put(testPropKeyB, testPropValueB);
JsonObject jsonObject = new JsonObject();
jsonObject.put(AmqpConstants.APPLICATION_PROPERTIES, jsonAppProps);
Message protonMsg = translator.convertToAmqpMessage(jsonObject);
assertNotNull("Expected converted msg", protonMsg);
ApplicationProperties appProps = protonMsg.getApplicationProperties();
assertNotNull("Application properties section not present", appProps);
@SuppressWarnings("unchecked")
Map<String, Object> props = appProps.getValue();
assertNotNull("Application properties map not present", appProps);
assertTrue("expected key to be present", props.containsKey(testPropKeyA));
assertEquals("expected value to be equal", testPropValueA, props.get(testPropKeyA));
assertTrue("expected key to be present", props.containsKey(testPropKeyB));
assertEquals("expected value to be equal", testPropValueB, props.get(testPropKeyB));
assertEquals("unexpected number of props", 2, props.size());
}
示例3: wrap
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@Override
protected Map wrap(ApplicationProperties val)
{
return val.getValue();
}
示例4: convertToJsonObject
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
public JsonObject convertToJsonObject(Message protonMessage) throws IllegalArgumentException {
JsonObject jsonObject = new JsonObject();
Section body = protonMessage.getBody();
if (body instanceof AmqpValue) {
Object value = translateToJsonCompatible(((AmqpValue) body).getValue());
jsonObject.put(AmqpConstants.BODY, value);
jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_VALUE);
} else if (body instanceof Data) {
Binary bin = ((Data) body).getValue();
byte[] bytes = new byte[bin.getLength()];
System.arraycopy(bin.getArray(), bin.getArrayOffset(), bytes, 0, bin.getLength());
jsonObject.put(AmqpConstants.BODY, bytes);
jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_DATA);
} else if (body instanceof AmqpSequence) {
JsonArray jsonSequence = (JsonArray) translateToJsonCompatible(((AmqpSequence) body).getValue());
jsonObject.put(AmqpConstants.BODY, jsonSequence);
jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_SEQUENCE);
}
Properties props = protonMessage.getProperties();
if (props != null) {
JsonObject jsonProps = createJsonProperties(props);
jsonObject.put(AmqpConstants.PROPERTIES, jsonProps);
}
Header header = protonMessage.getHeader();
if (header != null) {
JsonObject jsonHeader = createJsonHeader(header);
jsonObject.put(AmqpConstants.HEADER, jsonHeader);
}
ApplicationProperties appProps = protonMessage.getApplicationProperties();
if (appProps != null && appProps.getValue() != null) {
@SuppressWarnings("unchecked")
JsonObject jsonAppProps = createJsonApplicationProperties(appProps.getValue());
jsonObject.put(AmqpConstants.APPLICATION_PROPERTIES, jsonAppProps);
}
MessageAnnotations msgAnn = protonMessage.getMessageAnnotations();
if (msgAnn != null && msgAnn.getValue() != null) {
JsonObject jsonMsgAnn = createJsonMessageAnnotations(msgAnn.getValue());
jsonObject.put(AmqpConstants.MESSAGE_ANNOTATIONS, jsonMsgAnn);
}
return jsonObject;
}
示例5: setApplicationProperties
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
void setApplicationProperties(ApplicationProperties applicationProperties) {
if (applicationProperties != null) {
this.applicationPropertiesMap = applicationProperties.getValue();
}
}