Interface Authenticator

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String getAuthorizationHeaderValue​(com.smartgridready.ns.v0.DeviceFrame deviceDescription, com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)
      Retrieves the value of the authorization header of HTTP requests.
      default boolean isTokenRenewalSupported()
      Tells if access tokens can be renewed instead of re-authenticating.
      default void renewToken​(com.smartgridready.ns.v0.DeviceFrame deviceDescription, com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)
      Renews the access token.
    • Method Detail

      • getAuthorizationHeaderValue

        java.lang.String getAuthorizationHeaderValue​(com.smartgridready.ns.v0.DeviceFrame deviceDescription,
                                                     com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)
                                              throws java.io.IOException,
                                                     RestApiServiceCallException,
                                                     RestApiResponseParseException
        Retrieves the value of the authorization header of HTTP requests.
        Parameters:
        deviceDescription - the SGr device specification
        httpClientFactory - the SGr HTTP client factory
        Returns:
        a string
        Throws:
        java.io.IOException - when a communication error occurred
        RestApiServiceCallException - when the authentication failed
        RestApiResponseParseException - when the response could not be parsed
      • isTokenRenewalSupported

        default boolean isTokenRenewalSupported()
        Tells if access tokens can be renewed instead of re-authenticating. Defaults to false.
        Returns:
        a boolean
      • renewToken

        default void renewToken​(com.smartgridready.ns.v0.DeviceFrame deviceDescription,
                                com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)
                         throws java.io.IOException,
                                RestApiServiceCallException,
                                RestApiResponseParseException
        Renews the access token. Defaults to an empty implementation.
        Parameters:
        deviceDescription - the SGr device specification
        httpClientFactory - the SGr HTTP client factory
        Throws:
        java.io.IOException - when a communication error occurred
        RestApiServiceCallException - when the renewal failed
        RestApiResponseParseException - when the response could not be parsed