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
ConstructorsConstructorDescriptionAbstractRestrictedResourceRetriever(int connectTimeout, int readTimeout, int sizeLimit) Creates a new abstract restricted resource retriever. -
Method Summary
Modifier and TypeMethodDescriptionintGets the HTTP connect timeout.Gets the headers to set for the HTTP request.intGets the HTTP read timeout.intGets the HTTP entity size limit.voidsetConnectTimeout(int connectTimeoutMs) Sets the HTTP connect timeout.voidsetHeaders(Map<String, List<String>> headers) Sets the headers to set for the HTTP request.voidsetReadTimeout(int readTimeoutMs) Sets the HTTP read timeout.voidsetSizeLimit(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, waitMethods 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:RestrictedResourceRetrieverGets the HTTP connect timeout.- Specified by:
getConnectTimeoutin interfaceRestrictedResourceRetriever- Returns:
- The HTTP connect timeout, in milliseconds, zero for infinite.
-
setConnectTimeout
Description copied from interface:RestrictedResourceRetrieverSets the HTTP connect timeout.- Specified by:
setConnectTimeoutin interfaceRestrictedResourceRetriever- Parameters:
connectTimeoutMs- The HTTP connect timeout, in milliseconds, zero for infinite. Must not be negative.
-
getReadTimeout
Description copied from interface:RestrictedResourceRetrieverGets the HTTP read timeout.- Specified by:
getReadTimeoutin interfaceRestrictedResourceRetriever- Returns:
- The HTTP read timeout, in milliseconds, zero for infinite.
-
setReadTimeout
Description copied from interface:RestrictedResourceRetrieverSets the HTTP read timeout.- Specified by:
setReadTimeoutin interfaceRestrictedResourceRetriever- Parameters:
readTimeoutMs- The HTTP read timeout, in milliseconds, zero for infinite. Must not be negative.
-
getSizeLimit
Description copied from interface:RestrictedResourceRetrieverGets the HTTP entity size limit.- Specified by:
getSizeLimitin interfaceRestrictedResourceRetriever- Returns:
- The HTTP entity size limit, in bytes, zero for infinite.
-
setSizeLimit
Description copied from interface:RestrictedResourceRetrieverSets the HTTP entity size limit.- Specified by:
setSizeLimitin interfaceRestrictedResourceRetriever- Parameters:
sizeLimitBytes- The HTTP entity size limit, in bytes, zero for infinite. Must not be negative.
-
getHeaders
Description copied from interface:RestrictedResourceRetrieverGets the headers to set for the HTTP request.- Specified by:
getHeadersin interfaceRestrictedResourceRetriever- Returns:
- The HTTP headers as name - values map,
nullif not set.
-
setHeaders
Description copied from interface:RestrictedResourceRetrieverSets the headers to set for the HTTP request.- Specified by:
setHeadersin interfaceRestrictedResourceRetriever- Parameters:
headers- The HTTP headers as name - values map,nullif none.
-