Packagemx.data
Classpublic class CacheDataDescriptor
InheritanceCacheDataDescriptor Inheritance EventDispatcher Inheritance Object
Implements IExternalizable

This class provides information about the attributes of cached data. It can be used to by developers to gain access to usage statistics. When data is successfully stored in the local cache a CacheDataDescriptor is created to represent that data. Descriptors can be accessed using the getCacheDescriptors() method of the associated service.

See also

mx.data.DataService.getCacheDescriptors


Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  created : Date
[read-only] Returns the time in UTC that this cached data was first created in the local store.
CacheDataDescriptor
  id : Object
[read-only] Returns the unique ID of the data cached.
CacheDataDescriptor
  lastAccessed : Date
[read-only] Returns the time in UTC that this cached data was last accessed from the local store.
CacheDataDescriptor
  lastWrite : Date
[read-only] Returns the time in UTC that this cached data was last written to the local store.
CacheDataDescriptor
  metadata : Object
Provides access to custom information stored along with this data in the local store.
CacheDataDescriptor
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  type : uint
[read-only] Returns the type of data this cache descriptor is associated with Valid values are: CacheDataDescriptor.FILL - descriptor is for a filled collection. CacheDataDescriptor.ITEM - descriptor is for a managed item.
CacheDataDescriptor
Public Methods
 MethodDefined By
  
CacheDataDescriptor(dataList:DataList = null)
Initializes this descriptor with the specified cache item and associated id.
CacheDataDescriptor
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited Dispatched when Flash Player gains operating system focus and becomes active.EventDispatcher
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
Public Constants
 ConstantDefined By
  ALL : uint = 0
[static] Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned.
CacheDataDescriptor
  FILL : uint = 1
[static] Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned.
CacheDataDescriptor
  ITEM : uint = 2
[static] Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned.
CacheDataDescriptor
Property Detail
createdproperty
created:Date  [read-only]

Returns the time in UTC that this cached data was first created in the local store. This value is set when autoSave is true is called and a fill(), getItem(), or createItem() request for data that is not already in the local store is completed; or saveCache() is called. Invocations of these methods when the data is already cached will change the last accessed time. The last updated time will also be updated if the cached data is updated as a result of the request.


Implementation
    public function get created():Date
destinationproperty 
mx_internal var destination:String

This value is used to lookup the current DataService and is assigned after this descriptor has been loaded from the local store, it is not stored with the descriptor.

idproperty 
id:Object  [read-only]

Returns the unique ID of the data cached. This is the value that the service uses to uniquely identify this data. For collections of items this is the value desfined by the remote destination when a fill request is made. For single managed objects (SMOs) this is a map of name value pairs for the item as defined by the <identity> tag in the services-config.xml.


Implementation
    public function get id():Object
lastAccessedproperty 
lastAccessed:Date  [read-only]

Returns the time in UTC that this cached data was last accessed from the local store. This value is set when a fill(), getItem(), or createItem() request for data that is not already in the local store is completed.


Implementation
    public function get lastAccessed():Date
lastWriteproperty 
lastWrite:Date  [read-only]

Returns the time in UTC that this cached data was last written to the local store. This value is set when autoSave is true is called and a fill(), getItem(), or createItem() request for data that is not already in the local store is completed; or saveCache() is called. The last write time will be updated if the cached data is updated as a result of the request or a pushed update occurs when autoSave is true.


Implementation
    public function get lastWrite():Date
metadataproperty 
metadata:Object  [read-write]

Provides access to custom information stored along with this data in the local store. Values assinged to this property must be serializable, that is, implement flash.util.IExternalizable or descend from no UI based objects. Typically this value is a string description of the data's relevance within the system. For example "All gold customers" or "All orders over $10K"


Implementation
    public function get metadata():Object
    public function set metadata(value:Object):void
referencesproperty 
references:Array  [read-write]
Implementation
    mx_internal function get references():Array
    mx_internal function set references(value:Array):void
typeproperty 
type:uint  [read-only]

Returns the type of data this cache descriptor is associated with Valid values are:


Implementation
    public function get type():uint
Constructor Detail
CacheDataDescriptor()Constructor
public function CacheDataDescriptor(dataList:DataList = null)

Initializes this descriptor with the specified cache item and associated id.

Parameters
dataList:DataList (default = null) — DataList reference to the associated items.
Constant Detail
ALLConstant
public static const ALL:uint = 0

Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned. This constant indicates that descriptors for both filled collections and single managed objects should be returned.

See also

FILLConstant 
public static const FILL:uint = 1

Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned. This option indicates that only descriptors for filled collections should be returned. This constant is also used to indicate the value of a descriptor's type.

See also


Example
 
         var desc:CacheDataDescriptor = CacheDataDescriptor(descriptors.getItemAt(0));
         if (desc.type == CacheDataDescriptor.FILL)
         {
            // this descriptor contains attribute data for a filled collection
         }
         else if (desc.type == CacheDataDescriptor.ITEM)
         {
            // this descriptor contains attribute data for a single managed item
         }
      
ITEMConstant 
public static const ITEM:uint = 2

Option for use with the getCacheDescriptors(), indicates what type of descriptors should be returned. This option indicates that only descriptors for single managed objects collections should be returned. This constant is also used to indicate the value of a descriptor's type.

See also


Example
 
         var desc:CacheDataDescriptor = CacheDataDescriptor(descriptors.getItemAt(0));
         if (desc.type == CacheDataDescriptor.FILL)
         {
            // this descriptor contains attribute data for a filled collection
         }
         else if (desc.type == CacheDataDescriptor.ITEM)
         {
            // this descriptor contains attribute data for a single managed item
         }
      




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/data/CacheDataDescriptor.html