public class EventBuilder extends Object
Event| Constructor and Description |
|---|
EventBuilder(org.mule.runtime.api.component.location.ComponentLocation location)
Creates the event builder from a flow construct
|
EventBuilder(org.mule.runtime.api.event.Event originalEvent)
Creates the event builder from an event
|
EventBuilder(org.mule.runtime.api.event.EventContext eventContext)
Creates the event builder from an event context and a flow construct
|
| Modifier and Type | Method and Description |
|---|---|
EventBuilder |
addInboundAttachment(String key,
DataHandler value)
Prepares an attachment with the given key and value to be sent in the product.
|
EventBuilder |
addInboundProperty(String key,
Serializable value)
Prepares a property with the given key and value to be sent as an inbound property of the product.
|
EventBuilder |
addInboundProperty(String key,
Serializable value,
String mediaType,
String charset)
Prepares a property with the given key and value to be sent as an inbound property of the product.
|
EventBuilder |
addOutboundAttachment(String key,
DataHandler value)
Prepares an attachment with the given key and value to be sent in the product.
|
EventBuilder |
addOutboundProperty(String key,
Serializable value)
Prepares a property with the given key and value to be sent as an outbound property of the product.
|
EventBuilder |
addOutboundProperty(String key,
Serializable value,
String mediaType,
String charset)
Prepares a property with the given key and value to be sent as an outbound property of the product.
|
EventBuilder |
addSessionProperty(String key,
Object value)
Prepares a property with the given key and value to be sent as a session property of the product.
|
EventBuilder |
addSessionProperty(String key,
Object value,
String mediaType,
String charset)
Prepares a property with the given key and value to be sent as a session property of the product.
|
EventBuilder |
addVariable(String key,
Object value)
Prepares a flow variable with the given key and value to be set in the product.
|
EventBuilder |
addVariable(String key,
Object value,
String mediaType,
String charset)
Prepares a flow variable with the given key and value to be set in the product.
|
org.mule.runtime.api.event.Event |
build()
Produces an event with the specified configuration.
|
EventBuilder |
clearSessionProperties()
Clears the session properties map
|
EventBuilder |
withAttributes(Object attributes)
Sets the
Message.getAttributes() value of the produced message |
EventBuilder |
withAttributes(Object attributes,
String mediaType,
String charset)
Prepares a flow variable with the given key and value to be set in the product.
|
EventBuilder |
withError(org.mule.runtime.api.message.ErrorType errorType,
Throwable exception)
Prepares the error to be added to the event
|
EventBuilder |
withGroupCorrelation(org.mule.runtime.core.api.message.GroupCorrelation correlation)
Configures the product event to have the provided
correlation. |
EventBuilder |
withInboundAttachments(Map<String,DataHandler> inboundAttachments)
Prepares the outbound attachments with the given map.
|
EventBuilder |
withInboundProperties(Map<String,Serializable> inboundProperties)
Prepares the inbound properties with the given map.
|
EventBuilder |
withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
Prepares the given data to be sent as the mediaType of the payload of the
Event to the configured flow. |
EventBuilder |
withOutboundAttachments(Map<String,DataHandler> outboundAttachments)
Prepares the outbound attachments with the given map.
|
EventBuilder |
withOutboundProperties(Map<String,Serializable> outboundProperties)
Prepares the outbound properties with the given map.
|
EventBuilder |
withPayload(Object payload)
Prepares the given data to be sent as the payload of the product.
|
EventBuilder |
withReplyToHandler(org.mule.runtime.core.privileged.connector.ReplyToHandler replyToHandler)
Configures the product event to have the provided
ReplyToHandler. |
EventBuilder |
withSessionProperties(Map<String,org.mule.runtime.api.metadata.TypedValue<Serializable>> sessionProperties)
Prepares the session properties with the given map.
|
EventBuilder |
withSourceCorrelationId(String sourceCorrelationId)
Configures the product event to have the provided
sourceCorrelationId. |
EventBuilder |
withVariables(Map<String,Object> variables)
Prepares the flow variables with the given map.
|
public EventBuilder(org.mule.runtime.api.component.location.ComponentLocation location)
location - location from where to create the new eventpublic EventBuilder(org.mule.runtime.api.event.EventContext eventContext)
eventContext - Flow construct from where to create the new eventpublic EventBuilder(org.mule.runtime.api.event.Event originalEvent)
originalEvent - Base event from where to create the new onepublic EventBuilder withPayload(Object payload)
payload - the payload to use in the messageEventBuilderpublic EventBuilder withMediaType(org.mule.runtime.api.metadata.MediaType mediaType)
Event to the configured flow.mediaType - the mediaType to use in the messageEventBuilderpublic EventBuilder withAttributes(Object attributes)
Message.getAttributes() value of the produced messageattributes - the attributes object for the produced MessageEventBuilderpublic EventBuilder withAttributes(Object attributes, String mediaType, String charset)
attributes - the attributes object for the produced MessagemediaType - the media type of the variable to addcharset - the charset of the property to addEventBuilderpublic EventBuilder addVariable(String key, Object value)
key - the key of the flow variable to putvalue - the value of the flow variable to putEventBuilderpublic EventBuilder addVariable(String key, Object value, String mediaType, String charset)
key - the key of the flow variable to putvalue - the value of the flow variable to putmediaType - the media type of the variable to addcharset - the charset of the property to addEventBuilderpublic EventBuilder withVariables(Map<String,Object> variables)
variables - the map to be setEventBuilderpublic EventBuilder addSessionProperty(String key, Object value)
key - the key of the session property to addvalue - the value of the session property to addEventBuilderpublic EventBuilder addSessionProperty(String key, Object value, String mediaType, String charset)
key - the key of the session property to addvalue - the value of the session property to addmediaType - the media type of the property to addcharset - the charset of the property to addEventBuilderpublic EventBuilder withSessionProperties(Map<String,org.mule.runtime.api.metadata.TypedValue<Serializable>> sessionProperties)
sessionProperties - the map to be setEventBuilderpublic EventBuilder clearSessionProperties()
EventBuilderpublic EventBuilder addInboundProperty(String key, Serializable value)
key - the key of the inbound property to addvalue - the value of the inbound property to addEventBuilderpublic EventBuilder addInboundProperty(String key, Serializable value, String mediaType, String charset)
key - the key of the inbound property to addvalue - the value of the inbound property to addmediaType - the media type of the property to addcharset - the charset of the property to addEventBuilderpublic EventBuilder withInboundProperties(Map<String,Serializable> inboundProperties)
inboundProperties - the map to be setEventBuilderpublic EventBuilder addOutboundProperty(String key, Serializable value)
key - the key of the outbound property to addvalue - the value of the outbound property to addEventBuilderpublic EventBuilder addOutboundProperty(String key, Serializable value, String mediaType, String charset)
key - the key of the outbound property to addvalue - the value of the outbound property to addmediaType - the media type of the property to addcharset - the charset of the property to addEventBuilderpublic EventBuilder withOutboundProperties(Map<String,Serializable> outboundProperties)
outboundProperties - the map to be setEventBuilderpublic EventBuilder addOutboundAttachment(String key, DataHandler value)
key - the key of the attachment to addvalue - the DataHandler for the attachment to addEventBuilderpublic EventBuilder withOutboundAttachments(Map<String,DataHandler> outboundAttachments)
outboundAttachments - the map to be setEventBuilderpublic EventBuilder addInboundAttachment(String key, DataHandler value)
key - the key of the attachment to addvalue - the DataHandler for the attachment to addEventBuilderpublic EventBuilder withInboundAttachments(Map<String,DataHandler> inboundAttachments)
inboundAttachments - the map to be setEventBuilderpublic EventBuilder withSourceCorrelationId(String sourceCorrelationId)
sourceCorrelationId.EventBuilderpublic EventBuilder withGroupCorrelation(org.mule.runtime.core.api.message.GroupCorrelation correlation)
correlation.EventBuilderpublic EventBuilder withReplyToHandler(org.mule.runtime.core.privileged.connector.ReplyToHandler replyToHandler)
ReplyToHandler.EventBuilderpublic EventBuilder withError(org.mule.runtime.api.message.ErrorType errorType, Throwable exception)
errorType - the type of the errorexception - the exception of the errorEventBuilderpublic org.mule.runtime.api.event.Event build()
Copyright © 2018. All rights reserved.