com.eurotech.framework.message
Class EsfPayload

java.lang.Object
  extended by com.eurotech.framework.message.EsfPayload
Direct Known Subclasses:
EsfBirthPayload, EsfDisconnectPayload, EsfRequestPayload, EsfResponsePayload

public class EsfPayload
extends Object

EdcPayload defines the recommended payload structure for the messages sent to the Everyware Cloud platform. Eurotech designed the format as an open format that is flexible from the aspect of data modeling yet is efficient when it comes to bandwidth conservation. The same payload model is used by the REST API - in which case it is serialized into XML or JSON as requested by the client - or uses the efficient Google ProtoBuf when sent over an MQTT connection when the bandwidth is very important. The EdcPayload contains the following fields: sentOn timestamp, an optional set of metrics represented as name-value pairs, an optional position field to capture a GPS position, and an optional binary body.


Constructor Summary
EsfPayload()
           
 
Method Summary
 void addMetric(String name, Object value)
           
 byte[] getBody()
           
 Object getMetric(String name)
           
 EsfPosition getPosition()
           
 Date getTimestamp()
           
 Set<String> metricNames()
           
 Map<String,Object> metrics()
           
 Iterator<String> metricsIterator()
           
 void removeAllMetrics()
           
 void removeMetric(String name)
           
 void setBody(byte[] body)
           
 void setPosition(EsfPosition position)
           
 void setTimestamp(Date timestamp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EsfPayload

public EsfPayload()
Method Detail

getTimestamp

public Date getTimestamp()

setTimestamp

public void setTimestamp(Date timestamp)

getPosition

public EsfPosition getPosition()

setPosition

public void setPosition(EsfPosition position)

getMetric

public Object getMetric(String name)

addMetric

public void addMetric(String name,
                      Object value)

removeMetric

public void removeMetric(String name)

removeAllMetrics

public void removeAllMetrics()

metricNames

public Set<String> metricNames()

metricsIterator

public Iterator<String> metricsIterator()

metrics

public Map<String,Object> metrics()

getBody

public byte[] getBody()

setBody

public void setBody(byte[] body)


Copyright © 2013. All Rights Reserved.