Package com.sap.cds.services.messaging
Interface TopicMessageEventContext
- All Superinterfaces:
EventContext
Describes the topic message of the
MessagingService
-
Method Summary
Modifier and TypeMethodDescriptionstatic TopicMessageEventContext
Creates a newTopicMessageEventContext
getData()
Returns the plain string message.Returns the data map.Returns the headers map.Returns the inbound flagReturns the message ID usually generated by the message brokervoid
Sets the plain string message.void
setDataMap
(Map<String, Object> data) Sets the data map.void
setHeadersMap
(Map<String, Object> headers) Sets the headers map.void
setIsInbound
(boolean inbound) Sets the inbound flagvoid
setMessageId
(String id) Sets the message IDMethods inherited from interface com.sap.cds.services.EventContext
as, get, getAuthenticationInfo, getCdsRuntime, getChangeSetContext, getEvent, getFeatureTogglesInfo, getMessages, getModel, getParameterInfo, getService, getServiceCatalog, getTarget, getUserInfo, isCompleted, keySet, proceed, put, setCompleted
-
Method Details
-
create
Creates a newTopicMessageEventContext
- Parameters:
topic
- destination topic- Returns:
- the
TopicMessageEventContext
-
getIsInbound
Boolean getIsInbound()Returns the inbound flag- Returns:
- true, if the message has been received from a message broker or false, if it emitted to a message broker.
-
setIsInbound
void setIsInbound(boolean inbound) Sets the inbound flag- Parameters:
inbound
- true, if the message has been received from a message broker or false, if it emitted to a message broker.
-
getData
String getData()Returns the plain string message. On inbound messages this is set, if the structured flag is not set (default). In case of a cloudevents message this is the full cloudevents message as String. Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
are set, never both.- Returns:
- the plain string message
-
setData
Sets the plain string message. In case of a cloudevents message this is the full cloudevents message as String. Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
can be set, never both.- Parameters:
data
- the plain string message
-
getDataMap
Returns the data map. On inbound messages this is set, if the structured flag is set. In case of a cloudevents message the data map corresponds to the map, available under the "data" key. Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
are set, never both.- Returns:
- the data map
-
setDataMap
Sets the data map. In case of a cloudevents message the data map corresponds to the map, available under the "data" key. Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
can be set, never both.- Parameters:
data
- the data map
-
getHeadersMap
Returns the headers map. On inbound messages this is set, if the structured flag is set. In case of a cloudevents message the headers map contains all properties of the message, except for "data". Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
are set, never both.- Returns:
- the header map
-
setHeadersMap
Sets the headers map. In case of a cloudevents message the headers map contains all properties of the message, except for "data". Note, that eithergetData()
or the two mapsgetDataMap()
andgetHeadersMap()
can be set, never both.- Parameters:
headers
- the structured header data as a map
-
getMessageId
String getMessageId()Returns the message ID usually generated by the message broker- Returns:
- the message ID usually generated by the message broker
-
setMessageId
Sets the message ID- Parameters:
id
- the message ID
-