Cumulus4j API
(1.0.1)

org.cumulus4j.store.model
Class IndexEntryFactory

java.lang.Object
  extended by org.cumulus4j.store.model.IndexEntryFactory
Direct Known Subclasses:
DefaultIndexEntryFactory

public abstract class IndexEntryFactory
extends Object

Factory for creating (or looking up) specific IndexEntry implementations.

It is optional to implement a specific factory. For most use cases, it is sufficient to use the DefaultIndexEntryFactory (which is used, if the extension specifies the attribute index-entry-type), but you can alternatively specify a custom factory via the extension-attribute index-entry-factory-type.

If you specify a custom factory, you must omit (or leave empty) the index-entry-type!

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
IndexEntryFactory()
           
 
Method Summary
 IndexEntry createIndexEntry(PersistenceManager pmIndex, FieldMeta fieldMeta, Object indexKey)
          Get an existing IndexEntry just like getIndexEntry(PersistenceManager, FieldMeta, Object) or create one, if it does not yet exist.
 IndexEntry getIndexEntry(PersistenceManager pmIndex, FieldMeta fieldMeta, Object indexKey)
          Get an IndexEntry for the specified unique key fields or null, if no such instance exists.
abstract  Class<? extends IndexEntry> getIndexEntryClass()
          Get the concrete implementation class (sub-class) of IndexEntry managed by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexEntryFactory

public IndexEntryFactory()
Method Detail

getIndexEntryClass

public abstract Class<? extends IndexEntry> getIndexEntryClass()
Get the concrete implementation class (sub-class) of IndexEntry managed by this factory.

Returns:
the concrete implementation class of IndexEntry managed by this factory.

getIndexEntry

public IndexEntry getIndexEntry(PersistenceManager pmIndex,
                                FieldMeta fieldMeta,
                                Object indexKey)
Get an IndexEntry for the specified unique key fields or null, if no such instance exists.

Parameters:
pmIndex - the backend-PersistenceManager. Must not be null.
fieldMeta - the meta-data of the field to query. Must not be null.
indexKey - the indexed value to search for. Might be null (null can be indexed).
Returns:
the matching IndexEntry or null.

createIndexEntry

public IndexEntry createIndexEntry(PersistenceManager pmIndex,
                                   FieldMeta fieldMeta,
                                   Object indexKey)
Get an existing IndexEntry just like getIndexEntry(PersistenceManager, FieldMeta, Object) or create one, if it does not yet exist.

Parameters:
pmIndex - the backend-PersistenceManager. Must not be null.
fieldMeta - the meta-data of the field to query. Must not be null.
indexKey - the indexed value to search for. Might be null (null can be indexed).
Returns:
the matching IndexEntry (never null).

Cumulus4j API
(1.0.1)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.