public class MessageBuilder extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
MessageBuilder.Message
Message class encapsulates the JbiTask message, two accessors provide the
message string and information on whether the message is a success or failure.
|
static class |
MessageBuilder.MessageType |
static class |
MessageBuilder.TaskResult |
| Constructor and Description |
|---|
MessageBuilder(StringTranslator translator) |
| Modifier and Type | Method and Description |
|---|---|
String |
buildCompositeExceptionMessage(String taskId,
Map<String,Throwable> exceptionMap)
This method composes a JBI Task Message from the exceptions in the Map.
|
MessageBuilder.Message |
buildCompositeMessage(String taskId,
Map<String,String> responseMap,
Map<String,Throwable> exceptionMap,
boolean requireAllSuccess)
This operation combines the data from exception jbi task messages and response
jbi task messages.
|
String |
buildExceptionMessage(String taskId,
Throwable ex)
Build a framework task message with exception.
|
String |
buildFrameworkMessage(String taskId,
MessageBuilder.TaskResult taskResult)
Build a simple framework task message based on the passed
parameters and return the string.
|
String |
buildFrameworkMessage(String taskId,
MessageBuilder.TaskResult taskResult,
List<ComponentMessageHolder> compMsgs)
Build a simple framework task message based on the passed
parameters and return the string.
|
String |
buildFrameworkMessage(String taskId,
MessageBuilder.TaskResult taskResult,
MessageBuilder.MessageType messageType,
String message,
String[] params,
String token)
Build a simple framework task message based on the passed
parameters and return the string.
|
String |
buildFrameworkMessage(String taskId,
MessageBuilder.TaskResult taskResult,
MessageBuilder.MessageType messageType,
String message,
String[] params,
String token,
List<ComponentMessageHolder> compMsgs)
Build a Framework Message with component task results
|
MessageBuilder.Message |
createMessage(String jbiTaskMsg)
Create a message
|
static String |
getMessageString(String message)
Returns the string from a message entry without the JBIMAxxxx token.
|
static String |
getMessageToken(String message)
Returns the JBIMAxxxx mesage token from a localized message entry.
|
String |
getStackTrace(Throwable exObj) |
String |
getString(JbiTaskResult jbiTaskMsg)
Get the string from the management message object.
|
List<ServiceUnitInfo> |
getSuccessfulServiceUnits(String jbiTaskMsg,
List<ServiceUnitInfo> suInfoList)
Parse the Component Results.
|
static boolean |
isLocalizedMessage(String message) |
static boolean |
isXmlString(String str)
This method is used to check if the given string contains well-formed
XML.
|
void |
throwManagementException(String taskId,
String msgKey,
String[] params) |
public MessageBuilder(StringTranslator translator) throws ManagementException
ManagementExceptionpublic MessageBuilder.Message createMessage(String jbiTaskMsg) throws ManagementException
jbiTaskMsg - - task message stringManagementExceptionpublic String buildFrameworkMessage(String taskId, MessageBuilder.TaskResult taskResult, List<ComponentMessageHolder> compMsgs) throws ManagementException
ManagementExceptionpublic String buildFrameworkMessage(String taskId, MessageBuilder.TaskResult taskResult) throws ManagementException
ManagementExceptionpublic String buildFrameworkMessage(String taskId, MessageBuilder.TaskResult taskResult, MessageBuilder.MessageType messageType, String message, String[] params, String token, List<ComponentMessageHolder> compMsgs) throws ManagementException
ManagementExceptionpublic String buildFrameworkMessage(String taskId, MessageBuilder.TaskResult taskResult, MessageBuilder.MessageType messageType, String message, String[] params, String token) throws ManagementException
ManagementExceptionpublic String buildExceptionMessage(String taskId, Throwable ex) throws ManagementException
taskId - - name of the operation which threw the exceptionex - - the exceptionManagementExceptionpublic String getStackTrace(Throwable exObj)
public String getString(JbiTaskResult jbiTaskMsg) throws ManagementException
ManagementExceptionpublic static String getMessageToken(String message)
public static String getMessageString(String message)
public void throwManagementException(String taskId, String msgKey, String[] params) throws ManagementException
ManagementExceptionpublic List<ServiceUnitInfo> getSuccessfulServiceUnits(String jbiTaskMsg, List<ServiceUnitInfo> suInfoList) throws ManagementException
ManagementExceptionpublic String buildCompositeExceptionMessage(String taskId, Map<String,Throwable> exceptionMap) throws ManagementException
exceptionMap - - a map keyed by the instance names and the value is the
exception thrown by the remote instance with the MBean exceptions stripped off.ManagementExceptionpublic MessageBuilder.Message buildCompositeMessage(String taskId, Map<String,String> responseMap, Map<String,Throwable> exceptionMap, boolean requireAllSuccess) throws ManagementException
taskId - - task idresponseMap - - a map of jbi task message responses from instances.exceptionMap - - a map of exception task message from instances.requireAllSuccess - - this flag indicates how the result of component task
results for each component from various instances has to be handled. If set to true
a Component task result has a task result of SUCCESS only if all the ComponentTask
results in the response and exception maps are a success.ManagementExceptionpublic static boolean isXmlString(String str)
str - the stringpublic static boolean isLocalizedMessage(String message)
Copyright © 2011-2016 OpenESB Community. All Rights Reserved.