Package io.ebeanservice.docstore.api
Interface DocStoreBeanAdapter<T>
- All Superinterfaces:
BeanDocType<T>
- All Known Implementing Classes:
DocStoreBeanBaseAdapter,NoneDocStoreBeanAdapter
public interface DocStoreBeanAdapter<T> extends BeanDocType<T>
Doc store specific adapter to process doc store events for a given bean type.
-
Method Summary
Modifier and Type Method Description voidapplyPath(Query<T> query)Apply the document structure to the query so that it fetches the required properties to build the document (typically in JSON form).DocumentMappingcreateDocMapping()Create the document mapping.voiddeleteById(Object idValue, DocUpdateContext txn)Process a delete by id of a given document.StringgetIndexName()Return the index name for this bean type.StringgetIndexType()Return the index type for this bean type.io.ebean.annotation.DocStoreModegetMode(io.ebeaninternal.server.core.PersistRequest.Type persistType, io.ebean.annotation.DocStoreMode txnMode)Determine and return how this persist type will be processed given the transaction mode.StringgetQueueId()Return the unique queueId for this bean type.booleanhasEmbeddedInvalidation()Return true if this bean type as embedded invalidate registered.voidindex(Object idValue, T entityBean, DocUpdateContext txn)Process an index event which is effectively an insert or update (or put).voidinsert(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn)Process an insert persist request.booleanisMapped()Return true if this type is mapped for doc storage.StringrawProperty(String property)Return an un-analysed property to use instead of the given property.voidregisterInvalidationPath(String queueId, String path, Set<String> properties)Register invalidation events for embedded/nested documents the given path and properties.voidregisterPaths()In deployment phase read the embedded/nested document information.voidupdate(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn)Process an update persist request.voidupdateEmbedded(io.ebeaninternal.server.core.PersistRequestBean<T> request, DocStoreUpdates docStoreUpdates)Process the persist request adding any embedded/nested document invalidation to the docStoreUpdates.voidupdateEmbedded(Object idValue, String embeddedProperty, String embeddedRawContent, DocUpdateContext txn)Process an update of an embedded document.Methods inherited from interface io.ebean.plugin.BeanDocType
embedded, embeddedManyRoot, getEmbedded, getEmbeddedManyRoot, indexName, indexType
-
Method Details
-
registerPaths
void registerPaths()In deployment phase read the embedded/nested document information. -
registerInvalidationPath
Register invalidation events for embedded/nested documents the given path and properties. -
applyPath
Apply the document structure to the query so that it fetches the required properties to build the document (typically in JSON form).- Specified by:
applyPathin interfaceBeanDocType<T>
-
isMapped
boolean isMapped()Return true if this type is mapped for doc storage. -
getQueueId
Return the unique queueId for this bean type. This is expected to be a relatively short unique string (rather than a fully qualified class name). -
getMode
io.ebean.annotation.DocStoreMode getMode(io.ebeaninternal.server.core.PersistRequest.Type persistType, io.ebean.annotation.DocStoreMode txnMode)Determine and return how this persist type will be processed given the transaction mode.Some transactions (like bulk updates) might specifically turn off indexing for example.
-
getIndexType
Return the index type for this bean type.- Specified by:
getIndexTypein interfaceBeanDocType<T>
-
getIndexName
Return the index name for this bean type.- Specified by:
getIndexNamein interfaceBeanDocType<T>
-
deleteById
Process a delete by id of a given document.- Specified by:
deleteByIdin interfaceBeanDocType<T>- Throws:
IOException
-
index
Process an index event which is effectively an insert or update (or put).- Specified by:
indexin interfaceBeanDocType<T>- Throws:
IOException
-
insert
void insert(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn) throws IOExceptionProcess an insert persist request.- Throws:
IOException
-
update
void update(Object idValue, io.ebeaninternal.server.core.PersistRequestBean<T> persistRequest, DocStoreUpdateContext txn) throws IOExceptionProcess an update persist request.- Throws:
IOException
-
updateEmbedded
void updateEmbedded(io.ebeaninternal.server.core.PersistRequestBean<T> request, DocStoreUpdates docStoreUpdates)Process the persist request adding any embedded/nested document invalidation to the docStoreUpdates.This is expected to check the specific properties to see what other documents they are nested in and register invalidation events based on that.
- Parameters:
request- The persist requestdocStoreUpdates- Invalidation events are registered to this docStoreUpdates
-
updateEmbedded
void updateEmbedded(Object idValue, String embeddedProperty, String embeddedRawContent, DocUpdateContext txn) throws IOExceptionProcess an update of an embedded document.- Specified by:
updateEmbeddedin interfaceBeanDocType<T>- Parameters:
idValue- the id of the bean effected by an embedded document updateembeddedProperty- the path of the propertyembeddedRawContent- the embedded content for this property in JSON formtxn- the doc store transaction to use to process the update- Throws:
IOException
-
createDocMapping
Create the document mapping. -
rawProperty
Return an un-analysed property to use instead of the given property.For analysed properties that we want to sort on we will map the property to an additional 'raw' property that we can use for sorting etc.
- Specified by:
rawPropertyin interfaceBeanDocType<T>
-
hasEmbeddedInvalidation
boolean hasEmbeddedInvalidation()Return true if this bean type as embedded invalidate registered.
-