Class EventDataImpl
- java.lang.Object
-
- com.microsoft.azure.eventhubs.impl.EventDataImpl
-
- All Implemented Interfaces:
EventData,Serializable,Comparable<EventData>
public final class EventDataImpl extends Object implements EventData
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.azure.eventhubs.EventData
EventData.SystemProperties
-
-
Constructor Summary
Constructors Constructor Description EventDataImpl(byte[] data)EventDataImpl(byte[] data, int offset, int length)EventDataImpl(ByteBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(EventData other)booleanequals(Object o)byte[]getBytes()Get Actual Payload/Data wrapped by EventData.ObjectgetObject()Use this method only if, the sender could be sending messages using third-party AMQP libraries.Map<String,Object>getProperties()Application property bagEventData.SystemPropertiesgetSystemProperties()SystemProperties that are populated by EventHubService.inthashCode()voidsetSystemProperties(EventData.SystemProperties props)
-
-
-
Constructor Detail
-
EventDataImpl
public EventDataImpl(byte[] data)
-
EventDataImpl
public EventDataImpl(byte[] data, int offset, int length)
-
EventDataImpl
public EventDataImpl(ByteBuffer buffer)
-
-
Method Detail
-
getObject
public Object getObject()
Description copied from interface:EventDataUse this method only if, the sender could be sending messages using third-party AMQP libraries.If all the senders of EventHub use client libraries released and maintained by Microsoft Azure EventHubs, use
EventData.getBytes()method.Get the value of AMQP messages' Body section on the received
EventData.If the AMQP message Body is always guaranteed to have Data section, use
EventData.getBytes()method.
-
getBytes
public byte[] getBytes()
Description copied from interface:EventDataGet Actual Payload/Data wrapped by EventData.- Specified by:
getBytesin interfaceEventData- Returns:
- byte[] of the actual data
null if the body of the message has other inter-operable AMQP messages, whose body does not represent byte[]. In that case use
EventData.getObject().
-
getProperties
public Map<String,Object> getProperties()
Description copied from interface:EventDataApplication property bag- Specified by:
getPropertiesin interfaceEventData- Returns:
- returns Application properties
-
getSystemProperties
public EventData.SystemProperties getSystemProperties()
Description copied from interface:EventDataSystemProperties that are populated by EventHubService.As these are populated by Service, they are only present on a Received EventData.
Usage:
final String offset = eventData.getSystemProperties().getOffset();- Specified by:
getSystemPropertiesin interfaceEventData- Returns:
- an encapsulation of all SystemProperties appended by EventHubs service into EventData.
nullif theEventDatais not received and is created by the public constructors. - See Also:
EventData.SystemProperties.getOffset(),EventData.SystemProperties.getSequenceNumber(),EventData.SystemProperties.getPartitionKey(),EventData.SystemProperties.getEnqueuedTime()
-
setSystemProperties
public void setSystemProperties(EventData.SystemProperties props)
- Specified by:
setSystemPropertiesin interfaceEventData
-
compareTo
public int compareTo(EventData other)
- Specified by:
compareToin interfaceComparable<EventData>
-
-