Commit Graph

362 Commits

Author SHA1 Message Date
Oleg Kalnichevski 1db3da376e tabs -> spaces; removed trailing whilespaces; updated stylecheck definitions
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1426529 13f79535-47bb-0310-9956-ffa450edef68
2012-12-28 14:48:57 +00:00
Oleg Kalnichevski 1c322eb843 Added minimal style checks: licence header, file length, illegal imports
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1426521 13f79535-47bb-0310-9956-ffa450edef68
2012-12-28 14:36:14 +00:00
Oleg Kalnichevski 38e6a997fc HTTPCLIENT-1250: Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
Contributed by Don Brown <mrdon at twdata.org>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1424589 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 16:56:41 +00:00
Oleg Kalnichevski b6d7989aae Authmatically shut down file system based cache storage instantiated by CachingHttpClientBuilder
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1423960 13f79535-47bb-0310-9956-ffa450edef68
2012-12-19 17:12:03 +00:00
Oleg Kalnichevski 877970d7d8 Use Asserts to verify object state (follow-up)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1423806 13f79535-47bb-0310-9956-ffa450edef68
2012-12-19 09:45:50 +00:00
Oleg Kalnichevski d72e9b3ae7 Use Asserts to verify object state; use Args to verify method arguments
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1423516 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 16:22:58 +00:00
Oleg Kalnichevski 12d11324c0 HTTPCLIENT-1280: CachingExec catches SocketTimeoutException silently and closes the backend InputStream
Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1423024 13f79535-47bb-0310-9956-ffa450edef68
2012-12-17 17:11:36 +00:00
Oleg Kalnichevski a92a196de2 HTTPCLIENT-1277: Caching client sends a 304 to an unconditional request.
Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1421977 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 17:02:46 +00:00
Oleg Kalnichevski a273929a9b Follow-up to HTTPCLIENT-1276
Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1421844 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 13:24:46 +00:00
Oleg Kalnichevski 1779158a4f HTTPCLIENT-1276: cache update on a 304 response causes NPE
Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1421330 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 15:08:01 +00:00
Oleg Kalnichevski 278e06df47 Ensure backend response is correctly closed in case of a HTTP, i/o or runtime error
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1420391 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 20:40:27 +00:00
Oleg Kalnichevski f643326e9e Moved HttpClientBuilder
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1420122 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 12:22:58 +00:00
Oleg Kalnichevski 034805c3af Added caching specific HttpClient builder
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1420121 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 12:20:08 +00:00
Oleg Kalnichevski b257aeec70 Added cache specific HttpContext adaptor
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1419448 13f79535-47bb-0310-9956-ffa450edef68
2012-12-10 13:40:25 +00:00
Oleg Kalnichevski fcd02a0a18 Ported CachingHttpClient to ClientExecChain API
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1418743 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 19:59:24 +00:00
Gary D. Gregory cdaca60ad0 Use the 'maven.compile.source' property instead of a hard-wired version number.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1418304 13f79535-47bb-0310-9956-ffa450edef68
2012-12-07 13:28:03 +00:00
Oleg Kalnichevski 9aea057953 Ported internal caching classes to the new execution chain API
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1417343 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 10:34:46 +00:00
Oleg Kalnichevski 0edf06281f Made CacheConfig consistent with the new config API
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1416582 13f79535-47bb-0310-9956-ffa450edef68
2012-12-03 16:34:27 +00:00
Gary D. Gregory f81dd8f31a The root project defines module the properties used by all the other modules.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1414748 13f79535-47bb-0310-9956-ffa450edef68
2012-11-28 15:17:17 +00:00
Oleg Kalnichevski f24317d156 HTTPCLIENT-1263: CachingHttpClient fails to release connections back to the connection manager for some type of HTTP response messages when used together with DecompressingHttpClient
Contributed by Francois-Xavier Bonnet <francois-xavier.bonnet at centraliens.net>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1412858 13f79535-47bb-0310-9956-ffa450edef68
2012-11-23 12:45:02 +00:00
Sebastian Bazley e9ed1f5725 Fix some obvious boxing in test classes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406888 13f79535-47bb-0310-9956-ffa450edef68
2012-11-08 01:34:17 +00:00
Sebastian Bazley c2e94980e1 Formatter instances need to be closed
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406436 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 03:24:08 +00:00
Sebastian Bazley 4e3cbc31a7 Explicit Boolean rather than boxing
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406435 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 03:23:35 +00:00
Sebastian Bazley 321319c965 Missing @Override
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406426 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 02:47:49 +00:00
Sebastian Bazley e1395539de Unthrown exceptions
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406425 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 02:47:24 +00:00
Sebastian Bazley 73054957f8 Unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406424 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 02:47:01 +00:00
Oleg Kalnichevski 43d4e8f469 HTTPCLIENT-1244: relaxed EasyMock based unit tests in the Caching module
Contributed by Joe Campbell <joseph.r.campbell at gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1395613 13f79535-47bb-0310-9956-ffa450edef68
2012-10-08 15:26:50 +00:00
Jonathan Moore b7d1d69ef6 HTTPCLIENT-1223: Forward port from 4.2.X branch to trunk.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1376181 13f79535-47bb-0310-9956-ffa450edef68
2012-08-22 18:31:52 +00:00
Oleg Kalnichevski 8ef44683ba Upgraded project version to 4.3-alpha1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1369849 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 13:59:21 +00:00
Oleg Kalnichevski b7f85c1af7 Upgraded project version to 4.2.2-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1356623 13f79535-47bb-0310-9956-ffa450edef68
2012-07-03 08:52:49 +00:00
Oleg Kalnichevski faef016a2c HTTPCLIENT-1201: Quick start doc improvements
Contributed by miles zarathustra <albert.bradley at thomsonreuters.com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1353605 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 15:43:28 +00:00
Jonathan Moore c429b34ca9 HTTPCLIENT-1202: Allow for caching responses without bodies.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1347764 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 19:43:22 +00:00
Jonathan Moore 2748f2748a HTTPCLIENT-1202: ResponseCachingPolicy had a bug that was making it too
draconian in refusing to cache certain responses.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1347627 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 14:14:42 +00:00
Jonathan Moore 218823fa4e HTTPCLIENT-1198: HttpHost is not set in HttpContext in CachingHttpClient.
This patch (with tests) primarily just needs to figure out how to set
appropriate context variables in the event of a pure cache hit--in the
event of a cache miss or a cache validation, we actually make an origin
request, and the "backend" client sets these context variables.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1345297 13f79535-47bb-0310-9956-ffa450edef68
2012-06-01 18:09:49 +00:00
Jonathan Moore 59314afc7d Added XML Schema reference for site.xml files.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1344849 13f79535-47bb-0310-9956-ffa450edef68
2012-05-31 18:24:23 +00:00
Oleg Kalnichevski 570aa9fa37 Upgraded project version to 4.2.1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1340700 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 12:51:21 +00:00
Oleg Kalnichevski 1b063abfa9 HTTPCLIENT-1187: If a revalidation response is deemed too old CachingHttpClient fails to consume its content resulting in a connection leak
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1335726 13f79535-47bb-0310-9956-ffa450edef68
2012-05-08 19:54:27 +00:00
Oleg Kalnichevski a8d2e5e5fa Added release version to deprecation annotations; removed references to deprecated methods / classes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1335088 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 16:06:11 +00:00
Oleg Kalnichevski 747593abb7 Upgraded project version to 4.2-beta2-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1242454 13f79535-47bb-0310-9956-ffa450edef68
2012-02-09 18:40:08 +00:00
Oleg Kalnichevski e7ab117ea5 Added missing ASL header
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1240777 13f79535-47bb-0310-9956-ffa450edef68
2012-02-05 18:17:02 +00:00
Oleg Kalnichevski 648e5ab9be Added missing ASL header
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1240723 13f79535-47bb-0310-9956-ffa450edef68
2012-02-05 13:18:38 +00:00
Oleg Kalnichevski 10f6da691e Moved Memcached specific interfaces from the public API space to the impl package (will also make maintenace of OSGi metadata easier)
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1239803 13f79535-47bb-0310-9956-ffa450edef68
2012-02-02 20:17:10 +00:00
Oleg Kalnichevski 8265a355e7 Fixed javadoc warnings
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1239801 13f79535-47bb-0310-9956-ffa450edef68
2012-02-02 20:15:11 +00:00
Oleg Kalnichevski e2da283f21 HTTPCLIENT-1147: backed out API breaking changes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1239536 13f79535-47bb-0310-9956-ffa450edef68
2012-02-02 11:12:11 +00:00
Jonathan Moore cac1432472 HTTPCLIENT-1154: MemcachedHttpCacheStorage should allow client
to specify custom prefix string for keys. This is implemented by
providing a decorator KeyHashingScheme that adds the prefix.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1232588 13f79535-47bb-0310-9956-ffa450edef68
2012-01-17 21:35:08 +00:00
Jonathan Moore d47c30baae HTTPCLIENT-1153: Added a hashing scheme to map the higher-level
logical storage keys the CachingHttpClient wants to store cache
entries under onto a keyspace suitable for use with memcached
(which has a max key length smaller than the logical keys we use).
A default hashing scheme based on SHA-256 is also provided.
Finally, since hashing now introduces the possibility of collisions,
we have to store the logical storage key along with the cache entry
itself so that it can be compared on retrieval. Implemented a new
serialization scheme to accommodate this (with associated interfaces
so this could be overridden if desired). Unfortunately, this meant
that one of the existing constructors that accepted an old-style
custom serializer had to be deprecated (default implementations of
the new serializers are used instead).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1232489 13f79535-47bb-0310-9956-ffa450edef68
2012-01-17 17:12:14 +00:00
Oleg Kalnichevski 76762ca4ed Fixed Java 1.5 compatibility issue
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1230515 13f79535-47bb-0310-9956-ffa450edef68
2012-01-12 13:19:02 +00:00
Jonathan Moore 58036bc594 HTTPCLIENT-1157: MemcachedHttpCacheStorage should throw IOExceptions instead of RuntimeExceptions.
Contributed by James Miller <jamesmiller01 at gmail dot com>.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1230174 13f79535-47bb-0310-9956-ffa450edef68
2012-01-11 18:12:50 +00:00
Jonathan Moore e78b50d6de HTTPCLIENT-1152: Also apply type check before byte[] cast on memcached retrieval.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1229203 13f79535-47bb-0310-9956-ffa450edef68
2012-01-09 15:27:04 +00:00
Jonathan Moore 9f0bc2474f HTTPCLIENT-1152: Log a WARN-level message if memcached gives us back something other
than a byte[].


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1229172 13f79535-47bb-0310-9956-ffa450edef68
2012-01-09 14:33:08 +00:00
Jonathan Moore a6fe2177be HTTPCLIENT-1152: MemcachedHttpCacheStorage should verify class of returned
object before casting. Contributed by Rajika Kumarasiri <rajika at wso2 dot com>.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1229169 13f79535-47bb-0310-9956-ffa450edef68
2012-01-09 14:28:38 +00:00
Oleg Kalnichevski 8f767628cf HTTPCLIENT-1155: CachingHttpClient fails to ensure that the response content gets fully consumed when using a ResponseHandler, which can potentially lead to connection leaks
Contributed by James Miller <jamesmiller01 at gmail dot com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1222845 13f79535-47bb-0310-9956-ffa450edef68
2011-12-23 20:59:54 +00:00
Oleg Kalnichevski cb6254fea6 Rewrote test case for HTTPCLIENT-1147: removed dependency on an external resource; removed hard-coded cache directory location
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1222843 13f79535-47bb-0310-9956-ffa450edef68
2011-12-23 20:57:11 +00:00
Oleg Kalnichevski a6db7c5185 HTTPCLIENT-1147: When HttpClient-Cache cannot open cache file, should act like miss
Contributed by Joe Campbell <joseph.r.campbell at gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1209503 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 14:15:11 +00:00
Oleg Kalnichevski 5b89c1097f HTTPCLIENT-1144: Caching client has a class for common headers that was not being used consistently in the code
Contributed by Joe Campbell <joseph.r.campbell at gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1209502 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 14:13:52 +00:00
Jonathan Moore fceb87e3bc HTTPCLIENT-1143: Added ASL header to ConsumableInputStream test class.
Credited James Miller in Release Notes.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1198941 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 21:13:45 +00:00
Jonathan Moore c8aafc5c1a HTTPCLIENT-1143: CachingHttpClient leaks connections with stale-if-error.
Bugfix from James Miller <jamesmiller01 at gmail dot com>.



