[exo-jcr-commits] exo-jcr SVN: r447 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Oct 29 20:11:02 EDT 2009


Author: pnedonosko
Date: 2009-10-29 20:11:01 -0400 (Thu, 29 Oct 2009)
New Revision: 447

Modified:
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
Log:
EXOJCR-201: cache loader 

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java	2009-10-30 00:08:52 UTC (rev 446)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java	2009-10-30 00:11:01 UTC (rev 447)
@@ -49,12 +49,11 @@
  * @author <a href="mailto:peter.nedonosko at exoplatform.com.ua">Peter Nedonosko</a> 
  * @version $Id$
  */
-public class ExoJCRCacheLoader
-   implements CacheLoader
+public class ExoJCRCacheLoader implements CacheLoader
 {
-   private CacheSPI cache;
+   //private CacheSPI cache;
 
-   private RegionManager regionManager;
+   //private RegionManager regionManager;
 
    private IndividualCacheLoaderConfig config;
 
@@ -94,7 +93,7 @@
     */
    public boolean exists(Fqn name) throws Exception
    {
-      // TODO Auto-generated method stub
+      // TODO use get(Fqn), i.e. get Node!=null  
       return false;
    }
 
@@ -103,7 +102,7 @@
     */
    public Map<Object, Object> get(Fqn name) throws Exception
    {
-      // TODO Auto-generated method stub
+      // TODO get Node
       return null;
    }
 
@@ -112,7 +111,7 @@
     */
    public Set<?> getChildrenNames(Fqn fqn) throws Exception
    {
-      // TODO Auto-generated method stub
+      // TODO get child nodes names
       return null;
    }
 
@@ -165,7 +164,7 @@
     */
    private void doModified(List<Modification> modifications) throws Exception
    {
-      JDBCStorageConnection jdbcConnection = (JDBCStorageConnection) dataContainer.openConnection();
+      JDBCStorageConnection jdbcConnection = (JDBCStorageConnection)dataContainer.openConnection();
 
       try
       {
@@ -175,7 +174,7 @@
             switch (md.getType())
             {
                case PUT_KEY_VALUE :
-                  doModifiedAddOrUpdate(md, jdbcConnection);
+                  doAddOrUpdate(md, jdbcConnection);
                   break;
                case REMOVE_NODE :
                   doRemove(md, jdbcConnection, "TODO $<Node identifier>");
@@ -194,15 +193,15 @@
    }
 
    private void doRemove(Modification modification, JDBCStorageConnection jdbcConnection, String identifier)
-            throws IllegalStateException, RepositoryException
+      throws IllegalStateException, RepositoryException
    {
 
       ItemData itemData = jdbcConnection.getItemData(identifier);
 
       if (itemData instanceof NodeData)
-         jdbcConnection.delete((NodeData) itemData);
+         jdbcConnection.delete((NodeData)itemData);
       if (itemData instanceof PropertyData)
-         jdbcConnection.delete((PropertyData) itemData);
+         jdbcConnection.delete((PropertyData)itemData);
    }
 
    /**
@@ -212,13 +211,13 @@
     * @throws IllegalStateException
     * @throws RepositoryException
     */
-   private void doModifiedAddOrUpdate(Modification modification, JDBCStorageConnection jdbcConnection)
-            throws IllegalStateException, RepositoryException
+   private void doAddOrUpdate(Modification modification, JDBCStorageConnection jdbcConnection)
+      throws IllegalStateException, RepositoryException
    {
       if (modification.getValue() instanceof NodeData)
       {
          //add or update node data
-         NodeData nodeData = (NodeData) modification.getValue();
+         NodeData nodeData = (NodeData)modification.getValue();
 
          ItemData itemData = jdbcConnection.getItemData(nodeData.getIdentifier());
 
@@ -236,7 +235,7 @@
       else if (modification.getValue() instanceof PropertyData)
       {
          //add or update property data
-         PropertyData propertyData = (PropertyData) modification.getValue();
+         PropertyData propertyData = (PropertyData)modification.getValue();
 
          ItemData itemData = jdbcConnection.getItemData(propertyData.getIdentifier());
 
@@ -258,6 +257,7 @@
     */
    public Object put(Fqn name, Object key, Object value) throws Exception
    {
+      // i.e. put Property
       return null;
    }
 
@@ -266,6 +266,8 @@
     */
    public void put(Fqn name, Map<Object, Object> attributes) throws Exception
    {
+      // i.e. put set of Properties    
+      
       // TODO Auto-generated method stub
 
    }
@@ -275,6 +277,7 @@
     */
    public void put(List<Modification> modifications) throws Exception
    {
+      
       // TODO Auto-generated method stub
 
    }
@@ -284,6 +287,7 @@
     */
    public Object remove(Fqn fqn, Object key) throws Exception
    {
+      // i.e. remove Property
       // TODO Auto-generated method stub
       return null;
    }
@@ -293,6 +297,8 @@
     */
    public void remove(Fqn fqn) throws Exception
    {
+      // i.e. remove Node
+      
       // TODO Auto-generated method stub
 
    }
@@ -302,6 +308,8 @@
     */
    public void removeData(Fqn fqn) throws Exception
    {
+      // i.e. remove all Properties of Node 
+      
       // TODO Auto-generated method stub
 
    }
@@ -319,8 +327,7 @@
     */
    public void setCache(CacheSPI c)
    {
-      this.cache = c;
-
+      //this.cache = c;
    }
 
    /**
@@ -337,7 +344,7 @@
     */
    public void setRegionManager(RegionManager manager)
    {
-      this.regionManager = manager;
+      //this.regionManager = manager;
    }
 
    /**



More information about the exo-jcr-commits mailing list