Top Description Fields Constructors Methods
net.sf.ehcache.search.query

public final Class QueryManagerBuilder

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Constructor, java.util.ArrayList, .Collection, .ArrayList, .Collection, net.sf.ehcache.CacheException, .CacheManager, .Ehcache

A Query Manager builder providing methods to add caches which can be queried. The Query Manager instance returned by this builder can be used to execute search queries expressed as Big Memory Structured Query Language (BMSQL) statements.
Author
dkumar

Field Summary

Modifier and TypeField and Description
private final Collection<Ehcache>
private final Class<? extends QueryManager>

Constructor Summary

AccessConstructor and Description
private
pack-priv
QueryManagerBuilder(Class<? extends QueryManager>
a concrete implementation of the Query Manager interface
implementationClass
)

Package-local constructor for testing purposes.

Method Summary

Modifier and TypeMethod and Description
public QueryManagerBuilder

Returns:

this for the builder pattern
addAllCachesCurrentlyIn
(CacheManager
a Cache Manager whose caches need to be added
cacheManager
)

Adds all Caches present in a Cache Manager to the internal state of the query manager.

public QueryManagerBuilder

Returns:

this for the builder pattern
addCache
(Ehcache
a cache instance to be added
cache
)

Adds a Cache to the internal state and allows it to be used as a target in a BMSQL statement's FROM clause.

public QueryManager

Returns:

the fully constructed Query Manager
build
()

Returns a new Query Manager using the options supplied during the building process.

private static Class<? extends QueryManager>
public static QueryManagerBuilder

Returns:

this for the builder pattern
newQueryManagerBuilder
()

Creates a new Query Manager builder.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachesback to summary
private final Collection<Ehcache> caches
defaultClassback to summary
private final Class<? extends QueryManager> defaultClass

Constructor Detail

QueryManagerBuilderback to summary
private QueryManagerBuilder()
QueryManagerBuilderback to summary
pack-priv QueryManagerBuilder(Class<? extends QueryManager> implementationClass)

Package-local constructor for testing purposes.

Parameters
implementationClass:Class<? extends QueryManager>

a concrete implementation of the Query Manager interface

Method Detail

addAllCachesCurrentlyInback to summary
public QueryManagerBuilder addAllCachesCurrentlyIn(CacheManager cacheManager)

Adds all Caches present in a Cache Manager to the internal state of the query manager. The added caches can be used in a BMSQL statement's FROM clause.

Parameters
cacheManager:CacheManager

a Cache Manager whose caches need to be added

Returns:QueryManagerBuilder

this for the builder pattern

addCacheback to summary
public QueryManagerBuilder addCache(Ehcache cache)

Adds a Cache to the internal state and allows it to be used as a target in a BMSQL statement's FROM clause.

Parameters
cache:Ehcache

a cache instance to be added

Returns:QueryManagerBuilder

this for the builder pattern

buildback to summary
public QueryManager build()

Returns a new Query Manager using the options supplied during the building process.

Returns:QueryManager

the fully constructed Query Manager

getImplementationClassback to summary
private static Class<? extends QueryManager> getImplementationClass()
newQueryManagerBuilderback to summary
public static QueryManagerBuilder newQueryManagerBuilder()

Creates a new Query Manager builder.

Returns:QueryManagerBuilder

this for the builder pattern