Optical rogue waves and dispersive shock waves