exo-jcr SVN: r1142 - in jcr/branches/1.12.0-JBCCACHE: applications/exo.jcr.applications.config and 14 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-21 13:20:39 -0500 (Mon, 21 Dec 2009)
New Revision: 1142
Modified:
jcr/branches/1.12.0-JBCCACHE/applications/exo.jcr.applications.config/pom.xml
jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.backupconsole/pom.xml
jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.browser/pom.xml
jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.fckeditor/pom.xml
jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.rest/pom.xml
jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.ear/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ext/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ftp/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.connectors.localadapter/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.command/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.ftpclient/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.web/pom.xml
jcr/branches/1.12.0-JBCCACHE/packaging/module/pom.xml
jcr/branches/1.12.0-JBCCACHE/pom.xml
Log:
EXOJCR-325 set right versions
Modified: jcr/branches/1.12.0-JBCCACHE/applications/exo.jcr.applications.config/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/exo.jcr.applications.config/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/exo.jcr.applications.config/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.config</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.backupconsole/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.backupconsole/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.backupconsole/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.backupconsole</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.browser/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.browser/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.browser/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.browser</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.fckeditor/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.fckeditor</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.rest/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.rest/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.applications.rest/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.rest</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.ear/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.ear/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/applications/java/exo.jcr.ear/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.ear</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.core</artifactId>
@@ -554,7 +554,7 @@
<include>**/**/TestConcurrentItems__.java</include>
<include>**/**/TestJBossCacheWorkspaceStorageCache_.java</include>
- <include>**/**/TestLinkedWorkspaceStorageCache.java</include>
+ <include>**/**/TestSVNodeDataOptimization.java</include>
<include>**/**/reading_/Test*.java</include>
<include>**/**/writing_/Test*.java</include>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ext/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ext/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.ext</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ftp/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ftp/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.ftp/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.ftp</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.webdav</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.connectors.localadapter/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.connectors.localadapter/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.connectors.localadapter/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.connectors.localadapter</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.command/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.command/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.command/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.command</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.ftpclient/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.ftpclient/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.ftpclient/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.ftpclient</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.web/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.web/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.framework.web/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.web</artifactId>
Modified: jcr/branches/1.12.0-JBCCACHE/packaging/module/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/packaging/module/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/packaging/module/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12.0-JBCCACHE/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/pom.xml 2009-12-21 16:49:11 UTC (rev 1141)
+++ jcr/branches/1.12.0-JBCCACHE/pom.xml 2009-12-21 18:20:39 UTC (rev 1142)
@@ -30,7 +30,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.0-JCRCACHE-SNAPSHOT</version>
+ <version>1.12.0-JBCCACHE-SNAPSHOT</version>
<packaging>pom</packaging>
<name>eXo JCR</name>
16 years, 7 months
exo-jcr SVN: r1141 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation: db and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-12-21 11:49:11 -0500 (Mon, 21 Dec 2009)
New Revision: 1141
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/DBConstants.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/NewJDBCStorageConnection.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-302: GET_PROPERTIES_BY_PARENTID and FIND_ITEM_BY_NAME new queries added
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/DBConstants.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/DBConstants.java 2009-12-21 16:41:15 UTC (rev 1140)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/DBConstants.java 2009-12-21 16:49:11 UTC (rev 1141)
@@ -153,6 +153,11 @@
protected String FIND_PROPERTIES_BY_PARENTID;
/**
+ * FIND_PROPERTIES_BY_PARENTID_NEW.
+ */
+ protected String GET_PROPERTIES_BY_PARENTID;
+
+ /**
* INSERT_NODE.
*/
protected String INSERT_NODE;
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/NewJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/NewJDBCStorageConnection.java 2009-12-21 16:41:15 UTC (rev 1140)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/NewJDBCStorageConnection.java 2009-12-21 16:49:11 UTC (rev 1141)
@@ -642,6 +642,15 @@
children.add((PropertyData)itemData(parent.getQPath(), prop, I_CLASS_PROPERTY, null));
return children;
+
+ //TODO mine
+ // ResultSet prop = getChildPropertiesByParentIdentifier(getInternalId(parent.getIdentifier()));
+ // List<PropertyData> children = new ArrayList<PropertyData>();
+ // while (prop.next())
+ // children.add(loadPropertyRecord(prop, parent.getQPath()));
+ //
+ // return children;
+
}
catch (SQLException e)
{
@@ -655,6 +664,8 @@
/**
* {@inheritDoc}
+ *
+ * TODO left as current
*/
public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
{
@@ -1818,7 +1829,6 @@
try
{
-
int cptype = item.getInt(COLUMN_PTYPE);
boolean cpmultivalued = item.getBoolean(COLUMN_PMULTIVALUED);
try
@@ -1840,7 +1850,6 @@
data.add(vdata);
}
while (item.next() && item.getString(COLUMN_ID) == cid);
- //TODO avoid situation when there is valueDatas from another property (impossible but exception throwing need)
PersistedPropertyData pdata =
new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, data);
@@ -2251,4 +2260,6 @@
protected abstract ResultSet findItemByNameNew(String parentId, String name, int index) throws SQLException;
protected abstract ResultSet findChildNodesByParentIdentifierNew(String parentIdentifier) throws SQLException;
+
+ protected abstract ResultSet getChildPropertiesByParentIdentifier(String parentIdentifier) throws SQLException;
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2009-12-21 16:41:15 UTC (rev 1140)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2009-12-21 16:49:11 UTC (rev 1141)
@@ -86,6 +86,8 @@
protected PreparedStatement findPropertiesByParentId;
+ protected PreparedStatement getPropertiesByParentId;
+
protected PreparedStatement insertNode;
protected PreparedStatement insertProperty;
@@ -190,7 +192,7 @@
"select I.*, V.ORDER_NUM, V.DATA, V.STORAGE_DESC from JCR_MITEM I LEFT OUTER JOIN JCR_MVALUE V ON (V.PROPERTY_ID=I.ID)"
+ ", (select ID from JCR_MITEM where PARENT_ID=? and NAME=? and I_INDEX=?) I2"
+ " where (I.ID=I2.ID) or (I.PARENT_ID=I2.ID and I.I_CLASS=2 and I.NAME IN ('[http://www.jcp.org/jcr/1.0]primaryType','[http://www.jcp.org/jcr/1.0]mixinTypes'))"
- + " order by VERSION DESC, I.I_CLASS, I.NAME DESC";
+ + " order by I.I_CLASS, I.NAME DESC";
// "select I.*, V.ORDER_NUM, V.DATA, V.STORAGE_DESC from (select * from JCR_MITEM where PARENT_ID=? and NAME=?) I LEFT OUTER JOIN JCR_MVALUE V ON (V.PROPERTY_ID=I.ID)"
// + ", (select ID from JCR_MITEM where I_CLASS=1 and PARENT_ID=? and NAME=?) I2"
@@ -220,12 +222,14 @@
+ " I.NAME IN ('[http://www.jcp.org/jcr/1.0]primaryType','[http://www.jcp.org/jcr/1.0]mixinTypes')) order by I.I_CLASS, I.N_ORDER_NUM";
//,'[http://www.exoplatform.com/jcr/exo/1.0]owner','[http://www.exoplatform.com/jcr/exo/1.0]permissions'
- String query = "";
-
FIND_NODES_COUNT_BY_PARENTID = "select count(ID) from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?";
FIND_PROPERTIES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=?" + " order by ID";
+ GET_PROPERTIES_BY_PARENTID =
+ "select I.*, V.ORDER_NUM, V.DATA, V.STORAGE_DESC from JCR_MITEM I, JCR_MVALUE V"
+ + " where I.I_CLASS=2 and I.PARENT_ID=? and V.PROPERTY_ID=I.ID order by I.ID";
+
INSERT_NODE =
"insert into JCR_MITEM(ID, PARENT_ID, NAME, VERSION, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,"
+ I_CLASS_NODE + ",?,?)";
@@ -646,4 +650,16 @@
findItemByIdNew.setString(2, identifier);
return findItemByIdNew.executeQuery();
}
+
+ @Override
+ protected ResultSet getChildPropertiesByParentIdentifier(String parentIdentifier) throws SQLException
+ {
+ if (getPropertiesByParentId == null)
+ getPropertiesByParentId = dbConnection.prepareStatement(GET_PROPERTIES_BY_PARENTID);
+ else
+ getPropertiesByParentId.clearParameters();
+
+ getPropertiesByParentId.setString(1, parentIdentifier);
+ return getPropertiesByParentId.executeQuery();
+ }
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2009-12-21 16:41:15 UTC (rev 1140)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2009-12-21 16:49:11 UTC (rev 1141)
@@ -627,4 +627,11 @@
return null;
}
+ @Override
+ protected ResultSet getChildPropertiesByParentIdentifier(String parentIdentifier) throws SQLException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
16 years, 7 months
exo-jcr SVN: r1140 - in jcr/trunk/applications: java/exo.jcr.applications.backupconsole/bin and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-12-21 11:41:15 -0500 (Mon, 21 Dec 2009)
New Revision: 1140
Modified:
jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml
jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml
jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml
Log:
EXOJCR-322 asslemblies and scripts updated
Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
===================================================================
--- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2009-12-21 16:36:07 UTC (rev 1139)
+++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2009-12-21 16:41:15 UTC (rev 1140)
@@ -1 +1 @@
-java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05-SNAPSHOT.jar %*
+java -jar exo.jcr.applications.backupconsole-1.12.0-Beta06-SNAPSHOT.jar %*
Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
===================================================================
--- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2009-12-21 16:36:07 UTC (rev 1139)
+++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2009-12-21 16:41:15 UTC (rev 1140)
@@ -1,3 +1,3 @@
#!/bin/sh
-java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05-SNAPSHOT.jar $*
+java -jar exo.jcr.applications.backupconsole-1.12.0-Beta06-SNAPSHOT.jar $*
Modified: jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2009-12-21 16:36:07 UTC (rev 1139)
+++ jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2009-12-21 16:41:15 UTC (rev 1140)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta06-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta06-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2009-12-21 16:36:07 UTC (rev 1139)
+++ jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2009-12-21 16:41:15 UTC (rev 1140)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta06-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta06-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2009-12-21 16:36:07 UTC (rev 1139)
+++ jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2009-12-21 16:41:15 UTC (rev 1140)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta06-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
16 years, 7 months
exo-jcr SVN: r1139 - in jcr/tags/1.12.0-Beta05/applications: java/exo.jcr.applications.backupconsole/bin and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-12-21 11:36:07 -0500 (Mon, 21 Dec 2009)
New Revision: 1139
Modified:
jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jboss-ear.xml
jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jonas-ear.xml
jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-tomcat6.xml
Log:
EXOJCR-322 asslemblies and scripts updated
Modified: jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
===================================================================
--- jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2009-12-21 15:42:46 UTC (rev 1138)
+++ jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2009-12-21 16:36:07 UTC (rev 1139)
@@ -1 +1 @@
-java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05-SNAPSHOT.jar %*
+java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05.jar %*
Modified: jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
===================================================================
--- jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2009-12-21 15:42:46 UTC (rev 1138)
+++ jcr/tags/1.12.0-Beta05/applications/java/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2009-12-21 16:36:07 UTC (rev 1139)
@@ -1,3 +1,3 @@
#!/bin/sh
-java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05-SNAPSHOT.jar $*
+java -jar exo.jcr.applications.backupconsole-1.12.0-Beta05.jar $*
Modified: jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jboss-ear.xml
===================================================================
--- jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jboss-ear.xml 2009-12-21 15:42:46 UTC (rev 1138)
+++ jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jboss-ear.xml 2009-12-21 16:36:07 UTC (rev 1139)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta05</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta05</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jonas-ear.xml
===================================================================
--- jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jonas-ear.xml 2009-12-21 15:42:46 UTC (rev 1138)
+++ jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-jonas-ear.xml 2009-12-21 16:36:07 UTC (rev 1139)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta05</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta05</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-tomcat6.xml
===================================================================
--- jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-tomcat6.xml 2009-12-21 15:42:46 UTC (rev 1138)
+++ jcr/tags/1.12.0-Beta05/applications/product-exo-jcr-as-tomcat6.xml 2009-12-21 16:36:07 UTC (rev 1139)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.0-Beta05-SNAPSHOT</version>
+ <version>1.12.0-Beta05</version>
</parent>
<modelVersion>4.0.0</modelVersion>
16 years, 7 months
exo-jcr SVN: r1138 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2009-12-21 10:42:46 -0500 (Mon, 21 Dec 2009)
New Revision: 1138
Removed:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableItemData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableNodeData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutablePropertyData.java
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientPropertyData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java
Log:
EXOJCR-300: remove unused Interface: MutableItemData
Deleted: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableItemData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableItemData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableItemData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.datamodel;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov</a>
- * @version $Id: MutableItemData.java 11907 2008-03-13 15:36:21Z ksm $
- */
-
-public interface MutableItemData extends ItemData
-{
-
- /**
- * Adds 1 to current persistedVersion value. NOT USED.
- */
- @Deprecated
- void increasePersistedVersion();
-}
Deleted: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableNodeData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableNodeData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutableNodeData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.datamodel;
-
-import org.exoplatform.services.jcr.access.AccessControlList;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov</a>
- * @version $Id$
- */
-
-public interface MutableNodeData extends NodeData, MutableItemData
-{
-
- void setOrderNumber(int orderNum);
-
- void setMixinTypeNames(InternalQName[] mixinTypeNames);
-
- void setIdentifier(String identifier);
-
- void setACL(AccessControlList acl);
-}
Deleted: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutablePropertyData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutablePropertyData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/MutablePropertyData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.datamodel;
-
-import java.util.List;
-
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov</a>
- * @version $Id: MutablePropertyData.java 11907 2008-03-13 15:36:21Z ksm $
- */
-
-public interface MutablePropertyData extends PropertyData, MutableItemData
-{
-
- /**
- * @param values
- * @throws RepositoryException
- */
- void setValues(List<ValueData> values) throws RepositoryException;
-
- /**
- * @param type
- */
- void setType(int type);
-}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SysViewWorkspaceInitializer.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -317,6 +317,11 @@
this.primaryTypeName = primaryTypeName;
}
+ public void setMixinTypeNames(InternalQName[] mixinTypeNames)
+ {
+ this.mixinTypeNames = mixinTypeNames;
+ }
+
/**
* Add name of child node.
*
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.MutableItemData;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.log.ExoLogger;
@@ -38,7 +37,7 @@
* @author Gennady Azarenkov
* @version $Id: TransientItemData.java 11907 2008-03-13 15:36:21Z ksm $
*/
-public abstract class TransientItemData implements MutableItemData, Externalizable
+public abstract class TransientItemData implements ItemData, Externalizable
{
protected static final Log LOG = ExoLogger.getLogger("jcr.TransientItemData");
@@ -145,16 +144,6 @@
return qpath;
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.MutableItemData#increasePersistedVersion()
- */
- public void increasePersistedVersion()
- {
- this.persistedVersion++;
- }
-
/**
* {@inheritDoc}
*/
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientNodeData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -30,9 +30,8 @@
import org.exoplatform.services.jcr.access.AccessControlList;
import org.exoplatform.services.jcr.dataflow.ItemDataVisitor;
import org.exoplatform.services.jcr.datamodel.IllegalNameException;
-import org.exoplatform.services.jcr.datamodel.IllegalPathException;
import org.exoplatform.services.jcr.datamodel.InternalQName;
-import org.exoplatform.services.jcr.datamodel.MutableNodeData;
+import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.impl.Constants;
@@ -46,7 +45,7 @@
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
-public class TransientNodeData extends TransientItemData implements Comparable, MutableNodeData, Externalizable
+public class TransientNodeData extends TransientItemData implements Comparable, NodeData, ItemData, Externalizable
{
private static final long serialVersionUID = -8675118546441306180L;
@@ -113,43 +112,9 @@
return acl;
}
- // ---------------- MutableNodeData
-
/**
* {@inheritDoc}
*/
- public void setOrderNumber(int orderNum)
- {
- this.orderNum = orderNum;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setMixinTypeNames(InternalQName[] mixinTypeNames)
- {
- this.mixinTypeNames = mixinTypeNames;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setIdentifier(String identifier)
- {
- this.identifier = identifier;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setACL(AccessControlList acl)
- {
- this.acl = acl;
- }
-
- /**
- * {@inheritDoc}
- */
public void accept(ItemDataVisitor visitor) throws RepositoryException
{
visitor.visit(this);
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientPropertyData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientPropertyData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientPropertyData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -20,8 +20,9 @@
import org.exoplatform.services.jcr.dataflow.ItemDataVisitor;
import org.exoplatform.services.jcr.datamodel.InternalQName;
-import org.exoplatform.services.jcr.datamodel.MutablePropertyData;
+import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.util.IdGenerator;
@@ -42,7 +43,7 @@
* @version $Id: TransientPropertyData.java 13962 2008-05-07 16:00:48Z pnedonosko $
*/
-public class TransientPropertyData extends TransientItemData implements MutablePropertyData, Externalizable
+public class TransientPropertyData extends TransientItemData implements PropertyData, ItemData, Externalizable
{
private static final long serialVersionUID = -8224902483861330191L;
@@ -140,33 +141,6 @@
}
/**
- * {@inheritDoc}
- */
- public void setValues(List<ValueData> values)
- {
- this.values = values;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setType(int type)
- {
- this.type = type;
- }
-
- /**
- * Shortcut for single-valued property data initialization.
- *
- * @param value
- */
- public void setValue(ValueData value)
- {
- this.values = new ArrayList<ValueData>();
- values.add(value);
- }
-
- /**
* Factory method.
*
* @param parent NodeData
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -267,6 +267,26 @@
return exoPrivileges != null;
}
+ public void setOrderNumber(int orderNum)
+ {
+ this.orderNum = orderNum;
+ }
+
+ public void setMixinTypeNames(InternalQName[] mixinTypeNames)
+ {
+ this.mixinTypeNames = mixinTypeNames;
+ }
+
+ public void setIdentifier(String identifier)
+ {
+ this.identifier = identifier;
+ }
+
+ public void setACL(AccessControlList acl)
+ {
+ this.acl = acl;
+ }
+
public void setIsNewIdentifer(boolean newIdentifer)
{
this.newIdentifer = newIdentifer;
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java 2009-12-21 15:38:27 UTC (rev 1137)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java 2009-12-21 15:42:46 UTC (rev 1138)
@@ -19,10 +19,14 @@
package org.exoplatform.services.jcr.impl.xml.importing.dataflow;
import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Created by The eXo Platform SAS.
*
@@ -88,4 +92,38 @@
this.qpath = path;
}
+ /**
+ * Set property values.
+ *
+ * @param values
+ * values property
+ */
+ public void setValues(List<ValueData> values)
+ {
+ this.values = values;
+ }
+
+ /**
+ * Set type of property
+ *
+ * @param type
+ * property type
+ */
+ public void setType(int type)
+ {
+ this.type = type;
+ }
+
+ /**
+ * Set property value.
+ *
+ * @param value
+ * property value
+ */
+ public void setValue(ValueData value)
+ {
+ this.values = new ArrayList<ValueData>();
+ values.add(value);
+ }
+
}
16 years, 7 months
exo-jcr SVN: r1137 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-21 10:38:27 -0500 (Mon, 21 Dec 2009)
New Revision: 1137
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
Log:
EXOJCR-333: JCR cache concepts in the class javadoc
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2009-12-21 15:37:24 UTC (rev 1136)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2009-12-21 15:38:27 UTC (rev 1137)
@@ -62,9 +62,10 @@
* <li>cache transparent: or item cached or not, we should not generate "not found" Exceptions </li>
* <li>cache consists of next resident nodes:
* <ul>
- * <li>/$ITEMS - stores items by Id</li>
- * <li>/$CHILD_NODES, /$CHILD_PROPS - stores items by parentId and name (e.g. /$CHILD_NODES/parentId/childName/$ITEM_ID)</li>
- * <li>/$CHILD_NODES_LIST, /$CHILD_PROPS_LIST - stores childs list by parentId and child Id (e.g. /$CHILD_NODES_LIST/parentId/childId)</li>
+ * <li>/$ITEMS - stores items by Id (i.e. /$ITEMS/itemId)</li>
+ * <li>/$CHILD_NODES, /$CHILD_PROPS - stores items by parentId and name (i.e. /$CHILD_NODES/parentId/childName/$ITEM_ID)</li>
+ * <li>/$CHILD_NODES_LIST, /$CHILD_PROPS_LIST - stores childs list by parentId and child Id
+ * (i.e. /$CHILD_NODES_LIST/parentId/childId)</li>
* </ul>
* </li>
* <li>all child properties/nodes lists should be evicted from parent at same time
16 years, 7 months
exo-jcr SVN: r1136 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-21 10:37:24 -0500 (Mon, 21 Dec 2009)
New Revision: 1136
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
Log:
EXOJCR-333: JCR cache concepts in the class javadoc
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2009-12-21 15:30:24 UTC (rev 1135)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2009-12-21 15:37:24 UTC (rev 1136)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.config.CacheEntry;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
@@ -59,32 +58,29 @@
*
* Cache based on JBossCache.<p/>
*
- * <pre>
- * TODO
- * 1. cache transparent: or item cached or not, we should not generate "not found" Exceptions
- * 2. all child nodes should be evicted from parent at same time (Ids of childs)
- * 3. node should not be evicted if listed in child nodes somewhere, or
- * eviction of a node causes eviction of whole childs list
- * 4. properties in attributes of a node, they will be evicted with the node at same time
- * 5. but property should not be evicted if listed in attributes of a node somewhere, or
- * eviction of a property causes eviction of its parent node (and as a result eviction
- * of childs where this node listed)
- * 6. or we have fully independent ITEMS and CHILD_NODES with CHILD_PROPS
- * i.e. CHILD_x contains real ItemDatas of all childs of a parent.
- * It will be simple for eviction policy but will cause more replication traffic
- * as will replicated dublicated data often.
- * ITEMS for read by Id only. CHILD_x for read by parentId and name,
- * first read CHILD_NODES, if not found read CHILD_PROPS.
- * Only a small data will be replicated, not so big deal IMO.
- * Good that CHILD_x and ITEMS will live its own lifecycles, and will be populated on demand independently.
- * </pre>
+ * <ul>
+ * <li>cache transparent: or item cached or not, we should not generate "not found" Exceptions </li>
+ * <li>cache consists of next resident nodes:
+ * <ul>
+ * <li>/$ITEMS - stores items by Id</li>
+ * <li>/$CHILD_NODES, /$CHILD_PROPS - stores items by parentId and name (e.g. /$CHILD_NODES/parentId/childName/$ITEM_ID)</li>
+ * <li>/$CHILD_NODES_LIST, /$CHILD_PROPS_LIST - stores childs list by parentId and child Id (e.g. /$CHILD_NODES_LIST/parentId/childId)</li>
+ * </ul>
+ * </li>
+ * <li>all child properties/nodes lists should be evicted from parent at same time
+ * i.e. for /$CHILD_NODES_LIST, /$CHILD_PROPS_LIST we need customized eviction policy (EvictionActionPolicy) to evict
+ * whole list on one of childs eviction
+ * </li>
+ * </ul>
+ *
+ * <p/>
+ * Current state notes (subject of change):
+ * <ul>
+ * <li>cache implements WorkspaceStorageCache, without any stuff about references and locks</li>
+ * <li>transaction style implemented via JBC barches, do with JTA (i.e. via exo's TransactionService + JBoss TM)</li>
+ * <li>we need customized eviction policy (EvictionActionPolicy) for /$CHILD_NODES_LIST, /$CHILD_PROPS_LIST</li>
+ * </ul>
*
- * <pre>
- * TODO #2
- * 1. CHILD_x should be consistent with ITEMS (e.g. via custom eviction policy), otherwise it's should be only ITEMS.
- * 2. CHILD_x_LIST should be consistent as list, i.e. if one of child record evicted, the whole list should be removed.
- * </pre>
- *
* @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
* @version $Id: JBossCacheWorkspaceStorageCache.java 13869 2008-05-05 08:40:10Z pnedonosko $
*/
16 years, 7 months
exo-jcr SVN: r1135 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2009-12-21 10:30:24 -0500 (Mon, 21 Dec 2009)
New Revision: 1135
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
Log:
EXOJCR-291: IndexInfos: javadoc fixed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2009-12-21 15:25:41 UTC (rev 1134)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2009-12-21 15:30:24 UTC (rev 1135)
@@ -152,12 +152,11 @@
}
/**
- * Returns the index name at position <code>i</code>.
- * @param i the position.
+ * Returns index names.
* @return the index name.
*/
Set<String> getNames() {
- return new HashSet<String>(indexes);
+ return names;
}
/**
16 years, 7 months
exo-jcr SVN: r1134 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-12-21 10:25:41 -0500 (Mon, 21 Dec 2009)
New Revision: 1134
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/PrimaryTypeNotFoundException.java
Log:
EXOJCR-302: optimisation moved from trunk to OPT
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/PrimaryTypeNotFoundException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/PrimaryTypeNotFoundException.java 2009-12-21 15:17:42 UTC (rev 1133)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/PrimaryTypeNotFoundException.java 2009-12-21 15:25:41 UTC (rev 1134)
@@ -46,7 +46,7 @@
* @param path
* - context path
*/
- public PrimaryTypeNotFoundException(String message, QPath path)
+ PrimaryTypeNotFoundException(String message, QPath path)
{
super(message);
this.path = path;
16 years, 7 months
exo-jcr SVN: r1133 - in jcr/branches/1.12.0-JBCCACHE: exo.jcr.component.core and 4 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-21 10:17:42 -0500 (Mon, 21 Dec 2009)
New Revision: 1133
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
Removed:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheImpl.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/branches/1.12.0-JBCCACHE/pom.xml
Log:
EXOJCR-333: JCR cache implementation on JBC
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/pom.xml 2009-12-21 15:17:42 UTC (rev 1133)
@@ -161,6 +161,10 @@
</dependency>
<!-- TCK binaries and deps for repo stub, some eXo API test -->
<dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-tests</artifactId>
<exclusions>
@@ -549,7 +553,11 @@
<include>**/**/TestErrorMultithreading__.java</include>
<include>**/**/TestConcurrentItems__.java</include>
- <include>**/**/TestValueImpl.java</include>
+ <include>**/**/TestJBossCacheWorkspaceStorageCache_.java</include>
+ <include>**/**/TestLinkedWorkspaceStorageCache.java</include>
+
+ <include>**/**/reading_/Test*.java</include>
+ <include>**/**/writing_/Test*.java</include>
</includes>
</configuration>
</plugin>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2009-12-21 15:17:42 UTC (rev 1133)
@@ -358,8 +358,14 @@
{
NodeData parentData = (NodeData)cache.get(nodeData.getIdentifier());
if (parentData == null)
+ {
parentData = (NodeData)super.getItemData(nodeData.getIdentifier());
- cache.addChildNodes(parentData, childNodes);
+ }
+
+ if (parentData != null)
+ {
+ cache.addChildNodes(parentData, childNodes);
+ }
}
return childNodes;
}
@@ -375,7 +381,9 @@
{
List<NodeData> childNodes = cache.getChildNodes(parent);
if (childNodes != null)
+ {
return childNodes.size();
+ }
}
return super.getChildNodesCount(parent);
@@ -417,8 +425,14 @@
{
NodeData parentData = (NodeData)cache.get(nodeData.getIdentifier());
if (parentData == null)
+ {
parentData = (NodeData)super.getItemData(nodeData.getIdentifier());
- cache.addChildProperties(parentData, childProperties);
+ }
+
+ if (parentData != null)
+ {
+ cache.addChildProperties(parentData, childProperties);
+ }
}
return childProperties;
}
@@ -460,12 +474,18 @@
{
NodeData parentData = (NodeData)cache.get(nodeData.getIdentifier());
if (parentData == null)
+ {
parentData = (NodeData)super.getItemData(nodeData.getIdentifier());
- cache.addChildPropertiesList(parentData, propertiesList);
+ }
+
+ if (parentData != null)
+ {
+ cache.addChildPropertiesList(parentData, propertiesList);
+ }
}
return propertiesList;
}
-
+
/**
* {@inheritDoc}
*/
Deleted: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheImpl.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheImpl.java 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheImpl.java 2009-12-21 15:17:42 UTC (rev 1133)
@@ -1,1247 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.dataflow.persistent;
-
-import org.exoplatform.services.cache.CacheListener;
-import org.exoplatform.services.cache.CacheListenerContext;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.CachedObjectSelector;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.cache.ObjectCacheInfo;
-import org.exoplatform.services.jcr.config.CacheEntry;
-import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
-import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
-import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.NodeData;
-import org.exoplatform.services.jcr.datamodel.PropertyData;
-import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.WeakHashMap;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Info: This cache implementation store item data and childs lists of item data. And it implements
- * OBJECTS cache - i.e. returns same java object that was cached before. Same item data or list of
- * childs will be returned from getXXX() calls. [PN] 13.04.06
- *
- * @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov </a>
- * @version $Id: WorkspaceStorageCacheImpl.java 11907 2008-03-13 15:36:21Z ksm $
- */
-@Deprecated
-// TODO remove it in JCR 1.12
-public class WorkspaceStorageCacheImpl implements WorkspaceStorageCache
-{
-
- static public int MAX_CACHE_SIZE = 200;
-
- static public long MAX_CACHE_LIVETIME = 600; // in
-
- // sec
-
- protected static Log log = ExoLogger.getLogger("jcr.WorkspaceStorageCacheImpl");
-
- protected Log info = ExoLogger.getLogger("jcr.WorkspaceStorageCacheImplINFO");
-
- private final ExoCache cache;
-
- private final WeakHashMap<String, List<NodeData>> nodesCache;
-
- private final WeakHashMap<String, List<PropertyData>> propertiesCache;
-
- private final String name;
-
- private boolean enabled;
-
- private Timer debugInformer;
-
- public WorkspaceStorageCacheImpl(CacheService cacheService, WorkspaceEntry wsConfig) throws Exception
- {
-
- this.name = "jcr." + wsConfig.getUniqueName();
-
- log
- .warn("This cache implementaion (WorkspaceStorageCacheImpl) is deprecated and will be removed in future versions of eXo JCR.");
-
- this.cache = cacheService.getCacheInstance(name);
-
- CacheEntry cacheConfig = wsConfig.getCache();
- if (cacheConfig != null)
- {
- enabled = cacheConfig.isEnabled();
-
- int maxSize;
- try
- {
- maxSize = cacheConfig.getParameterInteger("max-size");
- }
- catch (RepositoryConfigurationException e)
- {
- maxSize = cacheConfig.getParameterInteger("maxSize");
- }
- cache.setMaxSize(maxSize);
-
- nodesCache = new WeakHashMap<String, List<NodeData>>(maxSize);
- propertiesCache = new WeakHashMap<String, List<PropertyData>>(maxSize);
-
- long liveTime;
- try
- {
- liveTime = cacheConfig.getParameterTime("live-time"); // apply in milliseconds
- }
- catch (RepositoryConfigurationException e)
- {
- liveTime = cacheConfig.getParameterTime("liveTime");
- }
- cache.setLiveTime(liveTime);
- }
- else
- {
- cache.setMaxSize(MAX_CACHE_SIZE);
- cache.setLiveTime(MAX_CACHE_LIVETIME);
- nodesCache = new WeakHashMap<String, List<NodeData>>();
- propertiesCache = new WeakHashMap<String, List<PropertyData>>();
- enabled = true;
- }
-
- cache.addCacheListener(new ExpiredListener());
-
- if (info.isDebugEnabled())
- {
- debugInformer = new Timer(this.name);
- TimerTask informerTask = new TimerTask()
- {
- public void run()
- {
- try
- {
- int childNodes = 0;
- try
- {
- for (Map.Entry<String, List<NodeData>> ne : nodesCache.entrySet())
- {
- childNodes += ne.getValue().size();
- }
- }
- catch (ConcurrentModificationException e)
- {
- childNodes = -1;
- }
- int childProperties = 0;
- try
- {
- for (Map.Entry<String, List<PropertyData>> pe : propertiesCache.entrySet())
- {
- childProperties += pe.getValue().size();
- }
- }
- catch (ConcurrentModificationException e)
- {
- childProperties = -1;
- }
- info.info("C " + cache.getCacheSize() + ", CN " + nodesCache.size() + "/"
- + (childNodes < 0 ? "?" : childNodes) + ", CP " + propertiesCache.size() + "/"
- + (childProperties < 0 ? "?" : childProperties));
- }
- catch (Throwable e)
- {
- info.error("Debug informer task error " + e);
- }
- }
- };
-
- Calendar firstTime = Calendar.getInstance();
- firstTime.add(Calendar.SECOND, 5); // begin task after 30 second
- debugInformer.schedule(informerTask, firstTime.getTime(), 10 * 1000); // report each minute
- }
- }
-
- public long getSize()
- {
- return cache.getCacheSize();
- }
-
- /**
- * @param identifier
- * a Identifier of item cached
- */
- public ItemData get(final String identifier)
- {
- if (!enabled)
- return null;
-
- try
- {
- return getItem(identifier);
- }
- catch (Exception e)
- {
- log.error("GET operation fails. Item ID=" + identifier + ". Error " + e + ". NULL returned.", e);
- return null;
- }
- }
-
- /**
- * @return
- * @throws Exception
- */
- public ItemData get(String parentId, QPathEntry name)
- {
- if (!enabled)
- return null;
-
- try
- {
- return getItem(parentId, name);
- }
- catch (Exception e)
- {
- log.error("GET operation fails. Parent ID=" + parentId + " name " + (name != null ? name.getAsString() : name)
- + ". Error " + e + ". NULL returned.", e);
- return null;
- }
- }
-
- /**
- * Called by read operations
- *
- * @param data
- */
- public void put(final ItemData data)
- {
-
- try
- {
- if (enabled && data != null)
- {
-
- putItem(data);
-
- // add child item data to list of childs of the parent
- if (data.isNode())
- {
- // add child node
- List<NodeData> cachedParentChilds = nodesCache.get(data.getParentIdentifier());
- if (cachedParentChilds != null)
- {
- // Playing for orderable work
- NodeData nodeData = (NodeData)data;
- int orderNumber = nodeData.getOrderNumber();
-
- synchronized (cachedParentChilds)
- {
- int index = cachedParentChilds.indexOf(nodeData);
- if (index >= 0)
- {
-
- if (orderNumber != cachedParentChilds.get(index).getOrderNumber())
- {
- // replace and reorder
- List<NodeData> newChilds = new ArrayList<NodeData>(cachedParentChilds.size());
- for (int ci = 0; ci < cachedParentChilds.size(); ci++)
- {
- if (index == ci)
- newChilds.add(nodeData); // place in new position
- else
- newChilds.add(cachedParentChilds.get(ci)); // copy
- }
-
- nodesCache.put(data.getParentIdentifier(), newChilds); // cache new list
- if (log.isDebugEnabled())
- log.debug(name + ", put() update child node " + nodeData.getIdentifier()
- + " order #" + orderNumber);
- }
- else
- {
-
- cachedParentChilds.set(index, nodeData); // replace at current position
- if (log.isDebugEnabled())
- log.debug(name + ", put() update child node " + nodeData.getIdentifier()
- + " at index #" + index);
- }
-
- }
- else
- {
-
- // add to the end
- List<NodeData> newChilds = new ArrayList<NodeData>(cachedParentChilds.size() + 1);
- for (int ci = 0; ci < cachedParentChilds.size(); ci++)
- newChilds.add(cachedParentChilds.get(ci));
-
- newChilds.add(nodeData); // add
-
- nodesCache.put(data.getParentIdentifier(), newChilds); // cache new list
- if (log.isDebugEnabled())
- log.debug(name + ", put() add child node " + nodeData.getIdentifier());
- }
- }
- }
- }
- else
- {
- // add child property
- final List<PropertyData> cachedParentChilds = propertiesCache.get(data.getParentIdentifier());
- if (cachedParentChilds != null)
- {
- synchronized (cachedParentChilds)
- {
- int index = cachedParentChilds.indexOf(data);
- if (index >= 0)
- {
-
- cachedParentChilds.set(index, (PropertyData)data); // replace at current position
- if (log.isDebugEnabled())
- log.debug(name + ", put() update child property " + data.getIdentifier()
- + " at index #" + index);
-
- }
- else
- {
-
- List<PropertyData> newChilds = new ArrayList<PropertyData>(cachedParentChilds.size() + 1);
- for (int ci = 0; ci < cachedParentChilds.size(); ci++)
- newChilds.add(cachedParentChilds.get(ci));
-
- newChilds.add((PropertyData)data);
-
- propertiesCache.put(data.getParentIdentifier(), newChilds); // cache new list
- if (log.isDebugEnabled())
- log.debug(name + ", put() add child property " + data.getIdentifier());
- }
- }
- }
- }
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error put item data in cache: "
- + (data != null ? data.getQPath().getAsString() : "[null]"), e);
- }
- }
-
- public void addChildProperties(final NodeData parentData, final List<PropertyData> childItems)
- {
- if (enabled && parentData != null && childItems != null)
- {
-
- String logInfo = null;
- if (log.isDebugEnabled())
- {
- logInfo =
- "parent: " + parentData.getQPath().getAsString() + " " + parentData.getIdentifier() + " "
- + childItems.size();
- log.debug(name + ", addChildProperties() >>> " + logInfo);
- }
-
- final String parentIdentifier = parentData.getIdentifier();
- String operName = ""; // for debug/trace only
- try
- {
- // remove parent (no childs)
- operName = "removing parent";
- removeDeep(parentData, false);
-
- operName = "caching parent";
- putItem(parentData); // put parent in cache
-
- // [PN] 17.01.07 need to sync as the list can be accessed concurrently till the end of
- // addChildProperties()
- List<PropertyData> cp = childItems;
- synchronized (cp)
- {
-
- synchronized (propertiesCache)
- {
- // removing prev list of child properties from cache C
- operName = "removing child properties";
- removeChildProperties(parentIdentifier);
-
- operName = "caching child properties list";
- propertiesCache.put(parentIdentifier, cp); // put childs in cache CP
- }
-
- operName = "caching child properties";
- putItems(cp); // put childs in cache C
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error in addChildProperties() " + operName + ": parent "
- + (parentData != null ? parentData.getQPath().getAsString() : "[null]"), e);
- }
- if (log.isDebugEnabled())
- log.debug(name + ", addChildProperties() <<< " + logInfo);
- }
- }
-
- /**
- * Empty method for this cache impl.
- */
- public void addChildPropertiesList(NodeData parentData, List<PropertyData> childItems)
- {
- }
-
- public void addChildNodes(final NodeData parentData, final List<NodeData> childItems)
- {
- if (enabled && parentData != null && childItems != null)
- {
-
- String logInfo = null;
- if (log.isDebugEnabled())
- {
- logInfo =
- "parent: " + parentData.getQPath().getAsString() + " " + parentData.getIdentifier() + " "
- + childItems.size();
- log.debug(name + ", addChildNodes() >>> " + logInfo);
- }
-
- final String parentIdentifier = parentData.getIdentifier();
- String operName = ""; // for debug/trace only
- try
- {
- // remove parent (no childs)
- operName = "removing parent";
- removeDeep(parentData, false);
-
- operName = "caching parent";
- putItem(parentData); // put parent in cache
-
- // [PN] 17.01.07 need to sync as the list can be accessed concurrently till the end of
- // addChildNodes()
- List<NodeData> cn = childItems;
- synchronized (cn)
- {
-
- synchronized (nodesCache)
- {
- // removing prev list of child nodes from cache C
- operName = "removing child nodes";
- final List<NodeData> removedChildNodes = removeChildNodes(parentIdentifier, false);
-
- if (removedChildNodes != null && removedChildNodes.size() > 0)
- {
- operName = "search for stale child nodes not contains in the new list of childs";
- final List<NodeData> forRemove = new ArrayList<NodeData>();
- for (NodeData removedChildNode : removedChildNodes)
- {
- // used Object.equals(Object o), e.g. by UUID of nodes
- if (!cn.contains(removedChildNode))
- {
- // this child node has been removed from the list
- // we should remve it recursive in C, CN, CP
- forRemove.add(removedChildNode);
- }
- }
-
- if (forRemove.size() > 0)
- {
- operName = "removing stale child nodes not contains in the new list of childs";
- // do remove of removed child nodes recursive in C, CN, CP
- // we need here locks on cache, nodesCache, propertiesCache
- synchronized (propertiesCache)
- {
- for (NodeData removedChildNode : forRemove)
- {
- removeDeep(removedChildNode, true);
- }
- }
- }
- }
-
- operName = "caching child nodes list";
- nodesCache.put(parentIdentifier, cn); // put childs in cache CN
- }
-
- operName = "caching child nodes";
- putItems(cn); // put childs in cache C
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error in addChildNodes() " + operName + ": parent "
- + (parentData != null ? parentData.getQPath().getAsString() : "[null]"), e);
- }
- if (log.isDebugEnabled())
- log.debug(name + ", addChildNodes() <<< " + logInfo);
- }
- }
-
- protected void putItem(final ItemData data) throws Exception
- {
-
- if (log.isDebugEnabled())
- log.debug(name + ", putItem() " + data.getQPath().getAsString() + " " + data.getIdentifier() + " -- "
- + data);
-
- cache.put(data.getIdentifier(), data);
- cache.put(new CacheQPath(data.getParentIdentifier(), data.getQPath()), data);
- }
-
- protected ItemData getItem(final String identifier) throws Exception
- {
-
- final ItemData c = (ItemData)cache.get(identifier);
- if (log.isDebugEnabled())
- log.debug(name + ", getItem() " + identifier + " --> "
- + (c != null ? c.getQPath().getAsString() + " parent:" + c.getParentIdentifier() : "[null]"));
- return c;
- }
-
- /**
- * @param key
- * a InternalQPath path of item cached
- */
- protected ItemData getItem(final String parentUuid, final QPathEntry qname) throws Exception
- {
-
- // ask direct cache (C)
- final ItemData c = (ItemData)cache.get(new CacheQPath(parentUuid, qname));
- if (log.isDebugEnabled())
- log.debug(name + ", getItem() " + (c != null ? c.getQPath().getAsString() : "[null]") + " --> "
- + (c != null ? c.getIdentifier() + " parent:" + c.getParentIdentifier() : "[null]"));
- return c;
- }
-
- protected void putItems(final List<? extends ItemData> itemsList) throws Exception
- {
- final Map<Serializable, Object> subMap = new LinkedHashMap<Serializable, Object>();
- for (ItemData item : itemsList)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", putItems() " + item.getQPath().getAsString() + " " + item.getIdentifier()
- + " -- " + item);
-
- subMap.put(item.getIdentifier(), item);
- subMap.put(new CacheQPath(item.getParentIdentifier(), item.getQPath()), item);
- }
- cache.putMap(subMap);
- }
-
- public List<NodeData> getChildNodes(final NodeData parentData)
- {
-
- if (!enabled)
- return null;
-
- try
- {
- final List<NodeData> cn = nodesCache.get(parentData.getIdentifier());
- if (log.isDebugEnabled())
- {
- log.debug(name + ", getChildNodes() " + parentData.getQPath().getAsString() + " "
- + parentData.getIdentifier());
- final StringBuffer blog = new StringBuffer();
- if (cn != null)
- {
- blog.append("\n");
- for (NodeData nd : cn)
- {
- blog.append("\t\t" + nd.getQPath().getAsString() + " " + nd.getIdentifier() + "\n");
- }
- log.debug("\t-->" + blog.toString());
- }
- else
- {
- log.debug("\t--> null");
- }
- }
- return cn;
- }
- catch (Exception e)
- {
- log.error(name + ", Error in getChildNodes() parentData: "
- + (parentData != null ? parentData.getQPath().getAsString() : "[null]"), e);
- }
- return null; // nothing cached
- }
-
- public List<PropertyData> getChildProperties(final NodeData parentData)
- {
- if (enabled && parentData != null)
- {
- try
- {
- // we assume that parent cached too
- final List<PropertyData> cp = propertiesCache.get(parentData.getIdentifier());
-
- if (log.isDebugEnabled())
- {
- log.debug(name + ", getChildProperties() " + parentData.getQPath().getAsString() + " "
- + parentData.getIdentifier());
- final StringBuffer blog = new StringBuffer();
- if (cp != null)
- {
- blog.append("\n");
- for (PropertyData pd : cp)
- {
- blog.append("\t\t" + pd.getQPath().getAsString() + " " + pd.getIdentifier() + "\n");
- }
- log.debug("\t--> " + blog.toString());
- }
- else
- {
- log.debug("\t--> null");
- }
- }
-
- return cp;
- }
- catch (Exception e)
- {
- log.error(name + ", Error in getChildProperties() parentData: "
- + (parentData != null ? parentData.getQPath().getAsString() : "[null]"), e);
- }
- }
-
- return null; // nothing cached
- }
-
- /**
- * Wrapps {@link getChildProperties} in this cache impl.
- */
- public List<PropertyData> listChildProperties(final NodeData parentData)
- {
- return getChildProperties(parentData);
- }
-
- public boolean isEnabled()
- {
- return enabled;
- }
-
- public void setEnabled(boolean enabled)
- {
- this.enabled = enabled;
- }
-
- public void setMaxSize(int maxSize)
- {
- this.cache.setMaxSize(maxSize);
- }
-
- public void setLiveTime(long liveTime)
- {
- this.cache.setLiveTime(liveTime);
- }
-
- /**
- * Unload given property (outdated) from cache to be cached again. Add/update/remove mixins
- * usecase.
- */
- private void unloadProperty(PropertyData property) throws Exception
- {
- try
- {
- final ItemData parent = (ItemData)cache.get(property.getParentIdentifier());
- if (parent != null)
- // remove parent only (property like mixins lives inside the node data)
- removeDeep(parent, false);
- }
- catch (Exception e)
- {
- log.error("unloadProperty operation (remove of parent) fails. Parent ID=" + property.getParentIdentifier()
- + ". Error " + e, e);
- }
- finally
- {
- remove(property); // remove property
- }
- }
-
- // --------------------- ItemsPersistenceListener --------------
-
- private boolean needReload(ItemData data)
- {
- // [PN] Add ORed property NAMEs here to unload a parent on the save action
- return data.getQPath().getName().equals(Constants.JCR_MIXINTYPES)
- || data.getQPath().getName().equals(Constants.EXO_PERMISSIONS)
- || data.getQPath().getName().equals(Constants.EXO_OWNER);
- }
-
- public synchronized void onSaveItems(final ItemStateChangesLog changesLog)
- {
-
- if (!enabled)
- return;
-
- for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
- {
- ItemState state = iter.next();
- ItemData data = state.getData();
- if (log.isDebugEnabled())
- log.debug(name + ", onSaveItems() " + ItemState.nameFromValue(state.getState()) + " "
- + data.getQPath().getAsString() + " " + data.getIdentifier() + " parent:" + data.getParentIdentifier());
-
- try
- {
- if (state.isAdded())
- {
- if (!data.isNode() && needReload(data))
- unloadProperty((PropertyData)data);
- put(data);
- }
- else if (state.isUpdated())
- {
- if (data.isNode())
- // orderable nodes will be removed, to be loaded back from the persistence
- unloadNode((NodeData)data);
- else if (needReload(data))
- unloadProperty((PropertyData)data); // remove mixins
- put(data);
- }
- else if (state.isDeleted())
- {
- if (!data.isNode() && needReload(data))
- unloadProperty((PropertyData)data);
- else
- remove(data);
- }
- else if (state.isRenamed())
- {
- if (data.isNode())
- unloadNode((NodeData)data);
- else if (needReload(data))
- unloadProperty((PropertyData)data); // remove mixins
- put(data);
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error process onSaveItems action for item data: "
- + (data != null ? data.getQPath().getAsString() : "[null]"), e);
- }
- }
- }
-
- /**
- * Mark the item to be reloaded from the persistence.
- *
- * The case made be removing all descendats of the item parent. Same as remove(item) but not
- * delete
- */
- private void unloadNode(final NodeData item) throws Exception
- {
- final ItemData parent = (ItemData)cache.get(item.getParentIdentifier());
- // NOTE. it's possible that we have to not use the fact of caching and remove anyway by
- // data.getParentIdentifier()
- if (parent != null)
- {
- // remove the item parent (no whole tree)
- // removeDeep(parentData, false);
-
- if (item.isNode())
- {
- // remove child nodes of the item parent recursive
- synchronized (nodesCache)
- {
- synchronized (propertiesCache)
- {
- if (removeChildNodes(parent.getIdentifier(), true) == null)
- {
- // if no childs of the item (node) parent were cached - remove renamed node directly
- removeDeep(item, true);
- }
- }
- }
-
- // Traverse whole cache (C), select each descendant of the item and remove it from C. The
- // costly operation.
- removeSuccessors((NodeData)item);
- }
- else
- {
- // remove child properties of the item parent
- synchronized (propertiesCache)
- {
- removeChildProperties(parent.getIdentifier());
- // propertiesCache.remove(parentData.getIdentifier());
- }
- }
- }
- }
-
- // ---------------------------------------------------
-
- /**
- * Called by delete
- *
- * @param data
- */
- public void remove(final ItemData data)
- {
- if (!enabled)
- return;
-
- try
- {
- if (log.isDebugEnabled())
- log.debug(name + ", remove() " + data.getQPath().getAsString() + " " + data.getIdentifier());
-
- // do actual deep remove
- if (data.isNode())
- {
- synchronized (propertiesCache)
- {
- synchronized (nodesCache)
- {
- removeDeep(data, true);
- }
- }
- removeSuccessors((NodeData)data);
- }
- else
- {
- // [PN] 03.12.06 Fixed to forceDeep=true and synchronized block
- synchronized (propertiesCache)
- {
- removeDeep(data, true);
- }
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error remove item data from cache: "
- + (data != null ? data.getQPath().getAsString() : "[null]"), e);
- }
- }
-
- /**
- * Deep remove of an item in all caches (C, CN, CP). Outside must be sinchronyzed by cache(C). If
- * forceDeep=true then it must be sinchronyzed by cache(CN,CP) too.
- *
- * @param item
- * - ItemData of item removing
- * @param forceDeep
- * - if true then childs will be removed too, item's parent childs (nodes or properties)
- * will be removed also. if false - no actual deep remove will be done, the item only and
- * theirs 'phantom by identifier' if exists.
- */
- protected ItemData removeDeep(final ItemData item, final boolean forceDeep) throws Exception
- {
- if (log.isDebugEnabled())
- log.debug(name + ", removeDeep(" + forceDeep + ") >>> item " + item.getQPath().getAsString() + " "
- + item.getIdentifier());
-
- if (forceDeep)
- {
- removeRelations(item);
- }
-
- cache.remove(item.getIdentifier());
- final ItemData itemData = (ItemData)cache.remove(new CacheQPath(item.getParentIdentifier(), item.getQPath()));
- if (itemData != null && !itemData.getIdentifier().equals(item.getIdentifier()))
- {
- // same path but diff identifier node... phantom
- removeDeep(itemData, forceDeep);
- }
- if (log.isDebugEnabled())
- log.debug(name + ", removeDeep(" + forceDeep + ") <<< item " + item.getQPath().getAsString() + " "
- + item.getIdentifier());
- return itemData;
- }
-
- /**
- * Remove item relations in the cache(C,CN,CP) by Identifier in case of item remove from persisten
- * storage. Relations for a node it's a child nodes, properties and item in node's parent childs
- * list. Relations for a property it's a item in node's parent childs list.
- */
- protected void removeRelations(final ItemData item)
- {
- // removing child item data from list of childs of the parent
- try
- {
- if (item.isNode())
- {
- // removing childs of the node
- if (removeChildNodes(item.getIdentifier(), true) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", removeRelations() removeChildNodes() " + item.getIdentifier());
- }
- if (removeChildProperties(item.getIdentifier()) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", removeRelations() removeChildProperties() " + item.getIdentifier());
- }
-
- // removing child from the node's parent child nodes list
- if (removeChildNode(item.getParentIdentifier(), item.getIdentifier()) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", removeRelations() removeChildNode(parentIdentifier, childIdentifier) "
- + item.getParentIdentifier() + " " + item.getIdentifier());
- }
- }
- else
- {
- // removing child from the node's parent properties list
- if (removeChildProperty(item.getParentIdentifier(), item.getIdentifier()) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", removeRelations() removeChildProperty(parentIdentifier, childIdentifier) "
- + item.getParentIdentifier() + " " + item.getIdentifier());
- }
- }
- }
- catch (Exception e)
- {
- log.error(name + ", Error in removeRelations() item: "
- + (item != null ? item.getQPath().getAsString() : "[null]"), e);
- }
- }
-
- protected List<NodeData> removeChildNodes(final String parentIdentifier, final boolean forceDeep) throws Exception
- {
- final List<NodeData> childNodes = nodesCache.remove(parentIdentifier);
- if (childNodes != null)
- {
- // we have child nodes
- synchronized (childNodes)
- { // [PN] 17.01.07
- for (NodeData cn : childNodes)
- {
- removeDeep(cn, forceDeep);
- }
- }
- }
- return childNodes;
- }
-
- protected List<PropertyData> removeChildProperties(final String parentIdentifier) throws Exception
- {
- final List<PropertyData> childProperties = propertiesCache.remove(parentIdentifier);
- if (childProperties != null)
- {
- // we have child properties
- synchronized (childProperties)
- { // [PN] 17.01.07
- for (PropertyData cp : childProperties)
- {
- removeDeep(cp, false);
- }
- }
- }
- return childProperties;
- }
-
- protected PropertyData removeChildProperty(final String parentIdentifier, final String childIdentifier)
- throws Exception
- {
- final List<PropertyData> childProperties = propertiesCache.get(parentIdentifier);
- if (childProperties != null)
- {
- synchronized (childProperties)
- { // [PN] 17.01.07
- for (Iterator<PropertyData> i = childProperties.iterator(); i.hasNext();)
- {
- PropertyData cn = i.next();
- if (cn.getIdentifier().equals(childIdentifier))
- {
- // removedIndex = i;
- i.remove();
- break;
- }
- }
- }
- }
- return null;
- }
-
- protected NodeData removeChildNode(final String parentIdentifier, final String childIdentifier) throws Exception
- {
- final List<NodeData> childNodes = nodesCache.get(parentIdentifier);
- if (childNodes != null)
- {
- synchronized (childNodes)
- { // [PN] 17.01.07
- for (Iterator<NodeData> i = childNodes.iterator(); i.hasNext();)
- {
- NodeData cn = i.next();
- if (cn.getIdentifier().equals(childIdentifier))
- {
- i.remove();
- break;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Remove item by path. Path is a string, if an item's path equals given the item will be removed
- */
- protected void removeItem(final String itemPath)
- {
- final ItemRemoveSelector remover = new ItemRemoveSelector(itemPath);
- try
- {
- cache.select(remover);
- }
- catch (Exception e)
- {
- log.error(name + ", removeSuccessors() " + itemPath, e);
- }
- }
-
- // @Deprecated
- // protected void removeSuccessors(final String parentPath) {
- // final ByPathRemoveSelector remover = new ByPathRemoveSelector(parentPath);
- // try {
- // cache.select(remover);
- // } catch (Exception e) {
- // log.error(name + ", removeSuccessors() " + parentPath, e);
- // }
- // }
-
- /**
- * Remove successors by parent path. Path is a string, if an item's path starts with it then the
- * item will be removed
- */
- protected void removeSuccessors(final NodeData parent)
- {
- final ByParentRemoveSelector remover = new ByParentRemoveSelector(parent);
- try
- {
- cache.select(remover);
- }
- catch (Exception e)
- {
- log.error(name + ", removeSuccessors() " + parent.getQPath().getAsString(), e);
- }
- }
-
- // ------ internal selectors ------
-
- protected class ByParentRemoveSelector implements CachedObjectSelector
- {
-
- private final NodeData parent;
-
- protected ByParentRemoveSelector(NodeData parent)
- {
- this.parent = parent;
- }
-
- public void onSelect(ExoCache exoCache, Serializable key, ObjectCacheInfo value) throws Exception
- {
- try
- {
- ItemData removed = (ItemData)exoCache.remove(key);
- if (removed != null && key instanceof CacheQPath)
- exoCache.remove(removed.getIdentifier());
- }
- catch (Exception e)
- {
- log.error(name + ", ByParentRemoveSelector.onSelect() " + parent.getIdentifier() + ": "
- + parent.getQPath().getAsString() + " key: " + key, e);
- }
- }
-
- public boolean select(Serializable key, ObjectCacheInfo value)
- {
- if (key instanceof CacheQPath)
- {
- // path
- CacheQPath path = (CacheQPath)key;
- if (path.getQPath().isDescendantOf(parent.getQPath()))
- return true;
- }
- else
- {
- // id
- String id = (String)key;
- if (id.equals(parent.getIdentifier()))
- return true;
- }
-
- return false;
- }
- }
-
- @Deprecated
- protected class ByPathRemoveSelector implements CachedObjectSelector
- {
-
- private final String parentPath;
-
- protected ByPathRemoveSelector(String parentPath)
- {
- this.parentPath = parentPath;
- }
-
- public void onSelect(ExoCache exoCache, Serializable key, ObjectCacheInfo value) throws Exception
- {
- try
- {
- ItemData removed = (ItemData)exoCache.remove(key);
- if (removed != null)
- {
- exoCache.remove(removed.getIdentifier());
- }
- }
- catch (Exception e)
- {
- log.error(name + ", ByPathRemoveSelector.onSelect() " + parentPath + " key: " + key, e);
- }
- }
-
- public boolean select(Serializable key, ObjectCacheInfo value)
- {
- return ((String)key).startsWith(parentPath);
- }
- }
-
- protected class ItemRemoveSelector implements CachedObjectSelector
- {
-
- private final String itemPath;
-
- protected ItemRemoveSelector(String itemPath)
- {
- this.itemPath = itemPath;
- }
-
- public void onSelect(ExoCache exoCache, Serializable key, ObjectCacheInfo value) throws Exception
- {
- try
- {
- ItemData removed = (ItemData)exoCache.remove(key);
- if (removed != null)
- {
- exoCache.remove(removed.getIdentifier());
- }
- }
- catch (Exception e)
- {
- log.error(name + ", ItemRemoveSelector.onSelect() " + itemPath + " key: " + key, e);
- }
- }
-
- public boolean select(Serializable key, ObjectCacheInfo value)
- {
- return ((String)key).equals(itemPath);
- }
- }
-
- /**
- * Remove relations in CN and CP for item expired in C
- */
- protected class ExpiredListener implements CacheListener
- {
-
- public void onExpire(ExoCache cache, Serializable key, Object obj) throws Exception
- {
- if (obj == null)
- return;
-
- ItemData item = (ItemData)obj;
-
- // log.info("expired " + item.getQPath().getAsString());
-
- if (item.isNode())
- {
- // removing childs of the node
- if (removeChildNodes(item.getIdentifier(), false) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", onExpire() removeChildNodes() " + item.getIdentifier());
- }
- if (removeChildProperties(item.getIdentifier()) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", onExpire() removeChildProperties() " + item.getIdentifier());
- }
- }
- else
- {
- // removing child properties of the item parent
- if (removeChildProperties(item.getParentIdentifier()) != null)
- {
- if (log.isDebugEnabled())
- log.debug(name + ", onExpire() parent.removeChildProperties() " + item.getParentIdentifier());
- }
- }
- }
-
- public void onClearCache(ExoCache cache) throws Exception
- {
- }
-
- public void onGet(ExoCache cache, Serializable key, Object obj) throws Exception
- {
- }
-
- public void onPut(ExoCache cache, Serializable key, Object obj) throws Exception
- {
- }
-
- public void onRemove(ExoCache cache, Serializable key, Object obj) throws Exception
- {
- }
-
- public void onClearCache(CacheListenerContext context) throws Exception
- {
- // TODO Auto-generated method stub
-
- }
-
- public void onExpire(CacheListenerContext context, Serializable key, Object obj) throws Exception
- {
- // TODO Auto-generated method stub
-
- }
-
- public void onGet(CacheListenerContext context, Serializable key, Object obj) throws Exception
- {
- // TODO Auto-generated method stub
-
- }
-
- public void onPut(CacheListenerContext context, Serializable key, Object obj) throws Exception
- {
- // TODO Auto-generated method stub
-
- }
-
- public void onRemove(CacheListenerContext context, Serializable key, Object obj) throws Exception
- {
- // TODO Auto-generated method stub
-
- }
- }
-}
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2009-12-21 15:17:42 UTC (rev 1133)
@@ -0,0 +1,1050 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
+
+import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.config.CacheEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.dataflow.ItemState;
+import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.<p/>
+ *
+ * Cache based on JBossCache.<p/>
+ *
+ * <pre>
+ * TODO
+ * 1. cache transparent: or item cached or not, we should not generate "not found" Exceptions
+ * 2. all child nodes should be evicted from parent at same time (Ids of childs)
+ * 3. node should not be evicted if listed in child nodes somewhere, or
+ * eviction of a node causes eviction of whole childs list
+ * 4. properties in attributes of a node, they will be evicted with the node at same time
+ * 5. but property should not be evicted if listed in attributes of a node somewhere, or
+ * eviction of a property causes eviction of its parent node (and as a result eviction
+ * of childs where this node listed)
+ * 6. or we have fully independent ITEMS and CHILD_NODES with CHILD_PROPS
+ * i.e. CHILD_x contains real ItemDatas of all childs of a parent.
+ * It will be simple for eviction policy but will cause more replication traffic
+ * as will replicated dublicated data often.
+ * ITEMS for read by Id only. CHILD_x for read by parentId and name,
+ * first read CHILD_NODES, if not found read CHILD_PROPS.
+ * Only a small data will be replicated, not so big deal IMO.
+ * Good that CHILD_x and ITEMS will live its own lifecycles, and will be populated on demand independently.
+ * </pre>
+ *
+ * <pre>
+ * TODO #2
+ * 1. CHILD_x should be consistent with ITEMS (e.g. via custom eviction policy), otherwise it's should be only ITEMS.
+ * 2. CHILD_x_LIST should be consistent as list, i.e. if one of child record evicted, the whole list should be removed.
+ * </pre>
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
+ * @version $Id: JBossCacheWorkspaceStorageCache.java 13869 2008-05-05 08:40:10Z pnedonosko $
+ */
+public class JBossCacheWorkspaceStorageCache implements WorkspaceStorageCache
+{
+
+ private static final Log LOG = ExoLogger.getLogger("jcr.JBossCacheWorkspaceStorageCache");
+
+ public static final String JBOSSCACHE_CONFIG = "jbosscache-configuration";
+
+ public static final String ITEMS = "$ITEMS".intern();
+
+ public static final String CHILD_NODES = "$CHILD_NODES".intern();
+
+ public static final String CHILD_PROPS = "$CHILD_PROPS".intern();
+
+ public static final String CHILD_NODES_LIST = "$CHILD_NODES_LIST".intern();
+
+ public static final String CHILD_PROPS_LIST = "$CHILD_PROPS_LIST".intern();
+
+ public static final String LOCKS = "$LOCKS".intern();
+
+ public static final String REFS = "$REFS".intern();
+
+ public static final String ITEM_DATA = "$data".intern();
+
+ public static final String ITEM_ID = "$id".intern();
+
+ /**
+ * Empty cache node data for CHILD_x_LIST.
+ */
+ public static final Map<Serializable, Object> NULL_DATA = Collections.emptyMap();
+
+ public static final Set<String> NO_CHILDS = Collections.emptySet();
+
+ protected final Cache<Serializable, Object> cache;
+
+ protected final Fqn<String> itemsRoot;
+
+ protected final Fqn<String> childNodes;
+
+ protected final Fqn<String> childProps;
+
+ protected final Fqn<String> childNodesList;
+
+ protected final Fqn<String> childPropsList;
+
+ protected final Fqn<String> refsRoot;
+
+ protected boolean txStarted = false;
+
+ /**
+ * Node order comparator for getChildNodes().
+ */
+ class NodesOrderComparator<N extends NodeData> implements Comparator<NodeData>
+ {
+
+ /**
+ * {@inheritDoc}
+ */
+ public int compare(NodeData n1, NodeData n2)
+ {
+ return n1.getOrderNumber() - n2.getOrderNumber();
+ }
+ }
+
+ class ChildItemsIterator<T extends ItemData> implements Iterator<T>
+ {
+
+ final Iterator<Object> childs;
+
+ final String parentId;
+
+ final Fqn<String> root;
+
+ T next;
+
+ ChildItemsIterator(Fqn<String> root, String parentId)
+ {
+ this.parentId = parentId;
+ this.root = root;
+
+ Fqn<String> parentFqn = makeChildListFqn(root, parentId);
+ // TODO replace getNode with get attr -> use ITEMS with CHILDS etc
+ Node<Serializable, Object> parent = cache.getNode(parentFqn);
+ if (parent != null)
+ {
+ this.childs = cache.getChildrenNames(parentFqn).iterator();
+ fetchNext();
+ }
+ else
+ {
+ this.childs = null;
+ this.next = null;
+ }
+ }
+
+ protected void fetchNext()
+ {
+ if (childs.hasNext())
+ {
+ // traverse to the first existing or the end of childs
+ T n = null;
+ do
+ {
+ String itemId = (String)cache.get(makeChildListFqn(root, parentId, (String)childs.next()), ITEM_ID);
+ if (itemId != null)
+ {
+ n = (T)cache.get(makeItemFqn(itemId), ITEM_DATA);
+ }
+ }
+ while (n == null && childs.hasNext());
+ next = n;
+ }
+ else
+ {
+ next = null;
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return next != null;
+ }
+
+ public T next()
+ {
+ if (next == null)
+ {
+ throw new NoSuchElementException();
+ }
+
+ final T current = next;
+ fetchNext();
+ return current;
+ }
+
+ public void remove()
+ {
+ throw new IllegalArgumentException("Not implemented");
+ }
+ }
+
+ class ChildNodesIterator<N extends NodeData> extends ChildItemsIterator<N>
+ {
+
+ ChildNodesIterator(String parentId)
+ {
+ super(childNodes, parentId);
+ }
+
+ @Override
+ public N next()
+ {
+ return super.next();
+ }
+ }
+
+ class ChildPropertiesIterator<P extends PropertyData> extends ChildItemsIterator<P>
+ {
+
+ ChildPropertiesIterator(String parentId)
+ {
+ super(childProps, parentId);
+ }
+
+ @Override
+ public P next()
+ {
+ return super.next();
+ }
+ }
+
+ public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig) throws RepositoryException,
+ RepositoryConfigurationException
+ {
+ this(readJBCConfig(wsConfig));
+ }
+
+ protected static String readJBCConfig(final WorkspaceEntry wsConfig) throws RepositoryConfigurationException
+ {
+ if (wsConfig.getCache() != null)
+ {
+ return wsConfig.getCache().getParameterValue(JBOSSCACHE_CONFIG);
+ }
+ else
+ {
+ throw new RepositoryConfigurationException("Cache configuration not found");
+ }
+ }
+
+ /**
+ * JBossCacheWorkspaceStorageCache constructor.
+ *
+ */
+ public JBossCacheWorkspaceStorageCache(String jbcConfig) throws RepositoryException
+ {
+ CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+ LOG.info("JBoss Cache configuration used: " + jbcConfig);
+ this.cache = factory.createCache(jbcConfig, false);
+
+ this.cache.create();
+ this.cache.start();
+ //this.cache.addInterceptor(indexInterceptor, CacheStoreInterceptor.class);
+
+ Node<Serializable, Object> cacheRoot = cache.getRoot();
+
+ // TODO transaction
+
+ // prepare cache structures
+ txStart();
+ try
+ {
+ this.itemsRoot = Fqn.fromElements(ITEMS);
+ cacheRoot.addChild(this.itemsRoot).setResident(true);
+
+ this.childNodes = Fqn.fromElements(CHILD_NODES);
+ cacheRoot.addChild(this.childNodes).setResident(true);
+
+ this.childNodesList = Fqn.fromElements(CHILD_NODES_LIST);
+ cacheRoot.addChild(this.childNodesList).setResident(true);
+
+ this.childProps = Fqn.fromElements(CHILD_PROPS);
+ cacheRoot.addChild(this.childProps).setResident(true);
+
+ this.childPropsList = Fqn.fromElements(CHILD_PROPS_LIST);
+ cacheRoot.addChild(this.childPropsList).setResident(true);
+
+ this.refsRoot = Fqn.fromElements(REFS);
+ cacheRoot.addChild(refsRoot).setResident(true);
+
+ // TODO apply locks
+ //this.locks = cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.LOCKS));
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ throw new RepositoryException("Cannot preare cache", e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void put(ItemData item)
+ {
+ txStart();
+ try
+ {
+ putItem(item);
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ LOG.error("put error " + (item != null ? item.getQPath().getAsString() : item), e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void remove(ItemData item)
+ {
+ txStart();
+ try
+ {
+ removeItem(item);
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ LOG.error("remove error " + (item != null ? item.getQPath().getAsString() : item), e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onSaveItems(final ItemStateChangesLog itemStates)
+ {
+ txStart();
+ try
+ {
+
+ ItemState prevState = null;
+
+ for (ItemState state : itemStates.getAllStates())
+ {
+
+ if (state.isAdded())
+ {
+ if (state.isPersisted())
+ {
+ putItem(state.getData());
+ }
+ }
+ else if (state.isUpdated())
+ {
+ if (state.isPersisted())
+ {
+ ItemData prevItem = putItem(state.getData());
+ if (prevItem != null && state.isNode())
+ {
+ // nodes reordered, if prev is null it's InvalidItemState case
+ update((NodeData)state.getData(), (NodeData)prevItem);
+ }
+ }
+ }
+ else if (state.isDeleted())
+ {
+ removeItem(state.getData());
+ }
+ else if (state.isRenamed())
+ {
+ // TODO cleanup: update subtree paths
+ // if (prevState.isDeleted() && prevState.isNode())
+ // {
+ // renameNode((NodeData)prevState.getData(), (NodeData)state.getData());
+ // }
+ putItem(state.getData());
+ }
+ else if (state.isMixinChanged())
+ {
+ if (state.isPersisted())
+ {
+ // update subtree ACLs
+ updateMixin((NodeData)state.getData());
+ }
+ }
+ else
+ {
+ // TODO warn it?
+ }
+
+ prevState = state;
+ }
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ LOG.error("onSaveItems error " + itemStates, e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildNodes(NodeData parent, List<NodeData> childs)
+ {
+ txStart();
+ try
+ {
+ // remove previous all (to be sure about consistency)
+ cache.removeNode(makeChildListFqn(childNodesList, parent.getIdentifier()));
+
+ if (childs.size() > 0)
+ {
+ // add all new
+ for (NodeData child : childs)
+ {
+ putNode(child);
+ }
+ }
+ else
+ {
+ // cache fact of empty childs list
+ cache.put(makeChildListFqn(childNodesList, parent.getIdentifier()), NULL_DATA);
+ }
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ LOG.error("addChildNodes error " + (parent != null ? parent.getQPath().getAsString() : parent), e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildProperties(NodeData parent, List<PropertyData> childs)
+ {
+ txStart();
+ try
+ {
+ // remove previous all (to be sure about consistency)
+ cache.removeNode(makeChildListFqn(childPropsList, parent.getIdentifier()));
+
+ if (childs.size() > 0)
+ {
+ // add all new
+ for (PropertyData child : childs)
+ {
+ putProperty(child);
+ }
+ }
+ else
+ {
+ LOG.warn("Empty properties list cached " + (parent != null ? parent.getQPath().getAsString() : parent));
+ }
+
+ txCommit();
+ }
+ catch (Throwable e)
+ {
+ txRollback();
+ LOG.error("addChildProperties error " + (parent != null ? parent.getQPath().getAsString() : parent), e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildPropertiesList(NodeData parent, List<PropertyData> childProperties)
+ {
+ // TODO not implemented, will force read from DB
+
+ // start();
+ // try
+ // {
+ // commit();
+ // }
+ // catch (Throwable e)
+ // {
+ // rollback();
+ // LOG.error("addChildNodes error " + parent.getQPath().getAsString(), e);
+ // }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData get(String parentId, QPathEntry name)
+ {
+
+ // get as node first
+ String itemId = (String)cache.get(makeChildFqn(childNodes, parentId, name), ITEM_ID);
+ if (itemId == null)
+ {
+ // try as property
+ itemId = (String)cache.get(makeChildFqn(childProps, parentId, name), ITEM_ID);
+ }
+
+ if (itemId != null)
+ {
+ return get(itemId);
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData get(String id)
+ {
+ return (ItemData)cache.get(makeItemFqn(id), ITEM_DATA);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodes(final NodeData parent)
+ {
+ final List<NodeData> childs = new ArrayList<NodeData>();
+ final Node<Serializable, Object> parentNode =
+ cache.getNode(makeChildListFqn(childNodesList, parent.getIdentifier()));
+ if (parentNode != null)
+ {
+ for (Object child : parentNode.getChildrenNames())
+ {
+ NodeData node = (NodeData)cache.get(makeItemFqn((String)child), ITEM_DATA);
+ if (node == null)
+ {
+ return null;
+ }
+
+ childs.add(node);
+ }
+
+ // order childs by orderNumber, as JBC returns childs in any order
+ Collections.sort(childs, new NodesOrderComparator<NodeData>());
+
+ return Collections.unmodifiableList(childs);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getChildProperties(NodeData parent)
+ {
+ return getChildProps(parent.getIdentifier(), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> listChildProperties(NodeData parent)
+ {
+ return getChildProps(parent.getIdentifier(), false);
+ }
+
+ /**
+ * Internal get child properties.
+ *
+ * @param parentId String
+ * @param withValue boolean, if true only "full" Propeties can be returned
+ * @return List of PropertyData
+ */
+ protected List<PropertyData> getChildProps(String parentId, boolean withValue)
+ {
+ final List<PropertyData> childs = new ArrayList<PropertyData>();
+ final Node<Serializable, Object> parentNode = cache.getNode(makeChildListFqn(childPropsList, parentId));
+ if (parentNode != null)
+ {
+ for (Object child : parentNode.getChildrenNames())
+ {
+ PropertyData node = (PropertyData)cache.get(makeItemFqn((String)child), ITEM_DATA);
+ if (node == null)
+ {
+ return null;
+ }
+
+ if (withValue && node.getValues().size() <= 0)
+ {
+ // don't return list of empty-valued props (but listChildProperties() can)
+ return null;
+ }
+
+ childs.add(node);
+ }
+
+ return Collections.unmodifiableList(childs);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public long getSize()
+ {
+ // TODO
+ return -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ // TODO
+ return true;
+ }
+
+ // ****************
+
+ protected void txStart()
+ {
+ if (!txStarted)
+ {
+ txStarted = true;
+ this.cache.startBatch();
+ }
+ }
+
+ protected void txCommit()
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("commit " + txStarted);
+ }
+
+ // end batch
+ if (txStarted)
+ {
+ this.cache.endBatch(true);
+ txStarted = false;
+ }
+ else
+ {
+ // TODO
+ LOG.warn("Commit call without changes made.");
+ }
+ }
+
+ protected void txRollback()
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("rollback " + txStarted);
+ }
+
+ // rollback batch
+ if (txStarted)
+ {
+ this.cache.endBatch(false);
+ txStarted = false;
+ }
+ else
+ {
+ // TODO
+ LOG.warn("Rollback call without changes made.");
+ }
+ }
+
+ /**
+ * Make Item absolute Fqn, i.e. /$ITEMS/itemID.
+ *
+ * @param itemId String
+ * @return Fqn
+ */
+ protected Fqn<String> makeItemFqn(String itemId)
+ {
+ return Fqn.fromRelativeElements(itemsRoot, itemId);
+ }
+
+ /**
+ * Make child Item absolute Fqn, i.e. /root/parentId/childName.
+ *
+ * @param root Fqn
+ * @param parentId String
+ * @param childName QPathEntry
+ * @return Fqn
+ */
+ protected Fqn<String> makeChildFqn(Fqn<String> root, String parentId, QPathEntry childName)
+ {
+ return Fqn.fromRelativeElements(root, parentId, childName.getAsString(true));
+ }
+
+ /**
+ * Make child absolute Fqn, i.e. /root/parentId/childId.
+ *
+ * @param root Fqn
+ * @param parentId String
+ * @param itemId String
+ * @return Fqn
+ */
+ protected Fqn<String> makeChildListFqn(Fqn<String> root, String parentId, String childId)
+ {
+ return Fqn.fromRelativeElements(root, parentId, childId);
+ }
+
+ /**
+ * Make child node parent absolute Fqn, i.e. /root/itemId.
+ *
+ * @param root Fqn
+ * @param parentId String
+ * @return Fqn
+ */
+ protected Fqn<String> makeChildListFqn(Fqn<String> root, String parentId)
+ {
+ return Fqn.fromRelativeElements(root, parentId);
+ }
+
+ /**
+ * Internal put Item.
+ *
+ * @param item ItemData, new data to put in the cache
+ * @return ItemData, previous data or null
+ */
+ protected ItemData putItem(ItemData item)
+ {
+ if (item.isNode())
+ {
+ return putNode((NodeData)item);
+ }
+ else
+ {
+ return putProperty((PropertyData)item);
+ }
+ }
+
+ /**
+ * Internal put Node.
+ *
+ * @param node, NodeData, new data to put in the cache
+ * @return NodeData, previous data or null
+ */
+ protected ItemData putNode(NodeData node)
+ {
+ if (node.getParentIdentifier() != null)
+ {
+ // if not a root node
+
+ // add in CHILD_NODES
+ cache.put(makeChildFqn(childNodes, node.getParentIdentifier(), node.getQPath().getEntries()[node.getQPath()
+ .getEntries().length - 1]), ITEM_ID, node.getIdentifier());
+
+ // add in CHILD_NODES_LIST
+ // TODO
+ // Node<Serializable, Object> childsParent =
+ // cache.getNode(makeChildListFqn(childNodesList, node.getParentIdentifier()));
+ // if (childsParent != null)
+ // {
+ // cache.put(makeChildListFqn(childNodesList, node.getParentIdentifier(), node.getIdentifier()), NULL_DATA);
+ // }
+ cache.put(makeChildListFqn(childNodesList, node.getParentIdentifier(), node.getIdentifier()), NULL_DATA);
+ }
+
+ // add in ITEMS
+ return (ItemData)cache.put(makeItemFqn(node.getIdentifier()), ITEM_DATA, node);
+ }
+
+ /**
+ * Internal put Property.
+ *
+ * @param node, PropertyData, new data to put in the cache
+ * @return PropertyData, previous data or null
+ */
+ protected PropertyData putProperty(PropertyData prop)
+ {
+ // add in CHILD_PROPS
+ cache.put(makeChildFqn(childProps, prop.getParentIdentifier(), prop.getQPath().getEntries()[prop.getQPath()
+ .getEntries().length - 1]), ITEM_ID, prop.getIdentifier());
+
+ // add in CHILD_PROPS_LIST
+ // TODO
+ // Node<Serializable, Object> childsParent =
+ // cache.getNode(makeChildListFqn(childPropsList, prop.getParentIdentifier()));
+ // if (childsParent != null)
+ // {
+ // cache.put(makeChildListFqn(childPropsList, prop.getParentIdentifier(), prop.getIdentifier()), NULL_DATA);
+ // }
+ cache.put(makeChildListFqn(childPropsList, prop.getParentIdentifier(), prop.getIdentifier()), NULL_DATA);
+
+ // TODO REFERENCEs hadnling
+ //if (prop.getType() == PropertyType.REFERENCE)
+ //{
+ // addReferences(data);
+ //}
+
+ // add in ITEMS
+ return (PropertyData)cache.put(makeItemFqn(prop.getIdentifier()), ITEM_DATA, prop);
+ }
+
+ protected void removeItem(ItemData item)
+ {
+ if (item.isNode())
+ {
+ if (item.getParentIdentifier() != null)
+ {
+ // if not a root node
+
+ // remove from CHILD_NODES of parent
+ cache.removeNode(makeChildFqn(childNodes, item.getParentIdentifier(), item.getQPath().getEntries()[item
+ .getQPath().getEntries().length - 1]));
+
+ // remove from CHILD_NODES_LIST of parent
+ cache.removeNode(makeChildListFqn(childNodesList, item.getParentIdentifier(), item.getIdentifier()));
+
+ // remove from CHILD_NODES as parent
+ cache.removeNode(makeChildListFqn(childNodes, item.getIdentifier()));
+
+ // remove from CHILD_NODES_LIST as parent
+ cache.removeNode(makeChildListFqn(childNodesList, item.getIdentifier()));
+
+ // remove from CHILD_PROPS as parent
+ cache.removeNode(makeChildListFqn(childProps, item.getIdentifier()));
+
+ // remove from CHILD_PROPS_LIST as parent
+ cache.removeNode(makeChildListFqn(childPropsList, item.getIdentifier()));
+ }
+ }
+ else
+ {
+ // remove from CHILD_PROPS
+ cache.removeNode(makeChildFqn(childProps, item.getParentIdentifier(), item.getQPath().getEntries()[item
+ .getQPath().getEntries().length - 1]));
+
+ // remove from CHILD_PROPS_LIST
+ cache.removeNode(makeChildListFqn(childPropsList, item.getParentIdentifier(), item.getIdentifier()));
+
+ // TODO REFERENCEs hadnling
+ //if (prop.getType() == PropertyType.REFERENCE)
+ //{
+ // addReferences(data);
+ //}
+ }
+
+ // remove from ITEMS
+ cache.removeNode(makeItemFqn(item.getIdentifier()));
+ }
+
+ @Deprecated
+ protected void renameNode(NodeData from, NodeData to)
+ {
+ // TODO do move more cache-friendly, i.e. change ACL & paths of whole cached sub-tree
+
+ // remove "from", whole subtree will be removed
+ removeItem(from);
+
+ // add "to" only root will be added
+ // moved subtree will be populated to the cache on read
+ putItem(to);
+ }
+
+ /**
+ * Update Node's mixin and ACL.
+ *
+ * @param node NodeData
+ */
+ protected void updateMixin(NodeData node)
+ {
+ NodeData prevData = (NodeData)cache.put(makeItemFqn(node.getIdentifier()), ITEM_DATA, node);
+ if (prevData != null)
+ {
+ // do update ACL if needed
+ if (!prevData.getACL().equals(node.getACL()))
+ {
+ updateChildsACL(node.getIdentifier(), node.getACL());
+ }
+ }
+ else if (LOG.isDebugEnabled())
+ {
+ LOG.debug("Previous NodeData not found for mixin update " + node.getQPath().getAsString());
+ }
+ }
+
+ /**
+ * Update Node hierachy in case of same-name siblings reorder.
+ * Assumes the new (updated) nodes already putted in the cache. Previous name of updated nodes will be calculated
+ * and that node will be deleted (if has same id as the new node). Childs paths will be updated to a new node path.
+ *
+ * @param node NodeData
+ * @param prevNode NodeData
+ */
+ protected void update(final NodeData node, final NodeData prevNode)
+ {
+ // get previously cached NodeData and using its name remove child on the parent
+ Fqn<String> prevFqn =
+ makeChildFqn(childNodes, node.getParentIdentifier(), prevNode.getQPath().getEntries()[prevNode.getQPath()
+ .getEntries().length - 1]);
+ if (node.getIdentifier().equals(cache.get(prevFqn, ITEM_ID)))
+ {
+ // it's same-name siblings re-ordering, delete previous child
+ if (!cache.removeNode(prevFqn) && LOG.isDebugEnabled())
+ {
+ LOG.debug("Node not extists as a child but update asked " + node.getQPath().getAsString());
+ }
+ }
+
+ // update childs paths if index changed
+ int nodeIndex = node.getQPath().getEntries()[node.getQPath().getEntries().length - 1].getIndex();
+ int prevNodeIndex = prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1].getIndex();
+ if (nodeIndex != prevNodeIndex)
+ {
+ updateTreePath(node.getIdentifier(), node.getQPath(), null); // don't change ACL, it's same parent
+ }
+ }
+
+ /**
+ * Update Nodes tree with new path.
+ *
+ * @param parentId String - root node id of JCR subtree.
+ * @param rootPath QPath
+ * @param acl AccessControlList
+ */
+ protected void updateTreePath(final String parentId, final QPath rootPath, final AccessControlList acl)
+ {
+ boolean inheritACL = acl != null;
+
+ // update properties
+ // TODO for (Object child : cache.getChildrenNames(makeChildListFqn(childPropsList, parentId)))
+ for (Iterator<PropertyData> iter = new ChildPropertiesIterator<PropertyData>(parentId); iter.hasNext();)
+ {
+ PropertyData prevProp = iter.next();
+
+ // TODO if ACL related set on this Node...
+ if (inheritACL
+ && (prevProp.getQPath().getName().equals(Constants.EXO_PERMISSIONS) || prevProp.getQPath().getName()
+ .equals(Constants.EXO_OWNER)))
+ {
+ inheritACL = false;
+ }
+
+ // recreate with new path for child Props only
+ QPath newPath =
+ QPath
+ .makeChildPath(rootPath, prevProp.getQPath().getEntries()[prevProp.getQPath().getEntries().length - 1]);
+ TransientPropertyData newProp =
+ new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(), prevProp
+ .getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued());
+ newProp.setValues(prevProp.getValues());
+ cache.put(makeItemFqn(newProp.getIdentifier()), ITEM_DATA, newProp);
+ }
+
+ // update child nodes
+ // TODO for (Object child : cache.getChildrenNames(makeChildListFqn(childNodesList, parentId)))
+ for (Iterator<NodeData> iter = new ChildNodesIterator<NodeData>(parentId); iter.hasNext();)
+ {
+ NodeData prevNode = iter.next();
+
+ // recreate with new path for child Nodes only
+ QPath newPath =
+ QPath
+ .makeChildPath(rootPath, prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1]);
+ TransientNodeData newNode =
+ new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(), prevNode
+ .getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(), prevNode
+ .getParentIdentifier(), inheritACL ? acl : prevNode.getACL()); // TODO check ACL
+
+ // update this node
+ cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
+
+ // update childs recursive
+ updateTreePath(newNode.getIdentifier(), newNode.getQPath(), inheritACL ? acl : null);
+ }
+ }
+
+ /**
+ * Update child Nodes ACLs.
+ *
+ * @param parentId String - root node id of JCR subtree.
+ * @param acl AccessControlList
+ */
+ protected void updateChildsACL(final String parentId, final AccessControlList acl)
+ {
+ for (Iterator<NodeData> iter = new ChildNodesIterator<NodeData>(parentId); iter.hasNext();)
+ {
+ NodeData prevNode = iter.next();
+
+ // is ACL changes on this node (i.e. ACL inheritance brokes)
+ for (InternalQName mixin : prevNode.getMixinTypeNames())
+ {
+ if (mixin.equals(Constants.EXO_PRIVILEGEABLE) || mixin.equals(Constants.EXO_OWNEABLE))
+ {
+ continue;
+ }
+ }
+
+ // recreate with new path for child Nodes only
+ TransientNodeData newNode =
+ new TransientNodeData(prevNode.getQPath(), prevNode.getIdentifier(), prevNode.getPersistedVersion(),
+ prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(), prevNode
+ .getParentIdentifier(), acl);
+
+ // update this node
+ cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
+
+ // update childs recursive
+ updateChildsACL(newNode.getIdentifier(), acl);
+ }
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2009-12-21 15:17:42 UTC (rev 1133)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent;
+
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id$
+ */
+public class TestJBossCacheWorkspaceStorageCache extends WorkspaceStorageCacheBaseCase
+{
+
+ @Override
+ public WorkspaceStorageCache getCacheImpl() throws Exception
+ {
+ return new JBossCacheWorkspaceStorageCache("conf/standalone/test-jbosscache-config.xml");
+ }
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedWorkspaceStorageCache.java 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedWorkspaceStorageCache.java 2009-12-21 15:17:42 UTC (rev 1133)
@@ -25,7 +25,7 @@
* Created by The eXo Platform SAS.
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: TestLinkedWorkspaceStorageCache.java 34801 2009-07-31 15:44:50Z dkatayev $
+ * @version $Id$
*/
public class TestLinkedWorkspaceStorageCache extends WorkspaceStorageCacheBaseCase
{
@@ -33,7 +33,12 @@
@Override
public WorkspaceStorageCache getCacheImpl() throws Exception
{
- return new LinkedWorkspaceStorageCacheImpl((WorkspaceEntry)session.getContainer().getComponentInstanceOfType(
- WorkspaceEntry.class));
- }
+ /*String name, boolean enabled, int maxSize, long liveTimeSec,
+ long cleanerPeriodMillis, long statisticPeriodMillis, boolean deepDelete, boolean cleanStatistics,
+ int blockingUsers, boolean showStatistic*/
+ return new LinkedWorkspaceStorageCacheImpl("test_WorkspaceStorageCacheBaseCase", true,
+ 100 * 1024, 120, 5 * 60000, 30000, false, true, 0, false);
+ //return new LinkedWorkspaceStorageCacheImpl((WorkspaceEntry)session.getContainer().getComponentInstanceOfType(
+ // WorkspaceEntry.class));
+ }
}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedWorkspaceStorageCache.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml 2009-12-21 15:17:42 UTC (rev 1133)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <!-- Configure the TransactionManager -->
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
+
+ <!-- Enable batching -->
+ <invocationBatching enabled="true"/>
+</jbosscache>
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-12-21 15:17:42 UTC (rev 1133)
@@ -66,12 +66,9 @@
</properties>
</initializer
-->
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- <property name="statistic-period" value="30" />
- <property name="statistic-log" value="false" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -110,10 +107,9 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -150,10 +146,9 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -218,13 +213,11 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
+ </properties>
+ </cache>
<query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
@@ -279,10 +272,9 @@
<property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -334,10 +326,9 @@
<property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -380,10 +371,9 @@
<property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
</properties>
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBCCACHE/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/pom.xml 2009-12-21 15:14:44 UTC (rev 1132)
+++ jcr/branches/1.12.0-JBCCACHE/pom.xml 2009-12-21 15:17:42 UTC (rev 1133)
@@ -295,7 +295,7 @@
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.2.1</version>
+ <version>1.2.2</version>
</dependency>
<dependency>
<groupId>concurrent</groupId>
@@ -352,7 +352,11 @@
<artifactId>commons-io</artifactId>
<version>1.3</version>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.2.0.GA</version>
+ </dependency>
</dependencies>
</dependencyManagement>
16 years, 7 months