Your analogy is incorrect.
When a sovereign nation attacks another, war ensues. That is very clear. But when resistance elements arise within a city that is supposedly part of a sovereign nation, you don't build a wall around the city. That's how you would handle it in the Middle Ages.
But the issue is even more complex than that, since the resistance aims to gain independence from the state. So I would say that the Gaza situation is somewhat similar to that of the IRA and the UK.
I don't recall the UK building a wall around Ireland and carpet bombing it every few years?
Woah woah woah man... quite moderate? The destruction of a third of Gaza and the death of thousands of people is quite moderate?
I give up. This discussion is going nowhere :(