git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1198939 13f79535-47bb-0310-9956-ffa450edef68
2011-11-07 21:09:41 +00:00
Jonathan Moore d19daa3dcd HTTPCLIENT-1137: The values for the Via header are created by httpclient-cache
for each cached and backend request. Committing patch by alinachegalati at yahoo dot com.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1197713 13f79535-47bb-0310-9956-ffa450edef68
2011-11-04 19:07:52 +00:00
Oleg Kalnichevski 7541429cf2 Upgraded project version to 4.2-alpha2-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1196788 13f79535-47bb-0310-9956-ffa450edef68
2011-11-02 20:19:52 +00:00
Oleg Kalnichevski b1bad18c8c Added inceptionYear to httpclient-cache and fluent-hc poms
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1195711 13f79535-47bb-0310-9956-ffa450edef68
2011-10-31 22:50:56 +00:00
Oleg Kalnichevski 61ab54d99d HTTPCLIENT-1135: RandomAccessFile mode w is not valid
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1180373 13f79535-47bb-0310-9956-ffa450edef68
2011-10-08 13:12:12 +00:00
Oleg Kalnichevski 72a41afd5e HTTPCLIENT-1116: ResponseCachingPolicy uses integers for sizes
Contributed by Greg Bowyer <gbowyer at fastmail.co.uk >


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1172302 13f79535-47bb-0310-9956-ffa450edef68
2011-09-18 16:32:53 +00:00
Oleg Kalnichevski e5ea32b76d TABS -> SPACES
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1172301 13f79535-47bb-0310-9956-ffa450edef68
2011-09-18 16:20:20 +00:00
Sebastian Bazley 01b39c4883 Add version variables for report plugins
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1167667 13f79535-47bb-0310-9956-ffa450edef68
2011-09-11 03:28:11 +00:00
Jonathan Moore 2d017dcc0e HTTPCLIENT-1100: Missing Content-Length header makes cached entry invalid.
Applying patch provided by Bart Robeyns <bart dot robeyns at gmail dot com>


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1133907 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 15:01:42 +00:00
Jonathan Moore 8dbbed80cc Reverting changeset r1133877 (duplicate addition of spymemcached repository).
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1133902 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 14:52:41 +00:00
Jonathan Moore ae7c42fc95 + Noticed that the memcached dependency needed for the caching module
is not provided by Maven Central, so we couldn't build the project
  if the memcached jar wasn't already in the local repository. I added
  a <repository> for the pom for httpclient-cache, since that's the
  only module that needs it, but if we'd prefer to put that in the
  parent pom I can certainly move it there too (not sure what the
  prevailing opinion is on this).
 

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1133877 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 14:01:41 +00:00
Oleg Kalnichevski f3e7802196 Updated dependency declarations; upgraded HttpCore to 4.1.1; upgraded Memcached to version 2.6
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1124274 13f79535-47bb-0310-9956-ffa450edef68
2011-05-18 14:08:24 +00:00
Jonathan Moore e0105ac181 Reduced severity of several logging statements in the caching module so
as to reduce verbosity when the recommended DEBUG-level wire logging
settings are on.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1087358 13f79535-47bb-0310-9956-ffa450edef68
2011-03-31 16:16:35 +00:00
Jonathan Moore 2ae703aa85 HTTPCLIENT-1073: In the event a 100 (Continue) response makes its way up
to the caching module, but the original request did not expect one, it's
acceptable for the caching module to throw an exception but it had better
consume the body of the 100 (Continue) response before doing so to ensure
proper release of resources. Encountering this would require the underlying
(non-caching) HttpClient to not handle the expect-continue handshake properly
*AND* for the origin server to send a 100-Continue response out of turn
*WITH* a response body. Highly unlikely, but at least this codepath is
covered properly now.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084655 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 18:00:12 +00:00
Jonathan Moore 2d1711bb83 HTTPCLIENT-1073: receiving a 206 (Partial Content) response to a
request that did not request partial content is problematic from
a cache perspective, so throwing a ClientProtocolException is ok.
However, we should properly consume the body of the 206 response
before throwing the exception to ensure that resources are properly
released.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084649 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 17:25:53 +00:00
Jonathan Moore 962ddfa55a HTTPCLIENT-1073: caching module should not reject origin
401 (Unauthorized) response just because it is missing
a WWW-Authenticate challenge header; the caching module
doesn't care about this and should mind its own business.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084611 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 15:02:28 +00:00
Jonathan Moore 32221a1a48 HTTPCLIENT-1073: caching module should not reject an origin 405
(Method Not Allowed) response just because it is missing an Allow
header, even though this is required by RFC2616; this has no
effect on the caching module itself.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084610 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 14:59:25 +00:00
Jonathan Moore e9864b06ff HTTPCLIENT-1073: if caching module strips off a body for an origin response
that should not contain one, it should consume the body off the connection
as well to ensure resources are released.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084607 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 14:48:24 +00:00
Jonathan Moore 08bbd7bc75 HTTPCLIENT-1073: caching module need not be a stickler about receiving
a 407 (Proxy Authentication Required) response without a Proxy-Authenticate
header and should pass it through to local client.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1084590 13f79535-47bb-0310-9956-ffa450edef68
2011-03-23 13:54:11 +00:00
Jonathan Moore 8f73a72a1f Fix duplicate Warning 110 (stale response) header generated by
stale-while-revalidate.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1080575 13f79535-47bb-0310-9956-ffa450edef68
2011-03-11 14:18:28 +00:00
Jonathan Moore 55742a46e1 Minor enhancement to stale-while-revalidate (RFC5861) handling; now we can also
serve stale 304s (Not Modified) while asynchronously revalidating. Prior to this,
we were always returning a stale 200 response regardless of whether the incoming
request was conditional or not. The old behavior was not incorrect, but this is
better.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1080422 13f79535-47bb-0310-9956-ffa450edef68
2011-03-11 01:45:13 +00:00
Jonathan Moore 23bc2c7f78 + Fix minor typos in private function names.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1080419 13f79535-47bb-0310-9956-ffa450edef68
2011-03-11 01:32:46 +00:00
Oleg Kalnichevski 0bd45f2b39 Changed project version to 4.2-alpha1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1079543 13f79535-47bb-0310-9956-ffa450edef68
2011-03-08 21:06:55 +00:00
Sebastian Bazley a54611e8d6 @import is relative to the current css file
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070647 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 20:31:08 +00:00
Sebastian Bazley 0991eb0f07 Remove menu items which are now in the common parent section
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070169 13f79535-47bb-0310-9956-ffa450edef68
2011-02-13 01:20:10 +00:00
Sebastian Bazley 639891773c Use relative URLs so works anywhere
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070168 13f79535-47bb-0310-9956-ffa450edef68
2011-02-13 01:19:35 +00:00
Sebastian Bazley 04d14e5e95 Absolute references are converted incorrectly.
Better fix: if banners are inherited from parent POM, then references are calculated OK

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070077 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 13:17:47 +00:00
Sebastian Bazley d5444aad70 Absolute references are converted incorrectly for the HC sub-sub sites
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1070011 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 02:14:00 +00:00
Sebastian Bazley 35face477b Ensure the correct clover version is used for reports
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1069061 13f79535-47bb-0310-9956-ffa450edef68
2011-02-09 19:50:53 +00:00
Sebastian Bazley cae0917efd Javadoc is very noisy - quieten it
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1067841 13f79535-47bb-0310-9956-ffa450edef68
2011-02-07 02:00:12 +00:00
Oleg Kalnichevski 630ee5faad Upgraded project version to 4.1.1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1061714 13f79535-47bb-0310-9956-ffa450edef68
2011-01-21 10:03:26 +00:00
Jonathan Moore 8e914ae112 Add missing Apache License header.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1059097 13f79535-47bb-0310-9956-ffa450edef68
2011-01-14 18:25:06 +00:00
Oleg Kalnichevski 7fc0e265ef Changed project version to 4.1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058974 13f79535-47bb-0310-9956-ffa450edef68
2011-01-14 12:03:47 +00:00
Oleg Kalnichevski 3a0f3c34c4 Updated for HttpClient 4.1 release
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058964 13f79535-47bb-0310-9956-ffa450edef68
2011-01-14 11:50:12 +00:00
Jonathan Moore 17aa988f41 Fix for protocol recommendation:
"304 Not Modified ... If the conditional GET used a strong cache
validator (see section 13.3.3), the response SHOULD NOT include
other entity-headers."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058762 13f79535-47bb-0310-9956-ffa450edef68
2011-01-13 22:07:50 +00:00
Jonathan Moore bdf4174033 Capture acceptance tests for only-if-cached (implementation
already passes these).

