Author: areshetnyak
Date: 2009-11-17 11:58:22 -0500 (Tue, 17 Nov 2009)
New Revision: 733
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.
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-11-17
16:58:03 UTC (rev 732)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17
16:58:22 UTC (rev 733)
@@ -127,7 +127,7 @@
break;
case REMOVE_NODE :
- doRemove(m, conn);
+ doRemove(m, (JDBCStorageConnection) conn);
break;
case MOVE :
@@ -183,27 +183,21 @@
* @throws IllegalStateException
* @throws RepositoryException
*/
- private void doRemove(Modification modification, WorkspaceStorageConnection conn)
throws IllegalStateException,
- RepositoryException
+ private void doRemove(Modification modification, JDBCStorageConnection conn) throws
IllegalStateException,
+ RepositoryException
{
-
- if (modification.getFqn().size() == 2
- && (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) ||
modification.getFqn().get(0).equals(
- JBossCacheStorage.PROPS)))
+ if (modification.getFqn().size() == 2)
{
+ String identifier = (String) modification.getFqn().get(1);
- // TODO The removed ItemData was setting to value in prepareModifications();
- // That is need because we do not get NodeData from DB if we delete property
with primaytype.
-
- // String identifier = (String) modification.getFqn().get(1);
- // ItemData itemData = jdbcConnection.getItemData(identifier);
-
- ItemData itemData = (ItemData)modification.getValue();
-
- if (itemData instanceof NodeData)
- conn.delete((NodeData)itemData);
- if (itemData instanceof PropertyData)
- conn.delete((PropertyData)itemData);
+ if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES))
+ {
+ conn.deleteNode(identifier);
+ }
+ else if (modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))
+ {
+ conn.deleteProperty(identifier);
+ }
}
}
@@ -607,7 +601,7 @@
/**
* Prepare list of modifications.
*
- * Will be checked the UPDATE, ADD, REMOVE.
+ * Will be checked the UPDATE or ADD.
*
* @param modifications
* @throws RepositoryException
@@ -646,20 +640,6 @@
modifications.get(i).setOldValue(itemData);
}
}
- else if (m.getType() == ModificationType.REMOVE_NODE)
- {
- if (m.getFqn().size() == 2
- && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) ||
m.getFqn().get(0).equals(
- JBossCacheStorage.PROPS)))
- {
- String id = (String)m.getFqn().get(1);
- ItemData removedItemData = conn.getItemData(id);
-
- // Set valueData for update property or node.
- if (removedItemData != null)
- modifications.get(i).setValue(removedItemData);
- }
- }
}
}
finally
Show replies by date