Class SupplierBearerTokenProvider
java.lang.Object
com.eqixiac.equinix.core.auth.SupplierBearerTokenProvider
- All Implemented Interfaces:
BearerTokenProvider
A
BearerTokenProvider that obtains every token from a Supplier. A supplier that
returns null fails the request with an EquinixClientException.- Author:
- ianjones
-
Constructor Summary
ConstructorsConstructorDescriptionSupplierBearerTokenProvider(Supplier<BearerToken> supplier) Creates a provider over a token supplier. -
Method Summary
-
Constructor Details
-
SupplierBearerTokenProvider
Creates a provider over a token supplier.- Parameters:
supplier- supplies a token on each call; must not benull
-
-
Method Details
-
getToken
Calls the supplier.- Specified by:
getTokenin interfaceBearerTokenProvider- Returns:
- the supplied token
- Throws:
EquinixClientException- if the supplier returnsnull
-