"To do this, the client may include the only-if-cached directive
in a request. If it receives this directive, a cache SHOULD
either respond using a cached entry that is consistent with the
other constraints of the request, or respond with a 504 (Gateway
Timeout) status."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058661 13f79535-47bb-0310-9956-ffa450edef68
2011-01-13 17:00:30 +00:00
Jonathan Moore b4d6dee028 Support the following protocol recommendation:
"If a request includes the no-cache directive, it SHOULD NOT
include min-fresh, max-stale, or max-age."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4

We address this by looking for no-cache and then filtering the
above directives out if present.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058280 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 19:14:37 +00:00
Jonathan Moore 7b6ffc39b3 Implementation fix and acceptance tests for protocol recommendation:
"Many HTTP/1.0 cache implementations will treat an Expires value that
is less than or equal to the response Date value as being equivalent
to the Cache-Control response directive "no-cache". If an HTTP/1.1
cache receives such a response, and the response does not include a
Cache-Control header field, it SHOULD consider the response to be non-
cacheable in order to retain compatibility with HTTP/1.0 servers."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3

Also had to update a few other test cases that incidentally ran afoul
of this recommendation.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058247 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 17:35:29 +00:00
Jonathan Moore 7b141fd52d Document acceptance test (implementation already passes):
"If a new cacheable...response is received from a resource while any
existing responses for the same resource are cached, the cache SHOULD
use the new response to reply to the current request."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.12


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058232 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 16:57:14 +00:00
Jonathan Moore 759fe0a755 Added unit tests to document protocol recommendation:
"A cache that passes through requests for methods it does not understand
SHOULD invalidate any entities referred to by the Request-URI."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10

