MessageProperty Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.MessageProperty

public class MessageProperty

An IoT Hub message property.

Field Summary

Modifier and Type Field and Description
final String COMPONENT_ID
final String CONNECTION_DEVICE_ID
final String CONNECTION_MODULE_ID
final String IOTHUB_CONTENT_ENCODING
final String IOTHUB_CONTENT_TYPE
final String IOTHUB_CREATION_TIME_UTC
final String IOTHUB_SECURITY_INTERFACE_ID
final String IOTHUB_SECURITY_INTERFACE_ID_VALUE
final String OUTPUT_NAME_PROPERTY
final Set<String> RESERVED_PROPERTY_NAMES

A set of reserved property names. The reserved property names are interpreted in a meaningful way by the device and the IoT Hub.

Constructor Summary

Constructor Description
MessageProperty()
MessageProperty(String name, String value)

Constructor.

Method Summary

Modifier and Type Method and Description
String getName()

Returns the property name.

String getValue()

Returns the property value.

boolean hasSameName(String name)

Equivalent to property.getName().equalsIgnoreCase(name).

boolean isValidAppProperty(String name, String value)

Returns whether the property is a valid application property. The property is valid if it is not one of the reserved properties, only uses US-ASCII

boolean isValidSystemProperty(String name, String value)

Returns whether the property is a valid system property. The property is valid if it is one of the reserved properties and only uses US-ASCII

Field Details

COMPONENT_ID

public static final String COMPONENT_ID= "dt-subject"

CONNECTION_DEVICE_ID

public static final String CONNECTION_DEVICE_ID= "iothub-connection-device-id"

CONNECTION_MODULE_ID

public static final String CONNECTION_MODULE_ID= "iothub-connection-module-id"

IOTHUB_CONTENT_ENCODING

public static final String IOTHUB_CONTENT_ENCODING= "iothub-contentencoding"

IOTHUB_CONTENT_TYPE

public static final String IOTHUB_CONTENT_TYPE= "iothub-contenttype"

IOTHUB_CREATION_TIME_UTC

public static final String IOTHUB_CREATION_TIME_UTC= "iothub-creation-time-utc"

IOTHUB_SECURITY_INTERFACE_ID

public static final String IOTHUB_SECURITY_INTERFACE_ID= "iothub-interface-id"

IOTHUB_SECURITY_INTERFACE_ID_VALUE

public static final String IOTHUB_SECURITY_INTERFACE_ID_VALUE= "urn:azureiot:Security:SecurityAgent:1"

OUTPUT_NAME_PROPERTY

public static final String OUTPUT_NAME_PROPERTY= "iothub-outputname"

RESERVED_PROPERTY_NAMES

public static final Set RESERVED_PROPERTY_NAMES

A set of reserved property names. The reserved property names are interpreted in a meaningful way by the device and the IoT Hub.

Constructor Details

MessageProperty

protected MessageProperty()

MessageProperty

public MessageProperty(String name, String value)

Constructor.

Parameters:

name - The IoT Hub message property name.
value - The IoT Hub message property value.

Throws:

IllegalArgumentException - if the name and value constitute an invalid IoT Hub message property. A message property can only contain US-ASCII. A message property name cannot be one of the reserved property names.

Method Details

getName

public String getName()

Returns the property name.

Returns:

the property name.

getValue

public String getValue()

Returns the property value.

Returns:

the property value.

hasSameName

public boolean hasSameName(String name)

Equivalent to property.getName().equalsIgnoreCase(name).

Parameters:

name - the property name.

Returns:

true if the given name is the property name.

isValidAppProperty

public static boolean isValidAppProperty(String name, String value)

Returns whether the property is a valid application property. The property is valid if it is not one of the reserved properties, only uses US-ASCII

Parameters:

name - the property name.
value - the property value.

Returns:

whether the property is a valid application property.

isValidSystemProperty

public static boolean isValidSystemProperty(String name, String value)

Returns whether the property is a valid system property. The property is valid if it is one of the reserved properties and only uses US-ASCII

Parameters:

name - the property name.
value - the property value.

Returns:

whether the property is a valid system property.

Applies to