Code example for Cache

Methods: getIfPresentput

0
	protected String generateAlertId(String source_ip, String dst_ip,
			int alert_type) {
 
		String key = makeKey(source_ip, dst_ip, alert_type);
 
		if (cache.getIfPresent(key) != null)
			return cache.getIfPresent(key);
 
		String new_UUID = System.currentTimeMillis() + "-" + UUID.randomUUID();
 
		cache.put(key, new_UUID);
		key = makeKey(dst_ip, source_ip, alert_type);
		cache.put(key, new_UUID);
 
		return new_UUID;
 
	} 
 
	public boolean refresh() throws Exception {
		// TODO Auto-generated method stub 
Connect your IDE to all the code out there  Get Codota for Java