本文整理汇总了Java中com.redhat.lightblue.client.request.data.DataDeleteRequest类的典型用法代码示例。如果您正苦于以下问题:Java DataDeleteRequest类的具体用法?Java DataDeleteRequest怎么用?Java DataDeleteRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataDeleteRequest类属于com.redhat.lightblue.client.request.data包,在下文中一共展示了DataDeleteRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import com.redhat.lightblue.client.request.data.DataDeleteRequest; //导入依赖的package包/类
@Override
public void configure() throws Exception {
from("timer:" + deleterLockResourceId + "?period=" + deleteInterval.toMillis())
.routeId(deleterLockResourceId)
.routePolicy(new LockingRoutePolicy(deleterLockResourceId, lockStrategy))
.process(exchange -> {
Instant tooOld = clock.instant().minus(deleteOlderThan);
log.debug("Deleting {} entities with {} before {}", entityName, entityDateField, tooOld);
DataDeleteRequest deleteRequest = new DataDeleteRequest(entityName, entityVersion);
deleteRequest.where(Query.withValue(entityDateField, Query.BinOp.lt, Date.from(tooOld)));
LightblueDataResponse response = client.data(deleteRequest);
log.info("Deleted {} {} entities with {} before {}",
response.parseModifiedCount(), entityName, entityDateField, tooOld);
});
}
示例2: removeTuple
import com.redhat.lightblue.client.request.data.DataDeleteRequest; //导入依赖的package包/类
@Override
public void removeTuple(EntityKey key, TupleContext tupleContext) {
LightblueEntityMetadataId entityId = LightblueEntityMetadataId.extractEntityInfo(key.getMetadata());
DataDeleteRequest request = new DataDeleteRequest(entityId.entityName, entityId.entityVersion);
request.where(new ValueQuery("_id", ExpressionOperation.EQUALS, key.getColumnValues()[0].toString()));
try {
LightblueResponse data = provider.getLightblueClient().data(request);
System.out.println(data.getJson());
} catch (Exception e) {
throw new RuntimeException(e);
}
}