public class NXHttpFetcher extends Object implements org.apache.shindig.gadgets.http.HttpFetcher
Constructor and Description |
---|
NXHttpFetcher()
Creates a new fetcher using the default maximum object size and timeout
-- no limit and 5 seconds.
|
NXHttpFetcher(int maxObjSize,
int connectionTimeoutMs)
Creates a new fetcher for fetching HTTP objects.
|
Modifier and Type | Method and Description |
---|---|
org.apache.shindig.gadgets.http.HttpResponse |
fetch(org.apache.shindig.gadgets.http.HttpRequest request) |
void |
setConnectionTimeoutMs(int connectionTimeoutMs)
Change the global connection timeout for all fetchs.
|
void |
setMaxObjectSizeBytes(int maxObjectSizeBytes)
Change the global maximum fetch size (in bytes) for all fetches.
|
public NXHttpFetcher(int maxObjSize, int connectionTimeoutMs)
maxObjSize
- Maximum size, in bytes, of the object we will fetch, 0
if no limit..connectionTimeoutMs
- timeout, in milliseconds, for requests.public NXHttpFetcher()
@Inject(optional=true) public void setMaxObjectSizeBytes(int maxObjectSizeBytes)
maxObjectSizeBytes
- value for maximum number of bytes, or 0 for no
limit@Inject(optional=true) public void setConnectionTimeoutMs(int connectionTimeoutMs)
connectionTimeoutMs
- new connection timeout in millisecondspublic org.apache.shindig.gadgets.http.HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest request)
fetch
in interface org.apache.shindig.gadgets.http.HttpFetcher
Copyright © 2011 Nuxeo SA. All Rights Reserved.