当前位置: 首页>>代码示例>>Java>>正文


Java RemoteCache.remove方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:whalebone,项目名称:sinkit-core,代码行数:24,代码来源:WebApiEJB.java

示例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;
    }
}
 
开发者ID:whalebone,项目名称:sinkit-core,代码行数:23,代码来源:WebApiEJB.java

示例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);
    }
}
 
开发者ID:snowdrop,项目名称:spring-data-snowdrop,代码行数:7,代码来源:ProtobufInitializer.java

示例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);
}
 
开发者ID:NovaOrdis,项目名称:playground,代码行数:15,代码来源:Remove.java


注:本文中的org.infinispan.client.hotrod.RemoteCache.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。