Cathal Crotty has been sentenced to two years in prison for attacking activist Natasha O'Brien in Limerick in 2022.