Package dev.lavalink.youtube.http
Class YoutubeOauth2Handler
java.lang.Object
dev.lavalink.youtube.http.YoutubeOauth2Handler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionYoutubeOauth2Handler(com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager httpInterfaceManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToken(org.apache.http.client.methods.HttpUriRequest request) voidapplyToken(org.apache.http.client.methods.HttpUriRequest request, String token) com.grack.nanojson.JsonObjectcreateNewAccessToken(String refreshToken) Executes the HTTP request to refresh the access token and returns the response.@Nullable StringbooleanisOauthFetchContext(org.apache.http.client.protocol.HttpClientContext context) voidrefreshAccessToken(boolean force) Refreshes an access token using a supplied refresh token.voidsetRefreshToken(@Nullable String refreshToken, boolean skipInitialization) boolean
-
Field Details
-
OAUTH_INJECT_CONTEXT_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
YoutubeOauth2Handler
public YoutubeOauth2Handler(com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager httpInterfaceManager)
-
-
Method Details
-
setRefreshToken
-
shouldRefreshAccessToken
public boolean shouldRefreshAccessToken() -
getRefreshToken
-
isOauthFetchContext
public boolean isOauthFetchContext(org.apache.http.client.protocol.HttpClientContext context) -
refreshAccessToken
public void refreshAccessToken(boolean force) Refreshes an access token using a supplied refresh token.- Parameters:
force- Whether to forcefully renew the access token, even if it doesn't necessarily need to be refreshed yet.
-
createNewAccessToken
Executes the HTTP request to refresh the access token and returns the response.- Parameters:
refreshToken- The refresh token to be included in the request.- Returns:
- The JSON response as a JsonObject.
-
applyToken
public void applyToken(org.apache.http.client.methods.HttpUriRequest request) -
applyToken
-