public class FetchContext
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
java.util.Set<java.lang.String> |
allowedMIMETypes
If non-null, the request will be stopped if it has a MIME type that is not one of these,
or has no MIME type.
|
boolean |
allowSplitfiles
Whether to download splitfiles
|
BlockSet |
blocks
If set, contains a set of blocks to be consulted before checking the datastore.
|
boolean |
canWriteClientCache
Can this request write to the client-cache? We don't store all requests in the client cache,
in particular big stuff usually isn't written to it, to maximise its effectiveness.
|
java.lang.String |
charset
If not-null, the request, if it requires a charset for filtration, will be assumed
to use this charset
|
boolean |
dontEnterImplicitArchives |
ClientEventProducer |
eventProducer
Client events will be published to this, you can subscribe to them
|
boolean |
filterData |
boolean |
followRedirects
Whether to follow simple redirects
|
static int |
IDENTICAL_MASK |
boolean |
ignoreStore
If true, send the request to the network without checking whether the data is in the local store
|
boolean |
ignoreTooManyPathComponents |
boolean |
ignoreUSKDatehints
Ignore USK DATEHINTs
|
boolean |
localRequestOnly
If true, only read from the datastore and caches, do not send the request to the network
|
int |
maxArchiveLevels
Maximum number of manifest lookups during a request.
|
int |
maxArchiveRestarts |
int |
maxCheckBlocksPerSegment
Maximum number of check blocks per segment for splitfiles.
|
int |
maxDataBlocksPerSegment
Maximum number of data blocks per segment for splitfiles
|
int |
maxMetadataSize |
int |
maxNonSplitfileRetries
Maximum number of retries (after the original attempt) for a
non-splitfile block.
|
long |
maxOutputLength
Maximum length of the final returned data
|
int |
maxRecursionLevel
1 = only fetch a single block.
|
int |
maxSplitfileBlockRetries
Maximum number of retries (after the original attempt) for a
splitfile block.
|
long |
maxTempLength
Maximum length of data fetched in order to obtain the final data - metadata, containers, etc.
|
int |
maxUSKRetries |
java.lang.String |
overrideMIME
Force the content fiter to use this MIME type
|
FoundURICallback |
prefetchHook
Prefetch hook for HTML documents.
|
boolean |
returnZIPManifests
If true, and we get a ZIP manifest, and we have no meta-strings left, then
return the manifest contents as data.
|
static int |
SET_RETURN_ARCHIVES |
static int |
SPLITFILE_DEFAULT_BLOCK_MASK |
static int |
SPLITFILE_DEFAULT_MASK |
TagReplacerCallback |
tagReplacer
Callback needed for web-pushing
|
Constructor and Description |
---|
FetchContext(java.io.DataInputStream dis)
Create from a saved form, e.g.
|
FetchContext(FetchContext ctx,
int maskID)
Copy a FetchContext, creating a new EventProducer and not changing the blocks list.
|
FetchContext(FetchContext ctx,
int maskID,
boolean keepProducer,
BlockSet blocks)
Copy a FetchContext.
|
FetchContext(long curMaxLength,
long curMaxTempLength,
int maxMetadataSize,
int maxRecursionLevel,
int maxArchiveRestarts,
int maxArchiveLevels,
boolean dontEnterImplicitArchives,
int maxSplitfileBlockRetries,
int maxNonSplitfileRetries,
int maxUSKRetries,
boolean allowSplitfiles,
boolean followRedirects,
boolean localRequestOnly,
boolean filterData,
int maxDataBlocksPerSegment,
int maxCheckBlocksPerSegment,
BucketFactory bucketFactory,
ClientEventProducer producer,
boolean ignoreTooManyPathComponents,
boolean canWriteClientCache,
java.lang.String charset,
java.lang.String overrideMIME,
java.lang.String schemeHostAndPort) |
Modifier and Type | Method and Description |
---|---|
FetchContext |
clone()
Make public, but just call parent for a field for field copy
|
boolean |
equals(java.lang.Object obj)
Are two InsertContext's equal? Ignores the EventProducer, compares only the actual config
values.
|
int |
getCooldownRetries() |
long |
getCooldownTime() |
java.lang.String |
getSchemeHostAndPort() |
int |
hashCode() |
void |
setCooldownRetries(int cooldownRetries) |
void |
setCooldownTime(long cooldownTime)
Set the cooldown time
|
void |
setCooldownTime(long cooldownTime,
boolean force)
Only for tests
|
void |
writeTo(java.io.DataOutputStream dos) |
public static final int IDENTICAL_MASK
public static final int SPLITFILE_DEFAULT_BLOCK_MASK
public static final int SPLITFILE_DEFAULT_MASK
public static final int SET_RETURN_ARCHIVES
public long maxOutputLength
public long maxTempLength
public int maxRecursionLevel
public int maxArchiveRestarts
public int maxArchiveLevels
where this is enforced.
public boolean dontEnterImplicitArchives
public int maxSplitfileBlockRetries
public int maxNonSplitfileRetries
public final int maxUSKRetries
public boolean allowSplitfiles
public boolean followRedirects
public boolean localRequestOnly
public boolean ignoreStore
public final ClientEventProducer eventProducer
public int maxMetadataSize
public int maxDataBlocksPerSegment
public int maxCheckBlocksPerSegment
public boolean returnZIPManifests
public boolean filterData
public final boolean ignoreTooManyPathComponents
public final BlockSet blocks
public java.util.Set<java.lang.String> allowedMIMETypes
public java.lang.String charset
public boolean canWriteClientCache
public FoundURICallback prefetchHook
public TagReplacerCallback tagReplacer
public java.lang.String overrideMIME
public boolean ignoreUSKDatehints
public FetchContext(long curMaxLength, long curMaxTempLength, int maxMetadataSize, int maxRecursionLevel, int maxArchiveRestarts, int maxArchiveLevels, boolean dontEnterImplicitArchives, int maxSplitfileBlockRetries, int maxNonSplitfileRetries, int maxUSKRetries, boolean allowSplitfiles, boolean followRedirects, boolean localRequestOnly, boolean filterData, int maxDataBlocksPerSegment, int maxCheckBlocksPerSegment, BucketFactory bucketFactory, ClientEventProducer producer, boolean ignoreTooManyPathComponents, boolean canWriteClientCache, java.lang.String charset, java.lang.String overrideMIME, java.lang.String schemeHostAndPort)
public FetchContext(FetchContext ctx, int maskID)
ctx
- The old FetchContext to copy.maskID
- Mask mode for the copy operation e.g. SPLITFILE_DEFAULT_BLOCK_MASK.public FetchContext(FetchContext ctx, int maskID, boolean keepProducer, BlockSet blocks)
ctx
- The old FetchContext to copy.maskID
- Mask mode for the copy operation e.g. SPLITFILE_DEFAULT_BLOCK_MASK.keepProducer
- If true, keep the existing EventProducer. Must be false if we are
creating a new request. Can be true if we are masking the FetchContext within a single
request, e.g. to download a container. This is important so that we see the progress updates
for the request and not for other requests sharing the FetchContext, but also it could break
serialization.blocks
- Storing a BlockSet to the database is not supported, see comments on SimpleBlockSet.objectCanNew().public FetchContext(java.io.DataInputStream dis) throws StorageFormatException, java.io.IOException
dis
- StorageFormatException
- If the data is badly formatted or cannot be read.java.io.IOException
- If unable to read from the stream.public FetchContext clone()
clone
in class java.lang.Object
public void setCooldownRetries(int cooldownRetries)
public void setCooldownTime(long cooldownTime)
public void setCooldownTime(long cooldownTime, boolean force)
public int getCooldownRetries()
public java.lang.String getSchemeHostAndPort()
public long getCooldownTime()
public void writeTo(java.io.DataOutputStream dos) throws java.io.IOException
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object