Package com.nimbusds.jose.util
Class AbstractRestrictedResourceRetriever
java.lang.Object
com.nimbusds.jose.util.AbstractRestrictedResourceRetriever
- All Implemented Interfaces:
ResourceRetriever
,RestrictedResourceRetriever
- Direct Known Subclasses:
DefaultResourceRetriever
@ThreadSafe
public abstract class AbstractRestrictedResourceRetriever
extends Object
implements RestrictedResourceRetriever
Abstract retrieval of resources by URL with HTTP timeout and entity size
restrictions.
-
Constructor Summary
ConstructorDescriptionAbstractRestrictedResourceRetriever
(int connectTimeout, int readTimeout, int sizeLimit) Creates a new abstract restricted resource retriever. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the HTTP connect timeout.Gets the headers to set for the HTTP request.int
Gets the HTTP read timeout.int
Gets the HTTP entity size limit.void
setConnectTimeout
(int connectTimeoutMs) Sets the HTTP connect timeout.void
setHeaders
(Map<String, List<String>> headers) Sets the headers to set for the HTTP request.void
setReadTimeout
(int readTimeoutMs) Sets the HTTP read timeout.void
setSizeLimit
(int sizeLimitBytes) Sets the HTTP entity size limit.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.nimbusds.jose.util.ResourceRetriever
retrieveResource
-
Constructor Details
-
AbstractRestrictedResourceRetriever
Creates a new abstract restricted resource retriever.- Parameters:
connectTimeout
- The HTTP connects timeout, in milliseconds, zero for infinite. Must not be negative.readTimeout
- The HTTP read timeout, in milliseconds, zero for infinite. Must not be negative.sizeLimit
- The HTTP entity size limit, in bytes, zero for infinite. Must not be negative.
-
-
Method Details
-
getConnectTimeout
Description copied from interface:RestrictedResourceRetriever
Gets the HTTP connect timeout.- Specified by:
getConnectTimeout
in interfaceRestrictedResourceRetriever
- Returns:
- The HTTP connect timeout, in milliseconds, zero for infinite.
-
setConnectTimeout
Description copied from interface:RestrictedResourceRetriever
Sets the HTTP connect timeout.- Specified by:
setConnectTimeout
in interfaceRestrictedResourceRetriever
- Parameters:
connectTimeoutMs
- The HTTP connect timeout, in milliseconds, zero for infinite. Must not be negative.
-
getReadTimeout
Description copied from interface:RestrictedResourceRetriever
Gets the HTTP read timeout.- Specified by:
getReadTimeout
in interfaceRestrictedResourceRetriever
- Returns:
- The HTTP read timeout, in milliseconds, zero for infinite.
-
setReadTimeout
Description copied from interface:RestrictedResourceRetriever
Sets the HTTP read timeout.- Specified by:
setReadTimeout
in interfaceRestrictedResourceRetriever
- Parameters:
readTimeoutMs
- The HTTP read timeout, in milliseconds, zero for infinite. Must not be negative.
-
getSizeLimit
Description copied from interface:RestrictedResourceRetriever
Gets the HTTP entity size limit.- Specified by:
getSizeLimit
in interfaceRestrictedResourceRetriever
- Returns:
- The HTTP entity size limit, in bytes, zero for infinite.
-
setSizeLimit
Description copied from interface:RestrictedResourceRetriever
Sets the HTTP entity size limit.- Specified by:
setSizeLimit
in interfaceRestrictedResourceRetriever
- Parameters:
sizeLimitBytes
- The HTTP entity size limit, in bytes, zero for infinite. Must not be negative.
-
getHeaders
Description copied from interface:RestrictedResourceRetriever
Gets the headers to set for the HTTP request.- Specified by:
getHeaders
in interfaceRestrictedResourceRetriever
- Returns:
- The HTTP headers as name - values map,
null
if not set.
-
setHeaders
Description copied from interface:RestrictedResourceRetriever
Sets the headers to set for the HTTP request.- Specified by:
setHeaders
in interfaceRestrictedResourceRetriever
- Parameters:
headers
- The HTTP headers as name - values map,null
if none.
-