[exo-jcr-commits] exo-jcr SVN: r4231 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/backup and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Apr 13 07:16:17 EDT 2011


Author: tolusha
Date: 2011-04-13 07:16:17 -0400 (Wed, 13 Apr 2011)
New Revision: 4231

Modified:
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/RepositorySuspendController.java
Log:
EXOJCR-1301: Allow to use external backup tools in a secure manner

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java	2011-04-13 10:47:04 UTC (rev 4230)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java	2011-04-13 11:16:17 UTC (rev 4231)
@@ -60,16 +60,6 @@
    final int READONLY = 2;
 
    /**
-    * Repository SUSPENDED state.
-    */
-   public final int SUSPENDED = 3;
-
-   /**
-    * Undefined state. 
-    */
-   public final int UNDEFINED = 4;
-
-   /**
     * Add the items persistence listener to the named workspace.
     * 
     * @param workspaceName - name of workspace

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/RepositorySuspendController.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/RepositorySuspendController.java	2011-04-13 10:47:04 UTC (rev 4230)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/RepositorySuspendController.java	2011-04-13 11:16:17 UTC (rev 4231)
@@ -41,6 +41,21 @@
 @NameTemplate(@Property(key = "service", value = "RepositorySuspendController"))
 public class RepositorySuspendController implements Startable
 {
+   /**
+    * Repository ONLINE status.
+    */
+   private final String ONLINE = "online";
+
+   /**
+    * Repository SUSPENDED state.
+    */
+   private final String SUSPENDED = "suspended";
+
+   /**
+    * Undefined state. 
+    */
+   public final String UNDEFINED = "undefined";
+
    private final ManageableRepository repository;
 
    /**
@@ -63,7 +78,7 @@
     */
    @Managed
    @ManagedDescription("Suspend repository which means that allow only read operations. All writing threads will wait until resume operations invoked.")
-   public int suspend()
+   public String suspend()
    {
       for (Suspendable component : getSuspendableComponents())
       {
@@ -87,7 +102,7 @@
     */
    @Managed
    @ManagedDescription("Resume repository. All previously suspended threads continue working.")
-   public int resume()
+   public String resume()
    {
       List<Suspendable> components = getSuspendableComponents();
       Collections.reverse(components);
@@ -115,9 +130,9 @@
     */
    @Managed
    @ManagedDescription("Returns repository state.")
-   public int getState()
+   public String getState()
    {
-      int state = ManageableRepository.ONLINE;
+      String state = ONLINE;
       
       boolean hasSuspendedComponents = false;
       boolean hasOnlineComponents = false;
@@ -130,17 +145,17 @@
 
             if (hasOnlineComponents)
             {
-               return ManageableRepository.UNDEFINED;
+               return UNDEFINED;
             }
 
-            state = ManageableRepository.SUSPENDED;
+            state = SUSPENDED;
          }
          else
          {
             hasOnlineComponents = true;
             if (hasSuspendedComponents)
             {
-               return ManageableRepository.UNDEFINED;
+               return UNDEFINED;
             }
          }
       }



More information about the exo-jcr-commits mailing list