Class PersonManagementService

java.lang.Object
org.bhn.promotion.core.service.PersonManagementService

@Service public class PersonManagementService extends Object
Service class for getting Person details from the Person Management system.
  • Constructor Details

    • PersonManagementService

      public PersonManagementService()
  • Method Details

    • setPersonManagementProxy

      @Autowired public void setPersonManagementProxy(PersonManagementProxy personManagementProxy)
    • getPersonByEmail

      public Person getPersonByEmail(String email)
      Retrieves a single Person based on the provided email address.

      Error handling is implemented for specific scenarios:

      • WebClientResponseException.NotFound: Logs a message when no person is found.
      • WebClientResponseException: Logs the status code and error message for other HTTP errors.
      • Exception: Logs unexpected errors that might occur during execution.
      Parameters:
      email - the email address of the person to fetch.
      Returns:
      the first Person found, or null if none is found or an error occurs.