Class AbstractStreamProvider
- java.lang.Object
-
- org.apache.catalina.tribes.membership.cloud.AbstractStreamProvider
-
- All Implemented Interfaces:
StreamProvider
- Direct Known Subclasses:
CertificateStreamProvider
,InsecureStreamProvider
,TokenStreamProvider
public abstract class AbstractStreamProvider extends Object implements StreamProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected static TrustManager[]
INSECURE_TRUST_MANAGERS
protected static StringManager
sm
-
Constructor Summary
Constructors Constructor Description AbstractStreamProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static TrustManager[]
configureCaCert(String caCertFile)
protected abstract SSLSocketFactory
getSocketFactory()
URLConnection
openConnection(String url, Map<String,String> headers, int connectTimeout, int readTimeout)
Open URL connection to the specified URL.InputStream
openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout)
Open stream to the specified URL.
-
-
-
Field Detail
-
sm
protected static final StringManager sm
-
INSECURE_TRUST_MANAGERS
protected static final TrustManager[] INSECURE_TRUST_MANAGERS
-
-
Method Detail
-
getSocketFactory
protected abstract SSLSocketFactory getSocketFactory()
- Returns:
- the socket factory, or null if not needed
-
openConnection
public URLConnection openConnection(String url, Map<String,String> headers, int connectTimeout, int readTimeout) throws IOException
Open URL connection to the specified URL.- Parameters:
url
- the urlheaders
- the headers mapconnectTimeout
- connection timeout in msreadTimeout
- read timeout in ms- Returns:
- the URL connection
- Throws:
IOException
- when an error occurs
-
openStream
public InputStream openStream(String url, Map<String,String> headers, int connectTimeout, int readTimeout) throws IOException
Description copied from interface:StreamProvider
Open stream to the specified URL.- Specified by:
openStream
in interfaceStreamProvider
- Parameters:
url
- the urlheaders
- the headers mapconnectTimeout
- connection timeout in msreadTimeout
- read timeout in ms- Returns:
- the stream
- Throws:
IOException
- when an error occurs
-
configureCaCert
protected static TrustManager[] configureCaCert(String caCertFile) throws Exception
- Throws:
Exception
-
-