Police officer recovering after violent attack