/** * Equivalent to property.getName().equalsIgnoreCase(name). * * @param name the property name. * * @return true if the given name is the property name. */ public boolean hasSameName(String name) { boolean nameMatches = false; // Codes_SRS_MESSAGEPROPERTY_11_006: [The function shall return true if and only if the property has the given name, where the names are compared in a case-insensitive manner.] if (this.getName().equalsIgnoreCase(name)) { nameMatches = true; } return nameMatches; }
for (MessageProperty p : properties) allProperties.put(p.getName(), p.getValue());
/** * Returns a copy of the message properties. * * @return a copy of the message properties. */ public MessageProperty[] getProperties() { // Codes_SRS_HTTPSSINGLEMESSAGE_11_013: [The function shall return a copy of the message properties.] int propertiesSize = this.properties.length; MessageProperty[] propertiesCopy = new MessageProperty[propertiesSize]; for (int i = 0; i < propertiesSize; ++i) { MessageProperty property = this.properties[i]; MessageProperty propertyCopy = new MessageProperty(property.getName(), property.getValue()); propertiesCopy[i] = propertyCopy; } return propertiesCopy; }
public IotHubMessageResult execute(Message msg, Object context) { Counter counter = (Counter) context; System.out.println( "Received message " + counter.toString() + " with content: " + new String(msg.getBytes(), Message.DEFAULT_IOTHUB_MESSAGE_CHARSET)); for (MessageProperty messageProperty : msg.getProperties()) { System.out.println(messageProperty.getName() + " : " + messageProperty.getValue()); } counter.increment(); return IotHubMessageResult.COMPLETE; } }
public IotHubMessageResult execute(Message msg, Object context) { Counter counter = (Counter) context; System.out.println( "Received message " + counter.toString() + " with content: " + new String(msg.getBytes(), Message.DEFAULT_IOTHUB_MESSAGE_CHARSET)); for (MessageProperty messageProperty : msg.getProperties()) { System.out.println(messageProperty.getName() + " : " + messageProperty.getValue()); } counter.increment(); return IotHubMessageResult.COMPLETE; } }
public IotHubMessageResult execute(Message msg, Object context) { Counter counter = (Counter) context; System.out.println( "Received message " + counter.toString() + " with content: " + new String(msg.getBytes(), Message.DEFAULT_IOTHUB_MESSAGE_CHARSET)); for (MessageProperty messageProperty : msg.getProperties()) { System.out.println(messageProperty.getName() + " : " + messageProperty.getValue()); } counter.increment(); return IotHubMessageResult.COMPLETE; } }
public IotHubMessageResult execute(Message msg, Object context) { Counter counter = (Counter) context; System.out.println( "Device Client " + msg.getIotHubConnectionString().getDeviceId() + " received message " + counter.toString() + " with content: " + new String(msg.getBytes(), Message.DEFAULT_IOTHUB_MESSAGE_CHARSET)); for (MessageProperty messageProperty : msg.getProperties()) { System.out.println(messageProperty.getName() + " : " + messageProperty.getValue()); } IotHubMessageResult res = IotHubMessageResult.COMPLETE; System.out.println( "Responding to message " + counter.toString() + " with " + res.name()); counter.increment(); return res; } }
String propertyName = httpsAppPropertyToAppProperty(property.getName()); String propertyValue = property.getValue(); msg.setProperty(propertyName, propertyValue);
public IotHubTransportMessage(byte[] data, MessageType messageType, String messageId, String correlationId, MessageProperty[] messageProperties) { //Codes_SRS_IOTHUBTRANSPORTMESSAGE_34_017: [This constructor shall return an instance of IotHubTransportMessage with provided bytes, messagetype, correlationid, messageid, and application properties.] super(data); super.setMessageType(messageType); this.setMessageId(messageId); this.setCorrelationId(correlationId); for (MessageProperty messageProperty : messageProperties) { this.setProperty(messageProperty.getName(), messageProperty.getValue()); } }
for (MessageProperty messageProperty : msg.getProperties()) System.out.println(messageProperty.getName() + " : " + messageProperty.getValue());
for (MessageProperty messageProperty : msg.getProperties()) System.out.println(messageProperty.getName() + " : " + messageProperty.getValue());
HTTPS_APP_PROPERTY_PREFIX + property.getName(), property.getValue());
separatorNeeded = appendPropertyIfPresent(stringBuilder, separatorNeeded, property.getName(), property.getValue());
request.setHeaderField(property.getName(), property.getValue());
request.setHeaderField(property.getName(), property.getValue());