Class AuthenticationResponse

java.lang.Object
com.targomo.client.api.response.esri.AuthenticationResponse

public class AuthenticationResponse extends Object
The POJO for the response from the ESRI authentication. There are two different possible response types:
  • (1) the response was an error message (wasErrorResponse()==true), i.e. error value is set - see ErrorDescription
  • (2) the request was successful (wasErrorResponse()==false) and values for accessToken and expiresIn are set
  • Constructor Details

    • AuthenticationResponse

      public AuthenticationResponse(String accessToken, Integer expiresIn, ErrorDescription error)
      private - not used since this is a POJO only created from a json String
  • Method Details

    • getAccessToken

      public String getAccessToken()
      Returns:
      the retrieved access token (may be null if an error occurred during request)
    • getExpiresIn

      public Integer getExpiresIn()
      Returns:
      time validity for token in seconds (may be null if an error occurred during request)
    • getError

      public ErrorDescription getError()
      Returns:
      if an error occurred, the ErrorDescription is returned
    • wasErrorResponse

      public boolean wasErrorResponse()
      Returns:
      true if error was recorded; false otherwise