org.compass.core
Interface ResourceFactory

All Known Implementing Classes:
LuceneResourceFactory

public interface ResourceFactory

A Resource and Property factory allowing to create new instances.

Note, this does not means that the resources will be created in the search engine. CompassOperations.create(Object), or one of the other APIs still need to be called.

Author:
kimchy

Method Summary
 Property createProperty(String name, byte[] value, Property.Store store)
          Creates a binary property.
 Property createProperty(String name, Reader value)
          Creates a property (TEXT type) for the specified reader.
 Property createProperty(String name, Reader value, Property.TermVector termVector)
          Creates a property (indexed, and not stored) for the specified reader.
 Property createProperty(String value, ResourcePropertyMapping mapping)
          Creates a Property that is used with the actual Search Engine
 Property createProperty(String value, ResourcePropertyMapping mapping, Property.Store store, Property.Index index)
           
 Property createProperty(String name, String value, Property.Store store, Property.Index index)
          Creates a Property that is used with the actual Search Engine
 Property createProperty(String name, String value, Property.Store store, Property.Index index, Property.TermVector termVector)
          Creates a Property that is used with the actual Search Engine.
 Property createProperty(String name, String value, ResourcePropertyMapping mapping)
          Creates a Property that is used with the actual Search Engine
 Resource createResource(String alias)
          Creates a resource, that is used with the actual Search Engine implementation.
 String getNullValue()
          Returns a null value that represents no entry in the search engine.
 boolean isNullValue(String value)
          Returns true if the value is marked as a null value.
 

Method Detail

getNullValue

String getNullValue()
Returns a null value that represents no entry in the search engine. Usefull when the system needs to store an actual data entry, but for it to represent a business null value.


isNullValue

boolean isNullValue(String value)
Returns true if the value is marked as a null value.


createResource

Resource createResource(String alias)
                        throws SearchEngineException
Creates a resource, that is used with the actual Search Engine implementation.

Throws:
SearchEngineException

createProperty

Property createProperty(String value,
                        ResourcePropertyMapping mapping)
                        throws SearchEngineException
Creates a Property that is used with the actual Search Engine

Throws:
SearchEngineException

createProperty

Property createProperty(String value,
                        ResourcePropertyMapping mapping,
                        Property.Store store,
                        Property.Index index)
                        throws SearchEngineException
Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        String value,
                        ResourcePropertyMapping mapping)
                        throws SearchEngineException
Creates a Property that is used with the actual Search Engine

Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        String value,
                        Property.Store store,
                        Property.Index index)
                        throws SearchEngineException
Creates a Property that is used with the actual Search Engine

Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        String value,
                        Property.Store store,
                        Property.Index index,
                        Property.TermVector termVector)
                        throws SearchEngineException
Creates a Property that is used with the actual Search Engine. The available values for the store and index parameters are provided in the Property interface (Property.Store, Property.Index, Property.TermVector).

Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        Reader value)
                        throws SearchEngineException
Creates a property (TEXT type) for the specified reader.

Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        Reader value,
                        Property.TermVector termVector)
                        throws SearchEngineException
Creates a property (indexed, and not stored) for the specified reader.

Throws:
SearchEngineException

createProperty

Property createProperty(String name,
                        byte[] value,
                        Property.Store store)
                        throws SearchEngineException
Creates a binary property.

Throws:
SearchEngineException


Copyright (c) 2004-2008 The Compass Project.