Hi Lemtai,
Essentially, you have assaulted someone. But given who that person was (e.g. police officer, someone over 60 years, disabled person), the assault becomes serious.
See
Criminal Code (QLD) s 340 for the offence of serious assaults. The maximum penalty is 7 years imprisonment, but this is reserved for the upper spectrum of serious assaults. Merely spitting would not yield such a high sentence, especially considering the circumstances it was made under.
A court diversion program is an alternative resolution for summary offences. In QLD, it appears diversion is only reserved for minor drug offences. I am not too familiar with QLD law but from my research, it appears that QLD does not have something akin to diversion for non-drug offences. In any event, the police, accused and the Magistrates' Court will need to approve the diversion program.