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
Constructors Constructor Description AbstractRestrictedResourceRetriever(int connectTimeout, int readTimeout, int sizeLimit)Creates a new abstract restricted resource retriever.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetConnectTimeout()Gets the HTTP connect timeout.Map<String,List<String>>getHeaders()Gets the headers to set for the HTTP request.intgetReadTimeout()Gets the HTTP read timeout.intgetSizeLimit()Gets 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, wait
-
Methods inherited from interface com.nimbusds.jose.util.ResourceRetriever
retrieveResource
-
-
-
-
Constructor Detail
-
AbstractRestrictedResourceRetriever
public AbstractRestrictedResourceRetriever(int connectTimeout, int readTimeout, int sizeLimit)
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 Detail
-
getConnectTimeout
public int 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
public void setConnectTimeout(int connectTimeoutMs)
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
public int 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
public void setReadTimeout(int readTimeoutMs)
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
public int 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
public void setSizeLimit(int sizeLimitBytes)
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
public Map<String,List<String>> 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
public void setHeaders(Map<String,List<String>> headers)
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.
-
-