(Current implementation already does this, but always good to have that
captured in an automated acceptance test).



git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058224 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 16:38:28 +00:00
Jonathan Moore bac69b368f Removed deprecated HttpCacheEntry#getVariantURIs and associated
constructors and fields. Also removed code in surrounding classes
that was providing backwards compatibility for the deprecated
Set-based variant data structure. Made a note in the ChangeLog
about the change to the public API between 4.1-beta and 4.1.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1058153 13f79535-47bb-0310-9956-ffa450edef68
2011-01-12 14:21:32 +00:00
Jonathan Moore 3c0bc58a30 On the off chance someone wrote a custom serializer for use with the
4.1-beta version of HttpCacheEntry, we want to make sure things still
work properly. The current implementation of HttpCacheEntry already
throws an UnsupportedOperationException if you try to get at the variant
map but the old set-based data structure is there; now we handle this
exception, log a warning, and then use the old structure. This is a bit
less efficient but still demonstrably works (I added a unit test to the
Ehcache suite, where you can submit a custom serializer, that shows that
the implementation still conforms to all the MUST/MUST NOTs).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1057745 13f79535-47bb-0310-9956-ffa450edef68
2011-01-11 17:28:20 +00:00
Jonathan Moore e95a80b7a2 Responses from HTTP/1.0 origins to requests containing query parameters
SHOULD NOT be taken from a cache.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.9


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1057715 13f79535-47bb-0310-9956-ffa450edef68
2011-01-11 16:31:06 +00:00
Jonathan Moore 6e1d7a0ad3 Javadoc for Ehcache and memcached cache storage backends. I think we're in
good shape for Javadocs on the caching module now.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1057287 13f79535-47bb-0310-9956-ffa450edef68
2011-01-10 17:09:56 +00:00
Jonathan Moore 4b29dae09d Javadocs for CachingHttpClient itself.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1057265 13f79535-47bb-0310-9956-ffa450edef68
2011-01-10 16:33:51 +00:00
Jonathan Moore 6b723dd61e Added more Javadocs, including, most significantly so far, detailed
docs for CacheConfig talking about all the available configuration
options for the caching module.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1057242 13f79535-47bb-0310-9956-ffa450edef68
2011-01-10 15:35:37 +00:00
Sebastian Bazley 7ee591f0f4 Merge jar manifest entries into httpclient parent pom
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1056561 13f79535-47bb-0310-9956-ffa450edef68
2011-01-07 23:43:27 +00:00
Jonathan Moore ca41afb97e Provided lots of missing Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1056530 13f79535-47bb-0310-9956-ffa450edef68
2011-01-07 22:01:54 +00:00
Jonathan Moore f9c0e8cac9 Added Javadoc package.html for org.apache.http.client.cache.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1056504 13f79535-47bb-0310-9956-ffa450edef68
2011-01-07 21:01:16 +00:00
Sebastian Bazley 4fd34899f0 Unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055732 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:24:49 +00:00
Sebastian Bazley 868e46fd5b Unthrown Exceptions and @Overrides
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055731 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:23:34 +00:00
Sebastian Bazley 4b2dccf239 Exception not thrown
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055730 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:13:13 +00:00
Sebastian Bazley 32e1cc24bb Exception not thrown
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055729 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:11:38 +00:00
Sebastian Bazley 75dd0ae7dd DOcument thread-safety
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055728 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:10:21 +00:00
Sebastian Bazley 7550a6edf6 Make private immutable fields final
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055727 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:06:51 +00:00
Sebastian Bazley d9090f3d37 Not @Immutable, but it is @ThreadSafe
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055726 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:05:55 +00:00
Sebastian Bazley 4896d1752c Tab police
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055725 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 03:02:16 +00:00
Sebastian Bazley 3b4b68fe68 Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055723 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 02:57:48 +00:00
Sebastian Bazley 5e95645f07 Missing @Overrides
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055722 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 02:57:27 +00:00
Sebastian Bazley 37e01683fa Exception not thrown
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055721 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 02:56:23 +00:00
Sebastian Bazley 6a970590c0 Unnecessary cast
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055720 13f79535-47bb-0310-9956-ffa450edef68
2011-01-06 02:54:42 +00:00
Jonathan Moore 4a63d6a0da Fixed compiler warnings (unused imports, unused private methods).
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1053060 13f79535-47bb-0310-9956-ffa450edef68
2010-12-27 12:55:32 +00:00
Jonathan Moore 856c1c28ad HTTPCLIENT-1035: committed validating acceptance test and wired in new
cache invalidation call. Also cleaned up some unit tests in
TestCachingHttpClient: static imports of EasyMock methods, as well as
removing unit tests that exercised some protected methods, especially
where they are already covered by acceptance tests against a public
interface (unit testing protected methods leads to brittle tests). Also
rewrite some of the unit tests in TestCachingHttpClient to depend on
fewer mocks (often, just a mock backend HttpClient and mock cache
storage).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1052894 13f79535-47bb-0310-9956-ffa450edef68
2010-12-26 15:10:39 +00:00
Jonathan Moore 7b99aca6ab HTTPCLIENT-1035: finished cache-flushing logic for updated
entries mentioned by Content-Location in responses. Still
not hooked in to main request handling flow yet.



