mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
02.32.2014 57747a531e472493163a4f6a00c6c360c18da00d
OPENDJ-1602 New pluggable storage based backend


ivy.xml:
Added a dependency to sonar-persisit.

KeyValueStore.java:
Added javadocs.
2 files modified
86 ■■■■■ changed files
opendj-sdk/opendj3-server-dev/ivy.xml 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/KeyValueStore.java 74 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj3-server-dev/ivy.xml
@@ -32,6 +32,8 @@
    <!ENTITY crest.version      "2.1.0-SNAPSHOT">
    <!ENTITY jackson.version    "1.9.13">
    <!ENTITY slf4j.version      "1.7.6">
    <!ENTITY je.version         "5.0.104">
    <!ENTITY persistit.version  "3.3.1">
]>
<ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -49,7 +51,9 @@
    <dependency org="javax.mail"            name="mail"                     rev="1.4.7" />
    <!-- subsequent versions are not compatible with java 6, so force to use this version only -->
    <dependency org="javax.servlet"         name="javax.servlet-api"        rev="[3.1-b02]" />
    <dependency org="com.sleepycat"         name="je"                       rev="5.0.104" />
    <dependency org="com.sleepycat"         name="je"                       rev="&je.version;" />
    <dependency org="org.codehaus.sonar"    name="sonar-persistit"          rev="&persistit.version;" />
    <dependency org="org.forgerock.opendj"  name="opendj-rest2ldap-servlet" rev="&opendj.sdk.version;" conf="default->master,compile" />
    <dependency org="org.forgerock.opendj"  name="opendj-slf4j-adapter"     rev="&opendj.sdk.version;" />
    <dependency org="org.forgerock.commons" name="i18n-slf4j"               rev="&i18n.version;" />
@@ -70,6 +74,8 @@
    <!-- Force download of the source jars -->
    <!--
    <dependency org="com.sleepycat"         name="je"                       rev="&je.version;"         conf="default->master,sources"/>
    <dependency org="org.codehaus.sonar"    name="sonar-persistit"          rev="&persistit.version;"  conf="default->master,sources"/>
    <dependency org="org.codehaus.jackson"  name="jackson-core-asl"         rev="&jackson.version;"    conf="default->master,sources"/>
    <dependency org="org.codehaus.jackson"  name="jackson-mapper-asl"       rev="&jackson.version;"    conf="default->master,sources"/>
    <dependency org="org.glassfish.grizzly" name="grizzly-framework"        rev="&grizzly.version;"    conf="default->master,sources"/>
@@ -89,7 +95,9 @@
    <dependency org="org.slf4j"             name="slf4j-jdk14"              rev="&slf4j.version;"      conf="default->master,sources"/>
    -->
    <exclude org="javax.activation" artifact="activation" />
    <exclude    org="javax.activation"      artifact="activation" />
    <exclude    org="org.easytesting"       artifact="fest-assert" />
    <exclude    org="junit"                 artifact="junit" />
    <!-- This is already the OpenDJ server module :) -->
    <exclude  module="opendj3-server-dev"/>
  </dependencies>
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/KeyValueStore.java
@@ -29,78 +29,92 @@
import org.opends.server.types.DirectoryException;
/**
 * TODO JNR.
 * @param <K> TODO JNR
 * @param <V> TODO JNR
 * @param <T> TODO JNR
 * @param <M> TODO JNR
 * Interface for a key-value store, also known as an index.
 *
 * @param <K>
 *          type of key objects
 * @param <V>
 *          type of value objects
 * @param <T>
 *          type of transaction objects. Underlying databases that do not
 *          support transactions should use a {@link Void} type parameter and
 *          pass in a null value.
 * @param <M>
 *          type of lock mode objects. Underlying databases might not need this
 *          parameter. They should use a {@link Void} type parameter and pass in
 *          a null value.
 */
public interface KeyValueStore<K, V, T, M> extends Closeable
{
  /**
   * TODO JNR.
   * Opens a key-value store.
   *
   * @throws DirectoryException
   *           TODO JNR
   *           If an error occurs while opening the key-value store.
   */
  void open() throws DirectoryException;
  /**
   * TODO JNR.
   * Inserts a new record for the provided key-value mapping in the key-value
   * store.
   *
   * @param txn
   *          TODO JNR
   *          the current transaction
   * @param key
   *          TODO JNR
   *          the key to use when inserting the provided value
   * @param value
   *          TODO JNR
   * @return TODO JNR
   *          the value to insert
   * @return true if the record was inserted, false if a record with that key
   *         already exists.
   * @throws DirectoryException
   *           TODO JNR
   *           If an error occurs while opening the key-value store.
   */
  boolean insert(T txn, K key, V value) throws DirectoryException;
  /**
   * TODO JNR.
   * Puts the provided key-value mapping in the key-value store, overwriting any
   * previous mapping for the key.
   *
   * @param txn
   *          TODO JNR
   *          the current transaction
   * @param key
   *          TODO JNR
   *          the key to use when putting the provided value
   * @param value
   *          TODO JNR
   * @return TODO JNR
   *          the value to put
   * @return true if the key-value mapping could be put in the key-value store,
   *         false otherwise
   * @throws DirectoryException
   *           TODO JNR
   *           If an error occurs while opening the key-value store.
   */
  boolean put(T txn, K key, V value) throws DirectoryException;
  /**
   * TODO JNR.
   * Returns the value associated to the provided key.
   *
   * @param txn
   *          TODO JNR
   *          the current transaction
   * @param key
   *          TODO JNR
   *          the key for which to retrieve the value
   * @param mode
   *          TODO JNR
   * @return TODO JNR
   *          the mode to use when retrieving the value
   * @return The value associated with the provided key, or null if there is no
   *         such key-value mapping
   * @throws DirectoryException
   *           TODO JNR
   *           If an error occurs while opening the key-value store.
   */
  V get(T txn, K key, M mode) throws DirectoryException;
  /**
   * TODO JNR.
   * Removes the mapping for the provided key in the key-value store.
   *
   * @param txn
   *          TODO JNR
   *          the current transaction
   * @param key
   *          TODO JNR
   * @return TODO JNR
   *          the key to remove from the key-value store
   * @return true if the key could be removed, false otherwise
   * @throws DirectoryException
   *           TODO JNR
   *           If an error occurs while opening the key-value store.
   */
  boolean remove(T txn, K key) throws DirectoryException;
}