A stalker has been jailed for more than two years after he frequently harassed a Poole woman in public and online.