Package net.sf.ehcache.config
Class Searchable
- java.lang.Object
-
- net.sf.ehcache.config.Searchable
-
public class Searchable extends java.lang.ObjectSearch configuration for a Cache- Author:
- teck
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDYNAMIC_INDEXING_DEFAULTDefault for allowing dynamic indexingstatic booleanKEYS_DEFAULTDefault for auto-searchable keysstatic booleanVALUES_DEFAULTDefault for auto-searchable values
-
Constructor Summary
Constructors Constructor Description Searchable()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSearchAttribute(SearchAttribute searchAttribute)Add the given search attributevoidallowDynamicIndexing(boolean allow)Allow or disallow dynamic search attribute extractionvoidfreezeConfiguration()Freeze this configuration.java.util.Map<java.lang.String,SearchAttribute>getSearchAttributes()Get the defined search attributes indexed by attribute namejava.util.Map<java.lang.String,SearchAttribute>getUserDefinedSearchAttributes()Get the defined search attributes indexed by attribute name *excluding* any search attributes that are automatically/implicitly defined (eg.booleanisDynamicIndexingAllowed()Is dynamic indexing allowed?booleankeys()Are keys searchable?voidkeys(boolean b)Toggle searchable keysSearchablesearchAttribute(SearchAttribute searchAttribute)Add a search attributevoidsetAllowDynamicIndexing(boolean allow)Allow or disallow dynamic search attribute extractionvoidsetKeys(boolean keys)Toggle searchable keysvoidsetValues(boolean values)Toggle searchable valuesbooleanvalues()Are values searchable?voidvalues(boolean b)Toggle searchable values
-
-
-
Field Detail
-
KEYS_DEFAULT
public static final boolean KEYS_DEFAULT
Default for auto-searchable keys- See Also:
- Constant Field Values
-
VALUES_DEFAULT
public static final boolean VALUES_DEFAULT
Default for auto-searchable values- See Also:
- Constant Field Values
-
DYNAMIC_INDEXING_DEFAULT
public static final boolean DYNAMIC_INDEXING_DEFAULT
Default for allowing dynamic indexing- See Also:
- Constant Field Values
-
-
Method Detail
-
addSearchAttribute
public void addSearchAttribute(SearchAttribute searchAttribute) throws InvalidConfigurationException
Add the given search attribute- Parameters:
searchAttribute- to add- Throws:
InvalidConfigurationException- if an attribute already exists for the same name
-
getSearchAttributes
public java.util.Map<java.lang.String,SearchAttribute> getSearchAttributes()
Get the defined search attributes indexed by attribute name- Returns:
- search attributes
-
searchAttribute
public Searchable searchAttribute(SearchAttribute searchAttribute)
Add a search attribute- Parameters:
searchAttribute- attribute to add- Returns:
- this
-
freezeConfiguration
public void freezeConfiguration()
Freeze this configuration. Any subsequent changes will throw a CacheException
-
getUserDefinedSearchAttributes
public java.util.Map<java.lang.String,SearchAttribute> getUserDefinedSearchAttributes()
Get the defined search attributes indexed by attribute name *excluding* any search attributes that are automatically/implicitly defined (eg. key and value attributes)- Returns:
- search attributes
-
keys
public boolean keys()
Are keys searchable?- Returns:
- true if keys are searchable
-
values
public boolean values()
Are values searchable?- Returns:
- true if values are searchable
-
isDynamicIndexingAllowed
public boolean isDynamicIndexingAllowed()
Is dynamic indexing allowed?- Returns:
-
values
public void values(boolean b)
Toggle searchable values- Parameters:
b-
-
keys
public void keys(boolean b)
Toggle searchable keys- Parameters:
b-
-
setKeys
public void setKeys(boolean keys)
Toggle searchable keys- Parameters:
keys-
-
setValues
public void setValues(boolean values)
Toggle searchable values- Parameters:
values-
-
setAllowDynamicIndexing
public void setAllowDynamicIndexing(boolean allow)
Allow or disallow dynamic search attribute extraction- Parameters:
allow-
-
allowDynamicIndexing
public void allowDynamicIndexing(boolean allow)
Allow or disallow dynamic search attribute extraction- Parameters:
allow-
-
-