exo-jcr SVN: r3558 - jcr/tags/1.12.6-CR02.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-25 08:19:34 -0500 (Thu, 25 Nov 2010)
New Revision: 3558
Added:
jcr/tags/1.12.6-CR02/readme.txt
Log:
JCR-1510: release notes
Added: jcr/tags/1.12.6-CR02/readme.txt
===================================================================
--- jcr/tags/1.12.6-CR02/readme.txt (rev 0)
+++ jcr/tags/1.12.6-CR02/readme.txt 2010-11-25 13:19:34 UTC (rev 3558)
@@ -0,0 +1,427 @@
+JCR 1.12.6-CR02 release notes
+===========================
+
+eXoPlatform Java Content Repository (JSR-170) implementation and Extension services with clustering support.
+
+Features of this version:
+* Limited the total amount of WorkerThreads
+
+Changes of 1.12.6-CR02
+=====================
+
+Bug
+ * [JCR-1468] - Index already present error during cluster start
+ * [JCR-1504] - Indexer doesn't fully release resources on stop
+ * [JCR-1509] - Access Denied in jcr:content with anonim__ permission
+ * [JCR-1511] - WEBDav view in a webbrowser has hardcoded image links
+ * [JCR-1513] - Problems when start backup-console
+
+Improvement
+ * [JCR-1505] - Avoid iterating over a List thanks to its iterator when it is possible
+
+Task
+ * [JCR-1488] - Limit the total amount of WorkerThreads: apply patch
+
+Changes of 1.12.6-CR01
+=====================
+
+Bug
+ * [JCR-1470] - refresh breaks webdav published files
+ * [JCR-1482] - Corrupted Data if the server is stopped while somebobdy is editing a document in ECMS
+ * [JCR-1485] - Unknown error and strange behavior when mary edits a webcontent
+ * [JCR-1490] - Some Unit Tests on DB2 related to the CAS plugin fail
+ * [JCR-1494] - FTP server doesn't show list of workspaces after repository restoring
+
+Documentation
+ * [JCR-1433] - jcr backup/restore
+
+Improvement
+ * [KER-164] - Allow to use variables to define the realm, the rest context and the portal container name of a PortalContainerDefinition
+ * [WS-256] - Allow to use a String as entity for a JSON response
+ * [JCR-1459] - Whole Repository backup support in Backup Console tool
+ * [JCR-1469] - JCR clustering consumes lot of native threads
+ * [JCR-1491] - The result of the method getReferencesData is never stored into the cache
+
+Task
+ * [JCR-1489] - eXo JCR doesn't work with Oracle 11g R2 RAC
+ * [JCR-1495] - Bind slf4j-log4j and log4j dependencies onto the test phase of the various modules of JCR [part #2]
+
+Sub-task
+ * [JCR-1481] - Adding support form authentication in backup console
+
+Changes of 1.12.5-GA
+=====================
+
+Bug
+ * [KER-162] - Simple skin from examples folder doesn't appear at list
+ * [KER-163] - CachingContainer returns unregistered components
+ * [COR-213] - User logged-out and cannot login after some inactivity
+ * [WS-254] - Add org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter in container configuration by default
+ * [JCR-1438] - Problem with JCR versionning
+ * [JCR-1449] - Can't get property of a node if it has a child node with the same name with the property
+ * [JCR-1450] - JCROrganizationService contains nodetype with same name as in CS
+ * [JCR-1453] - Missed nodetypes in cluster testing configuration
+ * [JCR-1462] - Problems during testing of backup on jcr 1.12.5-GA-SNAPSHOT
+ * [JCR-1466] - RepositoryException: URI is not hierarchical on remove workspace via backup console
+ * [JCR-1474] - NPE when try to import data via WorkspaceContentImporter
+
+Improvement
+ * [KER-160] - Prevent the JobSchedulerServiceImpl to launch jobs that rely on non started services in JBoss AS
+ * [KER-161] - Make the JobSchedulerServiceImpl support multi portal containers
+
+Task
+ * [JCR-1455] - Doc's title should be rename from eXoJCR Reference Manual to eXo JCR Developer Guide
+ * [JCR-1461] - Remove timestamp from names of jar-files in application bundles
+ * [JCR-1467] - Cannot use webdav service with a version of jcr:content
+ * [JCR-1471] - Updating eXo JCR version in ra.xml automatically
+ * [JCR-1472] - Adopt Backup client article
+ * [JCR-1473] - merge performance improvements
+
+Changes of 1.12.4-GA
+=====================
+
+Bug
+ * [EXOJCR-688] - Some entries in the eXo JCR cache are not evicted properly
+ * [EXOJCR-843] - Exceptions after importing file with version history
+ * [EXOJCR-849] - "Permission denied" on client side, when trying to move file(s) to another workspace through FTP
+ * [EXOJCR-856] - Problems while recopying same files via webdav
+ * [EXOJCR-865] - Data corrupt after restore a node which has been imported with version history
+ * [EXOJCR-878] - WebDAV doesn't work with nt:file
+ * [EXOJCR-879] - TestCaching.testNotModifiedSince failed in same cases
+ * [EXOJCR-888] - The problems with restore version node
+ * [EXOJCR-890] - JSON framework don't work with beans created in groovy
+ * [EXOJCR-891] - Snaphosts IDs make the applications build improperly
+ * [EXOJCR-908] - Used wrong delimiter during parsing permission value
+ * [EXOJCR-909] - In LDAPService, InitialContext is not safely closed in authenticate method
+ * [EXOJCR-912] - Unable to convert the JCR documentation to pdf
+ * [EXOJCR-916] - Duplicate instantiation of some services
+ * [EXOJCR-921] - Workspace.copy(srcWS, srcAbsPath, destAbsPath) can not copy root child to another workspace root child
+ * [EXOJCR-924] - Unable to coerce 'Event' into a LONG: java.lang.NumberFormatException: For input string: "Event"
+ * [EXOJCR-933] - Determine property type from nodetype definition in DocumentViewImport for version history.
+ * [EXOJCR-936] - Avoid converting binary value to String in tests
+
+Feature Request
+ * [EXOJCR-842] - Allow to disable a given PortalContainer
+ * [EXOJCR-880] - Determine property is multi or single value from nodetype definition in import.
+ * [EXOJCR-886] - Update the document handler to manage MS Office 2007 meta data extraction (docx, ...)
+ * [EXOJCR-934] - Decouple event name from listener name in ListenerService.
+ * [EXOJCR-935] - Add "dav:isreadonly" property management
+
+Task
+ * [EXOJCR-896] - Port Manageability article into docbook
+ * [EXOJCR-905] - Merge the reference guide and the user guide in one single guide
+ * [EXOJCR-913] - Abuse of INFO level logging for DocNumberCache.get()
+ * [EXOJCR-914] - excessive INFO logging by IndexMerger.run()
+ * [EXOJCR-915] - excessive INFO logging by IndexMerger.run()
+ * [EXOJCR-917] - core.packaging.module.js error when in deploy phase
+ * [EXOJCR-919] - maxVolatileTime should be checked on checkFlush()
+ * [EXOJCR-927] - Add "application/x-groovy+html" to HTMLDocumentReader and "application/x-jaxrs+groovy" to TextPlainDocumentReader
+ * [EXOJCR-892] - Remove Fake Chapters
+
+Changes of 1.12.3-GA
+=====================
+
+Bug
+ * [EXOJCR-754] - JDBC Statements left open : Use of Datasources instead of DBCP and C3P0 pools
+ * [EXOJCR-763] - Reordering samename sibling nodes does not update path of child nodes
+ * [EXOJCR-766] - QPath isDescendantOf returns wrong result on samename siblings
+ * [EXOJCR-774] - If-Modified-Since doesn't seem to be well managed in the Wevdav
+ * [EXOJCR-781] - LockManagerImpl should call InitialContextInitializer.recall
+ * [EXOJCR-784] - DOC : wrong examples in profiles section
+ * [EXOJCR-785] - Parameter maxVolatileTime is not working correctly
+ * [EXOJCR-788] - Inconsistency issue cans occur on default portal container parameters
+ * [EXOJCR-795] - Unexpected behavior of the method PortalContainer.isScopeValid()
+ * [EXOJCR-796] - Data corruption
+ * [EXOJCR-804] - "No such file or directory" exception for value storage when using MySQL or Postgres DB in WCM demo 2.0
+ * [EXOJCR-806] - Problems while copying "ftp-ftp"
+ * [EXOJCR-810] - TestRemoveFromValueStorage failed in configuration without ValueStorage
+ * [EXOJCR-813] - ItemImpl.getParent method must return session pooled parent
+ * [EXOJCR-817] - max-buffer-size from configuration should be use to TransientValueData in import (docview and sysview)
+ * [EXOJCR-835] - TestMultiDbJDBCConnection and TestSingleDbJDBCConnection must drop also JCR_xCONTAINER table on tearDown
+ * [EXOJCR-857] - Exception during PROPFIND request if some property content "%" and after not hex chracters
+ * [EXOJCR-865] - Data corrupt after restore a node which has been imported with version history
+ * [EXOJCR-882] - TestCaching fails on Windows XP SP 2 with Russian locale
+
+Feature Request
+ * [EXOJCR-230] - Refactore and move in main part of exo.ws.rest.core project class AbstractResourceTest
+ * [EXOJCR-782] - No longer force extension developers to redefine the whole dependencies list
+ * [EXOJCR-783] - Use cached table for HSLQLDB tables
+ * [EXOJCR-797] - Unable see error message from ProxyService if remote server does not provide Content-Type header.
+
+Task
+ * [EXOJCR-392] - Siblings reordering may update not all the child-items in cache
+ * [EXOJCR-751] - Prepare maintenance branch for jcr 1.12
+ * [EXOJCR-808] - For Sybase DB "check-sns-new-connection" should be set to false by default
+ * [EXOJCR-809] - OrganizationService's tests should not be excluded
+ * [EXOJCR-815] - Document how to use AS Managed DataSource
+ * [EXOJCR-867] - Port documentation for Kernel from wiki to docbook
+ * [EXOJCR-868] - Port documentation for Core from wiki to docbook
+ * [EXOJCR-869] - Port documentation for JCR from wiki to docbook
+ * [EXOJCR-870] - Cleanup WS documentation
+ * [EXOJCR-871] - Document RestServicesList service
+ * [EXOJCR-881] - Port functionality of EXOJCR-482 in jcr-1.12.x
+ * [EXOJCR-884] - Rename JCR documentation artifacts to exo.jcr.* form
+
+Changes of 1.12.2-GA
+====================
+
+Bug
+ * [EXOJCR-497] - JCR serialization test wrong logic with CASable storage
+ * [EXOJCR-730] - Restored repository not accessible after restart Tomcat
+ * [EXOJCR-731] - Deploy error (500 - Unexpected error. null) of REST Service with annotation inheritance.
+ * [EXOJCR-735] - JCR repositories created in runtime is not available after eXo Social restart
+ * [EXOJCR-736] - Problems with anonymous entrance on FTP and NPE
+ * [EXOJCR-743] - InitialContextBinder bind twice same datasource in some case
+ * [EXOJCR-762] - Check whether the repository with the given name doesn't exists before starting restore from backup
+
+Feature Request
+ * [EXOJCR-640] - Migrate to newer version of Apache PDFBox ( and FontBox ) if possible;
+
+Task
+ * [EXOJCR-596] - Upload eXoJCR documentation on jboss.org
+ * [EXOJCR-668] - Validate format of the default values of the property definition during the nodetype registration
+ * [EXOJCR-738] - Search does not work with source in CDATA tag in XML document
+ * [EXOJCR-740] - Constrains ranges are not used in NodeTypeImpl.canSetProperty() validation
+ * [EXOJCR-741] - Backupconsole build improvements
+ * [EXOJCR-765] - Use StringBuilder instead of String concatenation in MSExcelDocumentReader.getContentAsText
+ * [EXOJCR-681] - Decreasing perfomance while running WebdavReadWriteTest tests several times in row
+
+
+
+Changes of 1.12.2-CR1
+=====================
+
+Bug
+ * [EXOJCR-175] - Problems with HTTPBackupAgent - Cyrillic symbols aren't showing after restore
+ * [EXOJCR-683] - java.io.IOException: Socket read failed on heavy loaded WebdavAddBLOBTest benchmark test
+ * [EXOJCR-697] - SQL search by date doesn't work
+ * [EXOJCR-698] - URL encoding in SEARCH and PROPFIND responces differs.
+ * [EXOJCR-700] - Problem in user search with MySql and PostgresDB
+ * [EXOJCR-704] - JCR testuite hangs on sybase
+ * [EXOJCR-708] - Problem with full text searching in text files with non-latin content.
+ * [EXOJCR-712] - Concurrent service creation leads to duplicate service instantiation
+ * [EXOJCR-724] - Bad URL in the error message when a component cannot be instantiated
+ * [EXOJCR-726] - Improper conversion of jboss.server.config.url system property value into File (spaces in filename problem)
+ * [EXOJCR-729] - The FileNotFoundException in restore workspace over BackupWorkspaceinitializer
+ * [EXOJCR-734] - The binary values was not stored in incremental backup.
+
+Feature Request
+ * [EXOJCR-705] - Expose listeners in OrganizationService
+ * [EXOJCR-707] - Check repository management operations on thread safety
+ * [EXOJCR-718] - Allow to get the complete configuration at runtime
+ * [EXOJCR-719] - Better debugging of components loaded
+ * [EXOJCR-721] - Add possibility to use customized GroovyClassLoader in org.exoplatform.services.script.groovy.GroovyScriptInstantiator
+ * [EXOJCR-722] - Make it possible to use other then org.exoplatform.services.rest.impl.method.DefaultMethodInvoker
+
+Task
+ * [EXOJCR-354] - Invoke post read after permissions check
+ * [EXOJCR-663] - Make possibility extends classes RequestDispatcher and ResourceBinder.
+ * [EXOJCR-691] - Fix your missing dependencies
+ * [EXOJCR-692] - Find the reason why the method of type Node.hasNodes is much slower since beta5
+ * [EXOJCR-694] - Change JBC dependencies to use 3.2.4.GA
+ * [EXOJCR-696] - Reduce the concurrency Level in the JBoss Cache Config
+ * [EXOJCR-711] - Misleading error message appears when the external settings cannot be found
+ * [EXOJCR-714] - Improve the usability of the ContainerLifecyclePlugin
+ * [EXOJCR-715] - Ensure that the ExoContainer is fully ThreadSafe
+ * [EXOJCR-716] - Prevent the JobSchedulerServiceImpl to launch jobs that rely on non started services
+ * [EXOJCR-717] - Add to RestRegistryService method without repositoryName in PathParam, insted use current repository. Methods with repositoryName in PathParam marks as Deprecated.
+ * [EXOJCR-720] - Make possibility extends classe GroovyScript2RestLoader
+ * [EXOJCR-723] - JCR Statistics: Describe the arguments of the methods exposed through JMX
+ * [EXOJCR-728] - implementing RequestLifecycle for REST services
+
+
+Changes of 1.12.1-GA
+=====================
+
+Bug
+ * [EXOJCR-612] - JBoss Cache Implementation for the Cache Service test TestAbstractExoCache fails
+ * [EXOJCR-638] - get mixin types through the NodeTypeUtil class
+ * [EXOJCR-661] - Cannot access to the MBeans through the JConsole in Standalone mode
+ * [EXOJCR-662] - Processing SQLException may cause infinite loop.
+ * [EXOJCR-664] - org.exoplatform.services.jcr.impl.storage.value.fs.TestFileIOChannel.testConcurrentRead fail with MSSQL and DB2
+ * [EXOJCR-667] - Temporary spooled file can be not found on save
+ * [EXOJCR-671] - ConcurrentModificationException in FileCleaner with heavy load
+ * [EXOJCR-672] - An eXoCache clear should be local
+ * [EXOJCR-687] - Some JCR parameters that are time parameter are retrieved as number instead of time
+
+Feature Request
+ * [EXOJCR-498] - Provide more details when a JCR query is invalid
+ * [EXOJCR-634] - Upload of a file with special characters like " ' " in filename is not supported by the FTPservice
+ * [EXOJCR-645] - Add ExtHttpHeaders.JAXRS_BODY_PROVIDED header for unhandled exception in REST services and set error message to body responce
+
+Task
+ * [EXOJCR-578] - Use Fisheye in SCM urls used in maven
+ * [EXOJCR-611] - Provide a way to collect statistics around the JCR API accesses
+ * [EXOJCR-639] - Find the reason why the methods of type Property.setValue are much slower since beta5
+ * [EXOJCR-685] - Change JBC dependencies to use 3.2.3.GA
+ * [EXOJCR-689] - Standartize eXo JCR docnmentation projects description.
+ * [EXOJCR-690] - Apply changes in the eXo JCR project in order to be able to publish artifacts in the nexus of JBoss
+ * [EXOJCR-545] - Checking performance on SearchNodesByPropertyTest
+ * [EXOJCR-643] - Improve the performances of the lucene indexing in a cluster by removing contention for read operations
+
+
+Changes of 1.12.1-CR1
+=====================
+
+Bug
+ * [EXOJCR-256] - There are server errors "500 Internal Server Error:" during creation repository or workspace by RestRepositoryService
+ * [EXOJCR-348] - Test problem: TestCleanableFileStreamValueData failed
+ * [EXOJCR-519] - DAILY TESTS are going too long (avg time=5hours)
+ * [EXOJCR-531] - Problems with Lock operations
+ * [EXOJCR-546] - TESTING: Performance testing problems. LockUnlockOwnNodeTest - TPS fell down
+ * [EXOJCR-548] - problem with import & export node
+ * [EXOJCR-555] - NPE with cache eviction at startup
+ * [EXOJCR-557] - Problem while uploading *.pdf to WebDAV server using Mac OS Finder
+ * [EXOJCR-558] - Files uploaded by Mac OS finder are displayed with size "0"
+ * [EXOJCR-559] - Problems with daily performance testing - on PostgreSQL 8.2.9
+ * [EXOJCR-567] - The REST servlet dump errors when the client cut the socket too early should be only a debug log
+ * [EXOJCR-572] - Can not create workspace with default configuration of lock manager
+ * [EXOJCR-581] - Listing the directory in TreeFile may return null during race condition, causing NPE.
+ * [EXOJCR-584] - User's research is case sensitive
+ * [EXOJCR-586] - Missed slf4j dependency for jcr applications on tomcat AS
+ * [EXOJCR-587] - session.save() throws NPE after node reordering
+ * [EXOJCR-588] - Tests errors in eXo XML Processing Services on MACOS
+ * [EXOJCR-591] - Problem with ObservationManager
+ * [EXOJCR-599] - deadlock during dashboard editing
+ * [EXOJCR-600] - Concurrency problem (java.util.HashMap.put called from CacheableLockManagerImpl.getSessionLockManager(CacheableLockManagerImpl.java:473))
+ * [EXOJCR-601] - gatein sample extension should not be required
+ * [EXOJCR-602] - StackOverflow on JsonGeneratorImpl
+ * [EXOJCR-603] - impossible to change user password
+ * [EXOJCR-607] - Sybase Issue with GateIn
+ * [EXOJCR-608] - XaSessionImpl as XA resource should be unique per user, workspace and repository
+ * [EXOJCR-614] - Node.getReferences fail in some cases
+ * [EXOJCR-615] - Need check nodedata to avoid exception in method NodeImpl.isNodeType(String).
+ * [EXOJCR-619] - Log record forging (Security Issue)
+ * [EXOJCR-621] - Conflict between symlink feature and Jbosscache
+ * [EXOJCR-623] - Unable to get a version of document using WebDAV (HTTP Response 404 returned).
+ * [EXOJCR-633] - Problems with manual testing - tomcat-server on ftp -.IndexOutOfBoundsException
+
+Feature Request
+ * [EXOJCR-549] - Backup and Restore of a whole Repository
+ * [EXOJCR-571] - Change PersitedValueDataReader/Writer
+ * [EXOJCR-573] - Create database and bind DataSource in runtime
+ * [EXOJCR-582] - DB script modification for oracle11 compatibility
+ * [EXOJCR-585] - Allow to get statistics on Database Access without using a Profiler
+ * [EXOJCR-616] - Remove repository container from repositoryContainers map when repository container start fail.
+ * [EXOJCR-617] - Map environment parameters for all String fields in Repository configuration
+
+Task
+ * [EXOJCR-150] - Ftp client tests failute
+ * [EXOJCR-250] - Add human readable message in case Workspace creation error via HTTPBackupAgent
+ * [EXOJCR-393] - Create indexer load test
+ * [EXOJCR-523] - Upgrade to JBoss Cache 3.2.3.GA
+ * [EXOJCR-550] - Bind slf4j-log4j and log4j dependencies onto the test phase of the various modules of JCR
+ * [EXOJCR-552] - Allow to Test eXo JCR 1.12 on EC2
+ * [EXOJCR-575] - Remove unused PairChangesLog class
+ * [EXOJCR-589] - Limit network traffic and thread blocking for the Lucene Indexer in a cluster
+ * [EXOJCR-590] - DO NOT exclude tests from a parent pom
+ * [EXOJCR-598] - Allow to disable the hints used for the Complex Queries on oracle
+ * [EXOJCR-605] - Normalize logging categories
+ * [EXOJCR-631] - Find a reason, why functional tests fails under Tornado.MySQL with "Cannot create PoolableConnectionFactory (Too many connections)" message.
+ * [EXOJCR-632] - svn: File 'jcr.packaging.module/1.12.0-CP01/jcr.packaging.module-1.12.0-CP01.js' has inconsistent newlines
+
+
+Features of eXoJCR 1.12 comparing to 1.11
+=========================================
+
+- Repository clustering based on JBossCache and JBoss Transactions.
+- Lazy-load option for child nodes and properties read, improved items dataflow for read/write operations
+- Alternative data container optimized for read operations (consuming less database queries)
+- Database dialect can be autodetected (if not pointed in the configuration)
+- Support for Values large of 2GiB
+- Portal container configuration improvements (default definitions, link and externaly loaded parameters)
+- Concurrency improvements for Session registry and Values stroage
+- Concurrency improvements for XA transactions support (Repository login and logout faster now)
+- Improved serach based on Lucene 2.4
+- Support of MySQL/InnoDB database for multi-language content
+- Standalone container can use configuration stored in JBossAS server configuration directory by default
+- WebDAV server update-policy can be configured to different versioning behaviour
+- Lot of WebDAV server bugfixes
+- HTTP (RESTful) Backup agent with concole client
+- HTTP (RESTful) Repository management service
+- Support of Java6 and Java5 runtime and development environment
+
+Since version of 1.12 eXoJCR available under LGPL license (version 2.1).
+
+eXoJCR 1.12 tested in on the databases:
+ MySQL 5.1 MYSQL Connector/J 5.1.8
+ Oracle DB 10g (10.2.0.1) Oracle 10g (10.2.0.1)
+ PostgresSQL 8.3.7 JDBC4 Driver, Version 8.3-605
+ DB2 9,7 IBM Data Server Driver for JDBC and SQLJ (JCC Driver) Version: 9.1 (fixpack 3a)
+ MS SQL Server 2005 SP3 JDBC Driver 2.0
+ MS SQL Server 2008 SP1 JDBC Driver 2.0
+ Sybase 15.0.2 JConnect v6.0.5 (Build 26564 / 11 Jun 2009)
+
+
+Release includes:
+* eXo Kernel 2.2.6-CR02
+* eXo Core 2.3.6-CR02
+* eXo WS 2.1.6-CR02
+* eXo JCR 1.12.6-CR02
+
+1.12.6-CR02 tasks:
+* http://jira.exoplatform.org/browse/JCR/fixforversion/12344
+
+JCR Samples
+===========
+
+1. Start Up (Tomcat)
+ Tomcat 6 bundled can be started by executing the following commands:
+
+ $CATALINA_HOME\bin\eXo.bat run (Windows)
+
+ $CATALINA_HOME/bin/eXo.sh run (Unix)
+
+2. After startup, the sample applications will be available by visiting:
+
+ http://localhost:8080/browser - Simple JCR browser
+ Browse the JCR repository that was started with Tomcat
+ http://localhost:8080/fckeditor - FCK editor sample
+ Edits the sample node using FCKEditor and browse it JCR browser
+ http://localhost:8080/rest/jcr/repository/production - WebDAV service,
+ Open in Microsoft Explorer, File-Open-OpenAsWebFolder with url http://localhost:8080/rest/jcr/repository/production
+ Add/read/remove files there and browse it in the JCR browser or FTP.
+ User name/password: root/exo
+ ftp://localhost:2121 - FTP server
+ Open the repository in FTP client and browse the JCR repository started with Tomcat as FTP content,
+ add/read/remove files there and browse it in the JCR browser or WebDAV.
+
+EAR deploy
+==========
+
+eXo JCR was tested under JBoss-5.1.0.GA application server
+
+JBoss-5.1.0.GA
+
+ 1. Configuration
+
+ * Copy jcr.ear into $jboss_home/server/default/deploy
+ * Create $jboss_home/server/default/conf/exo-conf folder if it doesn't exist.
+ * Put exo-configuration.xml into $jboss_home/server/default/conf/exo-conf/exo-configuration.xml
+ * Configure JAAS by inserting XML fragment shown below into $jboss_home/server/default/conf/login-config.xml
+
+---------
+<application-policy name="exo-domain">
+ <authentication>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
+ </authentication>
+ </application-policy>
+---------
+
+ 2. Start Up
+
+ Execute
+ * bin/run.bat on Windows
+ or
+ * bin/run.sh on Unix
+
+Resources
+=========
+
+ Company site http://www.exoplatform.com
+ Documentation wiki http://wiki.exoplatform.org
+ Community JIRA https://jira.jboss.org/jira/browse/EXOJCR, http://jira.exoplatform.org
+ Comminity site http://www.exoplatform.org
+ Community forum http://www.exoplatform.com/portal/public/en/forum
+ JavaDoc site http://docs.exoplatform.org
+
\ No newline at end of file
13 years, 5 months
exo-jcr SVN: r3557 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-25 08:04:40 -0500 (Thu, 25 Nov 2010)
New Revision: 3557
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/db-creator-service.xml
Log:
EXOJCR-929: add docs about new method in DBCreator
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/db-creator-service.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/db-creator-service.xml 2010-11-25 12:35:32 UTC (rev 3556)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/db-creator-service.xml 2010-11-25 13:04:40 UTC (rev 3557)
@@ -41,13 +41,19 @@
new database's connection) or throws <envar>DBCreatorException</envar>
exception if any errors occurs in other case.</para>
- <programlisting>
-public DBConnectionInfo createDatabase(String dbName) throws DBCreatorException;</programlisting>
+ <programlisting>public DBConnectionInfo createDatabase(String dbName) throws DBCreatorException;
+</programlisting>
<para>For MSSQL and Sybase servers, use autocommit mode to set true for
connection. It's due to after execution "create database" command newly
created database not available for "use" command and therefore you can't
create new user inside database per one script.</para>
+
+ <programlisting>public DBConnectionInfo getDBConnectionInfo(String dbName) throws DBCreatorException;
+</programlisting>
+
+ <para>Return database connection information without database
+ creation.</para>
</section>
<section>
13 years, 5 months
exo-jcr SVN: r3556 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-11-25 07:35:32 -0500 (Thu, 25 Nov 2010)
New Revision: 3556
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
Log:
EXOJCR-929: RepositoryCreationServiceImpl constructor without RPCService added.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java 2010-11-25 10:48:35 UTC (rev 3555)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java 2010-11-25 12:35:32 UTC (rev 3556)
@@ -16,6 +16,8 @@
*/
package org.exoplatform.services.jcr.ext.repository.creation;
+import javax.jcr.RepositoryException;
+
/**
* Created by The eXo Platform SAS.
*
@@ -24,9 +26,8 @@
* @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
* @version $Id: RepositoryCreationException.java 111 2008-11-11 11:11:11Z serg $
*/
-public class RepositoryCreationException extends Exception
+public class RepositoryCreationException extends RepositoryException
{
-
/**
* {@inheritDoc}
*/
@@ -42,5 +43,4 @@
{
super(message, cause);
}
-
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 10:48:35 UTC (rev 3555)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 12:35:32 UTC (rev 3556)
@@ -115,6 +115,22 @@
* Constructor RepositoryCreationServiceImpl.
*/
public RepositoryCreationServiceImpl(RepositoryService repositoryService, BackupManager backupManager,
+ DBCreator dbCreator, InitialContextInitializer initialContextInitializer)
+ {
+ this.repositoryService = repositoryService;
+ this.backupManager = backupManager;
+ this.rpcService = null;
+ this.dbCreator = dbCreator;
+ this.initialContextInitializer = initialContextInitializer;
+
+ LOG.warn("RepositoryCreationService initialized without RPCService, so other cluser nodes will"
+ + " not be notified about new repositories.");
+ }
+
+ /**
+ * Constructor RepositoryCreationServiceImpl.
+ */
+ public RepositoryCreationServiceImpl(RepositoryService repositoryService, BackupManager backupManager,
DBCreator dbCreator, InitialContextInitializer initialContextInitializer, final RPCService rpcService)
{
this.repositoryService = repositoryService;
@@ -123,85 +139,78 @@
this.dbCreator = dbCreator;
this.initialContextInitializer = initialContextInitializer;
- if (rpcService == null)
+ // register commands
+ reserveRepositoryName = rpcService.registerCommand(new RemoteCommand()
{
- LOG.warn("RepositoryCreationService initialized with null RPCService, so other cluser nodes will"
- + " not be notified about new repositories.");
- }
- else
- {
- // register commands
- reserveRepositoryName = rpcService.registerCommand(new RemoteCommand()
+
+ public String getId()
{
+ return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-reserveRepositoryName";
+ }
- public String getId()
- {
- return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-reserveRepositoryName";
- }
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ String repositoryName = (String)args[0];
+ return reserveRepoName(repositoryName);
+ }
+ });
- public Serializable execute(Serializable[] args) throws Throwable
- {
- String repositoryName = (String)args[0];
- return reserveRepoName(repositoryName);
- }
- });
+ createRepository = rpcService.registerCommand(new RemoteCommand()
+ {
- createRepository = rpcService.registerCommand(new RemoteCommand()
+ public String getId()
{
+ return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-createRepository";
+ }
- public String getId()
- {
- return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-createRepository";
- }
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ //String backupId, RepositoryEntry rEntry, String rToken
+ String backupId = (String)args[0];
+ String stringRepositoryEntry = (String)args[1];
+ String rToken = (String)args[2];
- public Serializable execute(Serializable[] args) throws Throwable
+ try
{
- //String backupId, RepositoryEntry rEntry, String rToken
- String backupId = (String)args[0];
- String stringRepositoryEntry = (String)args[1];
- String rToken = (String)args[2];
+ RepositoryEntry rEntry =
+ (RepositoryEntry)(getObject(RepositoryEntry.class, stringRepositoryEntry
+ .getBytes(Constants.DEFAULT_ENCODING)));
- try
- {
- RepositoryEntry rEntry =
- (RepositoryEntry)(getObject(RepositoryEntry.class, stringRepositoryEntry
- .getBytes(Constants.DEFAULT_ENCODING)));
-
- createRepo(backupId, rEntry, rToken);
- return null;
- }
- finally
- {
- // release tokens
- pendingRepositories.remove(rToken);
- }
+ createRepo(backupId, rEntry, rToken);
+ return null;
}
- });
-
- startRepository = rpcService.registerCommand(new RemoteCommand()
- {
- public String getId()
+ finally
{
- return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-startRepository";
+ // release tokens
+ pendingRepositories.remove(rToken);
}
+ }
+ });
- public Serializable execute(Serializable[] args) throws Throwable
+ startRepository = rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-startRepository";
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ // must not be executed on coordinator node, since coordinator node already created the repository
+ if (!rpcService.isCoordinator())
{
- // must not be executed on coordinator node, since coordinator node already created the repository
- if (!rpcService.isCoordinator())
- {
- //RepositoryEntry (as String) rEntry
- String stringRepositoryEntry = (String)args[0];
- RepositoryEntry rEntry =
- (RepositoryEntry)(getObject(RepositoryEntry.class, stringRepositoryEntry
- .getBytes(Constants.DEFAULT_ENCODING)));
+ //RepositoryEntry (as String) rEntry
+ String stringRepositoryEntry = (String)args[0];
+ RepositoryEntry rEntry =
+ (RepositoryEntry)(getObject(RepositoryEntry.class, stringRepositoryEntry
+ .getBytes(Constants.DEFAULT_ENCODING)));
- startRepository(rEntry);
- }
- return null;
+ startRepository(rEntry);
}
- });
- }
+ return null;
+ }
+ });
+
}
/**
13 years, 5 months
exo-jcr SVN: r3555 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-11-25 05:48:35 -0500 (Thu, 25 Nov 2010)
New Revision: 3555
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
Log:
EXOJCR-929: RepositoryCreationServiceImpl fixed.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 10:42:09 UTC (rev 3554)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 10:48:35 UTC (rev 3555)
@@ -16,10 +16,10 @@
*/
package org.exoplatform.services.jcr.ext.repository.creation;
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.services.database.creator.DBConnectionInfo;
import org.exoplatform.services.database.creator.DBCreator;
import org.exoplatform.services.database.creator.DBCreatorException;
-import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -314,14 +314,22 @@
if (rpcService != null)
{
// check does repository already created
- for (int i = 0; i < repositoryService.getConfig().getRepositoryConfigurations().size(); i++)
+ try
{
- RepositoryEntry conf = repositoryService.getConfig().getRepositoryConfigurations().get(i);
- if (conf.getName().equals(repositoryName))
+ if (repositoryService.getRepository(repositoryName) != null)
{
throw new RepositoryCreationException("Repository " + repositoryName + " already exists.");
}
}
+ catch (RepositoryConfigurationException e)
+ {
+ throw new RepositoryCreationException("Can not check does repository " + repositoryName + " exists: "
+ + e.getMessage(), e);
+ }
+ catch (RepositoryException e)
+ {
+ //ok - repository does not exists
+ }
// reserve RepositoryName at coordinator-node
try
@@ -360,14 +368,22 @@
protected String reserveRepoName(String repositoryName) throws RepositoryCreationException
{
// check does repository already created
- for (int i = 0; i < repositoryService.getConfig().getRepositoryConfigurations().size(); i++)
+ try
{
- RepositoryEntry conf = repositoryService.getConfig().getRepositoryConfigurations().get(i);
- if (conf.getName().equals(repositoryName))
+ if (repositoryService.getRepository(repositoryName) != null)
{
throw new RepositoryCreationException("Repository " + repositoryName + " already exists.");
}
}
+ catch (RepositoryConfigurationException e)
+ {
+ throw new RepositoryCreationException("Can not check does repository " + repositoryName + " exists: "
+ + e.getMessage(), e);
+ }
+ catch (RepositoryException e)
+ {
+ //ok - repository does not exists
+ }
// check does this repository name already reserved, otherwise generate and return token
if (!pendingRepositories.containsValue(repositoryName))
13 years, 5 months
exo-jcr SVN: r3554 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-11-25 05:42:09 -0500 (Thu, 25 Nov 2010)
New Revision: 3554
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
Log:
EXOJCR-1075 : Changes for "The JCR backupset should be fully independent" was committed.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2010-11-25 09:12:05 UTC (rev 3553)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2010-11-25 10:42:09 UTC (rev 3554)
@@ -834,8 +834,7 @@
writer.writeEndElement();
writer.writeStartElement("url");
- writer.writeCharacters(info.getURL().toString().replace(
- PrivilegedFileHelper.getCanonicalPath(config.getBackupDir()) + File.separator, ""));
+ writer.writeCharacters(getRelativeUrl(info.getURL(), config.getBackupDir()));
writer.writeEndElement();
writer.writeStartElement("date");
@@ -847,6 +846,14 @@
writer.flush();
}
+ private String getRelativeUrl(URL url, File backupDir) throws IOException
+ {
+ String str = PrivilegedFileHelper.getCanonicalPath(new File(url.getFile()));
+
+ return url.getProtocol() + ":"
+ + str.replace(PrivilegedFileHelper.getCanonicalPath(config.getBackupDir()) + File.separator, "");
+ }
+
private boolean isRootBackupManagerDir(File log) throws IOException
{
return (PrivilegedFileHelper.getCanonicalPath(log.getParentFile()).equals(PrivilegedFileHelper
13 years, 5 months
exo-jcr SVN: r3553 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-25 04:12:05 -0500 (Thu, 25 Nov 2010)
New Revision: 3553
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
Log:
EXOJCR-929: fix
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 09:02:40 UTC (rev 3552)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 09:12:05 UTC (rev 3553)
@@ -16,6 +16,9 @@
*/
package org.exoplatform.services.jcr.ext.repository.creation;
+import org.exoplatform.services.database.creator.DBConnectionInfo;
+import org.exoplatform.services.database.creator.DBCreator;
+import org.exoplatform.services.database.creator.DBCreatorException;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
13 years, 5 months
exo-jcr SVN: r3552 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-11-25 04:02:40 -0500 (Thu, 25 Nov 2010)
New Revision: 3552
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/exojcr-backup-service.xml
Log:
EXOJCR-1075 : Changes for "The JCR backupset should be fully independent" was committed.
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/exojcr-backup-service.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/exojcr-backup-service.xml 2010-11-25 08:59:12 UTC (rev 3551)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/exojcr-backup-service.xml 2010-11-25 09:02:40 UTC (rev 3552)
@@ -585,4 +585,89 @@
</listitem>
</itemizedlist>
</section>
+
+ <section>
+ <title>Backup log contains the original configurations such as the
+ RepositoryEntry or the WorkspaceEntry.</title>
+
+ <para>Backup manager have special methods to restore with original
+ configuration:</para>
+
+ <programlisting>/**
+ * Restore existing workspace. Previous data will be deleted.
+ * For getting status of workspace restore can use
+ * BackupManager.getLastRestore(String repositoryName, String workspaceName) method
+ * WorkspaceEntry for restore should be contains in BackupChainLog.
+ *
+ * @param workspaceBackupIdentifier
+ * identifier to workspace backup.
+ * @param asynchronous
+ * if 'true' restore will be in asynchronous mode (i.e. in separated thread)
+ * @throws BackupOperationException
+ * if backup operation exception occurred
+ * @throws BackupConfigurationException
+ * if configuration exception occurred
+ */
+ void restoreExistingWorkspace(String workspaceBackupIdentifier, boolean asynchronous)
+ throws BackupOperationException,
+ BackupConfigurationException;
+
+ /**
+ * Restore existing repository. Previous data will be deleted.
+ * For getting status of repository restore can use
+ * BackupManager.getLastRestore(String repositoryName) method.
+ * ReprositoryEntry for restore should be contains in BackupChainLog.
+ *
+ * @param repositoryBackupIdentifier
+ * identifier to repository backup.
+ * @param asynchronous
+ * if 'true' restore will be in asynchronous mode (i.e. in separated thread)
+ * @throws BackupOperationException
+ * if backup operation exception occurred
+ * @throws BackupConfigurationException
+ * if configuration exception occurred
+ */
+ void restoreExistingRepository(String repositoryBackupIdentifier, boolean asynchronous)
+ throws BackupOperationException,
+ BackupConfigurationException;
+
+ /**
+ * WorkspaceEntry for restore should be contains in BackupChainLog.
+ *
+ * @param workspaceBackupIdentifier
+ * identifier to workspace backup.
+ * @param asynchronous
+ * if 'true' restore will be in asynchronous mode (i.e. in separated thread)
+ * @throws BackupOperationException
+ * if backup operation exception occurred
+ * @throws BackupConfigurationException
+ * if configuration exception occurred
+ */
+ void restoreWorkspace(String workspaceBackupIdentifier, boolean asynchronous) throws BackupOperationException,
+ BackupConfigurationException;
+
+ /**
+ * ReprositoryEntry for restore should be contains in BackupChainLog.
+ *
+ * @param repositoryBackupIdentifier
+ * identifier to repository backup.
+ * @param asynchronous
+ * if 'true' restore will be in asynchronous mode (i.e. in separated thread)
+ * @throws BackupOperationException
+ * if backup operation exception occurred
+ * @throws BackupConfigurationException
+ * if configuration exception occurred
+ */
+ void restoreRepository(String repositoryBackupIdentifier, boolean asynchronous) throws BackupOperationException,
+ BackupConfigurationException;</programlisting>
+ </section>
+
+ <section>
+ <title>Backupset portability</title>
+
+ <para>Backup configuration was stored during Backup operation into two
+ locations: backup-dir directory of BackupService to support interactive
+ operations via Backup API (e.g. console); into Backupset files itself for
+ portability (e.g. on another server).</para>
+ </section>
</chapter>
13 years, 5 months
exo-jcr SVN: r3551 - jcr/trunk/exo.jcr.component.ext.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-25 03:59:12 -0500 (Thu, 25 Nov 2010)
New Revision: 3551
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
Log:
EXOJCR-929: revert pom.xml
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-25 08:58:46 UTC (rev 3550)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-25 08:59:12 UTC (rev 3551)
@@ -175,7 +175,7 @@
<configuration>
<argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
<includes>
- <!--include>**/actions/*Test.java</include>
+ <include>**/actions/*Test.java</include>
<include>**/metadata/*Test.java</include>
<include>**/owner/*Test.java</include>
<include>**/registry/*Test.java</include>
@@ -185,8 +185,7 @@
<include>**/replication/*.java</include>
<include>**/replication/external/*.java</include>
<include>**/replication/async/**/*.java</include>
- <include>**/**/TestBackupManager.java</include-->
-<include>**/**/TestRepositoryCreationService.java</include>
+ <include>**/**/TestBackupManager.java</include>
</includes>
<excludes>
<exclude>**/BaseStandaloneTest.java</exclude>
13 years, 5 months
exo-jcr SVN: r3550 - in jcr/trunk/exo.jcr.component.ext: src/main/java/org/exoplatform/services/jcr/ext/repository/creation and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-25 03:58:46 -0500 (Thu, 25 Nov 2010)
New Revision: 3550
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
Log:
EXOJCR-929: small fix
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-25 08:49:46 UTC (rev 3549)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-25 08:58:46 UTC (rev 3550)
@@ -175,7 +175,7 @@
<configuration>
<argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
<includes>
- <include>**/actions/*Test.java</include>
+ <!--include>**/actions/*Test.java</include>
<include>**/metadata/*Test.java</include>
<include>**/owner/*Test.java</include>
<include>**/registry/*Test.java</include>
@@ -185,7 +185,8 @@
<include>**/replication/*.java</include>
<include>**/replication/external/*.java</include>
<include>**/replication/async/**/*.java</include>
- <include>**/**/TestBackupManager.java</include>
+ <include>**/**/TestBackupManager.java</include-->
+<include>**/**/TestRepositoryCreationService.java</include>
</includes>
<excludes>
<exclude>**/BaseStandaloneTest.java</exclude>
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java 2010-11-25 08:49:46 UTC (rev 3549)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java 2010-11-25 08:58:46 UTC (rev 3550)
@@ -31,6 +31,7 @@
{
/**
* Reserves, validates and creates repository in a simplified form.
+ *
* @param rEntry - repository Entry - note that datasource must not exist.
* @param backupId - backup id
* @throws RepositoryConfigurationException
@@ -44,6 +45,7 @@
/**
* Reserve repository name to prevent repository creation with same name from other place in same time
* via this service.
+ *
* @param repositoryName - repositoryName
* @return repository token. Anyone obtaining a token can later create a repository of reserved name.
* @throws RepositoryCreationServiceException if can't reserve name
@@ -53,7 +55,8 @@
/**
* Creates repository, using token of already reserved repository name. Good for cases, when repository creation should be delayed or
* made asynchronously in dedicated thread.
- * @param rEntry - repository entry - note, taht datasource must not exist
+ *
+ * @param rEntry - repository entry - note, that datasource must not exist
* @param backupId - backup id
* @param rToken - token
* @throws RepositoryConfigurationException
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 08:49:46 UTC (rev 3549)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 08:58:46 UTC (rev 3550)
@@ -16,9 +16,7 @@
*/
package org.exoplatform.services.jcr.ext.repository.creation;
-import org.exoplatform.services.database.creator.DBConnectionInfo;
-import org.exoplatform.services.database.creator.DBCreator;
-import org.exoplatform.services.database.creator.DBCreatorException;
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -110,6 +108,9 @@
private RemoteCommand startRepository;
+ /**
+ * Constructor RepositoryCreationServiceImpl.
+ */
public RepositoryCreationServiceImpl(RepositoryService repositoryService, BackupManager backupManager,
DBCreator dbCreator, InitialContextInitializer initialContextInitializer, final RPCService rpcService)
{
@@ -243,7 +244,7 @@
}
catch (RPCException e)
{
- Throwable cause = ((RPCException)e).getCause();
+ Throwable cause = (e).getCause();
if (cause instanceof RepositoryCreationException)
{
throw (RepositoryCreationException)cause;
@@ -335,7 +336,7 @@
}
catch (RPCException e)
{
- Throwable cause = ((RPCException)e).getCause();
+ Throwable cause = (e).getCause();
if (cause instanceof RepositoryCreationException)
{
throw (RepositoryCreationException)cause;
@@ -446,7 +447,7 @@
}
File backLog = new File(backupChain.getLogFilePath());
- if (backLog != null && backLog.exists())
+ if (backLog != null && PrivilegedFileHelper.exists(backLog))
{
try
{
@@ -468,7 +469,8 @@
else
{
throw new RepositoryCreationException("Backup log file by id " + backupId
- + (backLog != null ? (" and file path=" + backLog.getAbsolutePath()) : "") + " do not exists.");
+ + (backLog != null ? (" and file path=" + PrivilegedFileHelper.getAbsolutePath(backLog)) : "")
+ + " do not exists.");
}
}
13 years, 5 months
exo-jcr SVN: r3549 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext/repository/creation and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-11-25 03:49:46 -0500 (Thu, 25 Nov 2010)
New Revision: 3549
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation/TestRepositoryCreationService.java
Log:
EXOJCR-929: RepositoryCreationServiceImpl updated. TestRepositoryCreationService updated
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java 2010-11-25 08:16:45 UTC (rev 3548)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java 2010-11-25 08:49:46 UTC (rev 3549)
@@ -31,29 +31,10 @@
{
/**
* Reserves, validates and creates repository in a simplified form.
- *
- * 1. check possibility to create repository locally
- * - check existing, pending repository and datasources with same names
- * 2. reserve name and put additional information (ex. ip and port of current machine)
- * 3. check possibility to create repository on others nodes
- * - sending to all cluster nodes information about new repository and waiting for answers
- * - all cluster nodes receive information and check possibility to create repository locally
- * - send response
- * 4. reserve name on all nodes of cluster
- * 6. Check that name is reserved
- * 7. Create repository locally from backup
- * - create related DB
- * - bind datasources
- * - restore repository from backup (in synchronous mode)
- * 8. If need to do the same in cluster then send requests to others cluster nodes to create repository and waits for responses
- * 9. On each others cluster nodes:
- * - bind datasources
- * - start repository
- * - send response
- * 10. Release lock (unreserve name)
-
- * @param rEntry
- * @param backupId
+ * @param rEntry - repository Entry - note that datasource must not exist.
+ * @param backupId - backup id
+ * @throws RepositoryConfigurationException
+ * if some exception occurred during repository creation or repository name is absent in reserved list
* @throws RepositoryCreationServiceException
* if some exception occurred during repository creation or repository name is absent in reserved list
*/
@@ -63,42 +44,20 @@
/**
* Reserve repository name to prevent repository creation with same name from other place in same time
* via this service.
- *
- * 1. check possibility to create repository locally
- * - check existing, pending repository and datasources with same names
- * 2. reserve name and put additional information (repository name token)
- * 3. check possibility to create repository on others nodes
- * - sending to all cluster nodes information about new repository and waiting for answers
- * - all cluster nodes receive information and check possibility to create repository locally
- * - send response
- * 4. reserve name on all nodes of cluster
- *
- * @param repositoryName
+ * @param repositoryName - repositoryName
* @return repository token. Anyone obtaining a token can later create a repository of reserved name.
- * @throws RepositoryCreationServiceException
- * if can't reserve name
+ * @throws RepositoryCreationServiceException if can't reserve name
*/
String reserveRepositoryName(String repositoryName) throws RepositoryCreationException;
/**
* Creates repository, using token of already reserved repository name. Good for cases, when repository creation should be delayed or
* made asynchronously in dedicated thread.
- *
- * 1. Check that name is reserved
- * 2. Create repository locally from backup
- * - create related DB
- * - bind datasources
- * - restore repository from backup (in synchronous mode)
- * 3. If need to do the same in cluster then send requests to others cluster nodes to create repository and waits for responses
- * 4. On each others cluster nodes:
- * - bind datasources
- * - start repository
- * - send response
- * 5. Release lock (unreserve name)
- *
- * @param rEntry
- * @param backupId
- * @param rToken
+ * @param rEntry - repository entry - note, taht datasource must not exist
+ * @param backupId - backup id
+ * @param rToken - token
+ * @throws RepositoryConfigurationException
+ * if some exception occurred during repository creation or repository name is absent in reserved list
* @throws RepositoryCreationServiceException
* if some exception occurred during repository creation or repository name is absent in reserved list
*/
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 08:16:45 UTC (rev 3548)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-25 08:49:46 UTC (rev 3549)
@@ -29,6 +29,7 @@
import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChainLog;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
+import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.naming.InitialContextInitializer;
@@ -43,7 +44,6 @@
import org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl;
import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
-import org.jboss.cache.util.concurrent.ConcurrentHashSet;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -52,8 +52,10 @@
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javax.jcr.RepositoryException;
import javax.naming.NamingException;
@@ -98,9 +100,9 @@
private final InitialContextInitializer initialContextInitializer;
/**
- * Store of reserved repository names.
+ * Store of reserved repository names. <tokenname, repositoryname>
*/
- private final Set<String> pendingRepositories = new ConcurrentHashSet<String>();
+ private final Map<String, String> pendingRepositories = new ConcurrentHashMap<String, String>();
private RemoteCommand reserveRepositoryName;
@@ -135,20 +137,11 @@
public Serializable execute(Serializable[] args) throws Throwable
{
- System.out.println("EXECUTED reserveRepositoryName");
-
String repositoryName = (String)args[0];
- if (!pendingRepositories.contains(repositoryName))
- {
- pendingRepositories.add(repositoryName);
- }
- else
- {
- throw new RepositoryCreationException("Repository name " + repositoryName + " already reserved.");
- }
- return repositoryName;
+ return reserveRepoName(repositoryName);
}
});
+
createRepository = rpcService.registerCommand(new RemoteCommand()
{
@@ -159,7 +152,6 @@
public Serializable execute(Serializable[] args) throws Throwable
{
- System.out.println("EXECUTED createRepository");
//String backupId, RepositoryEntry rEntry, String rToken
String backupId = (String)args[0];
String stringRepositoryEntry = (String)args[1];
@@ -172,28 +164,6 @@
.getBytes(Constants.DEFAULT_ENCODING)));
createRepo(backupId, rEntry, rToken);
-
- // execute startRepository at all cluster nodes (coordinator will ignore this command)
- try
- {
- rpcService.executeCommandOnAllNodes(startRepository, false, stringRepositoryEntry);
- }
- catch (RPCException e)
- {
- Throwable cause = e.getCause();
- if (cause instanceof RepositoryCreationException)
- {
- throw new RepositoryCreationException(
- "Repository " + rEntry.getName()
- + " created on coordinator, can not be started at other cluster node: "
- + cause.getMessage(), cause);
- }
- else
- {
- throw new RepositoryCreationException("Repository " + rEntry.getName()
- + " created on coordinator, can not be started at other cluster node: " + e.getMessage(), e);
- }
- }
return null;
}
finally
@@ -206,7 +176,6 @@
startRepository = rpcService.registerCommand(new RemoteCommand()
{
-
public String getId()
{
return "org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreationServiceImpl-startRepository";
@@ -214,7 +183,6 @@
public Serializable execute(Serializable[] args) throws Throwable
{
- System.out.println("EXECUTED startRepository");
// must not be executed on coordinator node, since coordinator node already created the repository
if (!rpcService.isCoordinator())
{
@@ -230,7 +198,6 @@
}
});
}
-
}
/**
@@ -249,10 +216,8 @@
public void createRepository(String backupId, RepositoryEntry rEntry, String rToken)
throws RepositoryConfigurationException, RepositoryCreationException
{
-
if (rpcService != null)
{
- //TODO is is correct to use Json code here
String stringRepositoryEntry = null;
try
{
@@ -265,6 +230,7 @@
throw new RepositoryCreationException("Can not serialize repository entry: " + e.getMessage(), e);
}
+ // notify coordinator node to create repository
try
{
Object result =
@@ -272,7 +238,7 @@
if (result != null)
{
- throw new RepositoryCreationException("ReserveRepositoryName command returns unknown command.");
+ throw new RepositoryCreationException("CreateRepository command must not return any results.");
}
}
catch (RPCException e)
@@ -291,6 +257,37 @@
throw new RepositoryCreationException(e.getMessage(), e);
}
}
+
+ // execute startRepository at all cluster nodes (coordinator will ignore this command)
+ try
+ {
+ List<Object> results = rpcService.executeCommandOnAllNodes(startRepository, true, stringRepositoryEntry);
+
+ for (Object result : results)
+ {
+ if (result instanceof RPCException)
+ {
+ Throwable cause = ((RPCException)result).getCause();
+ if (cause instanceof RepositoryCreationException)
+ {
+ throw new RepositoryCreationException("Repository " + rEntry.getName()
+ + " created on coordinator, but can not be started at other cluster nodes: "
+ + cause.getMessage(), cause);
+ }
+ }
+ if (result instanceof Throwable)
+ {
+ throw new RepositoryCreationException("Repository " + rEntry.getName()
+ + " created on coordinator, but can not be started at other cluster nodes: "
+ + ((Throwable)result).getMessage(), ((Throwable)result));
+ }
+ }
+ }
+ catch (RPCException e)
+ {
+ throw new RepositoryCreationException("Repository " + rEntry.getName()
+ + " created on coordinator, can not be started at other cluster node: " + e.getMessage(), e);
+ }
}
else
{
@@ -300,7 +297,7 @@
}
finally
{
- pendingRepositories.remove(rEntry);
+ pendingRepositories.remove(rToken);
}
}
}
@@ -310,21 +307,19 @@
*/
public String reserveRepositoryName(String repositoryName) throws RepositoryCreationException
{
-
- // check possibility to create repository locally
- //check does repository already created
- for (int i = 0; i < repositoryService.getConfig().getRepositoryConfigurations().size(); i++)
+ if (rpcService != null)
{
- RepositoryEntry conf = repositoryService.getConfig().getRepositoryConfigurations().get(i);
- if (conf.getName().equals(repositoryName))
+ // check does repository already created
+ for (int i = 0; i < repositoryService.getConfig().getRepositoryConfigurations().size(); i++)
{
- throw new RepositoryCreationException("Repository " + repositoryName + " already exists.");
+ RepositoryEntry conf = repositoryService.getConfig().getRepositoryConfigurations().get(i);
+ if (conf.getName().equals(repositoryName))
+ {
+ throw new RepositoryCreationException("Repository " + repositoryName + " already exists.");
+ }
}
- }
- if (rpcService != null)
- {
- //ask other nodes does they have pending repositories
+ // reserve RepositoryName at coordinator-node
try
{
Object result = rpcService.executeCommandOnCoordinator(reserveRepositoryName, true, repositoryName);
@@ -347,67 +342,62 @@
}
else
{
- throw new RepositoryCreationException(e.getMessage(), e);
+ throw new RepositoryCreationException("Can not reserve repository name " + repositoryName + " since: "
+ + e.getMessage(), e);
}
}
}
else
{
- pendingRepositories.add(repositoryName);
- return repositoryName;
+ return reserveRepoName(repositoryName);
}
}
+ protected String reserveRepoName(String repositoryName) throws RepositoryCreationException
+ {
+ // check does repository already created
+ for (int i = 0; i < repositoryService.getConfig().getRepositoryConfigurations().size(); i++)
+ {
+ RepositoryEntry conf = repositoryService.getConfig().getRepositoryConfigurations().get(i);
+ if (conf.getName().equals(repositoryName))
+ {
+ throw new RepositoryCreationException("Repository " + repositoryName + " already exists.");
+ }
+ }
+
+ // check does this repository name already reserved, otherwise generate and return token
+ if (!pendingRepositories.containsValue(repositoryName))
+ {
+ String rToken = repositoryName + IdGenerator.generate();
+ pendingRepositories.put(rToken, repositoryName);
+ return rToken;
+ }
+ else
+ {
+ throw new RepositoryCreationException("Repository name " + repositoryName + " already reserved.");
+ }
+ }
+
protected void createRepo(String backupId, RepositoryEntry rEntry, String rToken)
throws RepositoryConfigurationException, RepositoryCreationException
{
// check does token registered
- if (!this.pendingRepositories.contains(rToken))
+ if (!this.pendingRepositories.containsKey(rToken))
{
throw new RepositoryCreationException("Token " + rToken + " does not registered.");
}
- // Prepare list of datasource names that must be binded to newly created databases.
- Set<String> dataSourceNames = new HashSet<String>();
- for (WorkspaceEntry wsEntry : rEntry.getWorkspaceEntries())
- {
+ // Prepare list of data-source names that must be binded to newly created databases.
+ Set<String> dataSourceNames = extractDataSourceNames(rEntry, true);
- boolean isMultiDB =
- Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));
- String dbSourceName = wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
-
- if (isMultiDB && dataSourceNames.contains(dbSourceName))
- {
- throw new RepositoryCreationException("RepositoryEntry for new " + rToken
- + " repository contains workspaces that marked as multiDB but have same datasource " + dbSourceName
- + ".");
- }
-
- try
- {
- DataSource ds = (DataSource)initialContextInitializer.getInitialContext().lookup(dbSourceName);
- if (ds != null)
- {
- throw new RepositoryConfigurationException("RepositoryEntry for new " + rToken
- + " repository contains already bibded datasource " + dbSourceName + ".");
- }
- }
- catch (NamingException e)
- {
- throw new RepositoryConfigurationException(e.getMessage(), e);
- }
-
- dataSourceNames.add(dbSourceName);
- }
-
- // create and bind related database to each datasource name
+ // create and bind related database to each data-source name
for (String dataSource : dataSourceNames)
{
- // 1) create related DB
+ // create related DB
Map<String, String> refAddr = new HashMap<String, String>();
try
{
- DBConnectionInfo dbConnectionInfo = dbCreator.createDatabase(rToken + "_" + dataSource);
+ DBConnectionInfo dbConnectionInfo = dbCreator.createDatabase(rEntry.getName() + "_" + dataSource);
refAddr.put("driverClassName", dbConnectionInfo.getDriver());
refAddr.put("url", dbConnectionInfo.getUrl());
refAddr.put("username", dbConnectionInfo.getUsername());
@@ -415,13 +405,13 @@
}
catch (DBCreatorException e)
{
- throw new RepositoryCreationException("Can not create new database for " + rToken + " repository.", e);
+ throw new RepositoryCreationException("Can not create new database for " + rEntry.getName()
+ + " repository.", e);
}
- // 2) bind data-source
+ // bind data-source
try
{
- //bind new data-source
initialContextInitializer.bind(dataSource, "javax.sql.DataSource",
"org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr);
}
@@ -439,7 +429,7 @@
}
}
- //3) restore repository from backup
+ // restore repository from backup
RepositoryBackupChainLog backupChain = null;
for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
{
@@ -484,26 +474,101 @@
protected void startRepository(RepositoryEntry repositoryEntry) throws RepositoryCreationException
{
- //TODO do we need bind datasource here?
-
try
{
+ // Prepare list of data-source names that must be binded
+ Set<String> dataSourceNames = extractDataSourceNames(repositoryEntry, false);
+
+ for (String dataSource : dataSourceNames)
+ {
+ // get data base info
+ Map<String, String> refAddr = new HashMap<String, String>();
+ try
+ {
+ DBConnectionInfo dbConnectionInfo =
+ dbCreator.getDBConnectionInfo(repositoryEntry.getName() + "_" + dataSource);
+ refAddr.put("driverClassName", dbConnectionInfo.getDriver());
+ refAddr.put("url", dbConnectionInfo.getUrl());
+ refAddr.put("username", dbConnectionInfo.getUsername());
+ refAddr.put("password", dbConnectionInfo.getPassword());
+ }
+ catch (DBCreatorException e)
+ {
+ throw new RepositoryCreationException("Can not fetch database information associated with "
+ + repositoryEntry.getName() + " repository and " + dataSource + " datasource.", e);
+ }
+ // bind data-source
+ try
+ {
+ initialContextInitializer.bind(dataSource, "javax.sql.DataSource",
+ "org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr);
+ }
+ catch (NamingException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ catch (FileNotFoundException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ catch (XMLStreamException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ }
+
repositoryService.createRepository(repositoryEntry);
}
catch (RepositoryConfigurationException e)
{
- throw new RepositoryCreationException("Repository created but can not be started on this node: "
- + e.getLocalizedMessage(), e);
+ throw new RepositoryCreationException(e.getMessage(), e);
}
catch (RepositoryException e)
{
- throw new RepositoryCreationException("Repository created but can not be started on this node: "
- + e.getLocalizedMessage(), e);
+ throw new RepositoryCreationException(e.getMessage(), e);
}
}
+ private Set<String> extractDataSourceNames(RepositoryEntry repositoryEntry, boolean checkDataSourceExistance)
+ throws RepositoryConfigurationException, RepositoryCreationException
+ {
+ Set<String> dataSourceNames = new HashSet<String>();
+ for (WorkspaceEntry wsEntry : repositoryEntry.getWorkspaceEntries())
+ {
+ boolean isMultiDB =
+ Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));
+ String dbSourceName = wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
+
+ if (isMultiDB && dataSourceNames.contains(dbSourceName))
+ {
+ throw new RepositoryCreationException("RepositoryEntry for new " + repositoryEntry.getName()
+ + " repository contains workspaces that marked as multiDB but have same datasource " + dbSourceName
+ + ".");
+ }
+
+ if (checkDataSourceExistance)
+ {
+ try
+ {
+ DataSource ds = (DataSource)initialContextInitializer.getInitialContext().lookup(dbSourceName);
+ if (ds != null)
+ {
+ throw new RepositoryConfigurationException("RepositoryEntry for new " + repositoryEntry.getName()
+ + " repository contains already binded datasource " + dbSourceName + ".");
+ }
+ }
+ catch (NamingException e)
+ {
+ throw new RepositoryConfigurationException(e.getMessage(), e);
+ }
+ }
+
+ dataSourceNames.add(dbSourceName);
+ }
+ return dataSourceNames;
+ }
+
/**
- * TODO make another serialization scheme or move it to dedicated object
* Will be created the Object from JSON binary data.
*
* @param cl
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation/TestRepositoryCreationService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation/TestRepositoryCreationService.java 2010-11-25 08:16:45 UTC (rev 3548)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation/TestRepositoryCreationService.java 2010-11-25 08:49:46 UTC (rev 3549)
@@ -17,6 +17,7 @@
package org.exoplatform.services.jcr.ext.repository.creation;
import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.ext.backup.AbstractBackupTestCase;
@@ -117,4 +118,91 @@
RepositoryService repoService = (RepositoryService)this.container.getComponentInstance(RepositoryService.class);
assertNotNull(repoService.getConfig().getRepositoryConfiguration(tenantName));
}
+
+ public void testReserveRepositoryNameException() throws Exception
+ {
+ RepositoryCreationService creatorService =
+ (RepositoryCreationService)container.getComponentInstanceOfType(RepositoryCreationService.class);
+
+ // 1) check unexist repository same name
+ String tenantName = "new_repository_2";
+
+ String repoToken = creatorService.reserveRepositoryName(tenantName);
+ assertNotNull(repoToken);
+
+ try
+ {
+ creatorService.reserveRepositoryName(tenantName);
+ fail("There must be RepositoryCreationException.");
+ }
+ catch (RepositoryCreationException e)
+ {
+ //ok
+ }
+
+ // 2)try to reserve already existing repository
+ try
+ {
+ creatorService.reserveRepositoryName(this.repository.getName());
+ fail("There must be RepositoryCreationException.");
+ }
+ catch (RepositoryCreationException e)
+ {
+ //ok
+ }
+ }
+
+ public void testCreateRepositoryException() throws Exception
+ {
+ String tenantName = "new_repository_3";
+ RepositoryEntry baseRE =
+ (RepositoryEntry)ws1Session.getContainer().getComponentInstanceOfType(RepositoryEntry.class);
+
+ RepositoryEntry rEntry = makeRepositoryEntry(tenantName, baseRE, "source2", null);
+
+ RepositoryCreationService creatorService =
+ (RepositoryCreationService)container.getComponentInstanceOfType(RepositoryCreationService.class);
+
+ // 1) try to create with unregistered token
+ try
+ {
+ creatorService.createRepository("nomatter", rEntry, "any_name");
+ fail("There must be RepositoryCreationException.");
+ }
+ catch (RepositoryCreationException e)
+ {
+ //ok
+ }
+
+ String repoToken = creatorService.reserveRepositoryName(tenantName);
+ // 2) test with malformed repository entry
+
+ RepositoryEntry brokenRepositoryEntry = rEntry;
+
+ brokenRepositoryEntry.getWorkspaceEntries().get(0).getContainer().getParameters().remove(0);
+ brokenRepositoryEntry.getWorkspaceEntries().get(0).getContainer().getParameters().remove(0);
+
+ try
+ {
+ creatorService.createRepository("nomatter", brokenRepositoryEntry, repoToken);
+ fail("There must be RepositoryConfigurationException.");
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ //ok
+ }
+
+ repoToken = creatorService.reserveRepositoryName(tenantName);
+ // 3) test configuration with existing datasource
+ RepositoryEntry rEntryWithRealDataSource = makeRepositoryEntry(tenantName, baseRE, null, null);
+ try
+ {
+ creatorService.createRepository("nomatter", rEntryWithRealDataSource, repoToken);
+ fail("There must be RepositoryConfigurationException.");
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ //ok
+ }
+ }
}
13 years, 5 months