Search in sources :

Example 6 with ManagedOperation

use of org.apache.camel.api.management.ManagedOperation in project camel by apache.

the class MongoDbIdempotentRepository method remove.

@ManagedOperation(description = "Remove the key from the store")
@Override
public boolean remove(E key) {
    Bson document = eq(MONGO_ID, key);
    DeleteResult res = collection.deleteOne(document);
    return res.getDeletedCount() > 0;
}
Also used : DeleteResult(com.mongodb.client.result.DeleteResult) Bson(org.bson.conversions.Bson) ManagedOperation(org.apache.camel.api.management.ManagedOperation)

Aggregations

ManagedOperation (org.apache.camel.api.management.ManagedOperation)6 DeleteResult (com.mongodb.client.result.DeleteResult)2 BsonDocument (org.bson.BsonDocument)2 Document (org.bson.Document)2 Bson (org.bson.conversions.Bson)2 Method (java.lang.reflect.Method)1 Iterator (java.util.Iterator)1 List (java.util.List)1 EntityManager (javax.persistence.EntityManager)1 ManagedAttribute (org.apache.camel.api.management.ManagedAttribute)1 JpaHelper.getTargetEntityManager (org.apache.camel.component.jpa.JpaHelper.getTargetEntityManager)1 IntrospectionSupport (org.apache.camel.util.IntrospectionSupport)1 TransactionStatus (org.springframework.transaction.TransactionStatus)1