exo-jcr SVN: r4791 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: storage/jdbc and 1 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-08-23 05:05:53 -0400 (Tue, 23 Aug 2011)
New Revision: 4791
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
Log:
EXOJCR-1483 : applying patch.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-08-23 08:23:01 UTC (rev 4790)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-08-23 09:05:53 UTC (rev 4791)
@@ -382,11 +382,11 @@
// reuse this connection as system
? systemDataContainer.reuseConnection(thisConnection)
// or open one new system
- : systemDataContainer.openConnection()
+ : systemDataContainer.openConnection(false)
// else if it's same container instances (system and this)
: thisConnection == null
// and non-system connection doens't exist - open it
- ? thisConnection = dataContainer.openConnection()
+ ? thisConnection = dataContainer.openConnection(false)
// if already open - use it
: thisConnection)
// system connection opened - use it
@@ -404,11 +404,11 @@
// reuse system connection as this
? dataContainer.reuseConnection(systemConnection)
// or open one new
- : dataContainer.openConnection()
+ : dataContainer.openConnection(false)
// else if it's same container instances (system and this)
: systemConnection == null
// and system connection doens't exist - open it
- ? systemConnection = dataContainer.openConnection()
+ ? systemConnection = dataContainer.openConnection(false)
// if already open - use it
: systemConnection)
// this connection opened - use it
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-08-23 08:23:01 UTC (rev 4790)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-08-23 09:05:53 UTC (rev 4791)
@@ -242,7 +242,7 @@
// if conn.setAutoCommit(false) called twise or more times with value
// 'false'.
// TODO remove workaround for Sybase, jconn 6.05 Build 26564
- if (dbConnection.getAutoCommit())
+ if (!readOnly && dbConnection.getAutoCommit())
{
dbConnection.setAutoCommit(false);
}
@@ -347,7 +347,7 @@
{
closeStatements();
- if (!this.readOnly)
+ if (!readOnly)
{
dbConnection.rollback();
}
@@ -384,14 +384,8 @@
{
closeStatements();
- // If READ-ONLY status back it to READ-WRITE (we assume it was original state)
- if (readOnly)
+ if (!readOnly && dbConnection.getTransactionIsolation() > Connection.TRANSACTION_READ_COMMITTED)
{
- dbConnection.setReadOnly(true);
- }
-
- if (dbConnection.getTransactionIsolation() > Connection.TRANSACTION_READ_COMMITTED)
- {
dbConnection.rollback();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-08-23 08:23:01 UTC (rev 4790)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-08-23 09:05:53 UTC (rev 4791)
@@ -835,12 +835,12 @@
new SharedConnectionFactory(((JDBCStorageConnection)original).getJdbcConnection(), containerName, multiDb,
valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
- return STATISTICS_ENABLED ? new StatisticsJDBCStorageConnection(cFactory.openConnection()) : cFactory
- .openConnection();
+ return STATISTICS_ENABLED ? new StatisticsJDBCStorageConnection(cFactory.openConnection(false)) : cFactory
+ .openConnection(false);
}
else
{
- return openConnection();
+ return openConnection(false);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2011-08-23 08:23:01 UTC (rev 4790)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2011-08-23 09:05:53 UTC (rev 4791)
@@ -158,7 +158,7 @@
@Override
public WorkspaceStorageConnection openConnection() throws RepositoryException
{
- return openConnection(false);
+ return openConnection(true);
}
/**
@@ -197,12 +197,6 @@
Connection conn = dbDataSource != null ? dbDataSource.getConnection() : (dbUserName != null ? DriverManager
.getConnection(dbUrl, dbUserName, dbPassword) : DriverManager.getConnection(dbUrl));
- if (readOnly)
- {
- // set this feature only if it asked
- conn.setReadOnly(readOnly);
- }
-
return conn;
}
catch (SQLException e)
12 years, 8 months
exo-jcr SVN: r4790 - in jcr/trunk: packaging/module/src/main/javascript and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-08-23 04:23:01 -0400 (Tue, 23 Aug 2011)
New Revision: 4790
Modified:
jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js
jcr/trunk/pom.xml
Log:
EXOJCR-1470 : getting rid of commons-io
Modified: jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js
===================================================================
--- jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js 2011-08-23 08:16:31 UTC (rev 4789)
+++ jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js 2011-08-23 08:23:01 UTC (rev 4790)
@@ -22,7 +22,6 @@
addDependency(new Project("jcr", "jcr", "jar", "1.0")).
addDependency(new Project("concurrent", "concurrent", "jar", "1.3.4")).
addDependency(new Project("org.jgroups", "jgroups", "jar", "2.6.20.Final")).
- addDependency(new Project("commons-io", "commons-io", "jar", "1.3.2")).
addDependency(new Project("org.jboss.cache","jbosscache-core","jar","3.2.7.GA")).
addDependency(new Project("jboss.jbossts","jbossjts","jar","4.6.1.GA")).
addDependency(new Project("jboss.jbossts","jbossts-common","jar","4.6.1.GA")).
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2011-08-23 08:16:31 UTC (rev 4789)
+++ jcr/trunk/pom.xml 2011-08-23 08:23:01 UTC (rev 4790)
@@ -359,11 +359,6 @@
<version>1.5</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.2.7.GA</version>
12 years, 8 months
exo-jcr SVN: r4789 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan and 2 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-08-23 04:16:31 -0400 (Tue, 23 Aug 2011)
New Revision: 4789
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
jcr/trunk/exo.jcr.framework.command/pom.xml
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
Log:
EXOJCR-1470 : getting rid of commons-io
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-22 14:38:50 UTC (rev 4788)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-23 08:16:31 UTC (rev 4789)
@@ -168,10 +168,6 @@
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
<version>2.6.20.Final</version>
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2011-08-22 14:38:50 UTC (rev 4788)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2011-08-23 08:16:31 UTC (rev 4789)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.jcr.infinispan;
-import org.apache.commons.io.IOUtils;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
@@ -37,6 +36,8 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
import java.net.URL;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
@@ -62,6 +63,7 @@
public static final String INFINISPAN_CONFIG = "infinispan-configuration";
private final ConfigurationManager configurationManager;
+
private final TemplateConfigurationHelper configurationHelper;
private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.InfinispanCacheFactory");
@@ -78,9 +80,9 @@
public MBeanServer getMBeanServer(Properties properties)
{
return ExoContainerContext.getTopContainer().getMBeanServer();
- }
+ }
};
-
+
/**
* Creates InfinispanCacheFactory with provided configuration transaction managers.
* Transaction manager will later be injected to cache instance.
@@ -189,7 +191,19 @@
try
{
log.info("Custom JGroups configuration set: " + jgroupsConfigURL);
- p.setProperty("configurationXml", IOUtils.toString(jgroupsConfigInputStream));
+
+ // Read stream content into StringWriter
+ StringWriter sw = new StringWriter();
+ InputStreamReader in = new InputStreamReader(jgroupsConfigInputStream);
+
+ char[] buffer = new char[1024];
+ int n = 0;
+ while (-1 != (n = in.read(buffer)))
+ {
+ sw.write(buffer, 0, n);
+ }
+
+ p.setProperty("configurationXml", sw.toString());
p.remove("configurationFile");
}
finally
@@ -217,8 +231,8 @@
// Ensure that the cluster name won't be used between 2 ExoContainers
gc.fluent().transport().clusterName(gc.getClusterName() + "_" + container.getContext().getName())
.globalJmxStatistics().cacheManagerName(gc.getCacheManagerName() + "_" + container.getContext().getName()).
- // Configure the MBeanServerLookup
- mBeanServerLookup(MBEAN_SERVER_LOOKUP);
+ // Configure the MBeanServerLookup
+ mBeanServerLookup(MBEAN_SERVER_LOOKUP);
Configuration conf = manager.getDefaultConfiguration();
if (CACHE_MANAGERS.containsKey(gc))
{
Modified: jcr/trunk/exo.jcr.framework.command/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.framework.command/pom.xml 2011-08-22 14:38:50 UTC (rev 4788)
+++ jcr/trunk/exo.jcr.framework.command/pom.xml 2011-08-23 08:16:31 UTC (rev 4789)
@@ -52,10 +52,6 @@
<artifactId>commons-fileupload</artifactId>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2011-08-22 14:38:50 UTC (rev 4788)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2011-08-23 08:16:31 UTC (rev 4789)
@@ -25,12 +25,10 @@
import org.exoplatform.frameworks.jcr.command.JCRCommandHelper;
import org.exoplatform.frameworks.jcr.command.web.GenericWebAppContext;
-import java.io.File;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Locale;
import java.util.Map;
import javax.jcr.Node;
@@ -60,7 +58,9 @@
String type = (String)context.get("Type");
if (type == null)
+ {
type = "";
+ }
// // To limit browsing set Servlet init param "digitalAssetsPath"
// // with desired JCR path
@@ -88,7 +88,9 @@
String workspace = (String)webCtx.get(AppConstants.DIGITAL_ASSETS_PROP);
if (workspace == null)
+ {
workspace = AppConstants.DEFAULT_DIGITAL_ASSETS_WS;
+ }
String currentFolderStr = getCurrentFolderPath(webCtx);
@@ -106,14 +108,25 @@
{
FileItem item = (FileItem)iter.next();
if (item.isFormField())
+ {
fields.put(item.getFieldName(), item.getString());
+ }
else
+ {
fields.put(item.getFieldName(), item);
+ }
}
FileItem uplFile = (FileItem)fields.get("NewFile");
// On IE, the file name is specified as an absolute path.
- String fileName = org.apache.commons.io.FilenameUtils.getName(uplFile.getName());
+ String fileName = uplFile.getName();
+ if (fileName != null)
+ {
+ int lastUnixPos = fileName.lastIndexOf("/");
+ int lastWindowsPos = fileName.lastIndexOf("\\");
+ int index = Math.max(lastUnixPos, lastWindowsPos);
+ fileName = fileName.substring(index + 1);
+ }
Node file =
JCRCommandHelper
12 years, 8 months
exo-jcr SVN: r4788 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent and 14 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-08-22 10:38:50 -0400 (Mon, 22 Aug 2011)
New Revision: 4788
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCacheListener.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLHolder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/BloomFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPathEntry.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
Log:
EXOJCR-1456: ACL bloom filters reverted
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -227,55 +227,6 @@
}
/**
- * Parse named parameter as Double.
- *
- * @param name
- * parameter name
- * @param defaultValue
- * default Double value
- * @return Double value
- */
- public Double getParameterDouble(String name, Double defaultValue)
- {
- for (int i = 0; i < parameters.size(); i++)
- {
- SimpleParameterEntry p = parameters.get(i);
- if (p.getName().equals(name))
- {
- try
- {
- return StringNumberParser.parseDouble(p.getValue());
- }
- catch (NumberFormatException e)
- {
- //LOG.warn(name + ": unparseable Long. " + e);
- }
- }
- }
- return defaultValue;
- }
-
- /**
- * Parse named parameter as Double.
- *
- * @param name
- * parameter name
- * @return Double value
- * @throws RepositoryConfigurationException
- */
- public Double getParameterDouble(String name) throws RepositoryConfigurationException
- {
- try
- {
- return StringNumberParser.parseDouble(getParameterValue(name));
- }
- catch (NumberFormatException e)
- {
- throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);
- }
- }
-
- /**
* Parse named parameter using {@link StringNumberParser.parseTime} and return time in
* milliseconds (Long value).
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -275,31 +275,16 @@
/**
* Start buffering process.
*/
- void beginTransaction();
+ public void beginTransaction();
/**
* Sort changes and commit data to the cache.
*/
- void commitTransaction();
+ public void commitTransaction();
/**
* Forget about changes
*/
- void rollbackTransaction();
+ public void rollbackTransaction();
- /**
- * Adds a new listener
- * @param listener the listener to register
- * @throws UnsupportedOperationException in case the listeners are not supported by the
- * implementation
- */
- void addListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException;
-
- /**
- * Removes a listener
- * @param listener the listener to remove
- * @throws UnsupportedOperationException in case the listeners are not supported by the
- * implementation
- */
- void removeListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException;
}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCacheListener.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCacheListener.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCacheListener.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.dataflow.persistent;
-
-import org.exoplatform.services.jcr.datamodel.ItemData;
-
-/**
- * This class allows other class to be notified when a given cache event occurs
- *
- * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
- * @version $Id$
- *
- */
-public interface WorkspaceStorageCacheListener
-{
- /**
- * Called when a cache entry corresponding to the given item has been added
- * @param data the item corresponding to the added cache entry
- */
- void onCacheEntryAdded(ItemData data);
-
- /**
- * Called when a cache entry corresponding to the given item has been updated
- * @param data the item corresponding to the updated cache entry
- */
- void onCacheEntryUpdated(ItemData data);
-
- /**
- * Called when a cache entry corresponding to the given item has been removed
- * @param data the item corresponding to the removed cache entry
- */
- void onCacheEntryRemoved(ItemData data);
-}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPath.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -469,34 +469,6 @@
}
/**
- * Make child path using QName and Item index. <br/>
- *
- * @param parent
- * - parent QPath
- * @param name
- * - Item QName
- * @param itemIndex
- * - Item index
- * @param id
- * - Item id
- * @return new QPath
- */
- public static QPath makeChildPath(final QPath parent, final QName name, final int itemIndex, String id)
- {
-
- QPathEntry[] parentEntries = parent.getEntries();
- QPathEntry[] names = new QPathEntry[parentEntries.length + 1];
- int index = 0;
- for (QPathEntry pname : parentEntries)
- {
- names[index++] = pname;
- }
- names[index] = new QPathEntry(name.getNamespace(), name.getName(), itemIndex, id);
-
- QPath path = new QPath(names);
- return path;
- }
- /**
* Make child path using array of QPath entries (relative path). <br/>
*
* @param parent
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPathEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPathEntry.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/QPathEntry.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -36,8 +36,6 @@
private String cachedToStringShowIndex;
- private String id;
-
/**
* QPathEntry constructor.
*
@@ -48,27 +46,10 @@
*/
public QPathEntry(InternalQName qName, int index)
{
- this(qName, index, null);
- }
-
-
- /**
- * QPathEntry constructor.
- *
- * @param qName
- * - InternalQName (full qualified name)
- * @param index
- * - Item index
- * @param id
- * - Item id
- */
- public QPathEntry(InternalQName qName, int index, String id)
- {
super(qName.getNamespace(), qName.getName());
this.index = index > 0 ? index : 1;
- this.id = id;
}
-
+
/**
* QPathEntry constructor.
*
@@ -81,26 +62,8 @@
*/
public QPathEntry(String namespace, String name, int index)
{
- this(namespace, name, index, null);
- }
-
- /**
- * QPathEntry constructor.
- *
- * @param namespace
- * - namespace URI
- * @param name
- * - Item name
- * @param index
- * - Item index
- * @param id
- * - Item id
- */
- public QPathEntry(String namespace, String name, int index, String id)
- {
super(namespace, name);
this.index = index > 0 ? index : 1;
- this.id = id;
}
/**
@@ -126,16 +89,6 @@
InternalQName qname = InternalQName.parse(qnameString);
return new QPathEntry(qname, Integer.valueOf(indexString));
- }
-
- /**
- * Return Item id, can be null since it could not be set
- *
- * @return the id of the item
- */
- public String getId()
- {
- return id;
}
/**
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLHolder.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLHolder.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLHolder.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 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;
-
-/**
- * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
- * @version $Id$
- *
- */
-public class ACLHolder
-{
- /**
- * The id of the node that holds some ACL info
- */
- private final String id;
-
- /**
- * A flag indicating whether or not the node has owner set
- */
- private boolean owner;
-
- /**
- * A flag indicating whether or not the node has permissions set
- */
- private boolean permissions;
-
- public ACLHolder(String id)
- {
- this.id = id;
- }
-
- /**
- * @return the id
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * @return the owner
- */
- public boolean hasOwner()
- {
- return owner;
- }
-
- /**
- * @return the permissions
- */
- public boolean hasPermissions()
- {
- return permissions;
- }
-
- /**
- * @param owner the owner to set
- */
- public void setOwner(boolean owner)
- {
- this.owner = owner;
- }
-
- /**
- * @param permissions the permissions to set
- */
- public void setPermissions(boolean permissions)
- {
- this.permissions = permissions;
- }
-}
Copied: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java (from rev 4769, jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java)
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -0,0 +1,174 @@
+/*
+ * 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.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.SharedDataManager;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.ItemType;
+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.core.itemfilters.QPathEntryFilter;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.util.Calendar;
+import java.util.List;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS. Data Manager supported ACL Inheritance
+ *
+ * @author Gennady Azarenkov
+ * @version $Id: ACLInheritanceSupportedWorkspaceDataManager.java 11907 2008-03-13 15:36:21Z ksm $
+ */
+public class ACLInheritanceSupportedWorkspaceDataManager implements SharedDataManager
+{
+
+ private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ACLInheritanceSupportedWorkspaceDataManager");
+
+ protected final CacheableWorkspaceDataManager persistentManager;
+
+ public ACLInheritanceSupportedWorkspaceDataManager(CacheableWorkspaceDataManager persistentManager)
+ {
+ this.persistentManager = persistentManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ // ------------ ItemDataConsumer impl ------------
+ public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException
+ {
+ return persistentManager.getChildNodesData(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> patternFilters) throws RepositoryException
+ {
+ return persistentManager.getChildNodesData(parent, patternFilters);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ throws RepositoryException
+ {
+ return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getLastOrderNumber(final NodeData parent) throws RepositoryException
+ {
+ return persistentManager.getLastOrderNumber(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getChildNodesCount(final NodeData parent) throws RepositoryException
+ {
+ return persistentManager.getChildNodesCount(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(NodeData parent, QPathEntry name) throws RepositoryException
+ {
+ return getItemData(parent, name, ItemType.UNKNOWN);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(NodeData parent, QPathEntry name, ItemType itemType) throws RepositoryException
+ {
+ return persistentManager.getItemData(parent, name, itemType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(String identifier) throws RepositoryException
+ {
+ return persistentManager.getItemData(identifier);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException
+ {
+ return persistentManager.getChildPropertiesData(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> itemDataFilters)
+ throws RepositoryException
+ {
+ return persistentManager.getChildPropertiesData(parent, itemDataFilters);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException
+ {
+ return persistentManager.listChildPropertiesData(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getReferencesData(String identifier, boolean skipVersionStorage)
+ throws RepositoryException
+ {
+ return persistentManager.getReferencesData(identifier, skipVersionStorage);
+ }
+
+ // ------------ SharedDataManager ----------------------
+
+ /**
+ * {@inheritDoc}
+ */
+ public void save(ItemStateChangesLog changes) throws InvalidItemStateException, UnsupportedOperationException,
+ RepositoryException
+ {
+ persistentManager.save(changes);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Calendar getCurrentTime()
+ {
+ return persistentManager.getCurrentTime();
+ }
+}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/BloomFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/BloomFilter.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/BloomFilter.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -1,403 +0,0 @@
-/*
- * Copyright (C) 2011 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 java.io.Serializable;
-import java.nio.charset.Charset;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.BitSet;
-import java.util.Collection;
-
-/**
- * Implementation of a Bloom-filter, as described here:
- * http://en.wikipedia.org/wiki/Bloom_filter
- *
- * Inspired by the SimpleBloomFilter-class written by Ian Clarke. This
- * implementation provides a more evenly distributed Hash-function by
- * using a proper digest instead of the Java RNG. Many of the changes
- * were proposed in comments in his blog:
- * http://blog.locut.us/2008/01/12/a-decent-stand-alone-java-bloom-filter-im...
- *
- * @param <E> Object type that is to be inserted into the Bloom filter, e.g. String or Integer.
- * @author Magnus Skjegstad <magnus(a)skjegstad.com>
- */
-public class BloomFilter<E> implements Serializable {
- private BitSet bitset;
- private int bitSetSize;
- private double bitsPerElement;
- private int expectedNumberOfFilterElements; // expected (maximum) number of elements to be added
- private int numberOfAddedElements; // number of elements actually added to the Bloom filter
- private int k; // number of hash functions
-
- static final Charset charset = Charset.forName("UTF-8"); // encoding used for storing hash values as strings
-
- static final String hashName = "MD5"; // MD5 gives good enough accuracy in most circumstances. Change to SHA1 if it's needed
- static final MessageDigest digestFunction;
- static { // The digest method is reused between instances
- MessageDigest tmp;
- try {
- tmp = java.security.MessageDigest.getInstance(hashName);
- } catch (NoSuchAlgorithmException e) {
- tmp = null;
- }
- digestFunction = tmp;
- }
-
- /**
- * Constructs an empty Bloom filter. The total length of the Bloom filter will be
- * c*n.
- *
- * @param c is the number of bits used per element.
- * @param n is the expected number of elements the filter will contain.
- * @param k is the number of hash functions used.
- */
- public BloomFilter(double c, int n, int k) {
- this.expectedNumberOfFilterElements = n;
- this.k = k;
- this.bitsPerElement = c;
- this.bitSetSize = (int)Math.ceil(c * n);
- numberOfAddedElements = 0;
- this.bitset = new BitSet(bitSetSize);
- }
-
- /**
- * Constructs an empty Bloom filter. The optimal number of hash functions (k) is estimated from the total size of the Bloom
- * and the number of expected elements.
- *
- * @param bitSetSize defines how many bits should be used in total for the filter.
- * @param expectedNumberOElements defines the maximum number of elements the filter is expected to contain.
- */
- public BloomFilter(int bitSetSize, int expectedNumberOElements) {
- this(bitSetSize / (double)expectedNumberOElements,
- expectedNumberOElements,
- (int) Math.round((bitSetSize / (double)expectedNumberOElements) * Math.log(2.0)));
- }
-
- /**
- * Constructs an empty Bloom filter with a given false positive probability. The number of bits per
- * element and the number of hash functions is estimated
- * to match the false positive probability.
- *
- * @param falsePositiveProbability is the desired false positive probability.
- * @param expectedNumberOfElements is the expected number of elements in the Bloom filter.
- */
- public BloomFilter(double falsePositiveProbability, int expectedNumberOfElements) {
- this(Math.ceil(-(Math.log(falsePositiveProbability) / Math.log(2))) / Math.log(2), // c = k / ln(2)
- expectedNumberOfElements,
- (int)Math.ceil(-(Math.log(falsePositiveProbability) / Math.log(2)))); // k = ceil(-log_2(false prob.))
- }
-
- /**
- * Construct a new Bloom filter based on existing Bloom filter data.
- *
- * @param bitSetSize defines how many bits should be used for the filter.
- * @param expectedNumberOfFilterElements defines the maximum number of elements the filter is expected to contain.
- * @param actualNumberOfFilterElements specifies how many elements have been inserted into the <code>filterData</code> BitSet.
- * @param filterData a BitSet representing an existing Bloom filter.
- */
- public BloomFilter(int bitSetSize, int expectedNumberOfFilterElements, int actualNumberOfFilterElements, BitSet filterData) {
- this(bitSetSize, expectedNumberOfFilterElements);
- this.bitset = filterData;
- this.numberOfAddedElements = actualNumberOfFilterElements;
- }
-
- /**
- * Generates a digest based on the contents of a String.
- *
- * @param val specifies the input data.
- * @param charset specifies the encoding of the input data.
- * @return digest as long.
- */
- public static long createHash(String val, Charset charset) {
- return createHash(val.getBytes(charset));
- }
-
- /**
- * Generates a digest based on the contents of a String.
- *
- * @param val specifies the input data. The encoding is expected to be UTF-8.
- * @return digest as long.
- */
- public static long createHash(String val) {
- return createHash(val, charset);
- }
-
- /**
- * Generates a digest based on the contents of an array of bytes.
- *
- * @param data specifies input data.
- * @return digest as long.
- */
- public static long createHash(byte[] data) {
- long h = 0;
- byte[] res;
-
- synchronized (digestFunction) {
- res = digestFunction.digest(data);
- }
-
- for (int i = 0; i < 4; i++) {
- h <<= 8;
- h |= ((int) res[i]) & 0xFF;
- }
- return h;
- }
-
- /**
- * Compares the contents of two instances to see if they are equal.
- *
- * @param obj is the object to compare to.
- * @return True if the contents of the objects are equal.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final BloomFilter<E> other = (BloomFilter<E>) obj;
- if (this.expectedNumberOfFilterElements != other.expectedNumberOfFilterElements) {
- return false;
- }
- if (this.k != other.k) {
- return false;
- }
- if (this.bitSetSize != other.bitSetSize) {
- return false;
- }
- if (this.bitset != other.bitset && (this.bitset == null || !this.bitset.equals(other.bitset))) {
- return false;
- }
- return true;
- }
-
- /**
- * Calculates a hash code for this class.
- * @return hash code representing the contents of an instance of this class.
- */
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 61 * hash + (this.bitset != null ? this.bitset.hashCode() : 0);
- hash = 61 * hash + this.expectedNumberOfFilterElements;
- hash = 61 * hash + this.bitSetSize;
- hash = 61 * hash + this.k;
- return hash;
- }
-
-
- /**
- * Calculates the expected probability of false positives based on
- * the number of expected filter elements and the size of the Bloom filter.
- * <br /><br />
- * The value returned by this method is the <i>expected</i> rate of false
- * positives, assuming the number of inserted elements equals the number of
- * expected elements. If the number of elements in the Bloom filter is less
- * than the expected value, the true probability of false positives will be lower.
- *
- * @return expected probability of false positives.
- */
- public double expectedFalsePositiveProbability() {
- return getFalsePositiveProbability(expectedNumberOfFilterElements);
- }
-
- /**
- * Calculate the probability of a false positive given the specified
- * number of inserted elements.
- *
- * @param numberOfElements number of inserted elements.
- * @return probability of a false positive.
- */
- public double getFalsePositiveProbability(double numberOfElements) {
- // (1 - e^(-k * n / m)) ^ k
- return Math.pow((1 - Math.exp(-k * (double) numberOfElements
- / (double) bitSetSize)), k);
-
- }
-
- /**
- * Get the current probability of a false positive. The probability is calculated from
- * the size of the Bloom filter and the current number of elements added to it.
- *
- * @return probability of false positives.
- */
- public double getFalsePositiveProbability() {
- return getFalsePositiveProbability(numberOfAddedElements);
- }
-
-
- /**
- * Returns the value chosen for K.<br />
- * <br />
- * K is the optimal number of hash functions based on the size
- * of the Bloom filter and the expected number of inserted elements.
- *
- * @return optimal k.
- */
- public int getK() {
- return k;
- }
-
- /**
- * Sets all bits to false in the Bloom filter.
- */
- public void clear() {
- bitset.clear();
- numberOfAddedElements = 0;
- }
-
- /**
- * Adds an object to the Bloom filter. The output from the object's
- * toString() method is used as input to the hash functions.
- *
- * @param element is an element to register in the Bloom filter.
- */
- public void add(E element) {
- long hash;
- String valString = element.toString();
- for (int x = 0; x < k; x++) {
- hash = createHash(valString + Integer.toString(x));
- hash = hash % (long)bitSetSize;
- bitset.set(Math.abs((int)hash), true);
- }
- numberOfAddedElements ++;
- }
-
- /**
- * Adds all elements from a Collection to the Bloom filter.
- * @param c Collection of elements.
- */
- public void addAll(Collection<? extends E> c) {
- for (E element : c)
- add(element);
- }
-
- /**
- * Returns true if the element could have been inserted into the Bloom filter.
- * Use getFalsePositiveProbability() to calculate the probability of this
- * being correct.
- *
- * @param element element to check.
- * @return true if the element could have been inserted into the Bloom filter.
- */
- public boolean contains(E element) {
- long hash;
- String valString = element.toString();
- for (int x = 0; x < k; x++) {
- hash = createHash(valString + Integer.toString(x));
- hash = hash % (long)bitSetSize;
- if (!bitset.get(Math.abs((int)hash)))
- return false;
- }
- return true;
- }
-
- /**
- * Returns true if all the elements of a Collection could have been inserted
- * into the Bloom filter. Use getFalsePositiveProbability() to calculate the
- * probability of this being correct.
- * @param c elements to check.
- * @return true if all the elements in c could have been inserted into the Bloom filter.
- */
- public boolean containsAll(Collection<? extends E> c) {
- for (E element : c)
- if (!contains(element))
- return false;
- return true;
- }
-
- /**
- * Read a single bit from the Bloom filter.
- * @param bit the bit to read.
- * @return true if the bit is set, false if it is not.
- */
- public boolean getBit(int bit) {
- return bitset.get(bit);
- }
-
- /**
- * Set a single bit in the Bloom filter.
- * @param bit is the bit to set.
- * @param value If true, the bit is set. If false, the bit is cleared.
- */
- public void setBit(int bit, boolean value) {
- bitset.set(bit, value);
- }
-
- /**
- * Return the bit set used to store the Bloom filter.
- * @return bit set representing the Bloom filter.
- */
- public BitSet getBitSet() {
- return bitset;
- }
-
- /**
- * Returns the number of bits in the Bloom filter. Use count() to retrieve
- * the number of inserted elements.
- *
- * @return the size of the bitset used by the Bloom filter.
- */
- public int size() {
- return this.bitSetSize;
- }
-
- /**
- * Returns the number of elements added to the Bloom filter after it
- * was constructed or after clear() was called.
- *
- * @return number of elements added to the Bloom filter.
- */
- public int count() {
- return this.numberOfAddedElements;
- }
-
- /**
- * Returns the expected number of elements to be inserted into the filter.
- * This value is the same value as the one passed to the constructor.
- *
- * @return expected number of elements.
- */
- public int getExpectedNumberOfElements() {
- return expectedNumberOfFilterElements;
- }
-
- /**
- * Get expected number of bits per element when the Bloom filter is full. This value is set by the constructor
- * when the Bloom filter is created. See also getBitsPerElement().
- *
- * @return expected number of bits per element.
- */
- public double getExpectedBitsPerElement() {
- return this.bitsPerElement;
- }
-
- /**
- * Get actual number of bits per element based on the number of elements that have currently been inserted and the length
- * of the Bloom filter. See also getExpectedBitsPerElement().
- *
- * @return number of bits per element.
- */
- public double getBitsPerElement() {
- return this.bitSetSize / (double)numberOfAddedElements;
- }
-}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -19,15 +19,10 @@
package org.exoplatform.services.jcr.impl.dataflow.persistent;
import org.exoplatform.commons.utils.SecurityHelper;
-import org.exoplatform.management.annotations.Managed;
-import org.exoplatform.management.annotations.ManagedDescription;
-import org.exoplatform.services.jcr.access.AccessControlEntry;
import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPersistenceListener;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
-import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.ItemType;
import org.exoplatform.services.jcr.datamodel.NodeData;
@@ -48,14 +43,12 @@
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
-import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.rpc.RPCException;
import org.exoplatform.services.rpc.RPCService;
import org.exoplatform.services.rpc.RemoteCommand;
import org.exoplatform.services.rpc.TopologyChangeEvent;
import org.exoplatform.services.rpc.TopologyChangeListener;
import org.exoplatform.services.transaction.TransactionService;
-import org.picocontainer.Startable;
import java.io.Serializable;
import java.security.PrivilegedAction;
@@ -71,7 +64,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jcr.RepositoryException;
@@ -88,13 +80,9 @@
* @version $Id$
*/
public class CacheableWorkspaceDataManager extends WorkspacePersistentDataManager implements Suspendable,
- TopologyChangeListener, Startable, WorkspaceStorageCacheListener
+ TopologyChangeListener
{
- private final static double ACL_BF_FALSE_PROPBABILITY_DEFAULT = 0.1d;
-
- private final static int ACL_BF_ELEMENTS_NUMBER_DEFAULT = 1000000;
-
/**
* Items cache.
*/
@@ -110,19 +98,6 @@
*/
private final TransactionableResourceManager txResourceManager;
- private final AtomicBoolean filtersEnabled = new AtomicBoolean();
-
- /**
- * Bloom filter parameters.
- */
- private final double bfProbability;
-
- private final int bfElementNumber;
-
- private volatile BloomFilter<String> filterPermissions;
-
- private volatile BloomFilter<String> filterOwner;
-
private TransactionManager transactionManager;
/**
@@ -373,8 +348,6 @@
/**
* CacheableWorkspaceDataManager constructor.
*
- * @param wsConfig
- * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -388,30 +361,11 @@
* @param rpcService
* the service for executing commands on all nodes of cluster
*/
- public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
- WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
- TransactionableResourceManager txResourceManager, TransactionService transactionService, RPCService rpcService)
+ public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
+ SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
+ TransactionService transactionService, RPCService rpcService)
{
super(dataContainer, systemDataContainerHolder, txResourceManager);
-
- bfProbability =
- wsConfig.getContainer().getParameterDouble(WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY,
- ACL_BF_FALSE_PROPBABILITY_DEFAULT);
- if (bfProbability < 0 || bfProbability > 1)
- {
- throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY
- + " is invalid, must be between 0 and 1.");
- }
-
- bfElementNumber =
- wsConfig.getContainer().getParameterInteger(WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER,
- ACL_BF_ELEMENTS_NUMBER_DEFAULT);
- if (bfElementNumber <= 0)
- {
- throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER
- + " is invalid, can not be less then 1.");
- }
-
this.cache = cache;
this.requestCache = new ConcurrentHashMap<Integer, DataRequest>();
@@ -427,8 +381,6 @@
/**
* CacheableWorkspaceDataManager constructor.
*
- * @param wsConfig
- * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -439,18 +391,16 @@
* the resource manager used to manage the whole tx
* @param transactionService TransactionService
*/
- public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
- WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
- TransactionableResourceManager txResourceManager, TransactionService transactionService)
+ public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
+ SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
+ TransactionService transactionService)
{
- this(wsConfig, dataContainer, cache, systemDataContainerHolder, txResourceManager, transactionService, null);
+ this(dataContainer, cache, systemDataContainerHolder, txResourceManager, transactionService, null);
}
/**
* CacheableWorkspaceDataManager constructor.
*
- * @param wsConfig
- * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -460,30 +410,11 @@
* @param txResourceManager
* the resource manager used to manage the whole tx
*/
- public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
- WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
- TransactionableResourceManager txResourceManager, RPCService rpcService)
+ public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
+ SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
+ RPCService rpcService)
{
super(dataContainer, systemDataContainerHolder, txResourceManager);
-
- bfProbability =
- wsConfig.getContainer().getParameterDouble(WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY,
- ACL_BF_FALSE_PROPBABILITY_DEFAULT);
- if (bfProbability < 0 || bfProbability > 1)
- {
- throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY
- + " is invalid, must be between 0 and 1.");
- }
-
- bfElementNumber =
- wsConfig.getContainer().getParameterInteger(WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER,
- ACL_BF_ELEMENTS_NUMBER_DEFAULT);
- if (bfElementNumber <= 0)
- {
- throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER
- + " is invalid, can not be less then 1.");
- }
-
this.cache = cache;
this.requestCache = new ConcurrentHashMap<Integer, DataRequest>();
@@ -508,8 +439,6 @@
/**
* CacheableWorkspaceDataManager constructor.
*
- * @param wsConfig
- * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -519,18 +448,15 @@
* @param txResourceManager
* the resource manager used to manage the whole tx
*/
- public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
- WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
- TransactionableResourceManager txResourceManager)
+ public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
+ SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager)
{
- this(wsConfig, dataContainer, cache, systemDataContainerHolder, txResourceManager, (RPCService)null);
+ this(dataContainer, cache, systemDataContainerHolder, txResourceManager, (RPCService)null);
}
/**
* CacheableWorkspaceDataManager constructor.
*
- * @param wsConfig
- * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -538,10 +464,10 @@
* @param systemDataContainerHolder
* System Workspace data container (persistent level)
*/
- public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
- WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder)
+ public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
+ SystemDataContainerHolder systemDataContainerHolder)
{
- this(wsConfig, dataContainer, cache, systemDataContainerHolder, null, (RPCService)null);
+ this(dataContainer, cache, systemDataContainerHolder, null, (RPCService)null);
}
/**
@@ -786,22 +712,8 @@
* {@inheritDoc}
*/
@Override
- public ItemData getItemData(String identifier) throws RepositoryException
+ public ItemData getItemData(final String identifier) throws RepositoryException
{
- return getItemData(identifier, true);
- }
-
- /**
- * Do the same thing as getItemData(identifier), but ACL initialization can be specified.
- * If doInitACL is true (default value for getItemData(identifier)) ACL will be initialized.
- *
- * @param identifier
- * @param doInitACL
- * @return
- * @throws RepositoryException
- */
- private ItemData getItemData(final String identifier, final boolean doInitACL) throws RepositoryException
- {
if (cache.isEnabled())
{
// 1. Try from cache
@@ -854,14 +766,7 @@
public ItemData run() throws RepositoryException
{
ItemData item = CacheableWorkspaceDataManager.super.getItemData(identifier);
- if (item != null && item.isNode() && doInitACL)
- {
- return initACL(null, (NodeData)item);
- }
- else
- {
- return item;
- }
+ return item != null && item.isNode() ? initACL(null, (NodeData)item) : item;
}
});
}
@@ -2119,30 +2024,16 @@
/**
* Init ACL of the node.
+ *
* @param parent
* - a parent, can be null (get item by id)
- * @param node
+ * @param data
* - an item data
* @return - an item data with ACL was initialized
* @throws RepositoryException
*/
private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException
{
- return initACL(parent, node, null);
- }
-
- /**
- * @param parent
- * - a parent, can be null (get item by id)
- * @param node
- * - an node data
- * @param search
- * - indicates what we are looking for
- * @return - an node data with ACL was initialized
- * @throws RepositoryException
- */
- private NodeData initACL(NodeData parent, NodeData node, ACLSearch search) throws RepositoryException
- {
if (node != null)
{
AccessControlList acl = node.getACL();
@@ -2152,43 +2043,23 @@
{
// use parent ACL
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
- node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
+ .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
node.getParentIdentifier(), parent.getACL());
}
else
{
- if (search == null)
- {
- search = new ACLSearch(null, null);
- }
// use nearest ancestor ACL... case of get by id
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
- node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
- node.getParentIdentifier(), getNearestACAncestorAcl(node, search));
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
+ .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ node.getParentIdentifier(), getNearestACAncestorAcl(node));
}
}
else if (!acl.hasPermissions())
{
// use nearest ancestor permissions
- if (search == null)
- {
- search = new ACLSearch(acl.getOwner(), null);
- }
- else
- {
- search.setOwner(acl.getOwner());
- if (search.found())
- {
- return new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
- node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
- node.getParentIdentifier(), new AccessControlList(acl.getOwner(), null));
- }
- }
- AccessControlList ancestorAcl =
- parent != null && parent.getACL() != null && parent.getACL().hasPermissions() ? parent.getACL()
- : getNearestACAncestorAcl(node, search);
+ AccessControlList ancestorAcl = getNearestACAncestorAcl(node);
node =
new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
@@ -2197,24 +2068,8 @@
}
else if (!acl.hasOwner())
{
- if (search == null)
- {
- search = new ACLSearch(null, acl.getPermissionEntries());
- }
- else
- {
- search.setPermissions(acl.getPermissionEntries());
- if (search.found())
- {
- return new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
- node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
- node.getParentIdentifier(), new AccessControlList(null, acl.getPermissionEntries()));
- }
- }
// use nearest ancestor owner
- AccessControlList ancestorAcl =
- parent != null && parent.getACL() != null && parent.getACL().hasOwner() ? parent.getACL()
- : getNearestACAncestorAcl(node, search);
+ AccessControlList ancestorAcl = getNearestACAncestorAcl(node);
node =
new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
@@ -2233,288 +2088,27 @@
*
* @param node
* - item
- * @param search
- * - indicates what we are looking for
* @return - parent or null
* @throws RepositoryException
*/
- private AccessControlList getNearestACAncestorAcl(NodeData node, ACLSearch search) throws RepositoryException
+ private AccessControlList getNearestACAncestorAcl(NodeData node) throws RepositoryException
{
- String id = node.getParentIdentifier();
- if (id != null)
+
+ if (node.getParentIdentifier() != null)
{
- boolean filtersEnabled = this.filtersEnabled.get();
- BloomFilter<String> filterPermissions = this.filterPermissions;
- BloomFilter<String> filterOwner = this.filterOwner;
- if (filtersEnabled && filterOwner != null && filterPermissions != null)
+ NodeData parent = (NodeData)getItemData(node.getParentIdentifier());
+ while (parent != null)
{
- QPathEntry[] entries = node.getQPath().getEntries();
- for (int i = entries.length - 2; i >= 0; i--)
+ if (parent.getACL() != null)
{
- QPathEntry entry = entries[i];
- String currentId = entry.getId();
- if (currentId == null)
- {
- // the path doesn't contain any id so we do a normal call
- break;
- }
- else if ((!search.hasOwner() && filterOwner.contains(currentId))
- || (!search.hasPermissions() && filterPermissions.contains(currentId)))
- {
- id = currentId;
- break;
- }
- else
- {
- id = currentId;
- }
+ // has an AC parent
+ return parent.getACL();
}
+ // going up to the root
+ parent = (NodeData)getItemData(parent.getParentIdentifier());
}
- NodeData parent = getACL(id, search);
- if (parent != null && parent.getACL() != null)
- {
- // has an AC parent
- return parent.getACL();
- }
}
return new AccessControlList();
}
- /**
- * Find Item by identifier to get the missing ACL information.
- *
- * @param identifier the id of the node that we are looking for to fill the ACL research
- * @param search the ACL search describing what we are looking for
- * @return NodeData, data by identifier
- */
- private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException
- {
- final ItemData item = getItemData(identifier, false);
- return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null;
- }
-
- /**
- * Gets the list of all the ACL holders
- * @throws RepositoryException if an error occurs
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException
- {
- WorkspaceStorageConnection conn = dataContainer.openConnection();
- try
- {
- return conn.getACLHolders();
- }
- finally
- {
- conn.close();
- }
- }
-
- /**
- * Reloads the bloom filters
- * @return <code>true</code> if the filters could be reloaded successfully, <code>false</code> otherwise.
- */
- @Managed
- @ManagedDescription("Reloads the bloom filters used to efficiently manage the ACLs")
- public boolean reloadFilters()
- {
- return loadFilters(false);
- }
-
- /**
- * Clears the bloom filters
- */
- protected void clear()
- {
- this.filterPermissions = null;
- this.filterOwner = null;
- }
-
- /**
- * @see org.picocontainer.Startable#start()
- */
- public void start()
- {
- try
- {
- this.cache.addListener(this);
- }
- catch (UnsupportedOperationException e)
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("The method addListener is not supported", e);
- }
- return;
- }
-
- loadFilters(true);
- }
-
- /**
- * Loads the bloom filters
- * @param cleanOnFail clean everything if an error occurs
- * @return <code>true</code> if the filters could be loaded successfully, <code>false</code> otherwise.
- */
- protected boolean loadFilters(boolean cleanOnFail)
- {
- filtersEnabled.set(false);
- this.filterPermissions = new BloomFilter<String>(bfProbability, bfElementNumber);
- this.filterOwner = new BloomFilter<String>(bfProbability, bfElementNumber);
- boolean fails = true;
- List<ACLHolder> holders = null;
- try
- {
- LOG.info("Getting all the ACL Holders from the persistence layer");
- holders = getACLHolders();
- fails = false;
- }
- catch (UnsupportedOperationException e)
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("The method getACLHolders is not supported", e);
- }
- }
- catch (RepositoryException e)
- {
- LOG.error("Could not load all the ACL loaders", e);
- }
- if (fails)
- {
- if (cleanOnFail)
- {
- clear();
- cache.removeListener(this);
- }
- return false;
- }
- else if (holders != null && !holders.isEmpty())
- {
- LOG.info("Adding all the ACL Holders found into the BloomFilters");
- for (int i = 0, length = holders.size(); i < length; i++)
- {
- ACLHolder holder = holders.get(i);
- if (holder.hasOwner())
- {
- filterOwner.add(holder.getId());
- }
- if (holder.hasPermissions())
- {
- filterPermissions.add(holder.getId());
- }
- }
- }
- filtersEnabled.set(true);
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void stop()
- {
- }
-
- /**
- * {@inheritDoc}
- */
- public void onCacheEntryAdded(ItemData data)
- {
- onCacheEntryUpdated(data);
- }
-
- /**
- * {@inheritDoc}
- */
- public void onCacheEntryUpdated(ItemData data)
- {
- if (data instanceof NodeData)
- {
- NodeData node = (NodeData)data;
- AccessControlList acl = node.getACL();
- if (acl == null)
- {
- return;
- }
- if (acl.hasOwner())
- {
- filterOwner.add(node.getIdentifier());
- }
- if (acl.hasPermissions())
- {
- filterPermissions.add(node.getIdentifier());
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void onCacheEntryRemoved(ItemData data)
- {
- }
-
- /**
- * Defines what we are really looking for
- */
- private static class ACLSearch
- {
- private String owner;
-
- private List<AccessControlEntry> permissions;
-
- ACLSearch(String owner, List<AccessControlEntry> permissions)
- {
- this.owner = owner;
- this.permissions = permissions;
- }
-
- /**
- * @return <code>true</code> if the owner and the permission have been found, <code>false</code>
- * otherwise
- */
- public boolean found()
- {
- return owner != null && permissions != null;
- }
-
- /**
- * @param owner the owner to set
- */
- public void setOwner(String owner)
- {
- if (this.owner == null)
- {
- this.owner = owner;
- }
- }
-
- /**
- * @param permissions the permissions to set
- */
- public void setPermissions(List<AccessControlEntry> permissions)
- {
- if (this.permissions == null)
- {
- this.permissions = permissions;
- }
- }
-
- /**
- * @return the owner
- */
- public boolean hasOwner()
- {
- return owner != null;
- }
-
- /**
- * @return the permissions
- */
- public boolean hasPermissions()
- {
- return permissions != null;
- }
- }
}
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -24,7 +24,6 @@
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.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.ItemType;
import org.exoplatform.services.jcr.datamodel.NodeData;
@@ -2217,20 +2216,4 @@
public void addChildNodesByPage(NodeData parent, List<NodeData> childs, int fromOrderNum)
{
}
-
- /**
- * {@inheritDoc}
- */
- public void addListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException
- {
- throw new UnsupportedOperationException("The cache listeners are not supported by the LinkedWorkspaceStorageCacheImpl");
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException
- {
- throw new UnsupportedOperationException("The cache listeners are not supported by the LinkedWorkspaceStorageCacheImpl");
- }
}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -1,174 +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.jcr.dataflow.ItemStateChangesLog;
-import org.exoplatform.services.jcr.dataflow.SharedDataManager;
-import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.ItemType;
-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.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.util.Calendar;
-import java.util.List;
-
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS. Data Manager supported ACL Inheritance
- *
- * @author Gennady Azarenkov
- * @version $Id: ACLInheritanceSupportedWorkspaceDataManager.java 11907 2008-03-13 15:36:21Z ksm $
- */
-public class ShareableSupportedWorkspaceDataManager implements SharedDataManager
-{
-
- private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ACLInheritanceSupportedWorkspaceDataManager");
-
- protected final CacheableWorkspaceDataManager persistentManager;
-
- public ShareableSupportedWorkspaceDataManager(CacheableWorkspaceDataManager persistentManager)
- {
- this.persistentManager = persistentManager;
- }
-
- /**
- * {@inheritDoc}
- */
- // ------------ ItemDataConsumer impl ------------
- public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException
- {
- return persistentManager.getChildNodesData(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> patternFilters) throws RepositoryException
- {
- return persistentManager.getChildNodesData(parent, patternFilters);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
- throws RepositoryException
- {
- return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
- }
-
- /**
- * {@inheritDoc}
- */
- public int getLastOrderNumber(final NodeData parent) throws RepositoryException
- {
- return persistentManager.getLastOrderNumber(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- public int getChildNodesCount(final NodeData parent) throws RepositoryException
- {
- return persistentManager.getChildNodesCount(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- public ItemData getItemData(NodeData parent, QPathEntry name) throws RepositoryException
- {
- return getItemData(parent, name, ItemType.UNKNOWN);
- }
-
- /**
- * {@inheritDoc}
- */
- public ItemData getItemData(NodeData parent, QPathEntry name, ItemType itemType) throws RepositoryException
- {
- return persistentManager.getItemData(parent, name, itemType);
- }
-
- /**
- * {@inheritDoc}
- */
- public ItemData getItemData(String identifier) throws RepositoryException
- {
- return persistentManager.getItemData(identifier);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException
- {
- return persistentManager.getChildPropertiesData(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> itemDataFilters)
- throws RepositoryException
- {
- return persistentManager.getChildPropertiesData(parent, itemDataFilters);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException
- {
- return persistentManager.listChildPropertiesData(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<PropertyData> getReferencesData(String identifier, boolean skipVersionStorage)
- throws RepositoryException
- {
- return persistentManager.getReferencesData(identifier, skipVersionStorage);
- }
-
- // ------------ SharedDataManager ----------------------
-
- /**
- * {@inheritDoc}
- */
- public void save(ItemStateChangesLog changes) throws InvalidItemStateException, UnsupportedOperationException,
- RepositoryException
- {
- persistentManager.save(changes);
- }
-
- /**
- * {@inheritDoc}
- */
- public Calendar getCurrentTime()
- {
- return persistentManager.getCurrentTime();
- }
-}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -53,12 +53,12 @@
* @version $Id$
*/
-public class VersionableWorkspaceDataManager extends ShareableSupportedWorkspaceDataManager
+public class VersionableWorkspaceDataManager extends ACLInheritanceSupportedWorkspaceDataManager
{
private static Log log = ExoLogger.getLogger("exo.jcr.component.core.VersionableWorkspaceDataManager");
- private ShareableSupportedWorkspaceDataManager versionDataManager;
+ private ACLInheritanceSupportedWorkspaceDataManager versionDataManager;
public VersionableWorkspaceDataManager(CacheableWorkspaceDataManager persistentManager)
{
@@ -71,7 +71,7 @@
public void setSystemDataManager(DataManager systemDataManager)
{
- this.versionDataManager = (ShareableSupportedWorkspaceDataManager)systemDataManager;
+ this.versionDataManager = (ACLInheritanceSupportedWorkspaceDataManager)systemDataManager;
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -28,7 +28,6 @@
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.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.ItemData;
@@ -54,11 +53,6 @@
import org.exoplatform.services.transaction.ActionNonTxAware;
import org.infinispan.Cache;
import org.infinispan.lifecycle.ComponentStatus;
-import org.infinispan.notifications.Listener;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
-import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
-import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
import java.io.File;
import java.io.IOException;
@@ -72,7 +66,6 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
@@ -106,11 +99,6 @@
private final boolean enabled;
protected final BufferedISPNCache cache;
-
- /**
- * The list of all the listeners
- */
- private final List<WorkspaceStorageCacheListener> listeners = new CopyOnWriteArrayList<WorkspaceStorageCacheListener>();
private final CacheActionNonTxAware<Void, Void> commitTransaction = new CacheActionNonTxAware<Void, Void>()
{
@@ -474,7 +462,6 @@
// do n't nothing
}
this.cache = new BufferedISPNCache(parentCache, allowLocalChanges);
- cache.addListener(new CacheEventListener());
}
/**
@@ -1573,68 +1560,6 @@
}
/**
- * {@inheritDoc}
- */
- public void addListener(WorkspaceStorageCacheListener listener)
- {
- listeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeListener(WorkspaceStorageCacheListener listener)
- {
- listeners.remove(listener);
- }
-
- /**
- * Called when a cache entry corresponding to the given node has item updated
- * @param data the item corresponding to the updated cache entry
- */
- private void onCacheEntryUpdated(ItemData data)
- {
- if (data == null || data instanceof NullItemData)
- {
- return;
- }
- for (WorkspaceStorageCacheListener listener : listeners)
- {
- try
- {
- listener.onCacheEntryUpdated(data);
- }
- catch (Exception e)
- {
- LOG.warn("The method onCacheEntryUpdated fails for the listener " + listener.getClass(), e);
- }
- }
- }
-
- /**
- * Called when a cache entry corresponding to the given item has been removed
- * @param data the item corresponding to the removed cache entry
- */
- private void onCacheEntryRemoved(ItemData data)
- {
- if (data == null || data instanceof NullItemData)
- {
- return;
- }
- for (WorkspaceStorageCacheListener listener : listeners)
- {
- try
- {
- listener.onCacheEntryRemoved(data);
- }
- catch (Exception e)
- {
- LOG.warn("The method onCacheEntryRemoved fails for the listener " + listener.getClass(), e);
- }
- }
- }
-
- /**
* Actions that are not supposed to be called within a transaction
*
* Created by The eXo Platform SAS
@@ -1652,30 +1577,4 @@
return ISPNCacheWorkspaceStorageCache.this.getTransactionManager();
}
}
-
- @SuppressWarnings("rawtypes")
- @Listener
- public class CacheEventListener
- {
-
- @CacheEntryRemoved
- public void cacheEntryRemoved(CacheEntryRemovedEvent evt)
- {
- if (evt.isPre() && evt.getKey() instanceof CacheId)
- {
- final ItemData value = (ItemData)evt.getValue();
- onCacheEntryRemoved(value);
- }
- }
-
- @CacheEntryModified
- public void cacheEntryModified(CacheEntryModifiedEvent evt)
- {
- if (!evt.isPre() && evt.getKey() instanceof CacheId)
- {
- final ItemData value = (ItemData)evt.getValue();
- onCacheEntryUpdated(value);
- }
- }
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -29,7 +29,6 @@
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.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.ItemData;
@@ -63,10 +62,6 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.jboss.cache.jmx.JmxRegistrationManager;
-import org.jboss.cache.notifications.annotation.NodeModified;
-import org.jboss.cache.notifications.annotation.NodeRemoved;
-import org.jboss.cache.notifications.event.NodeModifiedEvent;
-import org.jboss.cache.notifications.event.NodeRemovedEvent;
import org.picocontainer.Startable;
import java.io.File;
@@ -83,7 +78,6 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
@@ -192,12 +186,7 @@
protected final Fqn<String> childNodesByPatternList;
protected final Fqn<String> rootFqn;
-
- /**
- * The list of all the listeners
- */
- private final List<WorkspaceStorageCacheListener> listeners = new CopyOnWriteArrayList<WorkspaceStorageCacheListener>();
-
+
private final CacheActionNonTxAware<Void, Void> commitTransaction = new CacheActionNonTxAware<Void, Void>()
{
@Override
@@ -691,8 +680,7 @@
createResidentNode(childPropsByPatternList);
createResidentNode(childNodesByPatternList);
createResidentNode(itemsRoot);
- this.cache.addCacheListener(new CacheEventListener());
-
+
if (jmxManager != null)
{
SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
@@ -2091,69 +2079,8 @@
createResidentNode(itemsRoot);
}
}
- /**
- * {@inheritDoc}
- */
- public void addListener(WorkspaceStorageCacheListener listener)
- {
- listeners.add(listener);
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeListener(WorkspaceStorageCacheListener listener)
- {
- listeners.remove(listener);
- }
/**
- * Called when a cache entry corresponding to the given node has item updated
- * @param data the item corresponding to the updated cache entry
- */
- private void onCacheEntryUpdated(ItemData data)
- {
- if (data == null || data instanceof NullItemData)
- {
- return;
- }
- for (WorkspaceStorageCacheListener listener : listeners)
- {
- try
- {
- listener.onCacheEntryUpdated(data);
- }
- catch (Exception e)
- {
- LOG.warn("The method onCacheEntryUpdated fails for the listener " + listener.getClass(), e);
- }
- }
- }
-
- /**
- * Called when a cache entry corresponding to the given item has been removed
- * @param data the item corresponding to the removed cache entry
- */
- private void onCacheEntryRemoved(ItemData data)
- {
- if (data == null || data instanceof NullItemData)
- {
- return;
- }
- for (WorkspaceStorageCacheListener listener : listeners)
- {
- try
- {
- listener.onCacheEntryRemoved(data);
- }
- catch (Exception e)
- {
- LOG.warn("The method onCacheEntryRemoved fails for the listener " + listener.getClass(), e);
- }
- }
- }
-
- /**
* Actions that are not supposed to be called within a transaction
*
* Created by The eXo Platform SAS
@@ -2171,30 +2098,4 @@
return JBossCacheWorkspaceStorageCache.this.getTransactionManager();
}
}
-
- @org.jboss.cache.notifications.annotation.CacheListener
- @SuppressWarnings("unchecked")
- public class CacheEventListener
- {
-
- @NodeRemoved
- public void nodeRemoved(NodeRemovedEvent ne)
- {
- if (ne.isPre() && ne.getFqn().isChildOf(itemsRoot))
- {
- final Map<Serializable, Object> data = ne.getData();
- onCacheEntryRemoved((ItemData)(data == null ? null : data.get(ITEM_DATA)));
- }
- }
-
- @NodeModified
- public void nodeModified(NodeModifiedEvent ne)
- {
- if (!ne.isPre() && ne.getFqn().isChildOf(itemsRoot))
- {
- final Map<Serializable, Object> data = ne.getData();
- onCacheEntryUpdated((ItemData)(data == null ? null : data.get(ITEM_DATA)));
- }
- }
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -26,7 +26,6 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -290,15 +289,6 @@
throw new UnsupportedOperationException();
}
-
- /**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getACLHolders()
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
class MapKey
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -37,7 +37,6 @@
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPersistedValueData;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CleanableFilePersistedValueData;
import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
@@ -1229,15 +1228,6 @@
throw new RepositoryException(e);
}
}
-
- /**
- * {@inheritDoc}
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- throw new UnsupportedOperationException("This method is not supported by the old JDBCWorkspaceDataContainer, use CQJDBCWorkspaceDataContainer instead.");
- }
/**
* {@inheritDoc}
@@ -1510,7 +1500,7 @@
}
QPathEntry qpe =
- new QPathEntry(InternalQName.parse(parent.getString(COLUMN_NAME)), parent.getInt(COLUMN_INDEX), caid);
+ new QPathEntry(InternalQName.parse(parent.getString(COLUMN_NAME)), parent.getInt(COLUMN_INDEX));
qrpath.add(qpe);
caid = parent.getString(COLUMN_PARENTID);
}
@@ -2223,7 +2213,7 @@
if (parentPath != null)
{
// get by parent and name
- qpath = QPath.makeChildPath(parentPath, qname, cindex, cid);
+ qpath = QPath.makeChildPath(parentPath, qname, cindex);
parentCid = cpid;
}
else
@@ -2237,7 +2227,7 @@
}
else
{
- qpath = QPath.makeChildPath(traverseQPath(cpid), qname, cindex, cid);
+ qpath = QPath.makeChildPath(traverseQPath(cpid), qname, cindex);
parentCid = cpid;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -20,7 +20,6 @@
import org.exoplatform.services.jcr.access.AccessControlEntry;
import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.core.ExtendedPropertyType;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
@@ -34,7 +33,6 @@
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
@@ -135,13 +133,6 @@
*/
protected String UPDATE_VALUE;
- /**
- * FIND_ACL_HOLDERS.
- */
- protected String FIND_ACL_HOLDERS;
-
- protected PreparedStatement findACLHolders;
-
protected PreparedStatement findNodesByParentIdCQ;
protected PreparedStatement findPropertiesByParentIdCQ;
@@ -186,64 +177,7 @@
{
super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- checkIfOpened();
- ResultSet resultSet = null;
- try
- {
- // query will return all the ACL holder
- resultSet = findACLHolders();
- Map<String, ACLHolder> mHolders = new HashMap<String, ACLHolder>();
-
- while (resultSet.next())
- {
- String cpid = resultSet.getString(COLUMN_PARENTID);
- ACLHolder holder = mHolders.get(cpid);
- if (holder == null)
- {
- holder = new ACLHolder(cpid);
- mHolders.put(cpid, holder);
- }
- int cptype = resultSet.getInt(COLUMN_PTYPE);
- if (cptype == ExtendedPropertyType.PERMISSION)
- {
- holder.setPermissions(true);
- }
- else
- {
- holder.setOwner(true);
- }
- }
- return new ArrayList<ACLHolder>(mHolders.values());
- }
- catch (SQLException e)
- {
- throw new RepositoryException(e);
- }
- finally
- {
- if (resultSet != null)
- {
- try
- {
- resultSet.close();
- }
- catch (SQLException e)
- {
- LOG.error("Can't close the ResultSet: " + e);
- }
- }
- }
- }
-
/**
* {@inheritDoc}
*/
@@ -994,7 +928,7 @@
if (parentPath != null)
{
// get by parent and name
- qpath = QPath.makeChildPath(parentPath, qname, cindex, cid);
+ qpath = QPath.makeChildPath(parentPath, qname, cindex);
parentCid = cpid;
}
else
@@ -1008,7 +942,7 @@
}
else
{
- qpath = QPath.makeChildPath(traverseQPath(cpid), qname, cindex, cid);
+ qpath = QPath.makeChildPath(traverseQPath(cpid), qname, cindex);
parentCid = cpid;
}
}
@@ -1160,13 +1094,13 @@
}
QPathEntry qpe1 =
- new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX), result.getString(COLUMN_ID));
+ new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX));
boolean isChild = caid.equals(result.getString(COLUMN_ID));
caid = result.getString(COLUMN_PARENTID);
if (result.next())
{
QPathEntry qpe2 =
- new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX), result.getString(COLUMN_ID));
+ new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX));
if (isChild)
{
// The child is the first result then we have the parent
@@ -1232,11 +1166,6 @@
try
{
- if (findACLHolders != null)
- {
- findACLHolders.close();
- }
-
if (findNodesByParentIdCQ != null)
{
findNodesByParentIdCQ.close();
@@ -1293,8 +1222,6 @@
}
}
- protected abstract ResultSet findACLHolders() throws SQLException;
-
protected abstract ResultSet findItemQPathByIdentifierCQ(String identifier) throws SQLException;
protected abstract ResultSet findChildNodesByParentIdentifierCQ(String parentIdentifier) throws SQLException;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -217,10 +217,6 @@
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID";
-
- FIND_ACL_HOLDERS = "select I.PARENT_ID, I.P_TYPE" +
- " from JCR_MITEM I" +
- " where I.I_CLASS=2 and (I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')";
}
/**
@@ -1014,18 +1010,4 @@
{
return PATTERN_ESCAPE_STRING;
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findACLHolders() throws SQLException
- {
- if (findACLHolders == null)
- {
- findACLHolders = dbConnection.prepareStatement(FIND_ACL_HOLDERS);
- }
-
- return findACLHolders.executeQuery();
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -222,10 +222,6 @@
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID";
-
- FIND_ACL_HOLDERS = "select I.PARENT_ID, I.P_TYPE" +
- " from JCR_SITEM I" +
- " where I.I_CLASS=2 and I.CONTAINER_NAME=? and (I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')";
}
/**
@@ -927,24 +923,4 @@
{
return PATTERN_ESCAPE_STRING;
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findACLHolders() throws SQLException
- {
- if (findACLHolders == null)
- {
- findACLHolders = dbConnection.prepareStatement(FIND_ACL_HOLDERS);
- }
- else
- {
- findACLHolders.clearParameters();
- }
-
- findACLHolders.setString(1, containerName);
-
- return findACLHolders.executeQuery();
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -22,7 +22,6 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.statistics.JCRStatisticsManager;
import org.exoplatform.services.jcr.statistics.Statistics;
@@ -129,12 +128,6 @@
* <code>getLastOrderNumber(NodeData parent)</code>
*/
private static final String GET_LAST_ORDER_NUMBER_DESCR = "getLastOrderNumber";
-
- /**
- * The description of the statistics corresponding to the method
- * <code>getACLHolders()</code>
- */
- private static final String GET_ACL_HOLDERS = "getACLHolders";
/**
* The description of the statistics corresponding to the method
@@ -199,7 +192,6 @@
ALL_STATISTICS.put(LIST_CHILD_PROPERTIES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS,
LIST_CHILD_PROPERTIES_DATA_DESCR));
ALL_STATISTICS.put(GET_REFERENCES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS, GET_REFERENCES_DATA_DESCR));
- ALL_STATISTICS.put(GET_ACL_HOLDERS, new Statistics(GLOBAL_STATISTICS, GET_ACL_HOLDERS));
// Write Methods
// Commit
ALL_STATISTICS.put(COMMIT_DESCR, new Statistics(GLOBAL_STATISTICS, COMMIT_DESCR));
@@ -625,23 +617,4 @@
s.end();
}
}
-
-
- /**
- * {@inheritDoc}
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- Statistics s = ALL_STATISTICS.get(GET_ACL_HOLDERS);
- try
- {
- s.begin();
- return wcs.getACLHolders();
- }
- finally
- {
- s.end();
- }
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -60,10 +60,6 @@
public final static String CHECK_SNS_NEW_CONNECTION = "check-sns-new-connection";
- public final static String ACL_BF_FALSE_PROPBABILITY = "acl-bloomfilter-false-positive-probability";
-
- public final static String ACL_BF_ELEMENTS_NUMBER = "acl-bloomfilter-elements-number";
-
/**
* [G.A] do we need it here or in WorkspaceDataManager better??
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -24,7 +24,6 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import java.util.List;
@@ -388,17 +387,4 @@
* @return boolean, true if connection is open and ready, false - otherwise
*/
boolean isOpened();
-
- /**
- * Returns all the nodes that hold some ACL info like owner or permissions
- *
- * @return a list of all the ACL holders for this workspace
- * @throws RepositoryException
- * if some exception occured
- * @throws IllegalStateException
- * if connection is closed
- * @throws UnsupportedOperationException
- * if operation is not supported
- */
- List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException, UnsupportedOperationException;
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -25,22 +25,14 @@
import org.exoplatform.services.jcr.core.CredentialsImpl;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
-import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.ItemType;
-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.core.ItemImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpoolFileHolder;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
-import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -51,12 +43,10 @@
import java.lang.ref.WeakReference;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
-import javax.jcr.InvalidItemStateException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
@@ -519,239 +509,4 @@
assertTrue(finded);
}
}
-
- /**
- * Test WorkspaceDataContainer.
- * Does nothing, must be extended in tests.
- *
- * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
- */
- public class TestWorkspaceDataContainer implements WorkspaceDataContainer
- {
- @Override
- public String getInfo()
- {
- return null;
- }
-
- @Override
- public String getName()
- {
- return null;
- }
-
- @Override
- public String getUniqueName()
- {
- return null;
- }
-
- @Override
- public String getStorageVersion()
- {
- return null;
- }
-
- @Override
- public Calendar getCurrentTime()
- {
- return null;
- }
-
- @Override
- public boolean isSame(WorkspaceDataContainer another)
- {
- return false;
- }
-
- @Override
- public WorkspaceStorageConnection openConnection() throws RepositoryException
- {
- return null;
- }
-
- @Override
- public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
- {
- return null;
- }
-
- @Override
- public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original) throws RepositoryException
- {
- return null;
- }
-
- @Override
- public boolean isCheckSNSNewConnection()
- {
- return false;
- }
- }
-
- /**
- * Test WorkspaceStorageConnection.
- * Does nothing, must be extended in tests.
- *
- * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
- */
- public class TestWorkspaceStorageConnection implements WorkspaceStorageConnection
- {
-
- @Override
- public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException,
- IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException,
- IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> pattern)
- throws RepositoryException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public int getChildNodesCount(NodeData parent) throws RepositoryException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public int getLastOrderNumber(NodeData parent) throws RepositoryException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException,
- IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> pattern)
- throws RepositoryException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException,
- IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
- IllegalStateException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void add(NodeData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void commit() throws IllegalStateException, RepositoryException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void rollback() throws IllegalStateException, RepositoryException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public void close() throws IllegalStateException, RepositoryException
- {
- }
-
- @Override
- public boolean isOpened()
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- @Override
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
- }
-
- }
-
}
Deleted: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2011 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.commons.utils.QName;
-import org.exoplatform.services.jcr.JcrImplBaseTest;
-import org.exoplatform.services.jcr.access.AccessControlEntry;
-import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
-import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
-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.QPath;
-import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
-import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.RepositoryException;
-
-/**
- * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
- *
- */
-public class TestCacheableWorksapceDataManagerBloomFilter extends JcrImplBaseTest
-{
- private MyWorkspaceDataContainer dataContainer;
-
- private CacheableWorkspaceDataManager mgr;
-
- public void setUp() throws Exception
- {
- super.setUp();
- dataContainer = new MyWorkspaceDataContainer();
- WorkspaceStorageCache cache = new MyWorkspaceStorageCache();
- WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
- WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
- mgr =
- new CacheableWorkspaceDataManager(wconf, dataContainer, cache, new SystemDataContainerHolder(dataContainer));
- }
-
- protected void tearDown() throws Exception
- {
- dataContainer.clear();
- dataContainer = null;
- mgr.clear();
- mgr = null;
- super.tearDown();
- }
-
- public void testGetItemWithACL() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("2", path = new QPath(new QPathEntry[]{new QPathEntry("", "2", 1, "2")}),
- "3", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(1, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemWithoutACL() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("3", path = new QPath(new QPathEntry[]{new QPathEntry("", "3", 1, "3")}),
- "4", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, null));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(2, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentWithSingleOwner() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList("owner", null)));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, null));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(3, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentWithSinglePermission() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, null));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(3, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentsWithCrossEmptyACL() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList("owner", null)));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, null));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(3, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentsWithCrossEmptyACL2() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList("owner", null)));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, null));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(3, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentsWithSameOwnerlessACL() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList("owner", null)));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(2, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- public void testGetItemParentsWithSamePermissionlessACL() throws Exception
- {
- QPath path;
- dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
- "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
- 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
- dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
- 1, 1, null, null, new AccessControlList("owner", null)));
- dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
- 1, 1, null, null, new AccessControlList("owner", null)));
- mgr.reloadFilters();
- mgr.getItemData("1");
- assertEquals(2, dataContainer.getTotalCalls());
- dataContainer.clear();
- }
-
- class MyWorkspaceDataContainer extends TestWorkspaceDataContainer
- {
-
- protected Map<String, NodeData> nodesById = new HashMap<String, NodeData>();
-
- protected List<ACLHolder> holders = new ArrayList<ACLHolder>();
-
- private int totalCalls;
-
- protected synchronized void incrementCalls()
- {
- totalCalls++;
- }
-
- public WorkspaceStorageConnection openConnection() throws RepositoryException
- {
- return new MyWorkspaceStorageConnection(this);
- }
-
- public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
- {
- return openConnection();
- }
-
- public void clear()
- {
- nodesById.clear();
- holders.clear();
- totalCalls = 0;
- }
-
- public void add(NodeData node)
- {
- nodesById.put(node.getIdentifier(), node);
- AccessControlList acl = node.getACL();
- if (acl != null)
- {
- ACLHolder holder = new ACLHolder(node.getIdentifier());
- holder.setOwner(acl.hasOwner());
- holder.setPermissions(acl.hasPermissions());
- holders.add(holder);
- }
- }
-
- /**
- * @return the totalCalls
- */
- public int getTotalCalls()
- {
- return totalCalls;
- }
-
- }
-
- class MyWorkspaceStorageConnection extends TestWorkspaceStorageConnection
- {
- private final MyWorkspaceDataContainer container;
-
- public MyWorkspaceStorageConnection(MyWorkspaceDataContainer myWorkspaceDataContainer)
- {
- container = myWorkspaceDataContainer;
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager#getItemData(java.lang.String)
- */
- @Override
- public ItemData getItemData(String identifier) throws RepositoryException
- {
- container.incrementCalls();
- return container.nodesById.get(identifier);
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager#getACLHolders()
- */
- @Override
- public List<ACLHolder> getACLHolders() throws RepositoryException
- {
- return container.holders;
- }
- }
-
- class MyWorkspaceStorageCache extends LinkedWorkspaceStorageCacheImpl
- {
- public MyWorkspaceStorageCache() throws RepositoryConfigurationException
- {
- super("", false, 0, 0, 0, 0, false, false, 0, false);
- }
-
- public boolean isEnabled()
- {
- return false;
- }
- }
-
-}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -16,14 +16,12 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
-import org.exoplatform.services.jcr.JcrImplBaseTest;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import junit.framework.TestCase;
+
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
-import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.ItemType;
import org.exoplatform.services.jcr.datamodel.NodeData;
@@ -54,7 +52,7 @@
* nicolas.filotto(a)exoplatform.com
* 29 mars 2010
*/
-public class TestCacheableWorkspaceDataManager extends JcrImplBaseTest
+public class TestCacheableWorkspaceDataManager extends TestCase
{
private static final int READER = 100;
@@ -68,16 +66,13 @@
private MyWorkspaceStorageConnection con;
@Override
- public void setUp() throws Exception
+ protected void setUp() throws Exception
{
super.setUp();
this.con = new MyWorkspaceStorageConnection();
this.wdc = new MyWorkspaceDataContainer(con);
- WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
- WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
this.cwdm =
- new CacheableWorkspaceDataManager(wconf, wdc, new MyWorkspaceStorageCache(),
- new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, new MyWorkspaceStorageCache(), new SystemDataContainerHolder(wdc));
}
@Override
@@ -444,20 +439,6 @@
{
}
- /**
- * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#addListener(org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener)
- */
- public void addListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException
- {
- }
-
- /**
- * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#removeListener(org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener)
- */
- public void removeListener(WorkspaceStorageCacheListener listener) throws UnsupportedOperationException
- {
- }
-
}
private static class MyWorkspaceStorageConnection implements WorkspaceStorageConnection
@@ -618,15 +599,6 @@
return null;
}
- /**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getACLHolders()
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- return null;
- }
-
};
private static class MyWorkspaceDataContainer extends WorkspaceDataContainerBase
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -21,8 +21,6 @@
import org.exoplatform.commons.utils.QName;
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.access.AccessControlList;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
@@ -74,12 +72,10 @@
{
MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
- WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
- WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
CacheableWorkspaceDataManager cwdmNode1 =
- new CacheableWorkspaceDataManager(wconf, wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
CacheableWorkspaceDataManager cwdmNode2 =
- new CacheableWorkspaceDataManager(wconf, wdc, cache2 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, cache2 = getCacheImpl(), new SystemDataContainerHolder(wdc));
NodeData parentNode = new PersistedNodeData("parent-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node")), Constants.ROOT_UUID, 1, 0,
Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
// Test getChildNodesData
@@ -333,12 +329,10 @@
// testConsistency
con = new MyWorkspaceStorageConnection(true);
wdc = new MyWorkspaceDataContainer(con);
- wsc = repository.getWorkspaceContainer("ws");
- wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
cwdmNode1 =
- new CacheableWorkspaceDataManager(wconf, wdc, cache1, new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, cache1, new SystemDataContainerHolder(wdc));
cwdmNode2 =
- new CacheableWorkspaceDataManager(wconf, wdc, cache2, new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, cache2, new SystemDataContainerHolder(wdc));
parentNode = new PersistedNodeData("parent2-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node")), Constants.ROOT_UUID, 1, 0,
Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
// Test getChildNodesData
@@ -955,15 +949,8 @@
return children;
}
-
- /**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getACLHolders()
- */
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- return null;
- }
+
+
};
private static class MyWorkspaceDataContainer extends WorkspaceDataContainerBase
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-08-22 14:38:50 UTC (rev 4788)
@@ -22,7 +22,6 @@
import org.exoplatform.services.jcr.config.CacheEntry;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
@@ -35,9 +34,9 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspaceStorageCacheBaseCase;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
@@ -84,10 +83,8 @@
{
MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
- WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
- WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
final CacheableWorkspaceDataManager cwdm =
- new CacheableWorkspaceDataManager(wconf, wdc, getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wdc, getCacheImpl(), new SystemDataContainerHolder(wdc));
String idNode = "foo1";
executeConcurrentReadNWrite(con, cwdm, Mode.READ_FIRST, idNode);
assertNotNull(cwdm.getItemData(idNode));
@@ -318,17 +315,6 @@
return getChildNodesData(parent);
}
-
- /**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getACLHolders()
- */
- @Override
- public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
- UnsupportedOperationException
- {
- return null;
- }
-
};
private static class MyWorkspaceDataContainer extends WorkspaceDataContainerBase
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2011-08-22 14:38:50 UTC (rev 4788)
@@ -262,7 +262,11 @@
operation but in same time Observation'll not notified, has
default value true</entry>
</row>
+ </tbody>
+ </tgroup>
+ <tgroup cols="2">
+ <tbody>
<row>
<entry>lazy-node-iterator-page-size</entry>
@@ -270,20 +274,6 @@
can be retrieved from storage per request. The default value is
100</entry>
</row>
-
- <row>
- <entry>acl-bloomfilter-false-positive-probability</entry>
-
- <entry>ACL Bloom-filter desired false positive probability. Range
- [0..1]. Default value 0.1d.</entry>
- </row>
-
- <row>
- <entry>acl-bloomfilter-elements-number</entry>
-
- <entry>Expected number of ACL-elements in the Bloom-filter.
- Default value 1000000.</entry>
- </row>
</tbody>
</tgroup>
</table>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-22 12:38:19 UTC (rev 4787)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-22 14:38:50 UTC (rev 4788)
@@ -24,8 +24,6 @@
<property name="max-buffer-size" value="200K"/>
<property name="swap-directory" value="target/temp/swap/ws"/>
<property name="lazy-node-iterator-page-size" value="50"/>
- <property name="acl-bloomfilter-false-positive-probability" value="0.1d"/>
- <property name="acl-bloomfilter-elements-number" value="1000000"/>
</properties></programlisting>
<para>Properties are Container specific parameters:</para>
@@ -53,26 +51,6 @@
child nodes iterator settings. Defines size of page, the number of nodes
that are retrieved from persistent storage at once.</para>
- <para><emphasis
- role="bold">acl-bloomfilter-false-positive-probability</emphasis>: ACL
- Bloom-filter settings. ACL Bloom-filter desired false positive probability.
- Range [0..1]. Default value 0.1d.</para>
-
- <para><emphasis role="bold">acl-bloomfilter-elements-number</emphasis>: ACL
- Bloom-filter settings. Expected number of ACL-elements in the Bloom-filter.
- Default value 1000000.</para>
-
- <note>
- <para>Bloom-filter used to avoid read nodes that definitely do not have
- ACL. <emphasis
- role="bold">acl-bloomfilter-false-positive-probability</emphasis> and
- <emphasis role="bold">acl-bloomfilter-elements-number</emphasis> used to
- configure such filters.</para>
-
- <para>More about Bloom filters you can read here <ulink
- url="http://en.wikipedia.org/wiki/Bloom_filter">http://en.wikipedia.org/wiki/Bloom_filter</ulink>.</para>
- </note>
-
<para>eXo JCR has an RDB (JDBC) based, production ready <emphasis
role="bold">Workspace Data Container</emphasis>.</para>
12 years, 8 months
exo-jcr SVN: r4787 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-22 08:38:19 -0400 (Mon, 22 Aug 2011)
New Revision: 4787
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/external-value-storages.xml
Log:
EXOJCR-1486: Support to disable value-storage
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/external-value-storages.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/external-value-storages.xml 2011-08-22 12:32:19 UTC (rev 4786)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/external-value-storages.xml 2011-08-22 12:38:19 UTC (rev 4787)
@@ -216,4 +216,15 @@
container;</member>
</simplelist></para>
</section>
+
+ <section>
+ <title>Disabling value storage</title>
+
+ <para>JCR allows to disable value storage by adding property into
+ configuration. For interal usage and testing purpose only.</para>
+
+ <programlisting language="xml"><property name="enabled" value="false" /></programlisting>
+
+ <para>Be careful, all stored values will be unaccessible.</para>
+ </section>
</chapter>
12 years, 8 months
exo-jcr SVN: r4786 - jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-08-22 08:32:19 -0400 (Mon, 22 Aug 2011)
New Revision: 4786
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestGet.java
Log:
EXOJCR-1379: added unit tests
Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestGet.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestGet.java 2011-08-22 11:57:00 UTC (rev 4785)
+++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestGet.java 2011-08-22 12:32:19 UTC (rev 4786)
@@ -39,6 +39,7 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
+import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
@@ -193,6 +194,64 @@
}
+ /**
+ * We test for parent href to be contained in response.
+ * We GET a collection and receive an html. Html should contain
+ * a href to parent collection of requested collection.
+ * @throws Exception
+ */
+ public void testParentHrefForGetColRequest() throws Exception
+ {
+ String folderOne = TestUtils.getFolderName();
+ String folderTwo = folderOne + TestUtils.getFolderName();
+
+ // add collections
+ TestUtils.addFolder(session, folderOne, defaultFolderNodeType, "");
+ TestUtils.addFolder(session, folderTwo, defaultFolderNodeType, "");
+
+ // get a sub-collection
+ ContainerResponse response = service(WebDAVMethods.GET, getPathWS() + folderTwo, "", null, null);
+ assertEquals(HTTPStatus.OK, response.getStatus());
+
+ // serialize response entity to string
+ XSLTStreamingOutput XSLTout = (XSLTStreamingOutput)response.getEntity();
+ ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+ XSLTout.write(byteOut);
+
+ assertTrue("Response should contain parent collection href", byteOut.toString().contains(folderOne));
+ }
+
+ /**
+ * We test for parent href to be contained in response. We GET a collection,
+ * which has non latin letters in its name, and receive an html like response.
+ * Response should contain href to parent collection of requested collection.
+ * Details can be found here: https://issues.jboss.org/browse/EXOJCR-1379
+ * @throws Exception
+ */
+ public void testParentHrefForGetColWithNonLatinNameRequest() throws Exception
+ {
+ // "%40" corresponds to '@' symbol
+ String folderOne = TestUtils.getFolderName() + "%40";
+ String folderTwo = folderOne + TestUtils.getFolderName() + "%40";
+
+ ContainerResponse response;
+
+ //add collections
+ TestUtils.addFolder(session, URLDecoder.decode(folderOne, "UTF-8"), defaultFolderNodeType, "");
+ TestUtils.addFolder(session, URLDecoder.decode(folderTwo, "UTF-8"), defaultFolderNodeType, "");
+
+ //get a sub-collection
+ response = service(WebDAVMethods.GET, getPathWS() + folderTwo, "", null, null);
+ assertEquals(HTTPStatus.OK, response.getStatus());
+
+ // serialize response entity to string
+ XSLTStreamingOutput XSLTout = (XSLTStreamingOutput)response.getEntity();
+ ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+ XSLTout.write(byteOut);
+
+ assertTrue("Response should contain parent collection href", byteOut.toString().contains(folderOne));
+ }
+
@Override
protected String getRepositoryName()
{
12 years, 8 months
exo-jcr SVN: r4785 - in jcr/trunk/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/storage/value and 3 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-22 07:57:00 -0400 (Mon, 22 Aug 2011)
New Revision: 4785
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-1486: Support to disable value-storage
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -33,6 +33,7 @@
<jcr.test.configuration.file>/conf/standalone/test-configuration-jbc.xml</jcr.test.configuration.file>
<jbosscache.shareable>true</jbosscache.shareable>
<cache.enabled>true</cache.enabled>
+ <value.storage.enabled>true</value.storage.enabled>
<jbc.specific.1>**/jbc/**</jbc.specific.1>
<jbc.specific.2>**/jbosscache/**</jbc.specific.2>
<ispn.specific.1>**/ispn/**</ispn.specific.1>
@@ -390,6 +391,10 @@
<name>cache-enabled</name>
<value>${cache.enabled}</value>
</property>
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
<!-- Uncomment the line below if you want to enable the statistics -->
<!--property>
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
@@ -615,6 +620,10 @@
<name>cache-enabled</name>
<value>${cache.enabled}</value>
</property>
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
<property>
<name>known.issues</name>
<value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
@@ -703,6 +712,10 @@
<value>${cache.enabled}</value>
</property>
<property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
+ <property>
<name>known.issues</name>
<value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
@@ -791,11 +804,10 @@
<name>cache-enabled</name>
<value>${cache.enabled}</value>
</property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
- </property-->
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
<!-- We add this system property due to some incompatibility between IPv6 and
some JVM of Linux distributions such as Ubuntu and Fedora-->
<property>
@@ -865,6 +877,12 @@
</properties>
</profile>
<profile>
+ <id>value-storage-disabled</id>
+ <properties>
+ <value.storage.enabled>false</value.storage.enabled>
+ </properties>
+ </profile>
+ <profile>
<id>sjdbc</id>
<properties>
<jcr.test.configuration.file>/conf/standalone/test-configuration-sjdbc-jbc.xml</jcr.test.configuration.file>
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2011-08-22 11:57:00 UTC (rev 4785)
@@ -55,9 +55,17 @@
private static final long serialVersionUID = 4537116106932443262L;
+ /**
+ * Logger.
+ */
private static Log log = ExoLogger.getLogger("exo.jcr.component.core.StandaloneStoragePluginProvider");
/**
+ * Value storage enabling parameter. For interal usage only and testing purpose.
+ */
+ private static final String VALUE_STORAGE_ENABLED_PARAM = "enabled";
+
+ /**
* ValueData resorces holder (Files etc). It's singleton feature.
*/
private final ValueDataResourceHolder resorcesHolder;
@@ -73,60 +81,64 @@
if (storages != null)
for (ValueStorageEntry storageEntry : storages)
{
-
- // can be only one storage with given id
- for (ValueStoragePlugin vsp : this)
+ if (storageEntry.getParameterBoolean(VALUE_STORAGE_ENABLED_PARAM, true))
{
- if (vsp.getId().equals(storageEntry.getId()))
- throw new RepositoryConfigurationException("Value storage with ID '" + storageEntry.getId()
- + "' already exists");
- }
+ // can be only one storage with given id
+ for (ValueStoragePlugin vsp : this)
+ {
+ if (vsp.getId().equals(storageEntry.getId()))
+ {
+ throw new RepositoryConfigurationException("Value storage with ID '" + storageEntry.getId()
+ + "' already exists");
+ }
+ }
- Object o = null;
- try
- {
- o =
- Class.forName(storageEntry.getType()).getConstructor(FileCleaner.class).newInstance(
- holder.getFileCleaner());
+ Object o = null;
+ try
+ {
+ o =
+ Class.forName(storageEntry.getType()).getConstructor(FileCleaner.class)
+ .newInstance(holder.getFileCleaner());
- }
- catch (Exception e)
- {
- log.error("Value Storage Plugin instantiation FAILED. ", e);
- continue;
- }
- if (!(o instanceof ValueStoragePlugin))
- {
- log.error("Not a ValueStoragePlugin object IGNORED: " + o);
- continue;
- }
+ }
+ catch (Exception e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ if (!(o instanceof ValueStoragePlugin))
+ {
+ log.error("Not a ValueStoragePlugin object IGNORED: " + o);
+ continue;
+ }
- ValueStoragePlugin plugin = (ValueStoragePlugin)o;
- // init filters
- ArrayList<ValuePluginFilter> filters = new ArrayList<ValuePluginFilter>();
- List<ValueStorageFilterEntry> filterEntries = storageEntry.getFilters();
- for (ValueStorageFilterEntry filterEntry : filterEntries)
- {
- ValuePluginFilter filter =
- new ValuePluginFilter(PropertyType.valueFromName(filterEntry.getPropertyType()), null, null,
- filterEntry.getMinValueSize());
- filters.add(filter);
- }
+ ValueStoragePlugin plugin = (ValueStoragePlugin)o;
+ // init filters
+ ArrayList<ValuePluginFilter> filters = new ArrayList<ValuePluginFilter>();
+ List<ValueStorageFilterEntry> filterEntries = storageEntry.getFilters();
+ for (ValueStorageFilterEntry filterEntry : filterEntries)
+ {
+ ValuePluginFilter filter =
+ new ValuePluginFilter(PropertyType.valueFromName(filterEntry.getPropertyType()), null, null,
+ filterEntry.getMinValueSize());
+ filters.add(filter);
+ }
- // init properties
- Properties props = new Properties();
- List<SimpleParameterEntry> paramEntries = storageEntry.getParameters();
- for (SimpleParameterEntry paramEntry : paramEntries)
- {
- props.setProperty(paramEntry.getName(), paramEntry.getValue());
- }
+ // init properties
+ Properties props = new Properties();
+ List<SimpleParameterEntry> paramEntries = storageEntry.getParameters();
+ for (SimpleParameterEntry paramEntry : paramEntries)
+ {
+ props.setProperty(paramEntry.getName(), paramEntry.getValue());
+ }
- plugin.init(props, resorcesHolder);
- plugin.setId(storageEntry.getId());
- plugin.setFilters(filters);
+ plugin.init(props, resorcesHolder);
+ plugin.setId(storageEntry.getId());
+ plugin.setFilters(filters);
- add(plugin);
- log.info("Value Storage Plugin initialized " + plugin);
+ add(plugin);
+ log.info("Value Storage Plugin initialized " + plugin);
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java 2011-08-22 11:57:00 UTC (rev 4785)
@@ -139,7 +139,7 @@
}
}
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < channels.size(); i++)
{
try
{
@@ -155,7 +155,7 @@
mySession.save();
// checking whether values are still in value storage.
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < channels.size(); i++)
{
try
{
@@ -177,7 +177,6 @@
{
log.warn("Value storages are not configured, test skipped.");
}
-
}
@Override
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -34,6 +34,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -104,6 +105,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -179,6 +181,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -255,6 +258,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
@@ -268,6 +272,7 @@
<property name="vcas-type"
value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -355,6 +360,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -424,6 +430,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -504,6 +511,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -586,6 +594,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -666,6 +675,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -39,6 +39,7 @@
value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
<property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -102,6 +103,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -168,6 +170,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -239,6 +242,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
@@ -252,6 +256,7 @@
<property name="vcas-type"
value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -333,6 +338,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -398,6 +404,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -472,6 +479,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -546,6 +554,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -619,6 +628,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -45,10 +45,10 @@
<properties>
<property name="path" value="target/temp/values/ws" />
<property name="digest-algo" value="MD5" />
- <property name="vcas-type"
- value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
<property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -101,10 +101,10 @@
<property name="swap-directory" value="target/temp/swap/ws1" />
</properties>
<value-storages>
- <value-storage id="ws1"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -160,10 +160,10 @@
<property name="swap-directory" value="target/temp/swap/ws2" />
</properties>
<value-storages>
- <value-storage id="ws2"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -224,23 +224,22 @@
This storage is used to check whether properties are removed correctly from each value-storage
(TestRemoveFromValueStorage.java)
-->
- <value-storage id="ws3_big"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
</filters>
</value-storage>
- <value-storage id="ws3"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
+ <value-storage id="ws3" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3" />
<property name="digest-algo" value="MD5" />
- <property name="vcas-type"
- value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -315,6 +314,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -373,6 +373,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -440,6 +441,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -507,6 +509,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -573,6 +576,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -49,6 +49,7 @@
value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
<property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -105,6 +106,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -164,6 +166,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -228,6 +231,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
@@ -241,6 +245,7 @@
<property name="vcas-type"
value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -316,6 +321,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -374,6 +380,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -441,6 +448,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -508,6 +516,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -574,6 +583,7 @@
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -47,6 +47,7 @@
<property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
<property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -99,6 +100,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -152,6 +154,7 @@
<value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -211,6 +214,7 @@
<value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
@@ -222,6 +226,7 @@
<property name="digest-algo" value="MD5" />
<property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -290,6 +295,7 @@
<value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -343,6 +349,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -407,6 +414,7 @@
<value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -467,6 +475,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -526,6 +535,7 @@
<value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-08-22 11:12:23 UTC (rev 4784)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-08-22 11:57:00 UTC (rev 4785)
@@ -47,6 +47,7 @@
<property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
<property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -99,6 +100,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -152,6 +154,7 @@
<value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -211,6 +214,7 @@
<value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="1024K" />
@@ -222,6 +226,7 @@
<property name="digest-algo" value="MD5" />
<property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
<property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -290,6 +295,7 @@
<value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -343,6 +349,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -407,6 +414,7 @@
<value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -467,6 +475,7 @@
<value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
@@ -526,6 +535,7 @@
<value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
<property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
</properties>
<filters>
<filter property-type="Binary" min-value-size="100K" />
12 years, 8 months
exo-jcr SVN: r4784 - in core/trunk: exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-22 07:12:23 -0400 (Mon, 22 Aug 2011)
New Revision: 4784
Modified:
core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/MembershipHandler.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/MembershipDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipDAOImpl.java
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java
Log:
EXOJCR-1236: MembershipHandler.linkMembership() should not allow to add membership record which already exists
Modified: core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/MembershipHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/MembershipHandler.java 2011-08-19 12:24:53 UTC (rev 4783)
+++ core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/MembershipHandler.java 2011-08-22 11:12:23 UTC (rev 4784)
@@ -46,8 +46,9 @@
public void createMembership(Membership m, boolean broadcast) throws Exception;
/**
- * Use this method to create a membership record, a relation of the user ,
- * group and membership type
+ * Use this method to create a membership record, a relation of the user,
+ * group and membership type. Doesn't throw an Exception if membership record with the
+ * same user, group and membership type exists.
*
* @param user The user of the membership
* @param group The group of the membership
@@ -55,8 +56,7 @@
* @param broadcast Broadcast the event if the value of the broadcast is
* 'true'
* @throws Exception An exception is thrown if the method is fail to access
- * the database, membership type not existed, a membership record with the same user,
- * group and membership type existed, or any listener fail to handle the event.
+ * the database, membership type not existed or any listener fail to handle the event.
*/
public void linkMembership(User user, Group group, MembershipType m, boolean broadcast) throws Exception;
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/MembershipDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/MembershipDAOImpl.java 2011-08-19 12:24:53 UTC (rev 4783)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/MembershipDAOImpl.java 2011-08-22 11:12:23 UTC (rev 4784)
@@ -79,16 +79,25 @@
this.listeners_ = new ListenerStack(5);
}
+ /**
+ * {@inheritDoc}
+ */
public void addMembershipEventListener(MembershipEventListener listener)
{
listeners_.add(listener);
}
+ /**
+ * {@inheritDoc}
+ */
final public Membership createMembershipInstance()
{
return new MembershipImpl();
}
+ /**
+ * {@inheritDoc}
+ */
public void createMembership(Membership m, boolean broadcast) throws Exception
{
if (orgService.getMembershipTypeHandler().findMembershipType(m.getMembershipType()) == null)
@@ -97,15 +106,31 @@
+ " because membership type " + m.getMembershipType() + " is not exists.");
}
+ // check if we already have membership record
+ if (findMembershipByUserGroupAndType(m.getUserName(), m.getGroupId(), m.getMembershipType()) != null)
+ {
+ return;
+ }
+
if (broadcast)
+ {
preSave(m, true);
+ }
+
Session session = service_.openSession();
session.save(m);
+
if (broadcast)
+ {
postSave(m, true);
+ }
+
session.flush();
}
+ /**
+ * {@inheritDoc}
+ */
public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
{
if (user == null)
@@ -130,13 +155,12 @@
membership.setMembershipType(mt.getName());
membership.setGroupId(g.getId());
membership.setId(IdentifierUtil.generateUUID(membership));
-
- if (findMembershipByUserGroupAndType(user.getUserName(), g.getId(), mt.getName()) != null)
- return;
-
createMembership(membership, broadcast);
}
+ /**
+ * {@inheritDoc}
+ */
public void saveMembership(Membership m, boolean broadcast) throws Exception
{
if (broadcast)
@@ -148,6 +172,9 @@
session.flush();
}
+ /**
+ * {@inheritDoc}
+ */
public Membership removeMembership(String id, boolean broadcast) throws Exception
{
Session session = service_.openSession();
@@ -166,6 +193,9 @@
return m;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection removeMembershipByUser(String username, boolean broadcast) throws Exception
{
Collection collection = findMembershipsByUser(username);
@@ -187,6 +217,9 @@
return collection;
}
+ /**
+ * {@inheritDoc}
+ */
public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
{
Session session = service_.openSession();
@@ -210,6 +243,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
{
Session session = service_.openSession();
@@ -220,6 +256,9 @@
return memberships;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByUser(String userName) throws Exception
{
Session session = service_.openSession();
@@ -246,6 +285,9 @@
return session.createQuery(queryFindMembershipsByUser).setString(0, userName).list();
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByGroup(Group group) throws Exception
{
Session session = service_.openSession();
@@ -253,6 +295,9 @@
return memberships;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByGroupId(String groupId) throws Exception
{
Session session = service_.openSession();
@@ -262,6 +307,9 @@
return memberships;
}
+ /**
+ * {@inheritDoc}
+ */
public Membership findMembership(String id) throws Exception
{
Session session = service_.openSession();
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipDAOImpl.java 2011-08-19 12:24:53 UTC (rev 4783)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipDAOImpl.java 2011-08-22 11:12:23 UTC (rev 4784)
@@ -67,6 +67,9 @@
return new MembershipImpl();
}
+ /**
+ * {@inheritDoc}
+ */
public void createMembership(Membership membership, boolean broadcast) throws Exception
{
if (service.getMembershipTypeHandler().findMembershipType(membership.getMembershipType()) == null)
@@ -75,15 +78,31 @@
+ " because membership type " + membership.getMembershipType() + " not exists.");
}
+ // check if we already have membership record
+ if (findMembershipByUserGroupAndType(membership.getUserName(), membership.getGroupId(),
+ membership.getMembershipType()) != null)
+ {
+ return;
+ }
+
MembershipImpl membershipImpl = (MembershipImpl)membership;
if (broadcast)
+ {
listenerService_.broadcast("organization.membership.preSave", this, membershipImpl);
+ }
+
membershipImpl.setId(IdentifierUtil.generateUUID(membership));
super.save(membershipImpl);
+
if (broadcast)
+ {
listenerService_.broadcast("organization.membership.postSave", this, membershipImpl);
+ }
}
+ /**
+ * {@inheritDoc}
+ */
public void linkMembership(User user, Group group, MembershipType mt, boolean broadcast) throws Exception
{
if (user == null)
@@ -104,16 +123,20 @@
}
if (log.isDebugEnabled())
+ {
log.debug("LINK MEMBER SHIP (" + user.getUserName() + ", " + group.getId() + " , " + mt.getName() + ");");
+ }
+
MembershipImpl membership = new MembershipImpl();
membership.setUserName(user.getUserName());
membership.setMembershipType(mt.getName());
membership.setGroupId(group.getId());
- if (findMembershipByUserGroupAndType(user.getUserName(), group.getId(), mt.getName()) != null)
- return;
createMembership(membership, broadcast);
}
+ /**
+ * {@inheritDoc}
+ */
public Membership findMembership(String id) throws Exception
{
if (id == null)
@@ -123,6 +146,9 @@
return loadUnique(query.toQuery());
}
+ /**
+ * {@inheritDoc}
+ */
public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
{
@@ -139,6 +165,9 @@
return member;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByGroup(Group group) throws Exception
{
@@ -151,6 +180,9 @@
return list;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByUser(String userName) throws Exception
{
if (userName == null)
@@ -164,6 +196,9 @@
return list;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
{
if (userName == null || groupId == null)
@@ -178,6 +213,9 @@
return list;
}
+ /**
+ * {@inheritDoc}
+ */
public Membership removeMembership(String id, boolean broadcast) throws Exception
{
DBObjectQuery<MembershipImpl> query = new DBObjectQuery<MembershipImpl>(MembershipImpl.class);
@@ -206,6 +244,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings("unchecked")
public Collection removeMembershipByUser(String username, boolean broadcast) throws Exception
{
@@ -220,6 +261,9 @@
return members;
}
+ /**
+ * {@inheritDoc}
+ */
public Collection removeMemberships(DBObjectQuery<MembershipImpl> query, boolean broadcast) throws Exception
{
DBPageList<MembershipImpl> pageList = new DBPageList<MembershipImpl>(20, this, query);
@@ -250,6 +294,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings("unchecked")
public void addMembershipEventListener(MembershipEventListener listener)
{
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java 2011-08-19 12:24:53 UTC (rev 4783)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/MembershipDAOImpl.java 2011-08-22 11:12:23 UTC (rev 4784)
@@ -123,6 +123,12 @@
+ " because membership type " + m.getMembershipType() + " is not exists.");
}
+ // check if we already have membership record
+ if (findMembershipByUserGroupAndType(m.getUserName(), m.getGroupId(), m.getMembershipType()) != null)
+ {
+ return;
+ }
+
for (int err = 0;; err++)
{
try
12 years, 8 months
exo-jcr SVN: r4783 - in jcr/trunk/exo.jcr.component.webdav/src/main: resources/xslt and 1 other directory.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-08-19 08:24:53 -0400 (Fri, 19 Aug 2011)
New Revision: 4783
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
jcr/trunk/exo.jcr.component.webdav/src/main/resources/xslt/get-method.xsl
Log:
EXOJCR-1379: fixed node's parent-href generatin in XSLT transformation
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2011-08-19 11:58:14 UTC (rev 4782)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2011-08-19 12:24:53 UTC (rev 4783)
@@ -88,6 +88,11 @@
final String XML_HREF = "xlink:href";
/**
+ * XML parent href constant.
+ */
+ final static String XML_PARENT_HREF = "xlink:parent-href";
+
+ /**
* XML namespace prefix.
*/
final String PREFIX_XMLNS = "xmlns:sv";
@@ -428,6 +433,20 @@
writer.writeAttribute(XLINK_XMLNS, XLINK_LINK);
writer.writeAttribute(XML_NAME, node.getName());
writer.writeAttribute(XML_HREF, rootHref + TextUtil.escape(node.getPath(), '%', true));
+
+
+ if (!node.getPath().equals("/"))
+ {
+ // this is added to fix EXOJCR-1379
+ // XSLT string operations with actual node href, (which are used during XSLT transformation
+ // to receive parent href) produce wrong parent-href if node path containes non-latin symbols,
+ // so instead we simply add one more attribute which already contains parent-href
+ // as result: no XLST processor string manipulation is needed
+ String nodeParentHref = rootHref + TextUtil.escape(node.getParent().getPath(), '%', true);
+ writer.writeAttribute(XML_PARENT_HREF, nodeParentHref);
+ }
+
+
// add properties
for (PropertyIterator pi = node.getProperties(); pi.hasNext();)
{
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/resources/xslt/get-method.xsl
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/resources/xslt/get-method.xsl 2011-08-19 11:58:14 UTC (rev 4782)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/resources/xslt/get-method.xsl 2011-08-19 12:24:53 UTC (rev 4783)
@@ -26,7 +26,7 @@
<!-- Parent node link -->
<a>
<xsl:attribute name="href">
- <xsl:value-of select="substring(./@xlink:href, 1, string-length(./@xlink:href) - string-length(./@sv:name))" />
+ <xsl:value-of select="./@xlink:parent-href" />
</xsl:attribute>
<xsl:if test="$folder-icon-path!=''">
<img src="{$folder-icon-path}" alt="" />
12 years, 8 months
exo-jcr SVN: r4782 - in jcr/trunk/exo.jcr.component.core/src: main/resources and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-19 07:58:14 -0400 (Fri, 19 Aug 2011)
New Revision: 4782
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java
jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-852: add profiles to run tests without cache
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java 2011-08-19 11:58:14 UTC (rev 4782)
@@ -37,6 +37,20 @@
private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ConfigurationFormat");
+ public static boolean parseBoolean(String text)
+ {
+ try
+ {
+ text = Deserializer.resolveNClean(text);
+ return Boolean.valueOf(text).booleanValue();
+ }
+ catch (Throwable e)
+ {
+ LOG.warn("Unparseable boolean '" + text + "'.", e);
+ return false;
+ }
+ }
+
public static int parseInt(String text)
{
try
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -1,6 +1,8 @@
<binding>
<!-- the default deserializer to use for String -->
<format type="java.lang.String" deserializer="org.exoplatform.container.xml.Deserializer.resolveString"/>
+ <!-- the default deserializer to use for boolean -->
+ <format type="boolean" deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseBoolean"/>
<mapping name="repository-service" class="org.exoplatform.services.jcr.config.RepositoryServiceConfiguration">
<value name="default-repository" field="defaultRepositoryName" style="attribute" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config-jbc.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -46,7 +46,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -111,7 +111,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -186,7 +186,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -275,7 +275,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -368,7 +368,7 @@
<property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -438,7 +438,7 @@
value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -518,7 +518,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -600,7 +600,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
@@ -680,7 +680,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="test-jbosscache-data.xml" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -51,7 +51,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -109,7 +109,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -175,7 +175,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -264,7 +264,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -347,7 +347,7 @@
value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -411,7 +411,7 @@
<property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -486,7 +486,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -560,7 +560,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
@@ -633,7 +633,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-jbc.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -61,7 +61,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -112,7 +112,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -171,7 +171,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -253,7 +253,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -329,7 +329,7 @@
value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -386,7 +386,7 @@
<property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -454,7 +454,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -521,7 +521,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -587,7 +587,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc-jbc.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -61,7 +61,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -112,7 +112,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -171,7 +171,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -253,7 +253,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -330,7 +330,7 @@
value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -387,7 +387,7 @@
<property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -455,7 +455,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -522,7 +522,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
@@ -588,7 +588,7 @@
value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
</properties>
</initializer>
- <cache enabled="true"
+ <cache enabled="${cache-enabled}"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -59,7 +59,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -106,7 +106,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -159,7 +159,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -234,7 +234,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -303,7 +303,7 @@
<property name="root-permissions" value="*:/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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -356,7 +356,7 @@
<property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -420,7 +420,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -480,7 +480,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -539,7 +539,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-08-19 11:52:03 UTC (rev 4781)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-08-19 11:58:14 UTC (rev 4782)
@@ -59,7 +59,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -106,7 +106,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -159,7 +159,7 @@
</value-storage>
</value-storages>
</container>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -234,7 +234,7 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -303,7 +303,7 @@
<property name="root-permissions" value="*:/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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -356,7 +356,7 @@
<property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
</properties>
</initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -420,7 +420,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -480,7 +480,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
@@ -539,7 +539,7 @@
<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.infinispan.ISPNCacheWorkspaceStorageCache">
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
</properties>
12 years, 8 months