001package com.nimbusds.oauth2.sdk.http;
002
003
004/**
005 * Retriever of resources specified by URL which permits setting of HTTP
006 * connect and read timeouts as well as a size limit.
007 */
008public interface RestrictedResourceRetriever extends ResourceRetriever {
009        
010
011        /**
012         * Gets the HTTP connect timeout.
013         *
014         * @return The HTTP connect timeout, in milliseconds, zero for
015         *         infinite.
016         */
017        int getConnectTimeout();
018
019
020        /**
021         * Sets the HTTP connect timeout.
022         *
023         * @param connectTimeoutMs The HTTP connect timeout, in milliseconds,
024         *                         zero for infinite. Must not be negative.
025         */
026        void setConnectTimeout(final int connectTimeoutMs);
027
028
029        /**
030         * Gets the HTTP read timeout.
031         *
032         * @return The HTTP read timeout, in milliseconds, zero for infinite.
033         */
034        int getReadTimeout();
035
036
037        /**
038         * Sets the HTTP read timeout.
039         *
040         * @param readTimeoutMs The HTTP read timeout, in milliseconds, zero
041         *                      for infinite. Must not be negative.
042         */
043        void setReadTimeout(final int readTimeoutMs);
044
045
046        /**
047         * Gets the HTTP entity size limit.
048         *
049         * @return The HTTP entity size limit, in bytes, zero for infinite.
050         */
051        int getSizeLimit();
052
053
054        /**
055         * Sets the HTTP entity size limit.
056         *
057         * @param sizeLimitBytes The HTTP entity size limit, in bytes, zero for
058         *                       infinite. Must not be negative.
059         */
060        void setSizeLimit(int sizeLimitBytes);
061}