Package org.springframework.geode.cache
Class RepositoryAsyncEventListener.RemoveAsyncEventRepositoryFunction<T,ID>
java.lang.Object
org.springframework.geode.cache.RepositoryAsyncEventListener.AbstractAsyncEventOperationRepositoryFunction<T,ID>
org.springframework.geode.cache.RepositoryAsyncEventListener.RemoveAsyncEventRepositoryFunction<T,ID>
- Type Parameters:
T
-type
of the entity tied to the event.ID
-type
of the identifier of the entity.
- All Implemented Interfaces:
Function<org.apache.geode.cache.asyncqueue.AsyncEvent<ID,
,T>, Boolean> RepositoryAsyncEventListener.AsyncEventOperationRepositoryFunction<T,
ID>
- Enclosing class:
- RepositoryAsyncEventListener<T,
ID>
public static class RepositoryAsyncEventListener.RemoveAsyncEventRepositoryFunction<T,ID>
extends RepositoryAsyncEventListener.AbstractAsyncEventOperationRepositoryFunction<T,ID>
An
Function
implementation capable of handling Operation.REMOVE
AsyncEvents
.
Invokes the CrudRepository.delete(Object)
data access operation.-
Constructor Summary
ConstructorDescriptionConstructs a new instance ofRepositoryAsyncEventListener.RemoveAsyncEventRepositoryFunction
initialized with the given, requiredRepositoryAsyncEventListener
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProcess
(org.apache.geode.cache.asyncqueue.AsyncEvent<ID, T> event) Determines whether the givenAsyncEvent
can be processed by thisFunction
.protected <R> R
doRepositoryOp
(T entity) Invokes the appropriate Spring DataCrudRepository
data access operation based on theAsyncEvent
Operation
as determined byGatewayQueueEvent.getOperation()
.Methods inherited from class org.springframework.geode.cache.RepositoryAsyncEventListener.AbstractAsyncEventOperationRepositoryFunction
apply, getErrorHandler, getListener, getRepository, resolveEntity
-
Constructor Details
-
RemoveAsyncEventRepositoryFunction
Constructs a new instance ofRepositoryAsyncEventListener.RemoveAsyncEventRepositoryFunction
initialized with the given, requiredRepositoryAsyncEventListener
.- Parameters:
listener
-RepositoryAsyncEventListener
forwardingAsyncEvents
for processing by thisFunction
- See Also:
-
-
Method Details
-
canProcess
Description copied from interface:RepositoryAsyncEventListener.AsyncEventOperationRepositoryFunction
Determines whether the givenAsyncEvent
can be processed by thisFunction
. Implementing classes must override this method to specify whichAsyncEvent
Operations
they are capable of processing.- Parameters:
event
-AsyncEvent
to evaluate.- Returns:
- a boolean value indicating whether this
Function
is capable of processing the givenAsyncEvent
. Default returns false. - See Also:
-
AsyncEvent
-
doRepositoryOp
Description copied from class:RepositoryAsyncEventListener.AbstractAsyncEventOperationRepositoryFunction
Invokes the appropriate Spring DataCrudRepository
data access operation based on theAsyncEvent
Operation
as determined byGatewayQueueEvent.getOperation()
.- Specified by:
doRepositoryOp
in classRepositoryAsyncEventListener.AbstractAsyncEventOperationRepositoryFunction<T,
ID> - Type Parameters:
R
-type
of the Spring DataCrudRepository
data access operation return value.- Parameters:
entity
- entity to process.- Returns:
- the result of invoking the Spring Data
CrudRepository
data access operation. - See Also:
-
CrudRepository
-