本文整理汇总了Java中org.infinispan.client.hotrod.RemoteCache.remove方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteCache.remove方法的具体用法?Java RemoteCache.remove怎么用?Java RemoteCache.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.infinispan.client.hotrod.RemoteCache
的用法示例。
在下文中一共展示了RemoteCache.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteRulesByCustomer
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
@Override
public String deleteRulesByCustomer(Integer customerId) {
int counter = 0;
//TODO: Shouldn't this be done by a one Infinispan DSL removal call?
try {
final RemoteCache<String, Rule> ruleCache = cacheManagerForIndexableCaches.getCache(SinkitCacheName.infinispan_rules.toString());
final QueryFactory qf = Search.getQueryFactory(ruleCache);
Query query = qf.from(Rule.class)
.having("customerId").eq(customerId)
.toBuilder().build();
// TODO: Use CloseableIterator
Iterator iterator = query.list().iterator();
while (iterator.hasNext()) {
ruleCache.remove(((Rule) iterator.next()).getStartAddress());
counter++;
}
return counter + " RULES DELETED FOR CUSTOMER ID: " + customerId;
} catch (Exception e) {
log.log(Level.SEVERE, "deleteRulesByCustomer", e);
// TODO: Proper Error codes.
return null;
}
}
示例2: deleteRule
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
@Override
public String deleteRule(final String cidrAddress) {
try {
final RemoteCache<String, Rule> ruleCache = cacheManagerForIndexableCaches.getCache(SinkitCacheName.infinispan_rules.toString());
final ImmutablePair<String, String> startEndAddresses = CIDRUtils.getStartEndAddresses(cidrAddress);
final String clientIPAddressPaddedBigInt = startEndAddresses.getLeft();
log.log(Level.FINE, "Deleting key [" + cidrAddress + "] which actually translates to BigInteger zero padded representation " +
"[" + clientIPAddressPaddedBigInt + "]");
String response;
if (ruleCache.containsKey(clientIPAddressPaddedBigInt)) {
ruleCache.remove(clientIPAddressPaddedBigInt);
response = clientIPAddressPaddedBigInt + " DELETED";
} else {
response = clientIPAddressPaddedBigInt + " DOES NOT EXIST";
}
return response;
} catch (Exception e) {
log.log(Level.SEVERE, "deleteRule", e);
// TODO: Proper Error codes.
return null;
}
}
示例3: stop
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public void stop() {
if (startError == null) {
RemoteCache<String, String> metadataCache = remoteCacheManager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.remove(fileName);
}
}
示例4: execute
import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
@Override
public void execute(String restOfTheLine) throws Exception {
if (restOfTheLine == null || restOfTheLine.trim().length() == 0) {
throw new UserErrorException("key name missing");
}
String keyName = restOfTheLine.replaceAll(" .*$", "");
RemoteCache defaultCache = insureConnected();
defaultCache.remove(keyName);
}