git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1052234 13f79535-47bb-0310-9956-ffa450edef68
2010-12-23 12:02:37 +00:00
Jonathan Moore 68ed95699e HTTPCLIENT-1035: begin adding functionality for flushing updated
entries mentioned by Content-Location in responses. Not yet hooked
in to be used.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051865 13f79535-47bb-0310-9956-ffa450edef68
2010-12-22 11:59:23 +00:00
Jonathan Moore 52f311f5de HTTPCLIENT-975: stale-while-revalidate also yields to must-revalidate,
proxy-revalidate on a shared cache, and requests with explicit
freshness constraints.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051235 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 18:30:46 +00:00
Jonathan Moore df577a7e8f HTTPCLIENT-975: stale-if-error now yields to higher-priority
directives, like must-revalidate, proxy-revalidate, and requests
with explicit freshness constraints.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051206 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 16:55:03 +00:00
Jonathan Moore 7573bf8284 HTTPCLIENT-975: more method extraction; the body for
CachingHttpClient#execute now at least fits on one screen. :)


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051133 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 14:42:34 +00:00
Jonathan Moore 65cb252c9b HTTPCLIENT-975: more method extraction from the body of
CachingHttpClient#execute()


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051087 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 12:51:26 +00:00
Jonathan Moore cd263f39e3 HTTPCLIENT-975: more refactoring/method-extraction
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051076 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 12:12:55 +00:00
Jonathan Moore 791bb497e2 HTTPCLIENT-975: more refactoring. Handled ProtocolExceptions from
RequestWrapper instantiations further down in the call stack.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051074 13f79535-47bb-0310-9956-ffa450edef68
2010-12-20 11:58:53 +00:00
Jonathan Moore 93603e5f19 HTTPCLIENT-975: refactoring primary execute method in
CachingHttpClient (mostly method extraction).



