buddycloud/buddycloud-server-java — pull request #191 by viv (2014-06-30 12:46:08+00:00)
Title: Add support for validating different payloads through plugins

We wanted to add support for IODEF validation to Buddycloud. Rather than polluting the core server with validation code that the majority of users will not need I have introduced a plugin system for payload validators.

There are two general changes I have made to:

1. Made content validation more generic by removing Atom specific knowledge from the publish processor.
2. Added support for validator plugins.

To remove Atom knowledge from publish processor I have:
- Passed a generic item element into AtomEntry (and other future validators) rather than the (Atom specific) entry element.
- Pushed the tasks of local and global ID generation, and the in-reply-to getter, into the validator(s).

I have updated the existing tests to conform with these changes and added new tests where appropriate. You might be interested to see an example of a validator plugin, I have IODEF validator and Atom validator examples. The Atom plugin is superfluous, it was created mainly to help me with testing. I didn't remove Atom validation from the core Buddycloud server!

* https://github.com/surevine/buddycloud-iodef-validator
* https://github.com/surevine/buddycloud-atom-validator

Thanks!