First of all the laws defining occupation were written to apply to sovereign land being captured by another nation, and since the territories were never sovereign land it is not clear they are legally occupied and since Israel has not attempted to exercise any governmental authority over the territories assigned to the so called Palestinians since Oslo, the notion that these territories are occupied by Israel is very murky, indeed.
Moreover if Israel were considered an occupying power, it would have obligation under international law to assume all governmental powers, including police powers, so the Palestinians would have no more right to strike against Israel and Israelis than they had to strike against Hamas.
None of the violence you try to pretend is self defense is sanctioned under international law, and if you consider Israel to be the occupying power all of its actions to establish and maintain peace and order in Gaza are perfectly legal.