| java.lang.Object com.sun.jbi.management.message.MessageBuilder
MessageBuilder | public class MessageBuilder (Code) | | Helper class to create Management messages
author: Sun Microsystems, Inc. |
Inner Class :public enum TaskResult | |
Inner Class :public enum MessageType | |
Inner Class :public class Message | |
Method Summary | |
String | buildComponentMessage(ComponentMessageHolder msgObject) Return an XML string of the component message(either status
or exception message). | public String | buildCompositeExceptionMessage(String taskId, java.util.Map<String, Throwable> exceptionMap) This method composes a JBI Task Message from the exceptions in the Map. | public 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. | public String | buildExceptionMessage(String taskId, Throwable ex) Build a framework task message with exception. | public String | buildFrameworkMessage(String taskId, TaskResult taskResult, List<ComponentMessageHolder> compMsgs) Build a simple framework task message based on the passed
parameters and return the string. | public String | buildFrameworkMessage(String taskId, TaskResult taskResult) Build a simple framework task message based on the passed
parameters and return the string. | public String | buildFrameworkMessage(String taskId, TaskResult taskResult, MessageType messageType, String message, String[] params, String token, List<ComponentMessageHolder> compMsgs) | public String | buildFrameworkMessage(String taskId, TaskResult taskResult, MessageType messageType, String message, String[] params, String token) Build a simple framework task message based on the passed
parameters and return the string. | public Message | createMessage(String jbiTaskMsg) | public static String | getMessageString(String message) Returns the string from a message entry without the JBIMAxxxx token. | public static String | getMessageToken(String message) Returns the JBIMAxxxx mesage token from a localized message entry. | public String | getStackTrace(Throwable exObj) | public String | getString(JbiTaskResult jbiTaskMsg) Get the string from the management message object. | public List<ServiceUnitInfo> | getSuccessfulServiceUnits(String jbiTaskMsg, List<ServiceUnitInfo> suInfoList) Parse the Component Results. | public static boolean | isLocalizedMessage(String message) | public static boolean | isXmlString(String str) This method is used to check if the given string contains well-formed
XML. | public void | throwManagementException(String taskId, String msgKey, String[] params) |
buildComponentMessage | String buildComponentMessage(ComponentMessageHolder msgObject) throws Exception(Code) | | Return an XML string of the component message(either status
or exception message).
Parameters: msgObject - component message holder object Message as XML string throws: Exception - if unable to build message |
buildCompositeExceptionMessage | public String buildCompositeExceptionMessage(String taskId, java.util.Map<String, Throwable> exceptionMap) throws ManagementException(Code) | | This method composes a JBI Task Message from the exceptions in the Map. In
cases of complete failure what we get back from the remote instance is an
exception, which ( hopefully ) has a jbi task message as the message. If the
exceptions message is not a jbi task message, then this will build a jbi task
message from it.
This composition is required only in the complete failure cases.
Parameters: exceptionMap - - a map keyed by the instance names and the value is theexception thrown by the remote instance with the MBean exceptions stripped off. a composite JBI Task message that has all the information. |
buildCompositeMessage | public Message buildCompositeMessage(String taskId, Map<String, String> responseMap, Map<String, Throwable> exceptionMap, boolean requireAllSuccess) throws ManagementException(Code) | | This operation combines the data from exception jbi task messages and response
jbi task messages. The primary user of this operation is the facade DeploymentSvc.
Parameters: taskId - - task id Parameters: responseMap - - a map of jbi task message responses from instances. Parameters: exceptionMap - - a map of exception task message from instances. Parameters: requireAllSuccess - - this flag indicates how the result of component taskresults for each component from various instances has to be handled. If set to truea Component task result has a task result of SUCCESS only if all the ComponentTaskresults in the response and exception maps are a success. |
buildExceptionMessage | public String buildExceptionMessage(String taskId, Throwable ex) throws ManagementException(Code) | | Build a framework task message with exception. If the exception message is a
jbi task message or a jbi localized message the message is returned as is.
Parameters: taskId - - name of the operation which threw the exception Parameters: ex - - the exception |
buildFrameworkMessage | public String buildFrameworkMessage(String taskId, TaskResult taskResult) throws ManagementException(Code) | | Build a simple framework task message based on the passed
parameters and return the string.
|
buildFrameworkMessage | public String buildFrameworkMessage(String taskId, TaskResult taskResult, MessageType messageType, String message, String[] params, String token) throws ManagementException(Code) | | Build a simple framework task message based on the passed
parameters and return the string.
|
getMessageString | public static String getMessageString(String message)(Code) | | Returns the string from a message entry without the JBIMAxxxx token.
|
getMessageToken | public static String getMessageToken(String message)(Code) | | Returns the JBIMAxxxx mesage token from a localized message entry.
|
getStackTrace | public String getStackTrace(Throwable exObj)(Code) | | the stack trace of the exception object as a string |
getSuccessfulServiceUnits | public List<ServiceUnitInfo> getSuccessfulServiceUnits(String jbiTaskMsg, List<ServiceUnitInfo> suInfoList) throws ManagementException(Code) | | Parse the Component Results. This is based on the fact that the
ServiceUnitList obtained from a ServiceAssemblyInfo and the ComponentTaskResults
follow the document order of the ServiceUnits in the Service Assembly jbi.xml.
The DeploymentService should also append a ComponentTaskResult for each Service
Unit in the Service Assembly.
|
isLocalizedMessage | public static boolean isLocalizedMessage(String message)(Code) | | true if the message starts with JBIMA |
isXmlString | public static boolean isXmlString(String str)(Code) | | This method is used to check if the given string contains well-formed
XML.
Parameters: str - the string true if the given string is xml |
|
|