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


Java RemoteCache.containsKey方法代码示例

本文整理汇总了Java中org.infinispan.client.hotrod.RemoteCache.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteCache.containsKey方法的具体用法?Java RemoteCache.containsKey怎么用?Java RemoteCache.containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.infinispan.client.hotrod.RemoteCache的用法示例。


在下文中一共展示了RemoteCache.containsKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: readSLAMessage

import org.infinispan.client.hotrod.RemoteCache; //导入方法依赖的package包/类
public SLAMessage readSLAMessage(String key) {
					
	RemoteCache<String, SLAMessage> cache = remoteCacheManager.getSlaMessageCache();
	
	if ( cache.containsKey(key) ) {
		
		return cache.get(key);
		
	} else {
		
		return null;
		
	}
					
}
 
开发者ID:anurag-saran,项目名称:sla-mgmt-brms,代码行数:16,代码来源:JDGDataService.java


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