Class TokenStreamProvider
java.lang.Object
org.apache.catalina.tribes.membership.cloud.AbstractStreamProvider
org.apache.catalina.tribes.membership.cloud.TokenStreamProvider
- All Implemented Interfaces:
StreamProvider
Stream provider that authenticates using a bearer token.
-
Field Summary
Fields inherited from class AbstractStreamProvider
INSECURE_TRUST_MANAGERS, sm -
Method Summary
Modifier and TypeMethodDescriptionprotected SSLSocketFactoryReturns the SSL socket factory.openStream(String url, Map<String, String> headers, int connectTimeout, int readTimeout) Opens an input stream to the specified URL.protected voidSets the bearer token for authentication.Methods inherited from class AbstractStreamProvider
configureCaCert, openConnection
-
Method Details
-
getSocketFactory
Description copied from class:AbstractStreamProviderReturns the SSL socket factory.- Specified by:
getSocketFactoryin classAbstractStreamProvider- Returns:
- the socket factory, or null if not needed
-
setToken
Sets the bearer token for authentication.- Parameters:
token- the bearer token
-
openStream
public InputStream openStream(String url, Map<String, String> headers, int connectTimeout, int readTimeout) throws IOExceptionDescription copied from class:AbstractStreamProviderOpens an input stream to the specified URL.- Specified by:
openStreamin interfaceStreamProvider- Overrides:
openStreamin classAbstractStreamProvider- Parameters:
url- the urlheaders- the headers mapconnectTimeout- connection timeout in msreadTimeout- read timeout in ms- Returns:
- the input stream
- Throws:
IOException- when an error occurs
-