git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050878 13f79535-47bb-0310-9956-ffa450edef68
2010-12-19 15:25:04 +00:00
Jonathan Moore a6c38788c0 HTTPCLIENT-975: Javadoc and formatting cleanup.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050624 13f79535-47bb-0310-9956-ffa450edef68
2010-12-18 12:06:28 +00:00
Jonathan Moore 1d4465bdb5 HTTPCLIENT-975: Javadoc and import cleanup.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050622 13f79535-47bb-0310-9956-ffa450edef68
2010-12-18 11:58:37 +00:00
Jonathan Moore 155a9c61c3 HTTPCLIENT-975: Make AsynchronousValidator class package-private.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050620 13f79535-47bb-0310-9956-ffa450edef68
2010-12-18 11:55:09 +00:00
Jonathan Moore 83efe306fd HTTPCLIENT-975: added CacheConfig settings to provide more detailed
control over the background revalidation thread pool, and enabled
the stale-while-revalidate feature by default with a single worker
thread and a max queue size of 100 pending revalidations, which
should be a pretty safe setting.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050360 13f79535-47bb-0310-9956-ffa450edef68
2010-12-17 12:15:50 +00:00
Jonathan Moore 5f88f05627 HTTPCLIENT-975: committed patch for stale-while-revalidate from
Michajlo Matijkiw (michajlo_matijkiw at comcast dot com).
Stale-while-revalidate functionality is currently off by default
until we can add bounding to the revalidation queue (or make it
configurable).

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049941 13f79535-47bb-0310-9956-ffa450edef68
2010-12-16 11:54:30 +00:00
Jonathan Moore 3c0cef4586 Added additional acceptance test for variant negotiation:
"If any of the existing cache entries contains only partial content
for the associated entity, its entity-tag SHOULD NOT be included in
the If-None-Match header field unless the request is for a range
that would be fully satisfied by that entry." 
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.6)


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049287 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 21:37:31 +00:00
Jonathan Moore d60c36c40c Renamed URIExtractor to CacheKeyGenerator, which is more descriptive
of what we actually use it for.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049278 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 21:18:06 +00:00
Jonathan Moore a91847b57c HTTPCLIENT-975: committed patch to support stale-if-error from
RFC5861, with thanks to Mohammed Azeem Uddin
(mohammedazeem_uddin at comcast dot com).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049179 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 17:18:06 +00:00
Jonathan Moore 70e7ee17d5 HTTPCLIENT-1034: committed patch to update documentation to list
httpclient-cache as a module of the HttpClient component, plus
adding a link to the external benchmarking writeup done by
Comcast Interactive Media. With thanks to Matthew Hawthorne
(matthew_hawthorne -at- comcast.com).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049124 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 15:27:35 +00:00
Jonathan Moore 6eaaac8251 Added ASF header to Variant.java.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049099 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 14:16:47 +00:00
Jonathan Moore 0ae68981c8 HTTPCLIENT-1032: during variant negotiation, when the origin specifies
reuse of an existing variant, we no longer cache another copy of the
variant, but rather update the variantMap in the parent entry to
reflect the variant's reuse for requests whose varying headers match
those of the current request.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049051 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 11:48:34 +00:00
Jonathan Moore e16a59b38c HTTPCLIENT-1032: added a method to HttpCache to allow updating a specific
variant cache entry if its cache key is known. Committed patch with the
additional acceptance test, which now passes. We are still caching extra
copies of the re-used variant, though, so the issue is not yet closed.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049048 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 11:30:10 +00:00
Jonathan Moore 477fdb1a3c HTTPCLIENT-1032: variant information is now passed back from the HttpCache
as a Map<String,Variant> mapping Etags to specific information about the
variants (variant key, cache key, cache entry).


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049045 13f79535-47bb-0310-9956-ffa450edef68
2010-12-14 11:12:36 +00:00
Jonathan Moore 6e5139df32 HTTPCLIENT-1032: added a Variant class to track a set of related
information about a particular cached variant.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045389 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 22:14:07 +00:00
Jonathan Moore ae8764760b HTTPCLIENT-1032: caching of 200 origin response from variant
negotiation should be stored w.r.t. original client request.


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045360 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 20:25:08 +00:00
Jonathan Moore 24a5f0c060 HTTPCLIENT-1032: Refactor to clean up duplicated code in cache
entry validation (regular, and variant reuse negotation) by
extracting code to shared method.



