public abstract class AbstractNotificationMessageBuilder extends Object
| Constructor and Description |
|---|
AbstractNotificationMessageBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addObjectPropertyToContext(Map<String,Object> context,
String propertyName,
Object propertyValue,
Object jsonEscapedPropertyValue,
Object xmlEscapedPropertyValue)
Adds string property to the specified context along with the relative JSON and XML escaped copies of the property.
|
protected void |
addStringPropertyToContext(Map<String,Object> context,
String propertyName,
String propertyValue)
Adds string property to the specified context along with the relative JSON and XML escaped copies of the property.
|
List<NotificationMessage> |
buildNotificationMessages(NotificationEvent notificationEvent)
Builds a list of notification messages for the change event.
|
protected String |
escapeJson(String input)
JSON escapes a specified string.
|
protected String |
escapeXml(String input)
XML escapes a specified string.
|
protected String |
evaluateVelocityTemplate(String velocityTemplate,
Map<String,Object> contextMap,
String velocityTemplateName)
Evaluates a velocity template if one is defined for the specified configuration value.
|
Map<Class<?>,ConfigurationValue> |
getEventTypeMessageDefinitionKeyMap()
Get the event type to Message Definition Key map
|
abstract Map<String,Object> |
getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
Returns Velocity context map of additional keys and values relating to the notification message body to place in the velocity context.
|
public Map<Class<?>,ConfigurationValue> getEventTypeMessageDefinitionKeyMap()
public abstract Map<String,Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
notificationEvent - the notification eventpublic List<NotificationMessage> buildNotificationMessages(NotificationEvent notificationEvent)
notificationEvent - the notification eventprotected String escapeJson(String input)
input - the input stringprotected String escapeXml(String input)
input - the input stringprotected void addStringPropertyToContext(Map<String,Object> context, String propertyName, String propertyValue)
context - the context mappropertyName - the name of the propertypropertyValue - the value of the property, maybe nullprotected void addObjectPropertyToContext(Map<String,Object> context, String propertyName, Object propertyValue, Object jsonEscapedPropertyValue, Object xmlEscapedPropertyValue)
context - the context mappropertyName - the name of the propertypropertyValue - the value of the property, maybe nulljsonEscapedPropertyValue - the JSON escaped value of the property, maybe nullxmlEscapedPropertyValue - the XML escaped value of the property, maybe nullprotected String evaluateVelocityTemplate(String velocityTemplate, Map<String,Object> contextMap, String velocityTemplateName)
velocityTemplate - the optional velocity template, may be nullcontextMap - the optional context map of additional keys and values to place in the velocity context. This can be useful if you have values from an
incoming request message you want to make available to velocity to use in the building of the outgoing response message.velocityTemplateName - the velocity template name used when Velocity logs error messages.Copyright © 2019. All rights reserved.