Class OAuth

    • Constructor Detail

      • OAuth

        public OAuth()
        OAuth constructor.
      • OAuth

        public OAuth​(jakarta.ws.rs.client.Client httpClient)
      • OAuth

        public OAuth​(jakarta.ws.rs.client.Client client,
                     OAuthFlow flow,
                     String authorizationUrl,
                     String tokenUrl,
                     String scopes)
        OAuth constructor.
        Parameters:
        client - The client to use
        flow - The OAuth flow
        authorizationUrl - The auth url
        tokenUrl - The token URL
        scopes - The scopes to use
      • OAuth

        public OAuth​(OAuthFlow flow,
                     String authorizationUrl,
                     String tokenUrl,
                     String scopes)
        OAuth constructor.
        Parameters:
        flow - The OAuth flow
        authorizationUrl - The auth url
        tokenUrl - The token URL
        scopes - The scopes to use
    • Method Detail

      • applyToParams

        public void applyToParams​(List<Pair> queryParams,
                                  Map<String,​String> headerParams)
        applyToParams method.
        Specified by:
        applyToParams in interface Authentication
        Parameters:
        queryParams - The query params
        headerParams - The header params
      • updateAccessToken

        public void updateAccessToken()
                               throws ApiException
        updateAccessToken method.
        Throws:
        ApiException
      • registerAccessTokenListener

        public void registerAccessTokenListener​(AccessTokenListener accessTokenListener)
        registerAccessTokenListener method.
        Parameters:
        accessTokenListener - The access token listener
      • getAccessToken

        public String getAccessToken()
        getAccessToken method.
        Returns:
        String
      • getExpirationTimeMillis

        public Long getExpirationTimeMillis()
      • setExpirationTimeMillis

        public void setExpirationTimeMillis​(Long expirationTimeMillis)
      • setAccessToken

        public void setAccessToken​(String accessToken,
                                   Long expiresIn)
      • getClientId

        public String getClientId()
      • setClientId

        public void setClientId​(String clientId)
      • getClientSecret

        public String getClientSecret()
      • setClientSecret

        public void setClientSecret​(String clientSecret)
      • getAuthorizationUrl

        public String getAuthorizationUrl()
      • setAuthorizationUrl

        public void setAuthorizationUrl​(String authorizationUrl)
      • getTokenUrl

        public String getTokenUrl()
      • setTokenUrl

        public void setTokenUrl​(String tokenUrl)
      • getRedirectURI

        public String getRedirectURI()
      • setRedirectURI

        public void setRedirectURI​(String redirectURI)
      • getScope

        public String getScope()
      • setScope

        public void setScope​(String scope)
      • getGrantType

        public OAuthFlow getGrantType()
      • setGrantType

        public void setGrantType​(OAuthFlow grantType)
      • getJwtAssertion

        public String getJwtAssertion()
      • setJwtAssertion

        public void setJwtAssertion​(String jwtAssertion)
      • getAuthCode

        public String getAuthCode()
      • setAuthCode

        public void setAuthCode​(String authCode)
      • buildResponseHeaders

        protected Map<String,​List<String>> buildResponseHeaders​(jakarta.ws.rs.core.Response response)
      • serialize

        public jakarta.ws.rs.client.Entity<?> serialize​(Object obj,
                                                        Map<String,​Object> formParams,
                                                        String contentType)
                                                 throws ApiException
        Serialize the given Java object into string entity according the given Content-Type (only JSON is supported for now).
        Parameters:
        obj - Object
        formParams - Form parameters
        contentType - Context type
        Returns:
        Entity
        Throws:
        ApiException - API exception
      • parameterToString

        public String parameterToString​(Object param)
        Format the given parameter object into string.
        Parameters:
        param - Object
        Returns:
        Object in string format
      • deserialize

        public <T> T deserialize​(jakarta.ws.rs.core.Response response,
                                 jakarta.ws.rs.core.GenericType<T> returnType)
                          throws ApiException
        Deserialize response body to Java object according to the Content-Type.
        Type Parameters:
        T - Type
        Parameters:
        response - Response
        returnType - Return type
        Returns:
        Deserialize object
        Throws:
        ApiException - API exception