git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045357 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 20:17:49 +00:00
Jonathan Moore a26fb6a846 Fixing pom (build was barfing on "--" inside an XML comment).
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045291 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 18:51:55 +00:00
Sebastian Bazley a11743431b Fix up clirr version comparison so defaults to 4.0, except cache=4.1-alpha2
Can also override individually using -DcomparisonVersion and -Dcache.comparisonVersion

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045260 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 17:53:59 +00:00
Jonathan Moore 618754b6a9 HTTPCLIENT-1032: renamed HttpCache#getVariantCacheEntries to
HttpCache#getVariantCacheEntriesWithEtags and had it return a
Map of etags to cache entries. Doing the filtering here makes
it simpler downstream, and returning a map makes it easier to
find the appropriate entry when handling a 304 indicating we
should use an existing variant.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045084 13f79535-47bb-0310-9956-ffa450edef68
2010-12-13 11:55:36 +00:00
Jonathan Moore 62dd08891c HTTPCLIENT-1032: variant storage now separates a "variant key" (determined by
the portion of a request covered by Vary headers on an entry) from a
"variant cache key" (the place in the cache storage where a particular variant
response is stored). The variantMap in an HttpCacheEntry now maps variant keys
to variant cache keys, setting us up for the possibility of having multiple
variant keys point to the same variant cache entry.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1044826 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 14:37:48 +00:00
Jonathan Moore 4e7d9fa5c8 HTTPCLIENT-1032: minor refactoring on URIExtractor to clean up
internal-only API for getVariantKey()


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1044824 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 14:24:25 +00:00
Jonathan Moore 2c04f2689b HTTPCLIENT-1032: fix Javadocs on HttpCacheEntry.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1044820 13f79535-47bb-0310-9956-ffa450edef68
2010-12-12 13:29:43 +00:00