com.atlassian.jira.user
Class CachingExternalEntityStore

java.lang.Object
  extended by com.atlassian.jira.user.CachingExternalEntityStore
All Implemented Interfaces:
ExternalEntityStore

public class CachingExternalEntityStore
extends Object
implements ExternalEntityStore

A caching wrapper around the delegateEntityStore.


Field Summary
protected  ConcurrentHashMap<String,Long> nameIdMap
           
 
Constructor Summary
CachingExternalEntityStore(ExternalEntityStore delegateEntityStore)
          Creates a new instance of this class wrapping and caching the given ExternalEntityStore
 
Method Summary
 Long createIfDoesNotExist(String name)
          Checks the cache first and if does not exist in the cache, delegates to the wrapped entity store.
 void onClearCache(ClearCacheEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameIdMap

protected final ConcurrentHashMap<String,Long> nameIdMap
Constructor Detail

CachingExternalEntityStore

public CachingExternalEntityStore(ExternalEntityStore delegateEntityStore)
Creates a new instance of this class wrapping and caching the given ExternalEntityStore

Parameters:
delegateEntityStore - ExternalEntityStore to cache and delegate to
Method Detail

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

createIfDoesNotExist

public Long createIfDoesNotExist(String name)
                          throws IllegalArgumentException
Checks the cache first and if does not exist in the cache, delegates to the wrapped entity store.

Specified by:
createIfDoesNotExist in interface ExternalEntityStore
Parameters:
name - profile name to create
Returns:
Long id, this is the created or existing id for the name.
Throws:
IllegalArgumentException - if the given name is null


Copyright © 2002-2013 Atlassian. All Rights Reserved.