/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2013 ForgeRock AS
*/
/**
* This class defines the default entry cache which acts as an arbiter for
* every entry cache implementation configured and installed within the
* Directory Server or acts an an empty cache if no implementation specific
* entry cache is configured. It does not actually store any entries, so
* all calls to the entry cache public API are routed to underlying entry
* cache according to the current configuration order and preferences.
*/
public class DefaultEntryCache
extends EntryCache<EntryCacheCfg>
implements ConfigurationChangeListener<EntryCacheCfg>,
{
/**
* The tracer object for the debug logger.
*/
// The entry cache order array reflects all currently configured and
// active entry cache implementations in cache level specific order.
new EntryCache<?>[0];
/**
* Creates a new instance of this default entry cache.
*/
public DefaultEntryCache()
{
super();
// Register with backend initialization listener to clear cache
// entries belonging to given backend that about to go offline.
}
/**
* {@inheritDoc}
*/
{
// No implementation required.
}
/**
* {@inheritDoc}
*/
public void finalizeEntryCache()
{
}
// ReInitialize cache order array.
}
/**
* {@inheritDoc}
*/
{
return false;
}
return true;
}
}
return false;
}
/**
* {@inheritDoc}
*/
{
{
{
}
}
// Indicate global cache miss.
{
}
return null;
}
/**
* {@inheritDoc}
*/
{
{
{
}
}
// Indicate global cache miss.
{
}
return null;
}
/**
* {@inheritDoc}
*/
{
{
if (entryID != -1)
{
return entryID;
}
}
return -1;
}
/**
* {@inheritDoc}
*/
{
{
{
return entryDN;
}
}
return null;
}
/**
* {@inheritDoc}
*/
{
// The first cache in the order which can take this entry
// gets it.
break;
}
}
}
/**
* {@inheritDoc}
*/
{
// The first cache in the order which can take this entry
// gets it.
}
}
return false;
}
/**
* {@inheritDoc}
*/
{
break;
}
}
}
/**
* {@inheritDoc}
*/
public void clear()
{
entryCache.clear();
}
}
/**
* {@inheritDoc}
*/
{
}
}
/**
* {@inheritDoc}
*/
{
}
}
/**
* {@inheritDoc}
*/
public void handleLowMemory()
{
}
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationChangeAcceptable(
)
{
// No implementation required.
return true;
}
/**
* {@inheritDoc}
*/
)
{
// No implementation required.
);
return changeResult;
}
/**
* {@inheritDoc}
*/
{
// The sum of cache hits of all active entry cache
// implementations.
// Common for all active entry cache implementations.
// The sum of cache counts of all active entry cache
// implementations.
// Get cache hits and counts from every active cache.
}
try {
null,
null,
);
} catch (Exception e) {
if (debugEnabled()) {
}
}
return attrs;
}
/**
* {@inheritDoc}
*/
{
}
return cacheCount;
}
/**
* {@inheritDoc}
*/
{
{
if (s != null)
{
}
}
}
/**
* Retrieves the current cache order array.
*
* @return The current cache order array.
*/
{
return DefaultEntryCache.cacheOrder;
}
/**
* Sets the current cache order array.
*
* @param cacheOrderMap The current cache order array.
*/
public final void setCacheOrder(
{
}
/**
* Performs any processing that may be required whenever a backend
* is initialized for use in the Directory Server. This method will
* be invoked after the backend has been initialized but before it
* has been put into service.
*
* @param backend The backend that has been initialized and is
* about to be put into service.
*/
{
// Do nothing.
}
/**
* Performs any processing that may be required whenever a backend
* is finalized. This method will be invoked after the backend has
* been taken out of service but before it has been finalized.
*
* @param backend The backend that has been taken out of service
* and is about to be finalized.
*/
{
// Do not clear any backends if the server is shutting down.
}
}
}