Class EnvironmentTokenAPIHandler

    • Field Detail

      • tokenEnv

        protected final java.lang.String tokenEnv
    • Constructor Detail

      • EnvironmentTokenAPIHandler

        protected EnvironmentTokenAPIHandler​(EnvironmentTokenAPIHandler.Conf<?> builder)
        Constructor.
        Parameters:
        builder - The builder to use.
    • Method Detail

      • getToken

        public java.lang.String getToken()
        Return the current token from the System environment.
        Returns:
        The current token.
      • refreshToken

        public void refreshToken()
                          throws HiroException
        Refresh an invalid token.
        Throws:
        HiroException - On Hiro protocol / handling errors.
      • revokeToken

        public void revokeToken()
                         throws HiroException
        Revoke a token
        Throws:
        HiroException - On Hiro protocol / handling errors.
      • hasToken

        public boolean hasToken()
        Check for existence of a token in the TokenAPIHandler.
        Returns:
        true if a token has been set or retrieved, false if the token is empty.
      • hasRefreshToken

        public boolean hasRefreshToken()
        Check for existence of a refresh token in the TokenAPIHandler.
        Returns:
        false
      • expiryInstant

        public java.time.Instant expiryInstant()
        Calculate the Instant after which the token should be refreshed.
        Returns:
        The Instant after which the token shall be refreshed. null if token cannot be refreshed.