When Hamas took control of Gaza they made it clear that the release of Alan Johnston is at the top of their agenda, and they've delivered. You can find a detailed account on how Hamas did it on BBC:
Fortunately for Alan, when Hamas took control in Gaza the rules of the game changed.It took Hamas to take full control of Gaza for Alan to be released, Fatah is much weaker and was unable to pressure the kidnappers (besides Fatah was busy trying to bring down the elected Hamas government, using American money).
Hamas's priority is to restore law and order to the Gaza Strip, and one the first items on that agenda was to get Alan Johnston freed.
The group's Executive Forces, a kind of irregular police force in Gaza, and its military wing, the Izzedine al-Qassam Brigades, deployed in the Dogmush neighbourhood.
Up to five members of the clan were detained in the last few days. There are reports that water and electricity were cut off in some streets.
Calls also came from senior members of the family from different branches to free Alan.
It is a relief all round that the pro-Hamas forces did not resort to a military solution, which could have endangered the lives of Alan Johnston, as well as captors, rescuers and bystanders.
The captors were clearly afraid of such a possibility. At one point they dressed Alan in what appeared to be an explosives belt, of the type used by suicide bombers, which they said would be detonated if they were attacked.
This also sends a strong message to the Israelis, if you want the Israeli soldier in captivity to be released you must release some of the thousands of Palestinian prisoners in Israeli jails.
I use to listen to Alan's reports on BBC, his prospectives and observations about the living conditions in Gaza were much need and his sympathy to the blight of the Palestinian people was heartwarming. Alan talked about his ordeal and thanked Hamas and everyone who took part in his release.