A Dublin court has jailed three men who were part of a terrorist group that planned to bomb a mosque in Galway.