001/* 002 * oauth2-oidc-sdk 003 * 004 * Copyright 2012-2016, Connect2id Ltd and contributors. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use 007 * this file except in compliance with the License. You may obtain a copy of the 008 * License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software distributed 013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 015 * specific language governing permissions and limitations under the License. 016 */ 017 018package com.nimbusds.oauth2.sdk.http; 019 020 021/** 022 * Retriever of resources specified by URL which permits setting of HTTP 023 * connect and read timeouts as well as a size limit. 024 */ 025@Deprecated 026public interface RestrictedResourceRetriever extends ResourceRetriever { 027 028 029 /** 030 * Gets the HTTP connect timeout. 031 * 032 * @return The HTTP connect timeout, in milliseconds, zero for 033 * infinite. 034 */ 035 int getConnectTimeout(); 036 037 038 /** 039 * Sets the HTTP connect timeout. 040 * 041 * @param connectTimeoutMs The HTTP connect timeout, in milliseconds, 042 * zero for infinite. Must not be negative. 043 */ 044 void setConnectTimeout(final int connectTimeoutMs); 045 046 047 /** 048 * Gets the HTTP read timeout. 049 * 050 * @return The HTTP read timeout, in milliseconds, zero for infinite. 051 */ 052 int getReadTimeout(); 053 054 055 /** 056 * Sets the HTTP read timeout. 057 * 058 * @param readTimeoutMs The HTTP read timeout, in milliseconds, zero 059 * for infinite. Must not be negative. 060 */ 061 void setReadTimeout(final int readTimeoutMs); 062 063 064 /** 065 * Gets the HTTP entity size limit. 066 * 067 * @return The HTTP entity size limit, in bytes, zero for infinite. 068 */ 069 int getSizeLimit(); 070 071 072 /** 073 * Sets the HTTP entity size limit. 074 * 075 * @param sizeLimitBytes The HTTP entity size limit, in bytes, zero for 076 * infinite. Must not be negative. 077 */ 078 void setSizeLimit(int sizeLimitBytes); 079}