From 0a91f5af5295a2d0f5cfdad0d529d4b5d532c181 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 10 Feb 2015 15:34:15 +0000
Subject: [PATCH] OPENDJ-1716 Various PluggableBackend/Storage refactorings

---
 opendj3-server-dev/src/server/org/opends/server/extensions/ConfigFileHandler.java |   38 ++++++++++----------------------------
 1 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/extensions/ConfigFileHandler.java b/opendj3-server-dev/src/server/org/opends/server/extensions/ConfigFileHandler.java
index 6403294..0df1892 100644
--- a/opendj3-server-dev/src/server/org/opends/server/extensions/ConfigFileHandler.java
+++ b/opendj3-server-dev/src/server/org/opends/server/extensions/ConfigFileHandler.java
@@ -1850,10 +1850,17 @@
 
   /** {@inheritDoc} */
   @Override
-  public boolean supportsLDIFExport()
+  public boolean supports(BackendOperation backendOperation)
   {
-    // TODO We would need export-ldif to initialize this backend.
-    return false;
+    switch (backendOperation)
+    {
+    case BACKUP:
+    case RESTORE:
+      return true;
+
+    default:
+      return false;
+    }
   }
 
   /** {@inheritDoc} */
@@ -1865,8 +1872,6 @@
     writeLDIF(exportConfig);
   }
 
-
-
   /**
    * Writes the current configuration to LDIF with the provided export
    * configuration.
@@ -1952,13 +1957,6 @@
 
   /** {@inheritDoc} */
   @Override
-  public boolean supportsLDIFImport()
-  {
-    return false;
-  }
-
-  /** {@inheritDoc} */
-  @Override
   public LDIFImportResult importLDIF(LDIFImportConfig importConfig)
          throws DirectoryException
   {
@@ -1968,14 +1966,6 @@
 
   /** {@inheritDoc} */
   @Override
-  public boolean supportsBackup()
-  {
-    // We do support an online backup mechanism for the configuration.
-    return true;
-  }
-
-  /** {@inheritDoc} */
-  @Override
   public void createBackup(BackupConfig backupConfig)
          throws DirectoryException
   {
@@ -2332,14 +2322,6 @@
 
   /** {@inheritDoc} */
   @Override
-  public boolean supportsRestore()
-  {
-    // We will provide a restore, but only for offline operations.
-    return true;
-  }
-
-  /** {@inheritDoc} */
-  @Override
   public void restoreBackup(RestoreConfig restoreConfig)
          throws DirectoryException
   {

--
Gitblit v1.10.0