org.jboss.soa.esb.actions.validation
Class SchemaValidationAction

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractActionLifecycle
      extended by org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
          extended by org.jboss.soa.esb.actions.validation.SchemaValidationAction
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor

public class SchemaValidationAction
extends AbstractActionPipelineProcessor

An action that validates the passed-in message payload against the configured schema. The payload can be of either type byte[] or String. Example configuration:

<action name="validate" class="org.jboss.soa.esb.actions.validation.SchemaValidationAction">
     <property name="schema" value="/test.xsd"/>
 </action>
 
Optional properties:
  • schemaLanguage the schema langauage to use. Defaults to "http://www.w3.org/2001/XMLSchema".
  • Author:
    Daniel Bevenius

    Field Summary
     
    Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
    PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
     
    Constructor Summary
    SchemaValidationAction(ConfigTree config)
              Sole constructor that expects the config tree to have the attribute "schema"
     
    Method Summary
     Message process(Message message)
              Processes the messsage, extracting the payload and validating the xml against the configured schema.
     
    Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
    processException, processSuccess
     
    Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
    destroy, initialise
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
    destroy, initialise
     

    Constructor Detail

    SchemaValidationAction

    public SchemaValidationAction(ConfigTree config)
                           throws ConfigurationException
    Sole constructor that expects the config tree to have the attribute "schema"

    Parameters:
    config - The action configuration.
    Throws:
    ConfigurationException
    Method Detail

    process

    public Message process(Message message)
                    throws ActionProcessingException
    Processes the messsage, extracting the payload and validating the xml against the configured schema.

    Parameters:
    message - The esb Message object.
    Returns:
    Message The esb Message unmodified.
    Throws:
    ActionProcessingException - If a exception occurs while trying to validate