001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.admin.std.server;
027
028
029
030import java.util.SortedSet;
031import org.opends.server.admin.server.ConfigurationChangeListener;
032
033
034
035/**
036 * A server-side interface for querying FIFO Entry Cache settings.
037 * <p>
038 * FIFO Entry Caches use a FIFO queue to keep track of the cached
039 * entries.
040 */
041public interface FIFOEntryCacheCfg extends EntryCacheCfg {
042
043  /**
044   * Gets the configuration class associated with this FIFO Entry Cache.
045   *
046   * @return Returns the configuration class associated with this FIFO Entry Cache.
047   */
048  Class<? extends FIFOEntryCacheCfg> configurationClass();
049
050
051
052  /**
053   * Register to be notified when this FIFO Entry Cache is changed.
054   *
055   * @param listener
056   *          The FIFO Entry Cache configuration change listener.
057   */
058  void addFIFOChangeListener(ConfigurationChangeListener<FIFOEntryCacheCfg> listener);
059
060
061
062  /**
063   * Deregister an existing FIFO Entry Cache configuration change listener.
064   *
065   * @param listener
066   *          The FIFO Entry Cache configuration change listener.
067   */
068  void removeFIFOChangeListener(ConfigurationChangeListener<FIFOEntryCacheCfg> listener);
069
070
071
072  /**
073   * Gets the "exclude-filter" property.
074   * <p>
075   * The set of filters that define the entries that should be
076   * excluded from the cache.
077   *
078   * @return Returns an unmodifiable set containing the values of the "exclude-filter" property.
079   */
080  SortedSet<String> getExcludeFilter();
081
082
083
084  /**
085   * Gets the "include-filter" property.
086   * <p>
087   * The set of filters that define the entries that should be
088   * included in the cache.
089   *
090   * @return Returns an unmodifiable set containing the values of the "include-filter" property.
091   */
092  SortedSet<String> getIncludeFilter();
093
094
095
096  /**
097   * Gets the "java-class" property.
098   * <p>
099   * Specifies the fully-qualified name of the Java class that
100   * provides the FIFO Entry Cache implementation.
101   *
102   * @return Returns the value of the "java-class" property.
103   */
104  String getJavaClass();
105
106
107
108  /**
109   * Gets the "lock-timeout" property.
110   * <p>
111   * Specifies the length of time to wait while attempting to acquire
112   * a read or write lock.
113   *
114   * @return Returns the value of the "lock-timeout" property.
115   */
116  long getLockTimeout();
117
118
119
120  /**
121   * Gets the "max-entries" property.
122   * <p>
123   * Specifies the maximum number of entries that we will allow in the
124   * cache.
125   *
126   * @return Returns the value of the "max-entries" property.
127   */
128  int getMaxEntries();
129
130
131
132  /**
133   * Gets the "max-memory-percent" property.
134   * <p>
135   * Specifies the maximum percentage of JVM memory used by the server
136   * before the entry caches stops caching and begins purging itself.
137   * <p>
138   * Very low settings such as 10 or 20 (percent) can prevent this
139   * entry cache from having enough space to hold any of the entries to
140   * cache, making it appear that the server is ignoring or skipping
141   * the entry cache entirely.
142   *
143   * @return Returns the value of the "max-memory-percent" property.
144   */
145  int getMaxMemoryPercent();
146
147}