# Class TokenStreamProvider

java.lang.Object
org.apache.catalina.tribes.membership.cloud.AbstractStreamProvider
org.apache.catalina.tribes.membership.cloud.TokenStreamProvider

All Implemented Interfaces:
  `StreamProvider`

public class TokenStreamProvider extends AbstractStreamProvider
Stream provider that authenticates using a bearer token.

## Field Summary

### Fields inherited from class AbstractStreamProvider

`INSECURE_TRUST_MANAGERS, sm`

## Method Summary

Modifier and Type
Method
Description
`protected SSLSocketFactory`
`getSocketFactory()`
Returns the SSL socket factory.
`InputStream`
`openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout)`
Opens an input stream to the specified URL.
`protected void`
`setToken(String token)`
Sets the bearer token for authentication.

### Methods inherited from class AbstractStreamProvider

`configureCaCert, openConnection`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getSocketFactory

protected SSLSocketFactory getSocketFactory()
Description copied from class: `AbstractStreamProvider`
Returns the SSL socket factory.

Specified by:
  `getSocketFactory` in class `AbstractStreamProvider`
Returns:
  the socket factory, or null if not needed

### setToken

protected void setToken(String token)
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 IOException
Description copied from class: `AbstractStreamProvider`
Opens an input stream to the specified URL.

Specified by:
  `openStream` in interface `StreamProvider`
Overrides:
  `openStream` in class `AbstractStreamProvider`
Parameters:
  `url` - the url
  `headers` - the headers map
  `connectTimeout` - connection timeout in ms
  `readTimeout` - read timeout in ms
Returns:
  the input stream
Throws:
  `IOException` - when an error occurs