directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1404155 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java
Date Wed, 31 Oct 2012 14:16:06 GMT
Author: kayyagari
Date: Wed Oct 31 14:16:05 2012
New Revision: 1404155

URL: http://svn.apache.org/viewvc?rev=1404155&view=rev
Log:
added a directory for cache

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java?rev=1404155&r1=1404154&r2=1404155&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InstanceLayout.java
Wed Oct 31 14:16:05 2012
@@ -67,6 +67,8 @@ import java.io.File;
  *    |    +-- <log file>
  *    |
  *    +-- run
+ *    |
+ *    +-- cache
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -82,6 +84,7 @@ public class InstanceLayout extends Abst
     private static final String CONF_NAME = "conf";
     private static final String PARTITIONS_NAME = "partitions";
     private static final String REPL_NAME = "syncrepl-data";
+    private static final String CACHE_NAME = "cache";
     
     /** Static file names */
     private static final String LOG4J_PROPERTIES = "log4j.properties";
@@ -103,6 +106,9 @@ public class InstanceLayout extends Abst
     /** The replication data directory */
     private File replDir;
 
+    /** The cache directory */
+    private File cacheDir;
+
     /**
      * Creates a new instance of InstanceLayout.
      *
@@ -139,8 +145,9 @@ public class InstanceLayout extends Abst
                 getConfDirectory(),
                 getLogDirectory(),
                 getPartitionsDirectory(),
-                getRunDirectory()
-        };
+                getRunDirectory(),
+                getCacheDirectory()
+            };
         setRequiredDirectories( requiredDirectories );
 
         // The required files
@@ -178,6 +185,31 @@ public class InstanceLayout extends Abst
         this.confDir = confDir;
     }
 
+    
+    
+    /**
+     * Gets the 'cache' directory.
+     *
+     * @return the 'cache' directory
+     */
+    public File getCacheDirectory()
+    {
+        if ( cacheDir == null )
+        {
+            cacheDir = new File( getInstanceDirectory(), CACHE_NAME );
+        }
+        
+        return cacheDir;
+    }
+    
+    
+    /**
+     * @param cacheDir the confDir to set
+     */
+    public void setCacheDir( File cacheDir )
+    {
+        this.cacheDir = cacheDir;
+    }
 
     /**
      * Gets the 'log' directory.
@@ -344,11 +376,12 @@ public class InstanceLayout extends Abst
     public String toString()
     {
         return "Instance Layout: \n" +
-            "  Instance dir            : " + getInstanceDirectory() + "\n" +
-            "  Instance conf dir       : " + getConfDirectory() + "\n" +
-            "  Instance log dir        : " + getLogDirectory() + "\n" +
-            "  Instance run dir        : " + getRunDirectory() + "\n" +
-            "  Instance partitions dir : " + getPartitionsDirectory() + "\n" +
-            "  Instance replication data dir        : " + getLogDirectory() + "\n";
+            "  Instance dir                  : " + getInstanceDirectory() + "\n" +
+            "  Instance conf dir             : " + getConfDirectory() + "\n" +
+            "  Instance log dir              : " + getLogDirectory() + "\n" +
+            "  Instance run dir              : " + getRunDirectory() + "\n" +
+            "  Instance partitions dir       : " + getPartitionsDirectory() + "\n" +
+            "  Instance replication data dir : " + getLogDirectory() + "\n" +
+            "  Instance cache dir            : " + getCacheDirectory() + "\n";
     }
 }



Mime
View raw message