A man convicted by a jury in October of attempted murder on a San Diego Harbor Police officer has been sentenced to 45 years to life in prison, San Diego County District Attorney Summer Stephan said in a news release.