Hamas succeeded in:
- bringing international attention to Palestine.
- winning widespread support from Palestinians and citizens of surrounding countries by 'standing' up to Israel.
- sidelining Abbas and Fatah ahead of the U.N application.
- forcing Israel to bomb Gaza to radicalize Palestinians and turning them over to Hamas.
- widen the rift between Israel and surrounding nations and sow the seeds of the next conflict between Israeli jews and Arabs.
Hamas was probably hoping for Israel to invade Gaza as well, as that would have helped their cause immeasurably due to the projected body count that would have been inflicted on Palestinians.
It would have been a punitive expedition by Israel, and they would have never been able to destroy Hamas competely. The mere act of surviving an Israel invasion would boost Hamas' power and the effect of the invasion would be utterly disastrous on the international opinion of Israel.
Hence, Israel would have lost no matter what action they take, but they would lose much more if the invasion went ahead.
I think Israel counts wins and losses by the number of deaths and infastructural damage. Hamas apparently does not, as they are willing to sacrifice their people to make such a "statement to the international community".
Most countries, aside from China and the Muslim world agreed that Israel has a right to defend itself. Even Obama, which surprised me.