Having taken immunology (though its not my major) it's not quite that simple . . . its best described as a cascade:
1) Produce random ABs (which is why allergies develop)
2) Send out ABs
3) If Abs attach to something, send WBs to destroy
4) Collect WBs and sift through for the foreign DNA/RNA sequence in the liver
5) Replicate "immunity pattern" from WB and begin invasion
6) Commit immunity to immunological memory
7) Repeat
However, and whether this interests you or not, this is only one of 3 immune systems we have: Surface (body salts, sweat, etc), Innate (immediate protection, but no long term immunity), Adaptive (most commonly referred, long term protection). This is protection in the order by which foreign microbes must first pass.
The idea is interesting, but would be problematic since your body would recognize the (for example) false H1N1, but you would still likely be susceptible to the real one. In a way, you could already call a vaccination a molecular mannequin. I wish i could recommend a book on the matter, but again, I've only had one class and cant really remember all of the nuances that were discussed. Bear in mind that even a dead microbe can be used as a vaccination (or for the process of making one).