A barrister and Dublin councillor was punched in the stomach by a business graduate beggar as he was leaving a cafe in the city centre, a court heard.
Richard Humphreys was on his way out of Bewley's on Grafton Street when he was accosted by Christopher McKenna (49).
McKenna demanded money from the senior counsel and when he refused, attacked him and ran off.
McKenna, who attended Blackrock College in his youth, was jailed for four months when he admitted attempted robbery.
Mr Humphreys, a Labour councillor with Dun Laoghaire Rathdown County Council, had been ready to give evidence at Dublin District Court when McKenna changed his plea.
Garda Bernard Maguire, of Harcourt Terrace Garda Station, told the court Mr Humphreys was leaving Bewley's on the evening of November 10 when McKenna asked him for money before grabbing him, pushing him up against the window and punching him in the stomach.
Defence Barrister Barry Ward said the Mount Merrion-based councillor had not been injured and the accused had offered him a personal apology.
Garda Neil Carberry, of Pearse Street Station, gave evidence of a separate public order incident on Dame Street on January 22, when McKenna threw a can of beer at a passing ambulance.
McKenna had three previous convictions and had been given a 28-day sentence for breach of the peace.
Mr Ward said the accused, with an address at Cedar House, Dublin 1, was originally from South Wales but had spent a long time in Ireland.
He had not worked in some time and did not have a "very stable life" at the moment. He was intoxicated at the time of both offences.
"He drinks every other day but says he doesn't have a problem with drink," Mr Ward said. "The offences stem from his use of alcohol.
"I know there is an attempted robbery before the court, he tells me he doesn't remember the event but he accepts that it occurred. Likewise in respect to the ambulance incident."
Judge Victor Blake said the maximum sentence he could give for attempted robbery was one year.
He sentenced him to four months, with a concurrent two-month sentence for the other incident.