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

kenneth_suter
31.21.2007 a060cd2a867fd7f7f1a5ebbb814fe83035e72214
opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -623,7 +623,18 @@
   */
  public long numSubordinates(DN entryDN) throws DirectoryException
  {
    EntryContainer ec = rootContainer.getEntryContainer(entryDN);
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    if(ec == null)
    {
      return -1;
@@ -669,7 +680,19 @@
  public Entry getEntry(DN entryDN) throws DirectoryException
  {
    readerBegin();
    EntryContainer ec = rootContainer.getEntryContainer(entryDN);
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    ec.sharedLock.lock();
    Entry entry;
    try
@@ -721,7 +744,19 @@
  {
    writerBegin();
    DN entryDN = entry.getDN();
    EntryContainer ec = rootContainer.getEntryContainer(entryDN);
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    ec.sharedLock.lock();
    try
    {
@@ -771,7 +806,18 @@
  {
    writerBegin();
    EntryContainer ec = rootContainer.getEntryContainer(entryDN);
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    ec.sharedLock.lock();
    try
    {
@@ -822,7 +868,18 @@
    writerBegin();
    DN entryDN = entry.getDN();
    EntryContainer ec = rootContainer.getEntryContainer(entryDN);
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(entryDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    ec.sharedLock.lock();
    try
@@ -878,8 +935,19 @@
      throws DirectoryException, CancelledOperationException
  {
    writerBegin();
    EntryContainer currentContainer = rootContainer.getEntryContainer(
        currentDN);
    EntryContainer currentContainer;
    if (rootContainer != null)
    {
      currentContainer = rootContainer.getEntryContainer(currentDN);
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    EntryContainer container = rootContainer.getEntryContainer(entry.getDN());
    if (currentContainer != container)
@@ -935,8 +1003,18 @@
      throws DirectoryException
  {
    readerBegin();
    EntryContainer ec = rootContainer.getEntryContainer(
        searchOperation.getBaseDN());
    EntryContainer ec;
    if (rootContainer != null)
    {
      ec = rootContainer.getEntryContainer(searchOperation.getBaseDN());
    }
    else
    {
      Message message = ERR_ROOT_CONTAINER_NOT_INITIALIZED.get(getBackendID());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
              message);
    }
    ec.sharedLock.lock();
    try