|
||||||||||
| 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 |
beginLocalTransaction()
Begins a unit of work using a Compass local transaction. |
|
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(Object object,
DirtyOperationContext context)
|
|
void |
create(String alias,
Object object)
Creates a NEW object in Compass that shares mapping alais with multiple objects. |
|
void |
create(String alias,
Object object,
DirtyOperationContext context)
|
|
void |
delete(Class clazz,
Object... ids)
Deletes an object from Compass that match the mapping specified for the defined class based on its ids. |
|
void |
delete(Class clazz,
Object obj)
Deletes an object from Compass that match the mapping specified for the defined class. |
|
void |
delete(Class clazz,
Object obj,
DirtyOperationContext context)
|
|
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(Object obj,
DirtyOperationContext context)
|
|
void |
delete(Resource resource)
Deletes a resource with the specified alias. |
|
void |
delete(String alias,
Object... ids)
Deletes an object from Compass with multiple alias's based on its ids. |
|
void |
delete(String alias,
Object obj)
Deletes an object from Compass with multiple alias's. |
|
void |
delete(String alias,
Object obj,
DirtyOperationContext context)
|
|
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. |
|
|
get(Class<T> clazz,
Object... ids)
Returns an object that match the mapping specified for the defined class, and matches the specified ids. |
|
|
get(Class<T> clazz,
Object id)
Returns an object that match the mapping specified for the defined class, and matches the specified id. |
|
Object |
get(String alias,
Object... ids)
Returns an object that match the mapping specified for the defined alias, and matches the specified ids. |
|
Object |
get(String alias,
Object id)
Returns an object that match the mapping specified for the defined alias, and matches the specified id. |
|
Object |
get(String alias,
Object 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,
Object... ids)
Returns a Resource that match the mapping specified for the defined class type, and specified ids. |
|
Resource |
getResource(Class clazz,
Object id)
Returns a Resource that match the mapping specified for the defined class type, and specified id. |
|
Resource |
getResource(String alias,
Object... ids)
Returns a Resource that match the mapping specified for the defined alias (possibley different object types), and matches the specified ids. |
|
Resource |
getResource(String alias,
Object 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)
|
|
Resource |
getResourceByIdResourceNoCache(Resource idResource)
|
|
SearchEngine |
getSearchEngine()
|
|
CompassSettings |
getSettings()
Runtimes settings that apply on the session level. |
|
boolean |
isClosed()
Returns true if the session is closed. |
|
|
load(Class<T> clazz,
Object... ids)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified ids. |
|
|
load(Class<T> clazz,
Object id)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified id. |
|
Object |
load(String alias,
Object... ids)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified ids. |
|
Object |
load(String alias,
Object id)
Loads and returns an object that match the mapping specified for the defined class, and matches the specified id. |
|
Resource |
loadResource(Class clazz,
Object... ids)
Loads and returns a Resource that match the mapping specified for the defined class, and matches the specified ids. |
|
Resource |
loadResource(Class clazz,
Object id)
Loads and returns a Resource that match the mapping specified for the defined class, and matches the specified id. |
|
Resource |
loadResource(String alias,
Object... ids)
Loads and returns a Resource that match the mapping specified for the defined alias, and matches the specified ids. |
|
Resource |
loadResource(String alias,
Object 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. |
|
ResourceFactory |
resourceFactory()
Returns a resource factory allowing to create resources and properties. |
|
void |
save(Object object)
Saves an object in Compass. |
|
void |
save(Object object,
DirtyOperationContext context)
|
|
void |
save(String alias,
Object object)
Saves an object in Compass that shares mapping alais with multiple objects. |
|
void |
save(String alias,
Object object,
DirtyOperationContext context)
|
|
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 ResourceFactory resourceFactory()
CompassSession
resourceFactory in interface CompassSessionpublic CompassSettings getSettings()
CompassSession
getSettings in interface CompassSessionRuntimeCompassEnvironment,
RuntimeLuceneEnvironment
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
CompassSessionNote, term frequencies are updated to reflect latest changes to the index only after an optimization as take place (note, calling optimize might not cause optimization).
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 CompassTransaction beginLocalTransaction()
throws CompassException
CompassSession
beginLocalTransaction in interface CompassSessionCompassException
public void flush()
throws CompassException
InternalCompassSession
flush in interface InternalCompassSessionCompassException
public Resource getResource(Class clazz,
Object... ids)
throws CompassException
CompassOperations
getResource in interface CompassOperationsclazz - The class that represents the required mappingids - The ids that identifies the resource
null if not found
CompassException
public Resource getResource(Class clazz,
Object 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,
Object... ids)
throws CompassException
CompassOperationsnull if the object is not found.
getResource in interface CompassOperationsalias - The alias that represents the required mappingids - The ids that identifies the resource
CompassException
public Resource getResource(String alias,
Object 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 InternalCompassSessionpublic Resource getResourceByIdResourceNoCache(Resource idResource)
getResourceByIdResourceNoCache in interface InternalCompassSession
public <T> T get(Class<T> clazz,
Object... ids)
throws CompassException
CompassOperationsnull if the object
is not found.
get in interface CompassOperationsclazz - The class that represents the required mappingids - The ids that identifies the resource
null if not found
CompassException
public <T> T get(Class<T> clazz,
Object 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,
Object... ids)
throws CompassException
CompassOperationsnull if the object is
not found.
get in interface CompassOperationsalias - The alias that represents the required mappingids - The ids that identifies the resource
null if not found
CompassException
public Object get(String alias,
Object 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,
Object 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,
Object... ids)
throws CompassException
CompassOperations
loadResource in interface CompassOperationsclazz - The class that represents the required mappingids - The ids that identifies the resource
CompassException
public Resource loadResource(Class clazz,
Object 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,
Object... ids)
throws CompassException
CompassOperations
loadResource in interface CompassOperationsalias - The alias that represents the required mappingids - The ids that identifies the resource
CompassException
public Resource loadResource(String alias,
Object 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 <T> T load(Class<T> clazz,
Object... ids)
throws CompassException
CompassOperations
load in interface CompassOperationsclazz - The class that represents the required mappingids - The ids that identifies the resource
CompassException
public <T> T load(Class<T> clazz,
Object 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,
Object... ids)
throws CompassException
CompassOperations
load in interface CompassOperationsalias - The alias that represents the required mappingids - The ids that identifies the resource
CompassException
public Object load(String alias,
Object 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(String alias,
Object object,
DirtyOperationContext context)
throws CompassException
create in interface InternalCompassSessionCompassException
public void create(Object object)
throws CompassException
CompassOperations
create in interface CompassOperationsobject - The object to save.
CompassException
public void create(Object object,
DirtyOperationContext context)
throws CompassException
create in interface InternalCompassSessionCompassException
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(String alias,
Object object,
DirtyOperationContext context)
throws CompassException
save in interface InternalCompassSessionCompassException
public void save(Object object)
throws CompassException
CompassOperations
save in interface CompassOperationsobject - The object to save.
CompassException
public void save(Object object,
DirtyOperationContext context)
throws CompassException
save in interface InternalCompassSessionCompassException
public void delete(String alias,
Object... ids)
throws CompassException
CompassOperations
delete in interface CompassOperationsalias - The alias that the objects maps underids - The ids of the object to delete
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(String alias,
Object obj,
DirtyOperationContext context)
throws CompassException
delete in interface InternalCompassSessionCompassException
public void delete(Class clazz,
Object... ids)
throws CompassException
CompassOperations
delete in interface CompassOperationsclazz - The class that represtents the required mappingids - The object ids 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(Class clazz,
Object obj,
DirtyOperationContext context)
throws CompassException
delete in interface InternalCompassSessionCompassException
public void delete(Object obj)
throws CompassException
CompassOperations
delete in interface CompassOperationsobj - The object to delete
CompassException
public void delete(Object obj,
DirtyOperationContext context)
throws CompassException
delete in interface InternalCompassSessionCompassException
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 CompassSessionCompassExceptionCompass.openSession()public boolean isClosed()
CompassSessiontrue if the session is closed. Note, if this session
"joined" another session, it won't actually be closed, and defer closing
the session to the outer session.
isClosed in interface CompassSessionpublic 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 | |||||||||