coldbox.system.cache.store.indexers

Class MetadataIndexer

lucee.Component
    extended by coldbox.system.cache.store.indexers.MetadataIndexer
Direct Known Subclasses:
JDBCMetadataIndexer

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This is a utility object that helps object stores keep their elements indexed and stored nicely. It is also a nice way to give back metadata results.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any fields
          The fields this indexer is tracking.

    • access = public
    • returntype = any
    true false
    any indexID
          The human id of this indexer.

    • access = public
    • returntype = any
    true false
    any<java.util.concurrent.ConcurrentHashMap> poolMetadata
          The metadata pool.

    • access = public
    • returntype = any
    • doc_generic = java.util.concurrent.ConcurrentHashMap
    true false
    Constructor Summary
    init(any fields)
          Constructor.
    Method Summary
    MetadataIndexer clear(any objectKey)
         Clears an object from the storage.
    MetadataIndexer clearAll()
         Clear all the elements in the store.
    string getFields()
    string getIndexID()
    array getKeys()
         Get all the store's object keys array.
    struct getObjectMetadata(any objectKey)
         Get a metadata entry for a specific entry.
    any getObjectMetadataProperty(any objectKey, any property, [any defaultValue])
         Get a metadata entry for a specific entry.
    string getPoolMetadata()
    numeric getSize()
         Get the size of the store.
    array getSortedKeys(any property, [any sortType='text'], [any sortOrder='asc'])
         Get an array of sorted keys for this indexer according to parameters.
    boolean objectExists(any objectKey)
         Check if the metadata entry exists for an object.
    MetadataIndexer setFields(any fields)
         Fancy setter for fields.
    any setIndexID(any indexID)
    MetadataIndexer setObjectMetadata(any objectKey, struct metadata)
         Set the metadata entry for a specific entry.
    MetadataIndexer setObjectMetadataProperty(any objectKey, any property, any value)
         Set a metadata property for a specific entry.
    any setPoolMetadata(any poolMetadata)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any fields)

    Constructor

    Parameters:
    fields - The list or array of fields to bind this index on

    Property Detail

    fields

    property any fields

    The fields this indexer is tracking

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    indexID

    property any indexID

    The human id of this indexer

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    poolMetadata

    property any<java.util.concurrent.ConcurrentHashMap> poolMetadata

    The metadata pool

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - java.util.concurrent.ConcurrentHashMap
    serializable - true

    Method Detail

    clear

    public MetadataIndexer clear(any objectKey)

    Clears an object from the storage

    Parameters:
    objectKey - The object key to clear

    clearAll

    public MetadataIndexer clearAll()

    Clear all the elements in the store


    getFields

    public string getFields()


    getIndexID

    public string getIndexID()


    getKeys

    public array getKeys()

    Get all the store's object keys array

    Returns:
    array

    getObjectMetadata

    public struct getObjectMetadata(any objectKey)

    Get a metadata entry for a specific entry. Exception if key not found

    Parameters:
    objectKey - The key to get

    getObjectMetadataProperty

    public any getObjectMetadataProperty(any objectKey, any property, [any defaultValue])

    Get a metadata entry for a specific entry. Exception if key not found

    Parameters:
    objectKey - The key to get
    property - The metadata property to get
    defaultValue - The default value if property doesn't exist

    getPoolMetadata

    public string getPoolMetadata()


    getSize

    public numeric getSize()

    Get the size of the store


    getSortedKeys

    public array getSortedKeys(any property, [any sortType='text'], [any sortOrder='asc'])

    Get an array of sorted keys for this indexer according to parameters

    Parameters:
    property - true
    sortType
    sortOrder

    objectExists

    public boolean objectExists(any objectKey)

    Check if the metadata entry exists for an object

    Parameters:
    objectKey - The key to get

    setFields

    public MetadataIndexer setFields(any fields)

    Fancy setter for fields

    Parameters:
    fields - The fields list or array

    setIndexID

    public any setIndexID(any indexID)

    Parameters:
    indexID

    setObjectMetadata

    public MetadataIndexer setObjectMetadata(any objectKey, struct metadata)

    Set the metadata entry for a specific entry

    Parameters:
    objectKey - The key to get
    metadata - The metadata struct to store

    setObjectMetadataProperty

    public MetadataIndexer setObjectMetadataProperty(any objectKey, any property, any value)

    Set a metadata property for a specific entry

    Parameters:
    objectKey - The key to set
    property - The metadata property to set
    value - The value to set

    setPoolMetadata

    public any setPoolMetadata(any poolMetadata)

    Parameters:
    poolMetadata