Author: areshetnyak
Date: 2009-12-08 04:08:28 -0500 (Tue, 08 Dec 2009)
New Revision: 940
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/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-293 : The JDBCCacheLoader was changed.
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-08
08:46:54 UTC (rev 939)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IdTreeHelper.java 2009-12-08
09:08:28 UTC (rev 940)
@@ -42,16 +42,6 @@
* @return String[]
* the tree id
*/
- /*public static String[] buildPath(String id)
- {
- String tree[] = new String[id.length()];
-
- for (int i = 1; i < id.length() + 1; i++)
- tree[i-1] = id.substring(i - 1, i);
-
- return tree;
- }*/
-
public static String[] buildPath(String id)
{
String tree[] = new String[X_LENGTH +1];
@@ -68,11 +58,11 @@
/**
* Create that transformation
*
- * /$NODES/0/0/e/x/o/0/j/c/r/0/r/o/o/t/0/u/u/i/d/0/0/0/0/0/0/0/0/0/0/0/0/0
+ * /$NODES/0/0/e/x/o/0/j/c/r0root0uuid0000000000000
* -->
* /$NODES/00exo0jcr0root0uuid0000000000000
*
- *
/$NODES/0/0/e/x/o/0/j/c/r/0/r/o/o/t/0/u/u/i/d/0/0/0/0/0/0/0/0/0/0/0/0/0/subNodeName:1
+ * /$NODES/0/0/e/x/o/0/j/c/r0root0uuid0000000000000/subNodeName:1
* -->
* /$NODES/00exo0jcr0root0uuid0000000000000/subNodeName:1
*
@@ -80,60 +70,6 @@
* the tree Fqn
* @return Fqn
*/
- /*public static Fqn buildFqn(Fqn treeFqn)
- {
- String id = treeFqn.getSubFqn(1, IdGenerator.IDENTIFIER_LENGTH + 1).toString();
-
- id = id.replaceAll(Fqn.SEPARATOR, "");
-
- String[] sArray = new String[treeFqn.size() - IdGenerator.IDENTIFIER_LENGTH + 1];
-
- sArray[0] = (String) treeFqn.get(0);
- sArray[1] = id;
-
- int sArrayIndex = 2;
-
- for (int i=(IdGenerator.IDENTIFIER_LENGTH + 1); i < treeFqn.size(); i++)
- {
- sArray[sArrayIndex++] = (String) treeFqn.get(i);
- }
-
- return Fqn.fromElements(sArray);
- } */
-
- /*public static Fqn buildFqn(Fqn treeFqn)
- {
- String id = "";
-
- int index = 1;
-
- for (;index < treeFqn.size(); index++)
- {
- if (((String) treeFqn.get(index)).length() == 1)
- {
- id += (String) treeFqn.get(index);
- } else
- {
- break;
- }
- }
-
- String[] sArray = new String[treeFqn.size() - (index - 2)];
-
- sArray[0] = (String) treeFqn.get(0);
- sArray[1] = id;
-
- int sArrayIndex = 2;
-
- for (int i=index; i < treeFqn.size(); i++)
- {
- sArray[sArrayIndex++] = (String) treeFqn.get(i);
- }
-
- return Fqn.fromElements(sArray);
- }*/
-
-
public static Fqn buildFqn(Fqn treeFqn)
{
String oldId = treeFqn.getSubFqn(1, X_LENGTH + 2).toString();
@@ -170,14 +106,4 @@
}
}
-
- public static void main(String[] args)
- {
-
System.out.println(Fqn.fromElements(buildPath("00exo0jcr0root0uuid0000000000000")));
-
System.out.println(buildFqn(Fqn.fromString("/$NODES/0/0/e/x/o/0/j/c/r/0/r/o/o/t/0/u/u/i/d/0/0/0/0/0/0/0/0/0/0/0/0/0")));
-
System.out.println(buildFqn(Fqn.fromString("/$NODES/0/0/e/x/o/0/j/c/r/0/r/o/o/t/0/u/u/i/d/0/0/0/0/0/0/0/0/0/0/0/0/0/[]subNodeName:1")));
-
System.out.println(buildFqn(Fqn.fromString("/$NODES/f/a/l/s/e/[]dsds:1")));
-
- }
-
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-12-08
08:46:54 UTC (rev 939)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-12-08
09:08:28 UTC (rev 940)
@@ -1412,4 +1412,20 @@
}
locksRoot.removeChild(makeNodeFqn(identifier));
}
+
+ /**
+ * Will be removed empty tree.
+ *
+ * @param parent
+ * FQN of tree
+ */
+ private void removeEmptyTree(Node<Serializable, Object> node, Fqn<String>
parent)
+ {
+ if (parent.size() != 0 && node.getChild(parent).getChildrenNames().size()
== 0)
+ {
+ node.removeChild(parent);
+
+ removeEmptyTree(node, parent.getParent());
+ }
+ }
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-12-08
08:46:54 UTC (rev 939)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-12-08
09:08:28 UTC (rev 940)
@@ -636,14 +636,13 @@
{
// TODO should never be called
LOG.warn("conn.getAllNodeIdentifiers()");
- return conn.getAllNodeIdentifiers();
-
+ return null/*conn.getAllNodeIdentifiers()*/;
}
else if (name.get(0).equals(JBossCacheStorage.PROPS))
{
// TODO should never be called
LOG.warn("conn.getAllPropertyIdentifiers()");
- return conn.getAllPropertyIdentifiers();
+ return null/*conn.getAllPropertyIdentifiers()*/;
}
else if (name.get(0).equals(JBossCacheStorage.LOCKS))
{
@@ -652,7 +651,7 @@
}
else if (name.get(0).equals(JBossCacheStorage.REFS))
{
- return conn.getAllRefencedNodeIdentifiers();
+ return null/*conn.getAllRefencedNodeIdentifiers()*/;
}
else if (name.get(0).equals(Fqn.ROOT))
{
Show replies by date