Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsICacheEntryDescriptor Interface Reference

import "nsICacheEntryDescriptor.idl";

Inheritance diagram for nsICacheEntryDescriptor:
Inheritance graph
[legend]
Collaboration diagram for nsICacheEntryDescriptor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void setExpirationTime (in PRUint32 expirationTime)
 Set the time at which the cache entry should be considered invalid (in seconds since the Epoch).
void setDataSize (in unsigned long size)
 Set the cache entry data size.
nsIInputStream openInputStream (in unsigned long offset)
 Open blocking input stream to cache data.
nsIOutputStream openOutputStream (in unsigned long offset)
 Open blocking output stream to cache data.
void doom ()
 Doom the cache entry this descriptor references in order to slate it for removal.
void doomAndFailPendingRequests (in nsresult status)
void markValid ()
 A writer must validate this cache object before any readers are given a descriptor to the object.
void close ()
 Explicitly close the descriptor (optional).
string getMetaDataElement (in string key)
 Methods for accessing meta data.
void setMetaDataElement (in string key, in string value)
void visitMetaData (in nsICacheMetaDataVisitor visitor)
 Visitor will be called with key/value pair for each meta data element.
boolean isStreamBased ()
 Find out whether or not the cache entry is stream based.

Public Attributes

attribute nsISupports cacheElement
 Get/set the cache data element.
readonly attribute
nsCacheAccessMode 
accessGranted
 Get the access granted to this descriptor.
attribute nsCacheStoragePolicy storagePolicy
 Get/set the storage policy of the cache entry.
readonly attribute nsIFile file
 Get the disk file associated with the cache entry.
attribute nsISupports securityInfo
 Get/set security info on the cache entry for this descriptor.
readonly attribute string clientID
 Get the client id associated with this cache entry.
readonly attribute string deviceID
 Get the id for the device that stores this cache entry.
readonly attribute ACString key
 Get the key identifying the cache entry.
readonly attribute long fetchCount
 Get the number of times the cache entry has been opened.
readonly attribute PRUint32 lastFetched
 Get the last time the cache entry was opened (in seconds since the Epoch).
readonly attribute PRUint32 lastModified
 Get the last time the cache entry was modified (in seconds since the Epoch).
readonly attribute PRUint32 expirationTime
 Get the expiration time of the cache entry (in seconds since the Epoch).
readonly attribute unsigned long dataSize
 Get the cache entry data size.

Detailed Description

Definition at line 55 of file nsICacheEntryDescriptor.idl.


Member Function Documentation

Explicitly close the descriptor (optional).

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.

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.

Find out whether or not the cache entry is stream based.

A writer must validate this cache object before any readers are given a descriptor to the object.

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.

Parameters:
offsetread starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
Returns:
blocking, unbuffered input stream.

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.

Parameters:
offsetwrite starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
Returns:
blocking, unbuffered output stream.

Set the cache entry data size.

This will fail if the cache entry IS stream based.

Set the time at which the cache entry should be considered invalid (in seconds since the Epoch).

Visitor will be called with key/value pair for each meta data element.


Member Data Documentation

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.

Definition at line 112 of file nsICacheEntryDescriptor.idl.

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.

Definition at line 105 of file nsICacheEntryDescriptor.idl.

Get the client id associated with this cache entry.

Definition at line 118 of file nsICacheVisitor.idl.

readonly attribute unsigned long nsICacheEntryInfo::dataSize [inherited]

Get the cache entry data size.

Definition at line 153 of file nsICacheVisitor.idl.

Get the id for the device that stores this cache entry.

Definition at line 123 of file nsICacheVisitor.idl.

Get the expiration time of the cache entry (in seconds since the Epoch).

Definition at line 148 of file nsICacheVisitor.idl.

Get the number of times the cache entry has been opened.

Definition at line 133 of file nsICacheVisitor.idl.

Get the disk file associated with the cache entry.

Definition at line 123 of file nsICacheEntryDescriptor.idl.

readonly attribute ACString nsICacheEntryInfo::key [inherited]

Get the key identifying the cache entry.

Definition at line 128 of file nsICacheVisitor.idl.

Get the last time the cache entry was opened (in seconds since the Epoch).

Definition at line 138 of file nsICacheVisitor.idl.

Get the last time the cache entry was modified (in seconds since the Epoch).

Definition at line 143 of file nsICacheVisitor.idl.

Get/set security info on the cache entry for this descriptor.

This fails if the storage policy is not STORE_IN_MEMORY.

Definition at line 129 of file nsICacheEntryDescriptor.idl.

Get/set the storage policy of the cache entry.

See nsICache.idl for the definitions of the storage policies.

Definition at line 118 of file nsICacheEntryDescriptor.idl.


The documentation for this interface was generated from the following file: