public class Cache
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Cache.CacheListeners
Wraps all the operations related to management of all types of
CacheListeners
|
static class |
Cache.OptimizedComparator
Optimized search uses a sorted tree map on dn.
|
Modifier and Type | Field and Description |
---|---|
protected LDAPSearchCache |
cacheSearch
All lock handling is synchronized on this cache object.
|
protected boolean |
cacheupdate
Register for cache listeners
|
protected LDAPConnection |
connection
Holds jldap connection object
|
protected LDAPSearchConstraints |
constraints |
protected LDAPControl |
ldapWrapper |
protected IEventOccurrenceCounter |
m_accessDenied |
protected IEventOccurrenceCounter |
m_lookupCounter |
protected IEventOccurrenceCounter |
m_removeCounter
Statistics of LDAP Directory cache
|
protected int |
numFlushes |
static int |
USE_LDAP_CONNECTION |
static int |
USE_LDAP_SOAPPROCESSOR
Constant variables for setting context for LDAP Cache Key
|
static int |
USE_MULTI_CAST_SOCKET |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
void |
close()
Stop all activities for this cache instance, e.g.
|
void |
createManagedComponent(IManagedComponent parentComponent) |
IEventOccurrenceCounter |
getAccessDeniedCounter()
Get a event occurrence Counter for this LDAP Directory.
|
static java.util.Comparator<LDAPCacheKey> |
getComparator() |
java.lang.String |
getLDAPSOAPNodeDN() |
IManagedComponent |
getManagedComponent()
Get a managed component for this LDAP Directory/
|
int |
getNumFlushes() |
int |
getNumHits() |
int |
getNumMisses() |
int |
getSize() |
int |
getTotalOperations()
statstics for LDAP Cache
|
void |
normalRemove(java.lang.String dnString,
java.util.Map<java.lang.String,java.lang.String> metadata) |
void |
optimizedRemove(java.lang.String dnString,
java.util.Map<java.lang.String,java.lang.String> metadata) |
void |
refillBootstrapInformationFromFile() |
void |
registerCacheListener(CacheListener listener)
A CacheListener is notified of changes in the cache.
|
void |
registerCacheListener(CacheListenerWithMetadata listener)
A CacheListenerWithMetadata is notified of changes in the cache.
|
void |
remove(java.lang.String dnString,
java.util.Map<java.lang.String,java.lang.String> metadata)
Removes all search results from the cache in which extent the specified
DN falls.
|
void |
removeCacheListener(CacheListener listener)
Removes the Cache Listener from the pool
|
void |
removeCacheListener(CacheListenerWithMetadata listener)
Removes the Cache Listener from the pool
|
void |
removeSearch(java.lang.String dn,
int scope,
java.lang.String filter,
java.lang.String[] attributes,
boolean returnValues)
Removes the results of the search from the cache.
|
void |
returnCookieConnection(java.lang.String cookie)
Release LDAP Connection with cookie argument
|
void |
setMaxCacheSize(long cacheMaxSize)
For JMX
|
void |
setMaxIdleTime(long cacheIdleTime)
For JMX
|
protected void |
startCacheUpdater()
Start listening for ldap 'dirty' messages, and remove effected dn's from
the cache.
|
protected void |
stopCacheUpdater() |
public static final int USE_LDAP_SOAPPROCESSOR
public static final int USE_LDAP_CONNECTION
public static final int USE_MULTI_CAST_SOCKET
protected int numFlushes
protected final LDAPSearchCache cacheSearch
protected boolean cacheupdate
protected LDAPConnection connection
protected LDAPSearchConstraints constraints
protected IEventOccurrenceCounter m_removeCounter
protected IEventOccurrenceCounter m_lookupCounter
protected LDAPControl ldapWrapper
protected IEventOccurrenceCounter m_accessDenied
public void createManagedComponent(IManagedComponent parentComponent)
public void setMaxCacheSize(long cacheMaxSize)
cacheSize
- maximum cache size set by the user.public void setMaxIdleTime(long cacheIdleTime)
cacheSize
- maximum idle time for a cache item set by the user.public IManagedComponent getManagedComponent()
public IEventOccurrenceCounter getAccessDeniedCounter()
public void registerCacheListener(CacheListener listener)
listener
- CacheListener that listens for the changes in Cachepublic void removeCacheListener(CacheListener listener)
listener
- listener that is to be removedpublic void registerCacheListener(CacheListenerWithMetadata listener)
listener
- public void removeCacheListener(CacheListenerWithMetadata listener)
listener
- public int getTotalOperations()
public int getNumHits()
public int getNumMisses()
public int getNumFlushes()
public int getSize()
protected void startCacheUpdater()
protected void stopCacheUpdater()
public void returnCookieConnection(java.lang.String cookie)
cookie
- public void clear()
public void removeSearch(java.lang.String dn, int scope, java.lang.String filter, java.lang.String[] attributes, boolean returnValues)
dn,filter
- and scopepublic void remove(java.lang.String dnString, java.util.Map<java.lang.String,java.lang.String> metadata)
dnString
- the invalidated DNmetadata
- the metadata of the removed entry whic is passed to the
listenerspublic void optimizedRemove(java.lang.String dnString, java.util.Map<java.lang.String,java.lang.String> metadata)
public static java.util.Comparator<LDAPCacheKey> getComparator()
public void normalRemove(java.lang.String dnString, java.util.Map<java.lang.String,java.lang.String> metadata)
public void close()
public java.lang.String getLDAPSOAPNodeDN()
public void refillBootstrapInformationFromFile()