The nsICacheEntryDescriptor interface provides a cache entry descriptor.
nsICacheEntryDescriptor is defined in netwerk/cache/public/nsICacheEntryDescriptor.idl
. It is scriptable
and
unfrozen (hasn't changed since Mozilla 1.9)
.
Inherits from: nsICacheEntryInfo
void setExpirationTime(in PRUint32 expirationTime);
|
void setDataSize(in unsigned long size);
|
nsIInputStream openInputStream(in unsigned long offset);
|
nsIOutputStream openOutputStream(in unsigned long offset);
|
void doom();
|
void doomAndFailPendingRequests(in nsresult status);
|
void markValid();
|
void close();
|
string getMetaDataElement(in string key);
|
void setMetaDataElement(in string key, in string value);
|
void visitMetaData(in nsICacheMetaDataVisitor visitor);
|
| Attribute | Type | Description |
beginTime
| PRTime
| Begin time range for results (INCLUSIVE). |
cacheElement
| nsISupports
| Get or set the cache data element. This will fail if the cache entry is stream based. The cache entry holds a strong reference to this object. The object will be released when the cache entry is destroyed. |
accessGranted
| nsCacheAccessMode
| Get the access granted to this descriptor. See nsICache
for the definitions of the access modes and a thorough description of their corresponding meanings.
|
storagePolicy
| nsCacheStoragePolicy
| Get or set the storage policy of the cache entry. See nsICache
for the definitions of the storage policies.
|
file
| nsIFile
| Get the disk file associated with the cache entry. |
securityInfo
| nsISupports
| Get or set security info on the cache entry for this descriptor. This fails if the storage policy is not STORE_IN_MEMORY.
|
This method sets the time at which the cache entry should be considered invalid (in seconds since the Epoch).
void setExpirationTime( in PRUint32 expirationTime );
This method sets the cache entry data size. This will fail if the cache entry is stream based.
void setDataSize( in unsigned long size );
This method opens blocking input stream to cache data. This will fail if the cache entry is not stream based. Use the stream transport service to asynchronously read this stream on a background thread. The returned stream may implement nsISeekableStream
.
nsIInputStream openInputStream( in unsigned long offset );
This method opens blocking output stream to cache data. This will fail if the cache entry is not stream based. Use the stream transport service to asynchronously write to this stream on a background thread. The returned stream may implement nsISeekableStream
.
If opening an output stream to existing cached data, the data will be truncated to the specified offset.
nsIOutputStream openOutputStream( in unsigned long offset );
This method dooms the cache entry this descriptor references in order to slate it for removal. Once doomed a cache entry cannot be undoomed.
void doom();
This method with the WRITE access can doom the cache entry and choose to fail pending requests. This means that pending requests will not get a cache descriptor. This is meant as a tool for clients that wish to instruct pending requests to skip the cache.
void doomAndFailPendingRequests( in nsresult status );
This method means that a writer must validate this cache object before any readers are given a descriptor to the object.
void markValid();
This method retrieves the meta data. Meta data is a table of key/value string pairs. The strings do not have to conform to any particular charset, but they must be NULL terminated.
string getMetaDataElement( in string key );
This method sets the meta data. Meta data is a table of key/value string pairs. The strings do not have to conform to any particular charset, but they must be NULL terminated.
void setMetaDataElement( in string key, in string value );
Page last modified 20:48, 4 Apr 2008 by Jimbeau?