A young man has been jailed after he was part of a group that attacked and killed father-of-seven Thomas Dooley in a graveyard in Kerry in 2022.