CoAP Server Listeners pass the CoAP request payload through as payload of the MuleMessage and the result payload of the Mule-flow is returned to the client as CoAP response payload. Other information in the CoAP request is passed on to the Mule-flow as properties in the inbound scope. Likewise can additional information set in the CoAP response by means of outbound properties on the resulting MuleMessage. In this topic is described what properties the Connector uses.
Inbound messages produced by listeners have inbound properties as described in the table below:
name | type | description |
---|---|---|
coap.request.code | String | request method, possible values "GET", "PUT", "POST", "DELETE" |
coap.request.address | String | address the request was issued on |
coap.request.uri | String | uri the request was issued on |
coap.request.relation | String | identifier of the observe-relation the update request was issued for (only present when the request was caused by resource-changed) |
coap.request.source.host | String | client host |
coap.request.source.port | String | client port |
The outbound properties used for the CoAP response are:
name | type | description |
---|---|---|
coap.response.code | String | the response code returned to the CoAP client |
The CoAP protocol has a number op Options defined that can set in the header of the CoAP messages. These options can be present on CoAP requests as well as CoAP responses, depending on the meaning of the option. Options in the request are passed on in the MuleMessage as inbound properties. Options that need to be returned in a CoAP response, must be set in the MuleMessage as outbound property. The table below gives an overview of existing options.
name | type | description |
---|---|---|
coap.opt.if_match.list | (Collection of) Byte[] | |
coap.opt.uri_host | String | |
coap.opt.etag.list | (Collection of) Byte[] / (Collection of) Etag | May also be an Etag object or Collection of Etag objects. |
coap.opt.if_none_match | Boolean | |
coap.opt.uri_port | Integer | |
coap.opt.location_path.list | Collection of String | |
coap.opt.location_path | String | |
coap.opt.uri_path.list | Collection of String | |
coap.opt.uri_path | String | |
coap.opt.content_format | Integer | |
coap.opt.max_age | Long | |
coap.opt.uri_query.list | Collection of String | |
coap.opt.uri_query | String | |
coap.opt.accept | Integer | |
coap.opt.location_query.list | Collection of String | |
coap.opt.location_query | String | |
coap.opt.proxy_uri | String | |
coap.opt.proxy_scheme | String | |
coap.opt.block1.szx | Integer | |
coap.opt.block1.size | Integer | |
coap.opt.block1.num | Integer | |
coap.opt.block1.m | Boolean | |
coap.opt.block2.szx | Integer | |
coap.opt.block2.size | Integer | |
coap.opt.block2.num | Integer | |
coap.opt.block2.m | Boolean | |
coap.opt.size1 | Integer | |
coap.opt.size2 | Integer | |
coap.opt.observe | Integer | |
coap.opt.other.xx | Byte[] or String | non-standard option ( xx is the number of the option) |
coap.opt.other.xx.critical | Boolean | non-standard option is critical and must be recognised ( xx is the number of the option, only inbound) |
coap.opt.other.xx.no_cache_key | Boolean | non-standard option must not be part of a cache key ( xx is the number of the option, only inbound) |
coap.opt.other.xx.unsafe | Boolean | non-standard option is unsafe to forward ( xx is the number of the option, only inbound) |