org.ow2.petals.microkernel.api.jbi.management
Class XMLResult

java.lang.Object
  extended by org.ow2.petals.microkernel.api.jbi.management.XMLResult

public class XMLResult
extends Object

This class gathers the DTD used for the management message.

Author:
ddesjardins - EBM WebSourcing, wjoseph - EBM WebSourcing

Nested Class Summary
static class XMLResult.CauseFramework
           
static class XMLResult.MessageType
           
static class XMLResult.TaskResult
           
 
Field Summary
protected  String frameworkTaskId
           
protected  StringBuffer xmlBuffer
           
 
Constructor Summary
XMLResult(String frameworkTaskId)
           
 
Method Summary
 void addComponentTaskResult(StringBuffer componentTaskString)
          Added a component task result to this management message
 void addFrameworkTaskResult(XMLResult.TaskResult taskResult, XMLResult.CauseFramework causeFramework)
          Add a framework task result to a xml management message
 void addFrameworkTaskResult(XMLResult.TaskResult taskResult, XMLResult.MessageType messageType, String message, String[] messageParams, String nestingLevel, String exceptionMessage, String[] exceptionMessageParams, String stackStrace, XMLResult.CauseFramework causeFramework)
          Add a framework task result to a xml management message
 void addFrameworkTaskResult(XMLResult.TaskResult taskResult, XMLResult.MessageType messageType, String message, String[] messageParams, String nestingLevel, String exceptionMessage, String[] exceptionMessageParams, XMLResult.CauseFramework causeFramework)
          Add a framework task result to a xml management message
 void addFrameworkTaskResult(XMLResult.TaskResult taskResult, XMLResult.MessageType messageType, String message, String[] messageParams, XMLResult.CauseFramework causeFramework)
          Add a framework task result to a xml management message
 String getString()
          Close the XMLResult and return the String
static boolean isValidComponentTask(String componentTask, InputStream xsd)
          Check if a component task result is valid against a xml schema
static void validateManagementMessage(String managementMessage, InputStream xsd)
          Check if a management message task result is valid against a xml schema
 String wrapComponentTaskResult(String componentName, String taskId, String message)
          Return a component task result xml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlBuffer

protected StringBuffer xmlBuffer

frameworkTaskId

protected String frameworkTaskId
Constructor Detail

XMLResult

public XMLResult(String frameworkTaskId)
Method Detail

addFrameworkTaskResult

public void addFrameworkTaskResult(XMLResult.TaskResult taskResult,
                                   XMLResult.CauseFramework causeFramework)
Add a framework task result to a xml management message

Parameters:
taskResult - result of the task
causeFramework - causeFramework

addFrameworkTaskResult

public void addFrameworkTaskResult(XMLResult.TaskResult taskResult,
                                   XMLResult.MessageType messageType,
                                   String message,
                                   String[] messageParams,
                                   XMLResult.CauseFramework causeFramework)
Add a framework task result to a xml management message

Parameters:
taskResult - result of the task
messageType - type of message
message - message
messageParams - list of param for the message
causeFramework - causeFramework

addFrameworkTaskResult

public void addFrameworkTaskResult(XMLResult.TaskResult taskResult,
                                   XMLResult.MessageType messageType,
                                   String message,
                                   String[] messageParams,
                                   String nestingLevel,
                                   String exceptionMessage,
                                   String[] exceptionMessageParams,
                                   XMLResult.CauseFramework causeFramework)
Add a framework task result to a xml management message

Parameters:
taskResult - result of the task
messageType - type of message
message - message
messageParams - list of param for the message
nestingLevel - nesting level of the exception
exceptionMessage - message of the exception
exceptionMessageParams - list of the param for the exception message
causeFramework - causeFramework

addComponentTaskResult

public void addComponentTaskResult(StringBuffer componentTaskString)
Added a component task result to this management message

Parameters:
componentTaskString - component task result xml

addFrameworkTaskResult

public void addFrameworkTaskResult(XMLResult.TaskResult taskResult,
                                   XMLResult.MessageType messageType,
                                   String message,
                                   String[] messageParams,
                                   String nestingLevel,
                                   String exceptionMessage,
                                   String[] exceptionMessageParams,
                                   String stackStrace,
                                   XMLResult.CauseFramework causeFramework)
Add a framework task result to a xml management message

Parameters:
taskResult - result of the task
messageType - type of message
message - message
messageParams - list of param for the message
nestingLevel - nesting level of the exception
exceptionMessage - message of the exception
exceptionMessageParams - list of the param for the exception message
stackStrace - stacktrace
causeFramework - causeFramework

getString

public String getString()
Close the XMLResult and return the String


isValidComponentTask

public static boolean isValidComponentTask(String componentTask,
                                           InputStream xsd)
Check if a component task result is valid against a xml schema

Parameters:
componentTask - xml of the component task
Returns:
true if valid, false if not valid

validateManagementMessage

public static void validateManagementMessage(String managementMessage,
                                             InputStream xsd)
                                      throws Exception
Check if a management message task result is valid against a xml schema

Parameters:
managementMessage - message xml of the management message
xsd - XMLSchema as InputStream to validate the message
Throws:
Exception

wrapComponentTaskResult

public String wrapComponentTaskResult(String componentName,
                                      String taskId,
                                      String message)
Return a component task result xml

Parameters:
componentName - component name
taskId - id of the task
taskResult - result of the task
messageType - type of message
message - message
messageParams - list of param for the message
nestingLevel - nesting level of the exception
exceptionMessage - message of the exception
exceptionMessageParams - list of the param for the exception message
stackStrace - stacktrace
Returns:
xml string


Copyright © 2005-2015 Linagora. All Rights Reserved.