|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.impl.DefaultCompassSession
public class DefaultCompassSession
| Constructor Summary | |
|---|---|
DefaultCompassSession(RuntimeCompassSettings runtimeSettings,
InternalCompass compass,
SearchEngine searchEngine,
FirstLevelCache firstLevelCache)
|
|
| Method Summary | |
|---|---|
CompassAnalyzerHelper |
analyzerHelper()
Returns an Analyzer helper. |
CompassTransaction |
beginTransaction()
Begin a unit of work and return the associated CompassTranscation object. |
CompassTransaction |
beginTransaction(CompassTransaction.TransactionIsolation transactionIsolation)
Begin a unit of work and return the associated CompassTranscation object. |
void |
close()
Closes the CompassSession. |
void |
create(Object object)
Creates a NEW object in Compass. |
void |
create(String alias,
Object object)
Creates a NEW object in Compass that shares mapping alais with multiple objects. |
Property |
createProperty(String name,
byte[] value,
Property.Store store)
Creates a binary property only stored (can be compressed). |
Property |
createProperty(String name,
Reader value)
Creates a property (indexed, and not stored) 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 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. |
Resource |
createResource(String alias)
Creates a resource, that is used with the actual Search Engine implementation. |
void |
delete(Class clazz,
Object obj)
Deletes an object from Compass that match the mapping specified for the defined class. |
void |
delete(CompassQuery query)
Deletes all entries in the index that match the given query. |
void |
delete(Object obj)
Deletes an object from Compass. |
void |
delete(Resource resource)
Deletes a resource with the specified alias. |
void |
delete(String alias,
Object obj)
Deletes an object from Compass with multiple alias's. |
void |
evict(Object obj)
Evicts the given object from the first level cache (transaction scoped cache). |
void |
evict(Resource resource)
Evicts the given resource from the first level cache (transaction scoped cache). |
void |
evict(String alias,
Object id)
Evicts the given object from the first level cache (transaction scoped cache). |
void |
evictAll()
Evicts all the objects and the resources from the first level cache. |
CompassHits |
find(String query)
Finds a list of objects that match the specified query. |
void |
flush()
Flushed the current transaction. |
Object |
get(Class clazz,
Serializable id)
Returns an object that match the mapping specified for the defined class, and matches the specified id. |
Object |
get(String alias,
Serializable id)
Returns an object that match the mapping specified for the defined alias, and matches the specified id. |
Object |
get(String alias,
Serializable id,
MarshallingContext context)
|
Object |
getByResource(Resource resource)
|
Object |
getByResource(Resource resource,
MarshallingContext context)
|
InternalCompass |
getCompass()
|
FirstLevelCache |
getFirstLevelCache()
|
CompassMapping |
getMapping()
|
MarshallingStrategy |
getMarshallingStrategy()
|
CompassMetaData |
getMetaData()
|
Resource |
getResource(Class clazz,
Serializable id)
Returns a Resource that match the mapping specified for the defined class type, and specified id. |
Resource |
getResource(String alias,
Serializable id)
Returns a Resource that match the mapping specified for the defined alias (possibley different object types), and matches the specified id. |
Resource |
getResourceByIdResource(Resource idResource)
|
SearchEngine |
getSearchEngine()
|
CompassSettings |
getSettings()
Runtimes settings that apply on the session level. |
Object |
load(Class clazz,
Serializable id)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified id. |
Object |
load(String alias,
Serializable id)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified id. |
Resource |
loadResource(Class clazz,
Serializable id)
Loads and returns a Resource that match the mapping specified for the defined class, and matches the specified id. |
Resource |
loadResource(String alias,
Serializable id)
Loads and returns a Resource that match the mapping specified for the defined alias, and matches the specified id. |
Resource |
loadResourceByIdResource(Resource idResource)
|
CompassQueryBuilder |
queryBuilder()
Creats a new query builder, used to build queries programmatically. |
CompassQueryFilterBuilder |
queryFilterBuilder()
Creats a new query filter builder, used to build filters of queries programmatically. |
void |
save(Object object)
Saves an object in Compass. |
void |
save(String alias,
Object object)
Saves an object in Compass that shares mapping alais with multiple objects. |
CompassTermFreqsBuilder |
termFreqsBuilder(String[] names)
Creates a new terms frequencies builder used to get terms names and freqs for a list of property names. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCompassSession(RuntimeCompassSettings runtimeSettings,
InternalCompass compass,
SearchEngine searchEngine,
FirstLevelCache firstLevelCache)
| Method Detail |
|---|
public CompassSettings getSettings()
CompassSession
getSettings in interface CompassSessionRuntimeCompassEnvironment,
RuntimeLuceneEnvironment
public Resource createResource(String alias)
throws CompassException
CompassOperations
createResource in interface CompassOperationsCompassException
public Property createProperty(String name,
String value,
Property.Store store,
Property.Index index)
throws CompassException
CompassOperations
createProperty in interface CompassOperationsCompassException
public Property createProperty(String name,
String value,
Property.Store store,
Property.Index index,
Property.TermVector termVector)
throws CompassException
CompassOperations
createProperty in interface CompassOperationsname - The name of the propertyvalue - The value of the propertystore - The store setting for the propertyindex - The index setting for the property
CompassException
public Property createProperty(String name,
Reader value)
throws CompassException
CompassOperations
createProperty in interface CompassOperationsname - The name of the propertyvalue - The value of the property
CompassException
public Property createProperty(String name,
Reader value,
Property.TermVector termVector)
throws CompassException
CompassOperations
createProperty in interface CompassOperationsname - The name of the propertyvalue - The value of the propertytermVector - The term vector setting for the property
CompassException
public Property createProperty(String name,
byte[] value,
Property.Store store)
throws CompassException
CompassOperations
createProperty in interface CompassOperationsname - The name of the propertyvalue - The value of the propertystore - The store setting for the property
CompassException
public CompassQueryBuilder queryBuilder()
throws CompassException
CompassSession
queryBuilder in interface CompassSessionCompassException
public CompassQueryFilterBuilder queryFilterBuilder()
throws CompassException
CompassSession
queryFilterBuilder in interface CompassSessionCompassException
public CompassTermFreqsBuilder termFreqsBuilder(String[] names)
throws CompassException
CompassSession
termFreqsBuilder in interface CompassSessionnames - The property names
CompassException
public CompassAnalyzerHelper analyzerHelper()
throws CompassException
CompassSession
analyzerHelper in interface CompassSessionCompassException
public CompassTransaction beginTransaction()
throws CompassException
CompassSessioncompass.transaction.factory.
beginTransaction in interface CompassSessionCompassExceptionCompassTransaction
public CompassTransaction beginTransaction(CompassTransaction.TransactionIsolation transactionIsolation)
throws CompassException
CompassSessioncompass.transaction.factory.
Also accepts the transcation isolation of the transaction.
beginTransaction in interface CompassSessionCompassExceptionCompassTransaction
public void flush()
throws CompassException
InternalCompassSession
flush in interface InternalCompassSessionCompassException
public Resource getResource(Class clazz,
Serializable id)
throws CompassException
CompassOperationsnull if the object is not found.
getResource in interface CompassOperationsclazz - The class that represents the required mappingid - The id that identifies the resource
null if not found
CompassException
public Resource getResource(String alias,
Serializable id)
throws CompassException
CompassOperationsnull if the
object is not found.
getResource in interface CompassOperationsalias - The alias that represents the required mappingid - The id that identifies the resource
CompassExceptionpublic Resource getResourceByIdResource(Resource idResource)
getResourceByIdResource in interface InternalCompassSession
public Object get(Class clazz,
Serializable id)
throws CompassException
CompassOperationsnull if the object is not found.
get in interface CompassOperationsclazz - The class that represents the required mappingid - The id that identifies the resource
null if not found
CompassException
public Object get(String alias,
Serializable id)
throws CompassException
CompassOperationsnull if the object is not found.
get in interface CompassOperationsalias - The alias that represents the required mappingid - The id that identifies the resource
null if not found
CompassException
public Object get(String alias,
Serializable id,
MarshallingContext context)
throws CompassException
get in interface InternalCompassSessionCompassExceptionpublic Object getByResource(Resource resource)
getByResource in interface InternalCompassSession
public Object getByResource(Resource resource,
MarshallingContext context)
public Resource loadResource(Class clazz,
Serializable id)
throws CompassException
CompassOperations
loadResource in interface CompassOperationsclazz - The class that represents the required mappingid - The id that identifies the resource
CompassException
public Resource loadResource(String alias,
Serializable id)
throws CompassException
CompassOperations
loadResource in interface CompassOperationsalias - The alias that represents the required mappingid - The id that identifies the resource
CompassExceptionpublic Resource loadResourceByIdResource(Resource idResource)
public Object load(Class clazz,
Serializable id)
throws CompassException
CompassOperations
load in interface CompassOperationsclazz - The class that represents the required mappingid - The id that identifies the resource
CompassException
public Object load(String alias,
Serializable id)
throws CompassException
CompassOperations
load in interface CompassOperationsalias - The alias that represents the required mappingid - The id that identifies the resource
CompassException
public CompassHits find(String query)
throws CompassException
CompassOperationsSeveral examples are:
Note that the list may contains several object types (classes) with no relation between them (except for the semantic relation).
find in interface CompassOperationsquery - The query string to search by
CompassException
public void create(String alias,
Object object)
throws CompassException
CompassOperations
create in interface CompassOperationsalias - The alias that match the object mappingsobject - The object to save
CompassException
public void create(Object object)
throws CompassException
CompassOperations
create in interface CompassOperationsobject - The object to save.
CompassException
public void save(String alias,
Object object)
throws CompassException
CompassOperations
save in interface CompassOperationsalias - The alias that match the object mappingsobject - The object to save
CompassException
public void save(Object object)
throws CompassException
CompassOperations
save in interface CompassOperationsobject - The object to save.
CompassException
public void delete(String alias,
Object obj)
throws CompassException
CompassOperations
delete in interface CompassOperationsalias - The alias that the objects maps underobj - The object to delete
CompassException
public void delete(Class clazz,
Object obj)
throws CompassException
CompassOperations
delete in interface CompassOperationsclazz - The class that represtents the required mappingobj - The object to delete
CompassException
public void delete(Object obj)
throws CompassException
CompassOperations
delete in interface CompassOperationsobj - The object to delete
CompassException
public void delete(Resource resource)
throws CompassException
CompassOperations
delete in interface CompassOperationsresource - The resource to be deleted.
CompassException
public void delete(CompassQuery query)
throws CompassException
CompassOperations
delete in interface CompassOperationsquery - The query to delete by
CompassExceptionpublic void evict(Object obj)
CompassOperations
evict in interface CompassOperationsobj - The objects to evict.
public void evict(String alias,
Object id)
CompassOperations
evict in interface CompassOperationsalias - The alias of the object/entry to evict.id - The id of the object/entry to evict.public void evict(Resource resource)
CompassOperations
evict in interface CompassOperationsresource - The resource to evict.public void evictAll()
CompassOperations
evictAll in interface CompassOperations
public void close()
throws CompassException
CompassSession
close in interface CompassSessionCompassExceptionpublic InternalCompass getCompass()
getCompass in interface InternalCompassSessionpublic SearchEngine getSearchEngine()
getSearchEngine in interface InternalCompassSessionpublic MarshallingStrategy getMarshallingStrategy()
getMarshallingStrategy in interface InternalCompassSessionpublic FirstLevelCache getFirstLevelCache()
getFirstLevelCache in interface InternalCompassSessionpublic CompassMapping getMapping()
getMapping in interface InternalCompassSessionpublic CompassMetaData getMetaData()
getMetaData in interface InternalCompassSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||