How to create a constraint that limits position & rotation (Think: Jack-in-the-Box)

I am trying to create a joint constraint that tries to keep the target object in a specified position and orientation but with some elasticity. The easiest mental picture would be a jack-in-the-box type function. So far can’t seem to find a solution that would use a single constraint. Is it possible to do this?

How can it be set up?

Thanks!

Never mind. After some searching, it turns out you need to use the Drive Forces of a configurable joint. At first, I though that was for a motor type effect only.