Is there a plugin that saves messages to Database?

Hi Everyone, I am a newbie in plugin development for OpenFire, so I thought I will ask before I start!

Basically,

  1. I am hoping that I can store say, last few days of messages to see what all is getting talked about!

Based on that, I will like to -

  1. Create some visualizations/graphs for our team to look at and understand what all is getting talked about.

  2. Create a way to filter things out just to make sure people are not abusing the system

Is there a plugin available that does this? If not exactly, I will appreciate if you can point me where I can find source code for #1 (storing messages in DB) and then I will make changes to it.

Any help will be greatly appreciated.