Author: sergiykarpenko
Date: 2009-11-06 05:21:09 -0500 (Fri, 06 Nov 2009)
New Revision: 483
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java
Log:
EXOJCR-202: empty IndexerCacheLoader class added
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java
(rev 0)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-06
10:21:09 UTC (rev 483)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.core.query.cacheloader;
+
+import
org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteOnlyCacheLoader;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.Modification;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: CacheIndexer.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader
+{
+
+ @Override
+ public void put(List<Modification> modifications) throws Exception
+ {
+ for (Modification m : modifications)
+ {
+ switch (m.getType())
+ {
+ case PUT_DATA :
+ put(m.getFqn(), m.getData());
+ break;
+ case PUT_DATA_ERASE :
+ removeData(m.getFqn());
+ put(m.getFqn(), m.getData());
+ break;
+ case PUT_KEY_VALUE :
+ put(m.getFqn(), m.getKey(), m.getValue());
+ break;
+ case REMOVE_DATA :
+ removeData(m.getFqn());
+ break;
+ case REMOVE_KEY_VALUE :
+ remove(m.getFqn(), m.getKey());
+ break;
+ case REMOVE_NODE :
+ remove(m.getFqn());
+ break;
+ case MOVE :
+ // involve moving all children too
+ move(m.getFqn(), m.getFqn2());
+ break;
+ default :
+ throw new CacheException("Unknown modification " +
m.getType());
+ }
+ }
+ }
+
+}