nsICacheEntryDescriptor
| IID: | 49c1a11d-f5d2-4f09-8262-551e64908ada |
| Inherits From: | nsICacheEntryInfo |
Properties
readonly nsCacheAccessMode accessGranted
Get the access granted to this descriptor. See nsICache.idl for the definitions of the access modes and a thorough description of their corresponding meanings.
nsISupports cacheElement
Get/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.
readonly nsIFile file
Get the disk file associated with the cache entry.
nsISupports securityInfo
Get/set security info on the cache entry for this descriptor. This fails if the storage policy is not STORE_IN_MEMORY.
nsCacheStoragePolicy storagePolicy
Get/set the storage policy of the cache entry. See nsICache.idl for the definitions of the storage policies.
Methods
void close ( )
void doom ( )
void doomAndFailPendingRequests ( nsresult status )
char* getMetaDataElement ( char* key )
void markValid ( )
nsIInputStream openInputStream ( PRUint32 offset )
nsIOutputStream openOutputStream ( PRUint32 offset )
void setDataSize ( PRUint32 size )
void setExpirationTime ( PRUint32 expirationTime )
void setMetaDataElement ( char* key , char* value )
void visitMetaData ( nsICacheMetaDataVisitor visitor )
Doom the cache entry this descriptor references in order to slate it for removal. Once doomed a cache entry cannot be undoomed.
A descriptor with 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.
char* getMetaDataElement ( char* key )
Methods for accessing 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.
- Arguments:
- key
A writer must validate this cache object before any readers are given a descriptor to the object.
nsIInputStream openInputStream ( PRUint32 offset )
Open 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.
- Arguments:
- offset: read starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
- Returns:
- blocking, unbuffered input stream.
nsIOutputStream openOutputStream ( PRUint32 offset )
Open 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.
- Arguments:
- offset: write starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
- Returns:
- blocking, unbuffered output stream.
void setDataSize ( PRUint32 size )
Set the cache entry data size. This will fail if the cache entry IS stream based.
- Arguments:
- size
void setExpirationTime ( PRUint32 expirationTime )
Set the time at which the cache entry should be considered invalid (in seconds since the Epoch).
- Arguments:
- expirationTime
void visitMetaData ( nsICacheMetaDataVisitor visitor )
Visitor will be called with key/value pair for each meta data element.
- Arguments:
- visitor
References
This interface is the type of the following properties:
nsIMsgMailNewsUrl.memCacheEntry
This interface is passed as an argument to the following methods:
nsICacheListener.onCacheEntryAvailable, nsIMsgMailNewsUrl.cacheCacheEntry, nsIMsgMailNewsUrl.removeCacheEntry
This interface is returned from the following methods:
nsICacheSession.openCacheEntry
Reference documentation is generated from Mozilla's source.
