Judge sentences California man to 12 years in terrorism case