7 Replies Latest reply on Nov 15, 2011 7:33 AM by Tomohisa igarashi

    Validator: Message Validation

    Tomohisa igarashi Master

      Hi all,

       

      I've written a prototype of Message Validator stuff and passed the compilation. I've just mapped the Transformer related classes into Validator's one by one. Please take a look when you like and let's start to discuss with this.

       

      [branch] https://github.com/igarashitm/core/tree/SWITCHYARD-492

      [commit] https://github.com/igarashitm/core/commit/b5ab2c1773d9fcf022e527316ffdb77c6ab178ba

       

      The points need to be crarified which I've noticed are ...

      • Validator needs Sequence? (cf. api/src/main/java/org/switchyard/validate/ValidateSequence.java)

      Unlike Transformer, Validator doesn't need to be taken care the ordering, but still need to be able to chain

       

      • When validator should be applied? (cf. runtime/src/main/java/org/switchyard/internal/ExchangeImpl.java)

      in ExchangeImpl#send() before apply Transformer right now. after transform may be better when OUT state because it's just the boundary with the caller.

       

      • Should Validator be applied every Message#getContent(Class<T>)? (cf. runtime/src/main/java/org/switchyard/internal/DefaultMessage.java)

      currently not applied. After actually transforming occurred may be the candidate to apply Validator.

       

      • Any Validator should be auto registered? (cf. deploy/base/src/main/java/org/switchyard/deploy/internal/AbstractDeployment.java)

      Just I'm not sure why JAXB Transformer should be auto-registered, so will take a look further.

       

      Any advice would be appreciated

       

      Thanks,

      Tomo