ColdBox Platform Version 3.7.0

coldbox.system.cache.store.indexers
Class MetadataIndexer

WEB-INF.cftags.component
        extended by coldbox.system.cache.store.indexers.MetadataIndexer
Direct Known Subclasses:
JDBCMetadataIndexer

public class MetadataIndexer
extends WEB-INF.cftags.component

This is a utility object that helps object stores keep their items indexed and pretty


Constructor Summary
init(any fields)
          Constructor
 
Method Summary
 void clear(any objectKey)
          Clear a metadata key
 void clearAll()
          Clear the entire metadata map
 any getFields()
          Get the bounded fields list
 any<array> getKeys()
          Returns an array of the keys stored in the index
 any getObjectMetadata(any objectKey)
          Get a metadata entry for a specific entry
 any getObjectMetadataProperty(any objectKey, any property)
          Get a specific metadata property for a specific entry
 any getPoolMetadata()
          Get the entire pool reference
 any getSize()
          Get the size of the indexer
 any getSortedKeys(any property, [any sortType='text'], [any sortOrder='asc'])
          Get an array of sorted keys for this indexer according to parameters
 any objectExists(any objectKey)
          Check if the metadata entry exists for an object
 void setFields(any fields)
          Override the constructed metadata fields this index is binded to
 void setObjectMetadata(any objectKey, any metadata)
          Set the metadata entry for a specific entry
 void setObjectMetadataProperty(any objectKey, any property, any value)
          Set a metadata property for a specific entry
private void validateField(any target)
          Validate or thrown an exception on an invalid field
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any fields)
Constructor

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

clear

public void clear(any objectKey)
Clear a metadata key

Parameters:
objectKey - The key of the object

clearAll

public void clearAll()
Clear the entire metadata map


getFields

public any getFields()
Get the bounded fields list


getKeys

public any<array> getKeys()
Returns an array of the keys stored in the index


getObjectMetadata

public any getObjectMetadata(any objectKey)
Get a metadata entry for a specific entry. Exception if key not found

Parameters:
objectKey - The key of the object

getObjectMetadataProperty

public any getObjectMetadataProperty(any objectKey, any property)
Get a specific metadata property for a specific entry

Parameters:
objectKey - The key of the object
property - The property of the metadata to retrieve, must exist in the binded fields or exception is thrown

getPoolMetadata

public any getPoolMetadata()
Get the entire pool reference


getSize

public any getSize()
Get the size of the indexer


getSortedKeys

public any getSortedKeys(any property, [any sortType='text'], [any sortOrder='asc'])
Get an array of sorted keys for this indexer according to parameters

Parameters:
property - The property field to sort the index on. It must exist in the binded fields or exception
sortType - The sort ordering: numeric, text or textnocase
sortOrder - The sort order: asc or desc

objectExists

public any objectExists(any objectKey)
Check if the metadata entry exists for an object

Parameters:
objectKey - The key of the object

setFields

public void setFields(any fields)
Override the constructed metadata fields this index is binded to

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

setObjectMetadata

public void setObjectMetadata(any objectKey, any metadata)
Set the metadata entry for a specific entry

Parameters:
objectKey - The key of the object
metadata - The metadata structure to store for the cache entry

setObjectMetadataProperty

public void setObjectMetadataProperty(any objectKey, any property, any value)
Set a metadata property for a specific entry

Parameters:
objectKey - The key of the object
property - The property of the metadata to retrieve
value - The value of the property

validateField

private void validateField(any target)
Validate or thrown an exception on an invalid field

Parameters:
target - The target field to validate

ColdBox Platform Version 3.7.0