The court heard that Michael O’Connor reloaded his father’s legally held shotgun on 23 occasions in a garda operation that involved 110 officers.
He pleaded guilty to all charges.
O’Connor barricaded himself into the family home when his parents were away, before opening fire on the gardai.
Judge Johnson told the court that although O’Connor had taken alcohol he still had the “presence of mind” to locate his father’s legally held shotgun.
And O’Connor had then opened fire on a uniformed garda who was clearly visible to him.
Shots were later exchanged as O’Connor fired at a garda patrol car.
Judge Johnson said the “public had to be protected” from O’Connor as a pre-sentence report stated that he was at “huge risk of reoffending.
The judge said O’Connor has shown a cavalier attitude to the gravity of the situation that cost the State enormous resources, before he eventually gave up the siege 13 hours after the ordeal began.
He added that the siege was something “that was completely alien to Ireland”.
Judge Johnson said that 17 houses in the area had to be evacuated during the siege.
Judge Johnson paid tribute to the gardai who had brought the siege with a successful outcome.
O'Connor was given a seven year sentence.