exo-jcr SVN: r5096 - jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:55:56 -0400 (Wed, 26 Oct 2011)
New Revision: 5096
Added:
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mssql.xml
Log:
EXOJCR-1585: add configuration for MSSQL
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mssql.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mssql.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mssql.xml 2011-10-26 11:55:56 UTC (rev 5096)
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file" />
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/jcr.log" />
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <!-- property name="log4j.category.ext.BackupScheduler" value="DEBUG"/>
+ <property name="log4j.category.ext.BackupManagerImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.ext.RestRepositoryService" value="DEBUG"/>
+
+ <!-- property name="log4j.category.org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyResourceLoader" value="DEBUG" / -->
+
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-ext-config-backup.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
+ <property name="source-name" value="jdbcjcr" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryService</type>
+ </component>
+
+ <!-- backup -->
+ <component>
+ <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key>
+ <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl</type>
+ <init-params>
+ <properties-param>
+ <name>backup-properties</name>
+ <property name="default-incremental-job-period" value="3600" />
+ <property name="full-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob" />
+ <property name="incremental-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" />
+ <property name="backup-dir" value="target/backup" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- HTTPBackupAgent -->
+ <component>
+ <type>org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.NodeRepresentationService</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.XMLViewNodeRepresentationRenderer</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.jcr.Handler</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
+ <property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=db1;" />
+ <property name="username" value="tester" />
+ <property name="password" value="tester" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
+ <property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=db2_ws;" />
+ <property name="username" value="tester" />
+ <property name="password" value="tester" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
+ <property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=db2_ws1;" />
+ <property name="username" value="tester" />
+ <property name="password" value="tester" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
14 years, 6 months
exo-jcr SVN: r5095 - in jcr/trunk/exo.jcr.component.ext/src/test: resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:54:23 -0400 (Wed, 26 Oct 2011)
New Revision: 5095
Added:
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-sybase.xml
Modified:
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java
Log:
EXOJCR-1585: add configuration for Sybase
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java 2011-10-26 11:47:17 UTC (rev 5094)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java 2011-10-26 11:54:23 UTC (rev 5095)
@@ -46,11 +46,13 @@
public void testBackupRestoreExistingRepositorySingleDB() throws Exception
{
repositoryBackupRestore("db1");
+ repositoryBackupRestore("db1");
}
public void testBackupRestoreExistingRepositoryMultiDB() throws Exception
{
repositoryBackupRestore("db2");
+ repositoryBackupRestore("db2");
}
protected void repositoryBackupRestore(String repositoryName) throws Exception
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-sybase.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-sybase.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-sybase.xml 2011-10-26 11:54:23 UTC (rev 5095)
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file" />
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/jcr.log" />
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <!-- property name="log4j.category.ext.BackupScheduler" value="DEBUG"/>
+ <property name="log4j.category.ext.BackupManagerImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.ext.RestRepositoryService" value="DEBUG"/>
+
+ <!-- property name="log4j.category.org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyResourceLoader" value="DEBUG" / -->
+
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-ext-config-backup.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
+ <property name="source-name" value="jdbcjcr" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryService</type>
+ </component>
+
+ <!-- backup -->
+ <component>
+ <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key>
+ <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl</type>
+ <init-params>
+ <properties-param>
+ <name>backup-properties</name>
+ <property name="default-incremental-job-period" value="3600" />
+ <property name="full-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob" />
+ <property name="incremental-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" />
+ <property name="backup-dir" value="target/backup" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- HTTPBackupAgent -->
+ <component>
+ <type>org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.NodeRepresentationService</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.XMLViewNodeRepresentationRenderer</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.jcr.Handler</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.sybase.jdbc4.jdbc.SybDriver" />
+ <property name="url" value="jdbc:sybase:Tds:localhost:5003/db1" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.sybase.jdbc4.jdbc.SybDriver" />
+ <property name="url" value="jdbc:sybase:Tds:localhost:5003/db2_ws" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.sybase.jdbc4.jdbc.SybDriver" />
+ <property name="url" value="jdbc:sybase:Tds:localhost:5003/db2_ws1" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
14 years, 6 months
exo-jcr SVN: r5094 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:47:17 -0400 (Wed, 26 Oct 2011)
New Revision: 5094
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/repository-check-controller.xml
Log:
EXOJCR-1471: doc updated
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/repository-check-controller.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/repository-check-controller.xml 2011-10-26 11:47:05 UTC (rev 5093)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/repository-check-controller.xml 2011-10-26 11:47:17 UTC (rev 5094)
@@ -23,7 +23,7 @@
each node in index checks on persistent layer along with opposite
direction, when each node from Data Container validated in index. Access
to check tool is exposed via JMX interface, with the following operation
- available: </para>
+ available:</para>
<table>
<title>Available methods</title>
@@ -54,21 +54,12 @@
<entry>Inspect only SearchIndex</entry>
</row>
-
- <row>
- <entry>getStatus()</entry>
-
- <entry>Get inspection process status. If process is finished, it
- will return inspection result.</entry>
- </row>
</tbody>
</tgroup>
</table>
- <para>Operations are launched in a separate thread without blocking JMX
- connection and the status of background job can be accessed by getStatus()
- operation. All inspection activities and corrupted data identifier are
- stored in file, which can be found in app directory by name
+ <para>All inspection activities and corrupted data identifier are stored
+ in file, which can be found in app directory by name
<code>report-<repository name>-dd-MMM-yy-HH-mm.txt</code>. Path to
file will be returned in result message also. Please, take in account
thare is three types of inconsistency and two of them are critical. They
14 years, 6 months
exo-jcr SVN: r5093 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:47:05 -0400 (Wed, 26 Oct 2011)
New Revision: 5093
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryCheckController.java
Log:
EXOJCR-1471: remove separeated thread
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryCheckController.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryCheckController.java 2011-10-26 11:31:42 UTC (rev 5092)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryCheckController.java 2011-10-26 11:47:05 UTC (rev 5093)
@@ -65,34 +65,10 @@
protected static final String FILE_NAME = "report";
- protected class InspectorThread extends Thread
- {
- private final DataStorage[] checkData;
-
- InspectorThread(DataStorage[] checkData)
- {
- super();
- this.checkData = checkData;
- this.setDaemon(true);
- }
-
- /**
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run()
- {
- String result = checkRepositoryDataConsistency(checkData);
- inspectionFinished(result);
- }
- }
-
protected enum DataStorage {
DB, VALUE_STORAGE, LUCENE_INDEX
};
- private InspectorThread inspectorThread = null;
-
private File inspectionLogFile = null;
private String lastResult = null;
@@ -124,73 +100,34 @@
* @return String check consistency report
*/
@Managed
- @ManagedDescription("Check repository data consistency. DB data, value storage and lucene index will be checked."
- + "All writing threads will wait until check become finished.")
+ @ManagedDescription("Check repository data consistency. DB data, value storage and lucene index will be checked.")
public String checkRepositoryDataConsistency()
{
- return startInspectionInThread(new DataStorage[]{DataStorage.DB, DataStorage.VALUE_STORAGE,
+ return checkRepositoryDataConsistency(new DataStorage[]{DataStorage.DB, DataStorage.VALUE_STORAGE,
DataStorage.LUCENE_INDEX});
}
@Managed
- @ManagedDescription("Check repository database consistency."
- + "All writing threads will wait until check become finished.")
+ @ManagedDescription("Check repository database consistency.")
public String checkRepositoryDataBaseConsistency()
{
- return startInspectionInThread(new DataStorage[]{DataStorage.DB});
+ return checkRepositoryDataConsistency(new DataStorage[]{DataStorage.DB});
}
@Managed
- @ManagedDescription("Check repository value storage consistency."
- + "All writing threads will wait until check become finished.")
+ @ManagedDescription("Check repository value storage consistency.")
public String checkRepositoryValueStorageConsistency()
{
- return startInspectionInThread(new DataStorage[]{DataStorage.VALUE_STORAGE});
+ return checkRepositoryDataConsistency(new DataStorage[]{DataStorage.VALUE_STORAGE});
}
@Managed
- @ManagedDescription("Check repository search index consistency."
- + "All writing threads will wait until check become finished.")
+ @ManagedDescription("Check repository search index consistency.")
public String checkRepositorySearchIndexConsistency()
{
- return startInspectionInThread(new DataStorage[]{DataStorage.LUCENE_INDEX});
+ return checkRepositoryDataConsistency(new DataStorage[]{DataStorage.LUCENE_INDEX});
}
- @Managed
- @ManagedDescription("Get inspection status.")
- public String getStatus()
- {
- if (inspectorThread != null)
- {
- return "Data consistency inspection in progress..";
- }
- else
- {
- return lastResult;
- }
- }
-
- protected void inspectionFinished(String resultMessage)
- {
- this.lastResult = resultMessage;
- inspectorThread = null;
- }
-
- protected synchronized String startInspectionInThread(DataStorage[] checkData)
- {
- if (inspectorThread == null)
- {
- inspectorThread = new InspectorThread(checkData);
- inspectorThread.start();
-
- return "Data consistency inspection started.";
- }
- else
- {
- return "Current inspection process is not finished.";
- }
- }
-
protected String checkRepositoryDataConsistency(DataStorage[] checkData)
{
inspectionLogFile = null;
@@ -418,9 +355,5 @@
*/
public void stop()
{
- if (inspectorThread != null)
- {
- inspectorThread.interrupt();
- }
}
}
14 years, 6 months
exo-jcr SVN: r5092 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:31:42 -0400 (Wed, 26 Oct 2011)
New Revision: 5092
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
Log:
EXOJCR-1590: add docs
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2011-10-26 11:31:25 UTC (rev 5091)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2011-10-26 11:31:42 UTC (rev 5092)
@@ -1,145 +1,186 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- This document was created with Syntext Serna Free. --><!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This document was created with Syntext Serna Free. -->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="JCR.LockManagerConfiguration">
-<?dbhtml filename="ch-lock-manager-config.html"?> <title>LockManager configuration</title>
+ <?dbhtml filename="ch-lock-manager-config.html"?>
+
+ <title>LockManager configuration</title>
+
<section>
<title>Introduction</title>
+
<para>What LockManager does?</para>
+
<para>In general, LockManager stores Lock objects, so it can give a Lock
object or can release it, etc.</para>
+
<para>Also, LockManager is responsible for removing Locks that live too
- long. This parameter may be configured with "time-out" property.</para>
- <para>JCR provides two basic implementations of LockManager:</para>
+ long. This parameter may be configured with "time-out" property.</para>
+
+ <para>JCR provides two basic implementations of LockManager:</para>
+
<itemizedlist>
<listitem>
<para><classname>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl</classname>;</para>
</listitem>
+
<listitem>
<para><classname>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl</classname>;</para>
</listitem>
</itemizedlist>
+
<para>In this article, we will mostly mention about
CacheableLockManagerImpl.</para>
+
<para>You can enable LockManager by adding lock-manager-configuration to
workspace-configuration.</para>
+
<para>For example:</para>
- <programlisting language="xml"><workspace name="ws">
+
+ <programlisting language="xml"><workspace name="ws">
...
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
+ <property name="time-out" value="15m" />
...
</properties>
</lock-manager>
...
</workspace></programlisting>
</section>
+
<section>
<title>LockManagerImpl</title>
+
<para>LockManagerImpl is a simple implementation of LockManager, and also
faster than CacheableLockManager. It stores Lock objects in HashMap and
may also persist Locks if LockPersister is configured. LockManagerImpl
does not support replication in any way.</para>
- <para>See more about LockManager Configuration at <link linkend="JCR.eXoJCRconfiguration">here</link>.</para>
+
+ <para>See more about LockManager Configuration at <link
+ linkend="JCR.eXoJCRconfiguration">here</link>.</para>
</section>
+
<section>
<title>CacheableLockManagerImpl</title>
- <para>CacheableLockManagerImpl stores Lock objects in JBoss-cache, so Locks
- are replicable and affect on cluster, not only a single node. Also,
+
+ <para>CacheableLockManagerImpl stores Lock objects in JBoss-cache, so
+ Locks are replicable and affect on cluster, not only a single node. Also,
JBoss-cache has JDBCCacheLoader, so Locks will be stored to the
database.</para>
- <para>Both of the implementations support to remove Expired Locks. LockRemover separates threads, that periodically ask LockManager to remove Locks
- that live so long. So, the timeout for LockRemover may be set
- as follows, the default value is 30m.</para>
+
+ <para>Both of the implementations support to remove Expired Locks.
+ LockRemover separates threads, that periodically ask LockManager to remove
+ Locks that live so long. So, the timeout for LockRemover may be set as
+ follows, the default value is 30m.</para>
+
<programlisting language="xml"><properties>
- <property name="time-out" value="10m" />
+ <property name="time-out" value="10m" />
...
</properties></programlisting>
+
<section>
<title>Configuration</title>
+
<para>Replication requirements are the same for Cache.</para>
- <para> You can see a full JCR configuration example at <link linkend="JCR.ClusterConfig.JCRExternalConfig">here</link>.</para>
+
+ <para>You can see a full JCR configuration example at <link
+ linkend="JCR.ClusterConfig.JCRExternalConfig">here</link>.</para>
+
<para>Common tips:</para>
+
<itemizedlist>
<listitem>
- <para><parameter>clusterName</parameter> ("jbosscache-cluster-name")
+ <para><parameter>clusterName</parameter> ("jbosscache-cluster-name")
must be unique;</para>
</listitem>
+
<listitem>
<para><parameter>cache.jdbc.table.name</parameter> must be unique
per datasource;</para>
</listitem>
+
<listitem>
<para><parameter>cache.jdbc.fqn.type</parameter> and
cache.jdbc.node.type must be configured according to used
database;</para>
</listitem>
</itemizedlist>
- <para>There are a few ways to configure CacheableLockManagerImpl, and all
- of them configure JBoss-cache and JDBCCacheLoader.</para>
- <para>See <ulink url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
+
+ <para>There are a few ways to configure CacheableLockManagerImpl, and
+ all of them configure JBoss-cache and JDBCCacheLoader.</para>
+
+ <para>See <ulink
+ url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
</section>
+
<section>
<title>Simple JbossCache Configuration</title>
- <para>The first one is putting JbossCache configuraion file path to
+
+ <para>The first one is putting JbossCache configuraion file path to
CacheableLockManagerImpl.</para>
+
<para><note>
- <para>This configuration is not so good as you think. Because
- the repository may contain many workspaces, and each workspace must
+ <para>This configuration is not so good as you think. Because the
+ repository may contain many workspaces, and each workspace must
contain LockManager configuration, and LockManager configuration may
- contain the JbossCache config file. So, the total configuration will grow
- up. But it is useful if we want to have a single LockManager with a special
- configuration.</para>
+ contain the JbossCache config file. So, the total configuration will
+ grow up. But it is useful if we want to have a single LockManager
+ with a special configuration.</para>
</note></para>
+
<para>Configuration is as follows:</para>
- <programlisting language="xml"><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+
+ <programlisting language="xml"><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
</properties>
</lock-manager></programlisting>
+
<para><filename>test-jbosscache-lock-config.xml</filename></para>
-
- <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+ <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
- <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
<jgroupsConfig>
- <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
- max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
- skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
- thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
- oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
- <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
+ <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+ max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
+ skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+ oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+ <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
- <MERGE2 max_interval="30000" min_interval="10000" />
+ <MERGE2 max_interval="30000" min_interval="10000" />
<FD_SOCK />
- <FD max_tries="5" shun="true" timeout="10000" />
- <VERIFY_SUSPECT timeout="1500" />
- <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
- <UNICAST timeout="300,600,1200,2400,3600" />
- <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
- <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
- <FRAG2 frag_size="60000" />
+ <FD max_tries="5" shun="true" timeout="10000" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
+ <UNICAST timeout="300,600,1200,2400,3600" />
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
+ <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
+ <FRAG2 frag_size="60000" />
<pbcast.STREAMING_STATE_TRANSFER />
- <pbcast.FLUSH timeout="0" />
+ <pbcast.FLUSH timeout="0" />
</jgroupsConfig
<sync />
</clustering>
- <loaders passivation="false" shared="true">
+ <loaders passivation="false" shared="true">
<preload>
- <node fqn="/" />
+ <node fqn="/" />
</preload>
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
cache.jdbc.table.name=jcrlocks_ws
cache.jdbc.table.create=true
@@ -158,53 +199,63 @@
</jbosscache>
</programlisting>
+
<para>Configuration requirements:</para>
+
<itemizedlist>
<listitem>
- <para><clustering mode="replication"
- clusterName="JBoss-Cache-Lock-Cluster_Name"> - the cluster name must
- be unique;</para>
+ <para><clustering mode="replication"
+ clusterName="JBoss-Cache-Lock-Cluster_Name"> - the cluster name
+ must be unique;</para>
</listitem>
+
<listitem>
<para><parameter>cache.jdbc.table.name</parameter> must be unique
per datasource;</para>
</listitem>
+
<listitem>
<para><parameter>cache.jdbc.node.type</parameter> and
<parameter>cache.jdbc.fqn.type</parameter> must be configured
- according to using the database. See <link endterm="datatypes.title" linkend="datatypes"/> .</para>
+ according to using the database. See <link endterm="datatypes.title"
+ linkend="datatypes"></link> .</para>
</listitem>
</itemizedlist>
</section>
+
<section>
<title>Template JBossCache Configuration</title>
- <para>The second one is using the template JBoss-cache configuration for all
- LockManagers.</para>
+
+ <para>The second one is using the template JBoss-cache configuration for
+ all LockManagers.</para>
+
<para><citetitle>Lock template configuration</citetitle></para>
+
<para><filename>test-jbosscache-lock.xml</filename></para>
- <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
- lockAcquisitionTimeout="20000" />
+ <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
- <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <jgroupsConfig multiplexerStack="jcr.stack" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
<sync />
</clustering>
- <loaders passivation="false" shared="true">
+ <loaders passivation="false" shared="true">
<!-- All the data of the JCR locks needs to be loaded at startup -->
<preload>
- <node fqn="/" />
+ <node fqn="/" />
</preload>
<!--
For another cache-loader class you should use another template with
cache-loader specific parameters
->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
- ignoreModifications="false" purgeOnStartup="false">
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
<properties>
cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
@@ -220,72 +271,79 @@
</loader>
</loaders>
</jbosscache></programlisting>
+
<para>As you see, all configurable parameters are filled by templates
and will be replaced by LockManagers configuration parameters:</para>
- <programlisting language="xml"><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+
+ <programlisting language="xml"><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
<properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="jgroups-multiplexer-stack" value="true" />
- <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
- <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
- <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
- <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
- <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
- <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
- <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
- <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
- <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
</properties>
</lock-manager></programlisting>
+
<para>Configuration requirements:<itemizedlist>
<listitem>
<para><parameter>jbosscache-cl-cache.jdbc.fqn.column</parameter>
and <parameter>jbosscache-cl-cache.jdbc.node.type</parameter> is
- the same as cache.jdbc.fqn.type and cache.jdbc.node.type in
+ the same as cache.jdbc.fqn.type and cache.jdbc.node.type in
JBoss-Cache configuration. You can set those data types according
- to database type (See <link endterm="datatypes.title" linkend="datatypes"/>) or set it as AUTO (or do not set at
+ to database type (See <link endterm="datatypes.title"
+ linkend="datatypes"></link>) or set it as AUTO (or do not set at
all) and data type will be detected automatically.</para>
</listitem>
+
<listitem>
- <para>As you see, jgroups-configuration is moved to separate the configuration
- file - udp-mux.xml. In this case, the udp-mux.xml file is a common JGroup
- configuration for all components (QueryHandler, Cache, LockManager), but
- we can still create our own configuration.</para>
+ <para>As you see, jgroups-configuration is moved to separate the
+ configuration file - udp-mux.xml. In this case, the udp-mux.xml
+ file is a common JGroup configuration for all components
+ (QueryHandler, Cache, LockManager), but we can still create our
+ own configuration.</para>
</listitem>
</itemizedlist></para>
+
<para><filename>our-udp-mux.xml</filename></para>
-
+
<programlisting language="xml"><protocol_stacks>
- <stack name="jcr.stack">
+ <stack name="jcr.stack">
<config>
- <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
- discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
- use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
- thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
- thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
+ <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+ discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+ use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
+ thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
+ thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
- <PING timeout="2000" num_initial_members="3" />
- <MERGE2 max_interval="30000" min_interval="10000" />
+ <PING timeout="2000" num_initial_members="3" />
+ <MERGE2 max_interval="30000" min_interval="10000" />
<FD_SOCK />
- <FD timeout="10000" max_tries="5" shun="true" />
- <VERIFY_SUSPECT timeout="1500" />
+ <FD timeout="10000" max_tries="5" shun="true" />
+ <VERIFY_SUSPECT timeout="1500" />
<BARRIER />
- <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
- gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
- <UNICAST timeout="300,600,1200" />
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
- <VIEW_SYNC avg_send_interval="60000" />
- <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
- <FC max_credits="500000" min_threshold="0.20" />
- <FRAG2 frag_size="60000" />
+ <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
+ gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
+ <UNICAST timeout="300,600,1200" />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
+ <VIEW_SYNC avg_send_interval="60000" />
+ <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
+ <FC max_credits="500000" min_threshold="0.20" />
+ <FRAG2 frag_size="60000" />
<!--pbcast.STREAMING_STATE_TRANSFER /-->
<pbcast.STATE_TRANSFER />
<!-- pbcast.FLUSH /-->
@@ -293,67 +351,164 @@
</stack>
</protocol_stacks> </programlisting>
</section>
+
<section id="datatypes">
<title id="datatypes.title">Data Types in Different Databases</title>
+
<table>
<title>FQN type and node type in different databases</title>
+
<tgroup cols="3">
<thead>
<row>
<entry>DataBase name</entry>
+
<entry>Node data type</entry>
+
<entry>FQN data type</entry>
</row>
</thead>
+
<tbody>
<row>
<entry>default</entry>
+
<entry>BLOB</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>HSSQL</entry>
+
<entry>OBJECT</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>MySQL</entry>
+
<entry>LONGBLOB</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>ORACLE</entry>
+
<entry>BLOB</entry>
+
<entry>VARCHAR2(512)</entry>
</row>
+
<row>
<entry>PostgreSQL</entry>
+
<entry>bytea</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>MSSQL</entry>
+
<entry>VARBINARY(MAX)</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>DB2</entry>
+
<entry>BLOB</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>Sybase</entry>
+
<entry>IMAGE</entry>
+
<entry>VARCHAR(512)</entry>
</row>
+
<row>
<entry>Ingres</entry>
+
<entry>long byte</entry>
+
<entry>VARCHAR(512)</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
+
+ <section>
+ <title>Lock migration from 1.12.x</title>
+
+ <para>There are 3 choices:</para>
+
+ <para>I. When new Shareable Cache feature is not going to be used and
+ all locks should be kept after migration.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Ensure that the same lock tables used in configuration;</para>
+ </listitem>
+
+ <listitem>
+ <para>Start the server;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>II. When new Shareable Cache feature is not going to be used and
+ all locks should be removed after migration.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Ensure that the same lock tables used in configuration;</para>
+ </listitem>
+
+ <listitem>
+ <para>Start the sever WITH system property
+ -Dorg.exoplatform.jcr.locks.force.remove=true;</para>
+ </listitem>
+
+ <listitem>
+ <para>Stop the server;</para>
+ </listitem>
+
+ <listitem>
+ <para>Start the server (WITHOUT system property
+ -Dorg.exoplatform.jcr.locks.force.remove);</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>III. When new Shareable Cache feature will be used (in this case
+ all locks are removed after migration).</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Start the sever WITH system property
+ -Dorg.exoplatform.jcr.locks.force.remove=true;</para>
+ </listitem>
+
+ <listitem>
+ <para>Stop the server;</para>
+ </listitem>
+
+ <listitem>
+ <para>Start the server (WITHOUT system property
+ -Dorg.exoplatform.jcr.locks.force.remove);</para>
+ </listitem>
+
+ <listitem>
+ <para>(Not mandatory) manually remove old tables for lock;</para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
</chapter>
14 years, 6 months
exo-jcr SVN: r5091 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 07:31:25 -0400 (Wed, 26 Oct 2011)
New Revision: 5091
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/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.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
Log:
EXOJCR-1590: fix names, add commit
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-10-26 10:06:35 UTC (rev 5090)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-10-26 11:31:25 UTC (rev 5091)
@@ -922,14 +922,20 @@
{
if (deleteLocks)
{
+ boolean failed = true;
JDBCStorageConnection conn = (JDBCStorageConnection)openConnection();
try
{
conn.deleteLockProperties();
+ conn.commit();
+ failed = false;
}
finally
{
- conn.close();
+ if (failed)
+ {
+ conn.rollback();
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-10-26 10:06:35 UTC (rev 5090)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-10-26 11:31:25 UTC (rev 5091)
@@ -566,11 +566,13 @@
{
removeValuesStatement =
dbConnection
- .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = ? OR NAME = ?)");
+ .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeValuesStatement.setString(1, Constants.JCR_LOCKISDEEP.getAsString());
removeValuesStatement.setString(2, Constants.JCR_LOCKOWNER.getAsString());
- removeItemsStatement = dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = ? OR NAME = ?");
+ removeItemsStatement =
+ dbConnection
+ .prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
removeItemsStatement.setString(1, Constants.JCR_LOCKISDEEP.getAsString());
removeItemsStatement.setString(2, Constants.JCR_LOCKOWNER.getAsString());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-10-26 10:06:35 UTC (rev 5090)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-10-26 11:31:25 UTC (rev 5091)
@@ -588,13 +588,14 @@
{
removeValuesStatement =
dbConnection
- .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = ? OR NAME = ?))");
+ .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
removeValuesStatement.setString(1, containerName);
removeValuesStatement.setString(2, Constants.JCR_LOCKISDEEP.getAsString());
removeValuesStatement.setString(3, Constants.JCR_LOCKOWNER.getAsString());
removeItemsStatement =
- dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = ? OR NAME = ?)");
+ dbConnection
+ .prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement.setString(1, containerName);
removeItemsStatement.setString(2, Constants.JCR_LOCKISDEEP.getAsString());
removeItemsStatement.setString(3, Constants.JCR_LOCKOWNER.getAsString());
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-10-26 10:06:35 UTC (rev 5090)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-10-26 11:31:25 UTC (rev 5091)
@@ -1043,13 +1043,11 @@
{
removeValuesStatement =
dbConnection
- .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = ? OR NAME = ?)");
- removeValuesStatement.setString(1, Constants.JCR_LOCKISDEEP.getAsString());
- removeValuesStatement.setString(2, Constants.JCR_LOCKOWNER.getAsString());
+ .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
- removeItemsStatement = dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = ? OR NAME = ?");
- removeItemsStatement.setString(1, Constants.JCR_LOCKISDEEP.getAsString());
- removeItemsStatement.setString(2, Constants.JCR_LOCKOWNER.getAsString());
+ removeItemsStatement =
+ dbConnection
+ .prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
removeValuesStatement.executeUpdate();
removeItemsStatement.executeUpdate();
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-10-26 10:06:35 UTC (rev 5090)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-10-26 11:31:25 UTC (rev 5091)
@@ -961,16 +961,13 @@
{
removeValuesStatement =
dbConnection
- .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = ? OR NAME = ?))");
+ .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
removeValuesStatement.setString(1, containerName);
- removeValuesStatement.setString(2, Constants.JCR_LOCKISDEEP.getAsString());
- removeValuesStatement.setString(3, Constants.JCR_LOCKOWNER.getAsString());
removeItemsStatement =
- dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = ? OR NAME = ?)");
+ dbConnection
+ .prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement.setString(1, containerName);
- removeItemsStatement.setString(2, Constants.JCR_LOCKISDEEP.getAsString());
- removeItemsStatement.setString(3, Constants.JCR_LOCKOWNER.getAsString());
removeValuesStatement.executeUpdate();
removeItemsStatement.executeUpdate();
14 years, 6 months
exo-jcr SVN: r5090 - jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 06:06:35 -0400 (Wed, 26 Oct 2011)
New Revision: 5090
Added:
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-pgsql.xml
Log:
EXOJCR-1585: add configuration for PGSQL
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-pgsql.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-pgsql.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-pgsql.xml 2011-10-26 10:06:35 UTC (rev 5090)
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file" />
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/jcr.log" />
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <!-- property name="log4j.category.ext.BackupScheduler" value="DEBUG"/>
+ <property name="log4j.category.ext.BackupManagerImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.ext.RestRepositoryService" value="DEBUG"/>
+
+ <!-- property name="log4j.category.org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyResourceLoader" value="DEBUG" / -->
+
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-ext-config-backup.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
+ <property name="source-name" value="jdbcjcr" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryService</type>
+ </component>
+
+ <!-- backup -->
+ <component>
+ <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key>
+ <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl</type>
+ <init-params>
+ <properties-param>
+ <name>backup-properties</name>
+ <property name="default-incremental-job-period" value="3600" />
+ <property name="full-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob" />
+ <property name="incremental-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" />
+ <property name="backup-dir" value="target/backup" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- HTTPBackupAgent -->
+ <component>
+ <type>org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.NodeRepresentationService</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.XMLViewNodeRepresentationRenderer</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.jcr.Handler</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
14 years, 6 months
exo-jcr SVN: r5089 - jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 05:58:03 -0400 (Wed, 26 Oct 2011)
New Revision: 5089
Added:
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mysql.xml
Log:
EXOJCR-1585: add unit tests for MySQL
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mysql.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mysql.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup-mysql.xml 2011-10-26 09:58:03 UTC (rev 5089)
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file" />
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/jcr.log" />
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <!-- property name="log4j.category.ext.BackupScheduler" value="DEBUG"/>
+ <property name="log4j.category.ext.BackupManagerImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.ext.RestRepositoryService" value="DEBUG"/>
+
+ <!-- property name="log4j.category.org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyResourceLoader" value="DEBUG" / -->
+
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-ext-config-backup.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
+ <property name="source-name" value="jdbcjcr" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryService</type>
+ </component>
+
+ <!-- backup -->
+ <component>
+ <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key>
+ <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl</type>
+ <init-params>
+ <properties-param>
+ <name>backup-properties</name>
+ <property name="default-incremental-job-period" value="3600" />
+ <property name="full-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob" />
+ <property name="incremental-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" />
+ <property name="backup-dir" value="target/backup" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- HTTPBackupAgent -->
+ <component>
+ <type>org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.NodeRepresentationService</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.XMLViewNodeRepresentationRenderer</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.jcr.Handler</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db2_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db2_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+</configuration>
14 years, 6 months
exo-jcr SVN: r5088 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 05:57:46 -0400 (Wed, 26 Oct 2011)
New Revision: 5088
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
Log:
EXOJCR-1585: add unit tests for MySQL
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2011-10-26 09:19:43 UTC (rev 5087)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2011-10-26 09:57:46 UTC (rev 5088)
@@ -47,6 +47,8 @@
static public String SQL_CREATETABLE = "^(CREATE(\\s)+TABLE(\\s)+(IF(\\s)+NOT(\\s)+EXISTS(\\s)+)*){1}";
+ static public String SQL_ALTERTABLE = "^(ALTER(\\s)+TABLE(\\s)+(IF(\\s)+NOT(\\s)+EXISTS(\\s)+)*){1}";
+
static public String SQL_CREATEVIEW = "^(CREATE(\\s)+VIEW(\\s)+(IF(\\s)+NOT(\\s)+EXISTS(\\s)+)*){1}";
static public String SQL_OBJECTNAME = "((JCR_[A-Z_]+){1}(\\s*?|(\\(\\))*?)+)+?";
@@ -71,6 +73,8 @@
protected final Pattern creatTablePattern;
+ protected final Pattern alterTablePattern;
+
protected final Pattern creatViewPattern;
protected final Pattern dbObjectNamePattern;
@@ -92,6 +96,7 @@
this.script = script(scriptPath);
this.creatTablePattern = Pattern.compile(SQL_CREATETABLE, Pattern.CASE_INSENSITIVE);
+ this.alterTablePattern = Pattern.compile(SQL_ALTERTABLE, Pattern.CASE_INSENSITIVE);
this.creatViewPattern = Pattern.compile(SQL_CREATEVIEW, Pattern.CASE_INSENSITIVE);
this.dbObjectNamePattern = Pattern.compile(SQL_OBJECTNAME, Pattern.CASE_INSENSITIVE);
this.creatIndexPattern = Pattern.compile(SQL_CREATEINDEX, Pattern.CASE_INSENSITIVE);
@@ -144,6 +149,25 @@
}
}
}
+ else if ((tMatcher = alterTablePattern.matcher(sql)).find())
+ {
+ // CREATE TABLE
+ tMatcher = dbObjectNamePattern.matcher(sql);
+ if (tMatcher.find())
+ {
+ // got table name
+ String tableName = sql.substring(tMatcher.start(), tMatcher.end());
+ if (isTableExists(conn, tableName))
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("Table is already exists " + tableName);
+ }
+ existingTables.add(tableName);
+ return true;
+ }
+ }
+ }
else if ((tMatcher = creatViewPattern.matcher(sql)).find())
{
// CREATE VIEW
14 years, 6 months
exo-jcr SVN: r5087 - in jcr/trunk/exo.jcr.component.ext: src/test/java/org/exoplatform/services/jcr/ext/backup and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-10-26 05:19:43 -0400 (Wed, 26 Oct 2011)
New Revision: 5087
Added:
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/BaseStandaloneBackupRestoreTest.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup.xml
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml
Removed:
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/load/
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
Log:
EXOJCR-1585: add unit tests for HSQLDB
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-10-25 13:35:38 UTC (rev 5086)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-10-26 09:19:43 UTC (rev 5087)
@@ -29,6 +29,9 @@
<artifactId>exo.jcr.component.ext</artifactId>
<name>eXo JCR :: Component :: Extension Service</name>
<description>eXo JCR Services extension</description>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
+ </properties>
<dependencies>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
@@ -177,6 +180,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ </systemProperties>
<includes>
<include>org/exoplatform/services/jcr/ext/**/Test*.java</include>
<include>org/exoplatform/services/jcr/ext/**/*Test.java</include>
@@ -189,7 +198,7 @@
<exclude>**/backup/TestBackupRestart.java</exclude>
<exclude>**/backup/load/TestLoadBackup.java*</exclude>
<exclude>**/replication/**</exclude>
- <include>**/repository/creation/cluster/**</include>
+ <exclude>**/repository/creation/cluster/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -232,4 +241,176 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>backup</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup.xml</jcr.test.configuration.file>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}" property="localRepositoryURL" />
+ <makeurl file="${project.build.outputDirectory}" property="outputDirectoryURL" />
+ <makeurl file="${project.build.testOutputDirectory}" property="testOutputDirectoryURL" />
+ <copy todir="${project.build.testOutputDirectory}" overwrite="true">
+ <fileset dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy" />
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO" value="${localRepositoryURL}" />
+ <filter token="MAIN_CLASSES" value="${outputDirectoryURL}" />
+ <filter token="TEST_CLASSES" value="${testOutputDirectoryURL}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>oracle</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-oracle.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>14</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mysql</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-mysql.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.14</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mssql</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-mssql.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>3.0.1301.101</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>db2</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-db2.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>9.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>9.7</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>sybase</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-sybase.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.sybase.jdbc4.jdbc</groupId>
+ <artifactId>jconn4</artifactId>
+ <version>26502</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>pgsql</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-backup-pgsql.xml</jcr.test.configuration.file>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-606.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/BaseStandaloneBackupRestoreTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/BaseStandaloneBackupRestoreTest.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/BaseStandaloneBackupRestoreTest.java 2011-10-26 09:19:43 UTC (rev 5087)
@@ -0,0 +1,66 @@
+/*
+ * 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.ext.backup.usecase;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.CredentialsImpl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+/**
+ * Created by The eXo Platform SAS .
+ *
+ * @author <a href="mailto:geaz@users.sourceforge.net">Gennady Azarenkov </a>
+ * @version $Id: BaseStandaloneBackupRestoreTest.java 12004 2007-01-17 12:03:57Z geaz $
+ */
+public abstract class BaseStandaloneBackupRestoreTest extends TestCase
+{
+ protected static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.BaseStandaloneBackupRestoreTest");
+
+ protected CredentialsImpl credentials;
+
+ protected RepositoryService repositoryService;
+
+ protected StandaloneContainer container;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ String configPath = System.getProperty("jcr.test.configuration.file");
+ if (configPath == null)
+ {
+ fail("System property jcr.test.configuration.file not found");
+ }
+
+ String containerConf = getClass().getResource(configPath).toString();
+ StandaloneContainer.addConfigurationURL(containerConf);
+ container = StandaloneContainer.getInstance();
+
+ if (System.getProperty("java.security.auth.login.config") == null)
+ System.setProperty("java.security.auth.login.config", Thread.currentThread().getContextClassLoader()
+ .getResource("login.conf").toString());
+
+ credentials = new CredentialsImpl("root", "exo".toCharArray());
+
+ repositoryService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ }
+}
Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/usecase/TestBackupRestore.java 2011-10-26 09:19:43 UTC (rev 5087)
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.ext.backup.usecase;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.services.jcr.core.ManageableRepository;
+import org.exoplatform.services.jcr.ext.backup.BackupJob;
+import org.exoplatform.services.jcr.ext.backup.BackupManager;
+import org.exoplatform.services.jcr.ext.backup.ExtendedBackupManager;
+import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain;
+import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChainLog;
+import org.exoplatform.services.jcr.ext.backup.RepositoryBackupConfig;
+import org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl;
+import org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+
+import java.io.File;
+
+import javax.jcr.Node;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TestLoadBackup.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestBackupRestore extends BaseStandaloneBackupRestoreTest
+{
+ public void testBackupRestoreExistingRepositorySingleDB() throws Exception
+ {
+ repositoryBackupRestore("db1");
+ }
+
+ public void testBackupRestoreExistingRepositoryMultiDB() throws Exception
+ {
+ repositoryBackupRestore("db2");
+ }
+
+ protected void repositoryBackupRestore(String repositoryName) throws Exception
+ {
+ addConent(repositoryName);
+
+ BackupManagerImpl backupManagerImpl = (BackupManagerImpl)getBackupManager();
+ backupManagerImpl.start();
+
+ File backDir = new File("target/backup/" + repositoryName);
+ backDir.mkdirs();
+
+ RepositoryBackupConfig config = new RepositoryBackupConfig();
+ config.setRepository(repositoryName);
+ config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
+ config.setBackupDir(backDir);
+
+ RepositoryBackupChain bch = backupManagerImpl.startBackup(config);
+
+ // wait till full backup will stop
+ while (bch.getState() != BackupJob.FINISHED)
+ {
+ Thread.yield();
+ Thread.sleep(30);
+ }
+
+ if (bch != null)
+ {
+ backupManagerImpl.stopBackup(bch);
+ }
+
+ // restore
+ File backLog = new File(bch.getLogFilePath());
+ if (backLog.exists())
+ {
+ RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
+
+ assertNotNull(bchLog.getStartedTime());
+ assertNotNull(bchLog.getFinishedTime());
+
+ backupManagerImpl.restoreExistingRepository(bchLog, repositoryService.getRepository(repositoryName)
+ .getConfiguration(), false);
+
+ JobRepositoryRestore restore = backupManagerImpl.getLastRepositoryRestore(repositoryName);
+ if (restore != null)
+ {
+ if (restore.getStateRestore() != JobRepositoryRestore.REPOSITORY_RESTORE_SUCCESSFUL)
+ {
+ fail(restore.getRestoreException().getMessage());
+ }
+ }
+ }
+ else
+ {
+ fail("There are no backup files in " + backDir.getAbsolutePath());
+ }
+
+ checkConent(repositoryName);
+ }
+
+ protected ExtendedBackupManager getBackupManager()
+ {
+ InitParams initParams = new InitParams();
+ PropertiesParam pps = new PropertiesParam();
+
+ pps.setProperty(BackupManagerImpl.FULL_BACKUP_TYPE,
+ "org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob");
+ pps.setProperty(BackupManagerImpl.BACKUP_DIR, "target/backup");
+ initParams.put(BackupManagerImpl.BACKUP_PROPERTIES, pps);
+
+ return new BackupManagerImpl(initParams, repositoryService);
+ }
+
+ protected void addConent(String repositoryName) throws Exception
+ {
+ ManageableRepository repository = repositoryService.getRepository(repositoryName);
+ String wsName = repository.getConfiguration().getSystemWorkspaceName();
+
+ SessionImpl session = (SessionImpl)repository.login(credentials, wsName);
+ try
+ {
+ Node rootNode = session.getRootNode().addNode("test");
+
+ rootNode.addNode("node1").setProperty("prop1", "value1");
+ session.save();
+ }
+ finally
+ {
+ session.logout();
+ }
+ }
+
+ protected void checkConent(String repositoryName) throws Exception
+ {
+ ManageableRepository repository = repositoryService.getRepository(repositoryName);
+ String wsName = repository.getConfiguration().getSystemWorkspaceName();
+
+ SessionImpl session = (SessionImpl)repository.login(credentials, wsName);
+ try
+ {
+ Node rootNode = session.getRootNode().getNode("test");
+ assertEquals(rootNode.getNode("node1").getProperty("prop1").getString(), "value1");
+ }
+ finally
+ {
+ session.logout();
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-backup.xml 2011-10-26 09:19:43 UTC (rev 5087)
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file" />
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/jcr.log" />
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+
+ <!-- property name="log4j.category.ext.BackupScheduler" value="DEBUG"/>
+ <property name="log4j.category.ext.BackupManagerImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.ext.RestRepositoryService" value="DEBUG"/>
+
+ <!-- property name="log4j.category.org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyResourceLoader" value="DEBUG" / -->
+
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-ext-config-backup.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister" />
+ <property name="source-name" value="jdbcjcr" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryService</type>
+ </component>
+
+ <!-- backup -->
+ <component>
+ <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key>
+ <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl</type>
+ <init-params>
+ <properties-param>
+ <name>backup-properties</name>
+ <property name="default-incremental-job-period" value="3600" />
+ <property name="full-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob" />
+ <property name="incremental-backup-type" value="org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" />
+ <property name="backup-dir" value="target/backup" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!-- HTTPBackupAgent -->
+ <component>
+ <type>org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.NodeRepresentationService</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.XMLViewNodeRepresentationRenderer</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.resource.jcr.Handler</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ <init-params>
+ <value-param>
+ <name>auto-migrate</name>
+ <value>false</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/db1" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/db2ws" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/db2ws2" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml 2011-10-26 09:19:43 UTC (rev 5087)
@@ -0,0 +1,201 @@
+<!--
+
+ 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.
+
+-->
+<repository-service default-repository="db1">
+ <repositories>
+ <repository name="db1" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/db1ws" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/db1ws" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/db1ws" />
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>54000</time-out>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/db1ws1" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/db1ws1" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/db1ws1" />
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>54000</time-out>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+ <repository name="db2" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/db2ws" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/db2ws" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/db2ws" />
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/db2ws1" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/db2ws1" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="10k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/db2ws1" />
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
14 years, 6 months