Author: skabashnyuk
Date: 2009-12-16 08:17:41 -0500 (Wed, 16 Dec 2009)
New Revision: 1095
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IdTreeHelper.java
Log:
EXOJCR-199: removed tree algorithm
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IdTreeHelper.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IdTreeHelper.java 2009-12-16
11:53:08 UTC (rev 1094)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IdTreeHelper.java 2009-12-16
13:17:41 UTC (rev 1095)
@@ -16,7 +16,6 @@
*/
package org.exoplatform.services.jcr.impl.storage.jbosscache;
-import org.exoplatform.services.jcr.util.IdGenerator;
import org.jboss.cache.Fqn;
/**
@@ -29,11 +28,11 @@
*/
public class IdTreeHelper
{
-
+
private final static int X_LENGTH = 8;
-
- private final static int FQN_ID_LENGTH = X_LENGTH + 2;
-
+
+ private final static int FQN_ID_LENGTH = X_LENGTH + 2;
+
/**
* Build path by UUID.
*
@@ -44,6 +43,7 @@
*/
public static String[] buildPath(String id)
{
+ /*
String tree[] = new String[X_LENGTH +1];
char[] chs = id.toCharArray();
@@ -51,10 +51,11 @@
tree[i] = String.valueOf(chs[i]);
tree[X_LENGTH] = id.substring(X_LENGTH);
-
- return tree;
+ */
+ return new String[]{id};
+
}
-
+
/**
* Create that transformation
*
@@ -72,38 +73,41 @@
*/
public static Fqn buildFqn(Fqn treeFqn)
{
+ return treeFqn;
+ /*
String oldId = treeFqn.getSubFqn(1, X_LENGTH + 2).toString();
String id = oldId.replaceAll(Fqn.SEPARATOR, "");
-
+
String[] sArray = new String[treeFqn.size() - (X_LENGTH)];
-
- sArray[0] = (String) treeFqn.get(0);
+
+ sArray[0] = (String)treeFqn.get(0);
sArray[1] = id;
-
+
int sArrayIndex = 1;
-
- for (int i=(X_LENGTH + 2); i < treeFqn.size(); i++)
+
+ for (int i = (X_LENGTH + 2); i < treeFqn.size(); i++)
{
- sArray[++sArrayIndex] = (String) treeFqn.get(i);
+ sArray[++sArrayIndex] = (String)treeFqn.get(i);
}
-
- return Fqn.fromElements(sArray);
+
+ return Fqn.fromElements(sArray);*/
}
-
+
/**
* Check the sub Fqn like /$LOCKs/2/5/6
* @return
*/
- public static boolean isSubFqn (Fqn fqn) {
- if (FQN_ID_LENGTH - fqn.size() > 1)
- {
- return true;
- }
- else
- {
- return false;
- }
-
+ public static boolean isSubFqn(Fqn fqn)
+ {
+// if (FQN_ID_LENGTH - fqn.size() > 1)
+// {
+// return true;
+// }
+// else
+// {
+// return false;
+// }
+ return false;
}
}
Show replies by date