The law on self-defence in England is very clear
Under Common law, a person is allowed to use necessary, reasonable and proportionate force to defend themselves, another or their property from imminent attack.
Further, Section 3 of the Criminal Law Act 1967 provides that:
(1) A person may use such force as is reasonable in the circumstances in the prevention of crime, or in effecting or assisting in the lawful arrest of offenders or suspected offenders or of persons unlawfully at large.
(2) Subsection (1) above shall replace the rules of the common law on the question when force used for a purpose mentioned in the subsection is justified by that purpose.
Is John's action self-defence?
It would appear that John could avail himself of both the common law, because he is being attacked, and statutory defences because the attack would appear to be a criminal assault. Both defences require that the force used be reasonable.
The definitive statement on reasonable force comes from Palmer v The Queen [1971] AC 814, 832:
The defence of self-defence is one which can be and will be readily understood by any jury. It is a straightforward conception. It involves no abstruse legal thought. … Only common sense is needed for its understanding. It is both good law and good sense that a man who is attacked may defend himself. It is both good law and good sense that he may do, but may only do, what is reasonably necessary. But everything will depend upon the particular facts and circumstances. … It may in some cases be only sensible and clearly possible to take some simple avoiding action. Some attacks may be serious and dangerous. Others may not be. If there is some relatively minor attack it would not be common sense to permit some action of retaliation which was wholly out of proportion to the necessities of the situation. If an attack is serious so that it puts someone in immediate peril then immediate defensive action may be necessary. If the moment is one of crisis for someone in imminent danger he may have [to] avert the danger by some instant reaction. If the attack is all over and no sort of peril remains then the employment of force may be by way of revenge or punishment or by way of paying off an old score or may be pure aggression. There may no longer be any link with a necessity of defence… If a jury thought that in a moment of unexpected anguish a person attacked had only done what he honestly and instinctively thought was necessary that would be most potent evidence that only reasonable defensive action had been taken.
Essentially, if the jury is satisfied that John struck out to stop an ongoing attack, this would be self-defence. If the attack was over, and John struck the aggressor as they were leaving, this would not be self-defence.