En mann i 40-årene er dømt til forvaring i ti år for overgrep mot til sammen tolv mindreårige gutter.