Step 1Pull the ham apart with your fingers into uneven 1-inch chunks, discarding the fat and any sinew. Set aside.
Step 2Combine the wine, half the stock, bay leaves, thyme and peppercorns in a saucepan. Cover the pan and bring to a boil.
Step 3Wash and dry the parsley. Strip the parsley leaves from the stems and add stems to the wine mixture. Let it simmer, covered, very gently for about 30 minutes.
Step 4Chop the parsley leaves and put them in a small bowl. Pour the boiling water over the leaves to set the color and leave to cool.
Step 5Pour the remaining stock into a medium bowl, sprinkle the gelatin on top and leave it until spongy, about 5 minutes. Strain the wine mixture into a measuring cup. There should be 3 cups; if necessary add a little water. Bring the wine mixture just back to a boil, take off the heat, add the gelatin sponge and stir until melted. Pour into a bowl and leave it to cool until tepid, then stir in the parsley and water, shallots and garlic. Taste the aspic and season it with salt and pepper (remember that the ham is salty). Aspic will thicken quite suddenly when cold, so do not chill it.
Step 6To mold the ham, add a shallow layer of aspic (three-fourths cup) to the glass bowl or terrine mold and chill it in the refrigerator or over ice water about 8 to 10 minutes until almost set. Mix the ham with the shallots, garlic and parsley (along with its liquid) in a large bowl. Add the remaining tepid aspic, mix well, and transfer the entire mix to the mold. Press the pieces of ham well below the surface of the aspic and make sure no air bubbles are trapped beneath the ham. Cover the mold and chill it until set, at least 3 hours. It keeps well for up to a week, but once cut open should be eaten within a day.
Step 7To unmold and serve, dip the mold in hot water for 30 seconds to loosen the aspic. Run a knife around the edge, unmold the ham onto a platter, and cut it in wedges for serving.