You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/07/25 17:50:52 UTC
svn commit: r225142 [1/2] - in
/incubator/jackrabbit/trunk/contrib/bdb-persistence: ./ applications/
applications/test/ src/ src/java/ src/java/org/ src/java/org/apache/
src/java/org/apache/jackrabbit/ src/java/org/apache/jackrabbit/core/
src/java/org/...
Author: stefan
Date: Mon Jul 25 08:50:40 2005
New Revision: 225142
URL: http://svn.apache.org/viewcvs?rev=225142&view=rev
Log:
adding BerkeleyDb PersistenceManager contributed by Guillaume Bort
to contrib section
Added:
incubator/jackrabbit/trunk/contrib/bdb-persistence/
incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/jaas.config
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/project.xml
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeStateTupleBinding.java (with props)
incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/PropertyStateTupleBinding.java (with props)
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt Mon Jul 25 08:50:40 2005
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/HEADER.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt Mon Jul 25 08:50:40 2005
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt Mon Jul 25 08:50:40 2005
@@ -0,0 +1,13 @@
+// bdb-persistence
+// jcr (jsr170) support for the spring framework
+
+// berkeleydb je support for jackrabbit persistence
+
+~~ About
+
+A berkeleydb persistence manager for the jackrabbit project ( http://incubator.apache.org/jackrabbit )
+It use the berkeleydb java edition
+
+~~ Installation/Configuration
+
+Just use org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager as persistence managers in your repository.xml configuration file
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/jaas.config
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/jaas.config?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/jaas.config (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/jaas.config Mon Jul 25 08:50:40 2005
@@ -0,0 +1,3 @@
+Jackrabbit {
+ org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous";
+};
\ No newline at end of file
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties Mon Jul 25 08:50:40 2005
@@ -0,0 +1,22 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, file
+#log4j.rootLogger=DEBUG, stdout, file
+#log4j.rootLogger=ERROR, stdout, file
+
+log4j.logger.org.apache.jackrabbit.test=DEBUG
+log4j.logger.org.apache.jackrabbit.core.state.bdb=DEBUG
+
+# 'stdout' is set to be a ConsoleAppender.
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+
+# 'stdout' uses PatternLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n
+
+# 'file' is set to be a FileAppender.
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=jcr.log
+
+# 'file' uses PatternLayout.
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml Mon Jul 25 08:50:40 2005
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Repository [
+ <!--
+ the Repository element configures a repository instance;
+ individual workspaces of the repository are configured through
+ separate configuration files called workspace.xml which are
+ located in a subfolder of the workspaces root directory
+ (see Workspaces element).
+
+ it consists of
+
+ a FileSystem element (the virtual file system
+ used by the repository to persist global state such as
+ registered namespaces, custom node types, etc..
+
+ a Security element that specifies the name of the app-entry
+ in the JAAS config and the access manager
+
+ a Workspaces element that specifies to the location of
+ workspaces root directory and the name of default workspace
+
+ a Workspace element that is used as a workspace configuration
+ template; it is used to create the initial workspace if there's
+ no workspace yet and for creating additional workspaces through
+ the api
+
+ a SearchIndex element that is used for configuring per workspace
+ Indexing-related settings
+
+ a Versioning element that is used for configuring
+ versioning-related settings
+ -->
+ <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)>
+
+ <!--
+ a virtual file system
+ -->
+ <!ELEMENT FileSystem (param*)>
+ <!ATTLIST FileSystem
+ class CDATA #REQUIRED>
+
+ <!--
+ the Security element specifies the name (appName attribute)
+ of the JAAS configuration app-entry for this repository.
+
+ it also specifies the access manager to be used (AccessManager element).
+ -->
+ <!ELEMENT Security (AccessManager, LoginModule?)>
+ <!ATTLIST Security
+ appName CDATA #REQUIRED>
+
+ <!--
+ the AccessManager element configures the access manager to be used by
+ this repository instance; the class attribute specifies the FQN of the
+ class implementing the AccessManager interface
+ -->
+ <!ELEMENT AccessManager (param*)>
+ <!ATTLIST AccessManager
+ class CDATA #REQUIRED>
+
+ <!--
+ generic parameter (name/value pair)
+ -->
+ <!ELEMENT param EMPTY>
+ <!ATTLIST param
+ name CDATA #REQUIRED
+ value CDATA #REQUIRED>
+
+ <!--
+ the LoginModule element optionally specifies a JAAS login module to
+ authenticate users. This feature allows the use of Jackrabbit in a
+ non-JAAS environment.
+ -->
+ <!ELEMENT LoginModule (param*)>
+ <!ATTLIST LoginModule
+ class CDATA #REQUIRED>
+
+ <!--
+ the Workspaces element specifies the workspaces root directory
+ (rootPath attribute) and the name of the default workspace
+ (defaultWorkspace attribute).
+
+ individual workspaces are configured through individual workspace.xml
+ files located in a subfolder each of the workspaces root directory.
+ -->
+ <!ELEMENT Workspaces EMPTY>
+ <!ATTLIST Workspaces
+ rootPath CDATA #REQUIRED
+ defaultWorkspace CDATA #REQUIRED>
+
+ <!--
+ the Workspace element serves as a workspace configuration template;
+ it is used to create the initial workspace if there's no workspace yet
+ and for creating additional workspaces through the api
+ -->
+ <!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?)>
+ <!ATTLIST Workspace
+ name CDATA #REQUIRED>
+
+ <!--
+ the PersistenceManager element configures the persistence manager
+ to be used for the workspace; the class attribute specifies the
+ FQN of the class implementing the PersistenceManager interface
+ -->
+ <!ELEMENT PersistenceManager (param*)>
+ <!ATTLIST PersistenceManager
+ class CDATA #REQUIRED>
+
+ <!--
+ the SearchIndex element specifies the locaction of the search index
+ (used by the QueryHandler); the class attribute specifies the
+ FQN of the class implementing the QueryHandler interface.
+ -->
+ <!ELEMENT SearchIndex (param*,FileSystem)>
+ <!ATTLIST SearchIndex
+ class CDATA #REQUIRED>
+
+ <!--
+ the Versioning element configures the persistence manager
+ to be used for persisting version state
+ -->
+ <!ELEMENT Versioning (FileSystem, PersistenceManager)>
+ <!ATTLIST Versioning
+ rootPath CDATA #REQUIRED
+ >
+]>
+<!-- Example Repository Configuration File -->
+<Repository>
+ <!--
+ virtual file system where the repository stores global state
+ (e.g. registered namespaces, custom node types, etc.)
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/repository"/>
+ </FileSystem>
+
+ <!--
+ security configuration
+ -->
+ <Security appName="Jackrabbit">
+ <!--
+ access manager:
+ class: FQN of class implementing the AccessManager interface
+ -->
+ <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
+ <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+ </AccessManager>
+
+ <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
+ <!-- anonymous user name ('anonymous' is the default value) -->
+ <param name="anonymousId" value="anonymous"/>
+ </LoginModule>
+ </Security>
+
+ <!--
+ location of workspaces root directory and name of default workspace
+ -->
+ <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+ <!--
+ workspace configuration template:
+ used to create the initial workspace if there's no workspace yet
+ -->
+ <Workspace name="${wsp.name}">
+ <!--
+ virtual file system of the workspace:
+ class: FQN of class implementing the FileSystem interface
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}"/>
+ </FileSystem>
+ <!--
+ persistence manager of the workspace:
+ class: FQN of class implementing the PersistenceManager interface
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager"/>
+ <!--
+ Search index and the file system it uses.
+ class: FQN of class implementing the QueryHandler interface
+
+ Supported parameters for lucene search index:
+ - useCompoundFile: advises lucene to use compound files for the index files
+ - minMergeDocs: minimum number of nodes in an index until segments are merged
+ - maxMergeDocs: maximum number of nodes in segments that will be merged
+ - mergeFactor: determines how often segment indices are merged
+ - bufferSize: maximum number of documents that are held in a pending
+ queue until added to the index
+ - forceConsistencyCheck: runs a consistency check on every startup. If
+ false, a consistency check is only performed when the search index
+ detects a prior forced shutdown.
+ - autoRepair: errors detected by a consistency check are automatically
+ repaired. If false, errors are only written to the log.
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="useCompoundFile" value="true"/>
+ <param name="minMergeDocs" value="1000"/>
+ <param name="maxMergeDocs" value="100000"/>
+ <param name="mergeFactor" value="10"/>
+ <param name="bufferSize" value="10"/>
+ <param name="forceConsistencyCheck" value="false"/>
+ <param name="autoRepair" value="true"/>
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}/index"/>
+ </FileSystem>
+ </SearchIndex>
+ </Workspace>
+
+ <!--
+ Configures the versioning
+ -->
+ <Versioning rootPath="${rep.home}/version">
+ <!--
+ Configures the filesystem to use for versioning for the respective
+ persistence manager
+ -->
+ <FileSystem class="com.day.jackrabbit.fs.cq.CQFileSystem">
+ <param name="path" value="${rep.home}/version/version.dat"/>
+ <param name="autoRepair" value="false"/>
+ <param name="blockSize" value="128"/>
+ <param name="autoSync" value="false"/>
+ </FileSystem>
+
+ <!--
+ Configures the persistence manager to be used for persisting version state.
+ Please note that the current versioning implementation is based on
+ a 'normal' persistence manager, but this could change in future
+ implementations.
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager"/>
+
+ </Versioning>
+</Repository>
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repository.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties Mon Jul 25 08:50:40 2005
@@ -0,0 +1,432 @@
+#
+# This is the configuration file for the jackrabbit repository test stub.
+#
+
+# Stub implementation class
+javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.core.JackrabbitRepositoryStub
+
+# repository specific configuration
+org.apache.jackrabbit.repository.config=applications/test/repository.xml
+org.apache.jackrabbit.repository.name=repo
+org.apache.jackrabbit.repository.home=applications/test
+org.apache.jackrabbit.repository.jaas.config=applications/test/jaas.config
+
+# credential configuration
+javax.jcr.tck.superuser.name=superuser
+javax.jcr.tck.superuser.pwd=
+javax.jcr.tck.readwrite.name=user
+javax.jcr.tck.readwrite.pwd=
+javax.jcr.tck.readonly.name=anonymous
+javax.jcr.tck.readonly.pwd=
+
+# global test configuration
+javax.jcr.tck.testroot=/testroot
+javax.jcr.tck.nodetype=nt:unstructured
+javax.jcr.tck.nodename1=node1
+javax.jcr.tck.nodename2=node2
+javax.jcr.tck.nodename3=node3
+javax.jcr.tck.nodename4=node4
+javax.jcr.tck.propertyname1=prop1
+javax.jcr.tck.propertyname2=prop2
+javax.jcr.tck.workspacename=test
+
+# namespace configuration
+javax.jcr.tck.namespaces=test
+javax.jcr.tck.namespaces.test=http://www.apache.org/jackrabbit/test
+
+# sample for per test case config overriding
+# Test class: AddNodeText
+# Test method: testName
+javax.jcr.tck.AddNodeTest.testName.nodename1=myname
+
+# ==============================================================================
+# JAVAX.JCR CONFIGURATION
+# ==============================================================================
+
+# Test class: ItemDefTest
+javax.jcr.tck.ItemDefTest.testroot=/testdata
+
+# Test class: ItemReadMethodsTest
+javax.jcr.tck.ItemReadMethodsTest.testroot=/testdata
+
+# Test class: NodeReadMethodsTest
+javax.jcr.tck.NodeReadMethodsTest.testroot=/testdata
+
+# Test class: PropertyTypeTest
+javax.jcr.tck.PropertyTypeTest.testroot=/testdata
+
+# Test class: BinaryPropertyTest
+javax.jcr.tck.BinaryPropertyTest.testroot=/testdata
+
+# Test class: BooleanPropertyTest
+javax.jcr.tck.BooleanPropertyTest.testroot=/testdata
+
+# Test class: DatePropertyTest
+javax.jcr.tck.DatePropertyTest.testroot=/testdata
+
+# Test class: DoublePropertyTest
+javax.jcr.tck.DoublePropertyTest.testroot=/testdata
+
+# Test class: LongPropertyTest
+javax.jcr.tck.LongPropertyTest.testroot=/testdata
+
+# Test class: NamePropertyTest
+javax.jcr.tck.NamePropertyTest.testroot=/testdata
+
+# Test class: PathPropertyTest
+javax.jcr.tck.PathPropertyTest.testroot=/testdata
+
+# Test class: ReferencePropertyTest
+javax.jcr.tck.ReferencePropertyTest.testroot=/testdata
+
+# Test class: StringPropertyTest
+javax.jcr.tck.StringPropertyTest.testroot=/testdata
+
+# Test class: SetValueVersionExceptionTest
+# nodetype2: nodetype with a reference property
+javax.jcr.tck.SetValueVersionExceptionTest.nodetype2=nt:linkedFile
+# propertyname3: name of the single value reference property
+javax.jcr.tck.SetValueVersionExceptionTest.propertyname3=jcr:content
+
+# Test class: UndefinedPropertyTest
+javax.jcr.tck.UndefinedPropertyTest.testroot=/testdata
+
+# Test class: PropertyReadMethodsTest
+javax.jcr.tck.PropertyReadMethodsTest.testroot=/testdata
+
+# Test class: NodeIteratorTest
+javax.jcr.tck.NodeIteratorTest.testroot=/testdata
+
+# Test class: NodeDiscoveringNodeTypesTest
+javax.jcr.tck.NodeDiscoveringNodeTypesTest.testroot=/testdata
+
+# Test class: RepositoryDescriptorTest
+javax.jcr.tck.RepositoryDescriptorTest.testroot=/testdata
+
+# Test class: WorkspaceReadMethodsTest
+javax.jcr.tck.WorkspaceReadMethodsTest.testroot=/testdata
+
+# Test class: SessionReadMethodsTest
+javax.jcr.tck.SessionReadMethodsTest.testroot=/testdata
+
+# Test class: NamespaceRegistryReadMethodsTest
+javax.jcr.tck.NamespaceRegistryReadMethodsTest.testroot=/testdata
+
+# Test class: NamespaceRemappingTest
+javax.jcr.tck.NamespaceRemappingTest.testroot=/testdata
+
+# Test class: SessionTest
+# Test method: testMoveItemExistsException
+# nodetype that does not allow same name siblings
+javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype2=nt:folder
+# valid node type that can be added as child of nodetype2
+javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype3=nt:hierarchyNode
+
+# Test class: SessionTest
+# Test method: testSaveContstraintViolationException
+# nodetype that has a property that is mandatory but not autocreated
+javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2=nt:file
+
+# Test class: SessionUUIDTest
+# node type that has a property of type PropertyType.REFERENCE
+javax.jcr.tck.SessionUUIDTest.nodetype=nt:unstructured
+# name of the property that is of type PropertyType.REFERENCE
+javax.jcr.tck.SessionUUIDTest.propertyname1=foobar
+# nodetype that has nodetype mix:referenceable assigned
+javax.jcr.tck.SessionUUIDTest.nodetype2=test:refTargetNode
+
+# Test class: SessionUUIDTest
+# Test method: testSaveMovedRefNode
+# name of the property that can be modified
+javax.jcr.tck.SessionUUIDTest.testSaveMovedRefNode.propertyname1=foobar
+
+# Test class: NodeTest
+# Test method: testAddNodeItemExistsException
+# nodetype that does not allow same name siblings and allows child nodes of
+# the same type
+javax.jcr.tck.NodeTest.testAddNodeItemExistsException.nodetype=nt:folder
+
+# Test class: NodeTest
+# Test method: testRemoveMandatoryNode
+# nodetype that has a mandatory child node definition
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype2=nt:file
+# nodetype of the mandatory child
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype3=nt:base
+# name of the mandatory node
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodename3=jcr:content
+
+# Test class: NodeTest
+# Test method: testSaveContstraintViolationException
+# nodetype that has a property that is mandatory but not autocreated
+javax.jcr.tck.NodeTest.testSaveContstraintViolationException.nodetype2=nt:file
+
+# Test class: NodeUUIDTest
+# node type that has a property of type PropertyType.REFERENCE
+javax.jcr.tck.NodeUUIDTest.nodetype=nt:unstructured
+# name of the property that is of type PropertyType.REFERENCE
+javax.jcr.tck.NodeUUIDTest.propertyname1=ref
+# nodetype that has nodetype mix:referenceable assigned
+javax.jcr.tck.NodeUUIDTest.nodetype2=test:refTargetNode
+
+# Test class: NodeUUIDTest
+# Test method: testSaveMovedRefNode
+# name of the property that can be modified
+javax.jcr.tck.NodeUUIDTest.testSaveMovedRefNode.propertyname1=foobar
+# nodetype that has nodetype mix:referenceable assigned
+
+# Test class: NodeOrderableChildNodesTest
+# nodetype that supports orderable child nodes
+javax.jcr.tck.NodeOrderableChildNodesTest.nodetype2=nt:unstructured
+# valid node type that can be added as child of nodetype 2
+javax.jcr.tck.NodeOrderableChildNodesTest.nodetype3=nt:unstructured
+
+# Test class: NodeOrderableChildNodesTest
+# Test method: testOrderBeforeUnsupportedRepositoryOperationException
+# nodetype that does not allow ordering of child nodes
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype2=nt:folder
+# valid node type that can be added as child of nodetype 2
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3=nt:hierarchyNode
+
+# Test class: SetPropertyNodeTest
+# nodetype which is referenceable
+javax.jcr.tck.SetPropertyNodeTest.nodetype=test:setProperty
+
+# Test class: SetPropertyValueTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyValueTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyValueTest.nodetype=test:setProperty
+
+# Test class: SetPropertyStringTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyStringTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyStringTest.nodetype=test:setProperty
+
+# Test class: WorkspaceCloneSameNameSibsTest
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopyBetweenWorkspacesSameNameSibsTest
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopySameNameSibsTest
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceMoveSameNameSibsTest
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: RepositoryLoginTest
+javax.jcr.tck.RepositoryLoginTest.testroot=/testdata
+
+# Test class: RootNodeTest
+javax.jcr.tck.RootNodeTest.testroot=/testdata
+
+# Test class: ReferenceableRootNodesTest
+javax.jcr.tck.ReferenceableRootNodesTest.testroot=/testdata
+
+# Test class: ExportDocViewTest
+javax.jcr.tck.ExportDocViewTest.testroot=/testdata
+
+# ------------------------------------------------------------------------------
+# observation configuration
+# ------------------------------------------------------------------------------
+
+# Test class: AddEventListenerTest
+# Test method: testNodeType
+javax.jcr.tck.AddEventListenerTest.testNodeType.nodetype2=nt:folder
+
+# Configuration settings for the serialization.
+# Note that the serialization test tries to use as many features of the repository
+# as possible, but fails silently if a feature is not available. You have to
+# specify all of the following configuration entries, even if your repository does
+# not support the feature that is associated with them.
+
+# Root node for the example tree
+javax.jcr.tck.SerializationTest.testroot=/testdata/serialization
+
+# Node type to use for the example tree. Specify a node type that allows complex trees and all property types if possible
+javax.jcr.tck.SerializationTest.nodetype=nt:unstructured
+
+# Name of the nodes for source and target tree
+javax.jcr.tck.SerializationTest.sourceFolderName=source
+javax.jcr.tck.SerializationTest.targetFolderName=target
+javax.jcr.tck.SerializationTest.rootNodeName=test
+
+# List the properties whose values may change during serialization/deserialization. For example,
+# the UUID of a node is unique in the repository, so it will have to change when you re-import
+# a tree at a different location.
+javax.jcr.tck.SerializationTest.propertyValueMayChange= jcr:created jcr:uuid jcr:versionHistory jcr:baseVersion jcr:predecessors P_Reference
+
+# List all properties which are skipped during xml import according specification chapter 7.3.3
+javax.jcr.tck.SerializationTest.propertySkipped=
+
+# The name of the test node types. For easier diagnostics, the node types have names
+# that tell you the kind of information they store
+javax.jcr.tck.SerializationTest.nodeTypesTestNode=NodeTypes
+javax.jcr.tck.SerializationTest.mixinTypeTestNode=MixinTypes
+javax.jcr.tck.SerializationTest.propertyTypesTestNode=PropertyTypes
+javax.jcr.tck.SerializationTest.sameNameChildrenTestNode=SameNameChildren
+javax.jcr.tck.SerializationTest.multiValuePropertiesTestNode=MultiValueProperties
+javax.jcr.tck.SerializationTest.referenceableNodeTestNode=ReferenceableNode
+javax.jcr.tck.SerializationTest.orderChildrenTestNode=OrderChildren
+javax.jcr.tck.SerializationTest.namespaceTestNode=Namespace
+
+# The name of the test property types.
+javax.jcr.tck.SerializationTest.stringTestProperty=P_String
+javax.jcr.tck.SerializationTest.binaryTestProperty=P_Binary
+javax.jcr.tck.SerializationTest.dateTestProperty=P_Date
+javax.jcr.tck.SerializationTest.longTestProperty=P_Long
+javax.jcr.tck.SerializationTest.doubleTestProperty=P_Double
+javax.jcr.tck.SerializationTest.booleanTestProperty=P_Boolean
+javax.jcr.tck.SerializationTest.nameTestProperty=P_Name
+javax.jcr.tck.SerializationTest.pathTestProperty=P_Path
+javax.jcr.tck.SerializationTest.referenceTestProperty=P_Reference
+javax.jcr.tck.SerializationTest.multiValueTestProperty=P_MultiValue
+
+# node type not allowing same name sibs
+javax.jcr.tck.SerializationTest.sameNameSibsFalseChildNodeDefinition=test:sameNameSibsFalseChildNodeDefinition
+
+# Test method: testVersioningExceptionSessionFileChild
+# specified nodetype must be versionable and allow child nodes of the same type.
+javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileChild.nodetype=test:versionable
+
+# Test method: testVersioningExceptionSessionFileParent
+# specified nodetype must be versionable and allow child nodes of the same type.
+javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileParent.nodetype=test:versionable
+
+# Test method: testSessionImportXmlOverwriteException
+# requires a node type that does not allow same name siblings
+javax.jcr.tck.SerializationTest.testSessionImportXmlOverwriteException.nodetype=nt:folder
+
+# Test class: ExportSysViewTest
+javax.jcr.tck.ExportSysViewTest.testroot=/testdata
+
+# ==============================================================================
+# JAVAX.JCR.QUERY CONFIGURATION
+# ==============================================================================
+
+javax.jcr.tck.nodetype.testroot=/testdata
+
+# ==============================================================================
+# JAVAX.JCR.QUERY CONFIGURATION
+# ==============================================================================
+
+# Test class: SaveTest
+# Test method: testConstraintViolationException
+# Specified node type must not allow child nodes.
+javax.jcr.tck.SaveTest.testConstraintViolationException.nodetype=nt:query
+
+# Test class: XPathQueryLevel1Test
+javax.jcr.tck.XPathQueryLevel1Test.testroot=/testdata/query
+
+# Test class: XPathDocOrderTest
+javax.jcr.tck.XPathDocOrderTest.testroot=/testdata/query
+
+# Test class: XPathPosIndexTest
+javax.jcr.tck.XPathPosIndexTest.testroot=/testdata/query
+
+# Test class: XPathOrderByTest
+javax.jcr.tck.XPathOrderByTest.testroot=/testdata/query
+
+# Test class: XPathSyntaxTest
+javax.jcr.tck.XPathSyntaxTest.testroot=/testdata/query
+
+# Test class: XPathJcrPathTest
+javax.jcr.tck.XPathJcrPathTest.testroot=/testdata
+
+# Test class: SQLQueryLevel1Test
+javax.jcr.tck.SQLQueryLevel1Test.testroot=/testdata/query
+
+# Test class: SQLSyntaxTest
+javax.jcr.tck.SQLSyntaxTest.testroot=/testdata/query
+
+# Test class: SQLOrderByTest
+javax.jcr.tck.SQLOrderByTest.testroot=/testdata/query
+
+# Test class: DerefQueryLevel1Test
+javax.jcr.tck.DerefQueryLevel1Test.testroot=/testdata
+
+# Test class: GetLanguageTest
+javax.jcr.tck.GetLanguageTest.testroot=/testdata
+
+# Test class: GetPersistentQueryPathLevel1Test
+javax.jcr.tck.GetPersistentQueryPathLevel1Test.testroot=/testdata
+
+# Test class: GetPropertyNamesTest
+javax.jcr.tck.GetPropertyNamesTest.testroot=/testdata
+
+# Test class: GetStatementTest
+javax.jcr.tck.GetStatementTest.testroot=/testdata
+
+# Test class: GetSupportedQueryLanguagesTest
+javax.jcr.tck.GetSupportedQueryLanguagesTest.testroot=/testdata
+
+# Test class: SQLJcrPathTest
+javax.jcr.tck.SQLJcrPathTest.testroot=/testdata
+
+# Test class: SQLPathTest
+javax.jcr.tck.SQLPathTest.testroot=/testdata
+
+# Test class: PredicatesTest
+javax.jcr.tck.PredicatesTest.testroot=/testdata
+
+# Test class: SimpleSelectionTest
+javax.jcr.tck.SimpleSelectionTest.testroot=/testdata
+
+# ==============================================================================
+# JAVAX.JCR.VERSIONING CONFIGURATION
+# ==============================================================================
+
+# nodetye that is versionable. if it is not, an attempt is made to create versionable nodes
+# by adding a mix:versionable mixin-type.
+# NOTE: javax.jcr.tck.nodetype must define a non-versionable nodetype!
+javax.jcr.tck.version.versionableNodeType=test:versionable
+javax.jcr.tck.version.propertyValue=aPropertyValue
+
+# testroot for the version package
+# the test root must allow versionable and non-versionable nodes being created below
+javax.jcr.tck.version.testroot=/testroot
+
+# 3 nodes (nodeName1, nodeName2, nodeName3 with nt=versionableNodeType / nt=nonVersionableNodeType will be cloned to 2nd workspace
+# nodename1 > used to persistently create versionable node below testroot
+# nodename2 > used to create second versionable node below testroot (used for restore/workspace.restore with uuid-conflict)
+# nodename3 > used to persistently create non-versionable node below testroot
+javax.jcr.tck.version.nodename1=versionableNodeName1
+javax.jcr.tck.version.nodename2=versionableNodeName2
+javax.jcr.tck.version.nodename3=nonVersionableNodeName1
+
+# nodename 4: versionabel child-node of the first versionable node with nodeName1 and nodetype 'versionableNodeType'
+# used for:
+# + creation of a node in the 2nd workspace, that does not exist in the first workspace
+# + creation of a node in the 2nd workspace, in order to test uuid-conflicts with Workspace.restore.
+# + creation of a sub-node in the default workspace, in order to test uuid-conflicts with Node.restore.
+# + NOTE: the nodetype with 'versionableNodeType' must define its children nodes to either have COPY or VERSION
+# OPV behaviour in order to successfully test Node.restore and Workspace.restore with uuid conflict.
+javax.jcr.tck.version.nodename4=childNodeName
+
+# path to existing String-properties and a new value for the property, that allows to test the indicated OPV behaviour
+javax.jcr.tck.OnParentVersionAbortTest.propertyname1=test:abortOnParentVersionProp
+javax.jcr.tck.OnParentVersionComputeTest.propertyname1=test:computeOnParentVersionProp
+javax.jcr.tck.OnParentVersionCopyTest.propertyname1=test:copyOnParentVersionProp
+javax.jcr.tck.OnParentVersionIgnoreTest.propertyname1=test:ignoreOnParentVersionProp
+javax.jcr.tck.OnParentVersionInitializeTest.propertyname1=test:initializeOnParentVersionProp
+
+# Test class: RestoreTest
+# Test method: testRestoreWithUUIDConflict
+# nodename4 must be the name of a child node with a OPV definition COPY or VERSION
+javax.jcr.tck.RestoreTest.testRestoreWithUUIDConflict.nodename4=test:versionOnParentVersion
+
+# config for nodes that show the indicated OPV behaviour:
+# nodes are added in order to test the versioning behaviour indicated by the test-class name.
+# NOTE:
+# - nodename4 is uses as name for the childnode
+# - nodetype is used as nodetype name for the childnode
+# - the specified child node is created below nodename1 with versionableNodeType
+# the versionableNodeType and/or nodename1 may be overwritten with the individual
+# testclass below.
+javax.jcr.tck.OnParentVersionCopyTest.nodename4=test:copyOnParentVersion
+javax.jcr.tck.OnParentVersionCopyTest.nodetype=nt:unstructured
+javax.jcr.tck.OnParentVersionAbortTest.nodename4=test:abortOnParentVersion
+javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/applications/test/repositoryStubImpl.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml Mon Jul 25 08:50:40 2005
@@ -0,0 +1,171 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+<!--
+ Checkstyle checks configured for Maven.
+-->
+
+<module name="Checker">
+
+ <!-- Checks that a package.html file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+ <module name="PackageHtml"/>
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <module name="NewlineAtEndOfFile"/>
+
+ <!-- Checks that property files contain the same keys. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+ <module name="Translation"/>
+
+ <module name="TreeWalker">
+
+ <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
+ <!-- ************************************************************** -->
+ <!-- Checks that are different from the sun coding conventions ones -->
+ <!-- ************************************************************** -->
+
+ <module name="Header">
+ <property name="headerFile" value="${basedir}/HEADER.txt"/>
+ </module>
+ <!-- <property name="tabWidth" value="4"/> -->
+ <module name="LeftCurly">
+ <property name="option" value="eol"/>
+ </module>
+ <module name="LineLength">
+ <property name="max" value="132"/>
+ <property name="ignorePattern" value="\* \$"/>
+ </module>
+ <module name="MethodLength">
+ <property name="max" value="175"/>
+ </module>
+ <module name="ConstantName">
+ <property name="format" value="log|^[a-zA-Z][a-zA-Z0-9_]*$"/>
+ </module>
+
+ <!-- ************************************************************** -->
+ <!-- Default Sun coding conventions checks -->
+ <!-- ************************************************************** -->
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocMethod"/>
+ <module name="JavadocType"/>
+ <module name="JavadocVariable"/>
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+ <module name="MemberName"/>
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="FileLength"/>
+ <module name="ParameterNumber"/>
+
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="EmptyForIteratorPad"/>
+ <module name="NoWhitespaceAfter"/>
+ <module name="NoWhitespaceBefore"/>
+ <module name="OperatorWrap"/>
+ <module name="TabCharacter"/>
+ <module name="WhitespaceAfter"/>
+ <module name="WhitespaceAround"/>
+
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="NeedBraces"/>
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <!-- <module name="AvoidInlineConditionals"/> --> <!-- DISABLED-->
+ <module name="DoubleCheckedLocking"/>
+ <module name="EqualsHashCode"/>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows">
+ <property name="allowUnchecked" value="true"/> <!-- DISABLED -->
+ <property name="allowSubclasses" value="true"/> <!-- DISABLED -->
+ </module>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <module name="DesignForExtension">
+ <property name="severity" value="ignore"/> <!-- DISABLED -->
+ </module>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier">
+ <!-- Protected member variables are widely used in Jackrabbit -->
+ <property name="protectedAllowed" value="true"/>
+ </module>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="FinalParameters">
+ <property name="severity" value="ignore"/> <!-- DISABLED -->
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Line has trailing spaces."/>
+ </module>
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ </module>
+
+ <module name="SuppressionFilter">
+ <property name="file" value="checkstyle-suppressions.xml"/>
+ </module>
+
+</module>
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/checkstyle.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties Mon Jul 25 08:50:40 2005
@@ -0,0 +1,93 @@
+# Copyright 2003-2005 The Apache Software Foundation or its licensors,
+# as applicable
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+######################################################################
+# Apache Central Repository
+######################################################################
+maven.repo.central=www.apache.org
+maven.repo.central.directory=/www/www.apache.org/dist/java-repository
+maven.remote.group=apcvs
+maven.changelog.factory = org.apache.maven.svnlib.SvnChangeLogFactory
+
+######################################################################
+# JUnit Testing
+######################################################################
+maven.test.failure = false
+maven.junit.fork=true
+maven.test.search.classdir=true
+maven.junit.jvmargs=-Xmx1024M
+maven.junit.sysproperties=org.xml.sax.driver java.security.auth.login.config
+org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
+java.security.auth.login.config=applications/test/jaas.config
+
+
+#If you wish to skip tests when doing builds, uncomment
+#maven.test.skip = true
+
+######################################################################
+# Checkstyle
+######################################################################
+maven.checkstyle.properties= checkstyle.xml
+maven.linkcheck.enable=false
+
+######################################################################
+# JavaDoc
+#
+# javadoc urls can be added here, multiple urls are appended using a comma
+#
+# maven.javadoc.links = http://foo/bar/api,\
+# http://flim/flam/api/
+######################################################################
+maven.javadoc.links=http://java.sun.com/j2se/1.4.2/docs/api/,\
+ http://incubator.apache.org/jackrabbit/apidocs/,\
+ http://www.day.com/maven/jsr170/javadocs/jcr-1.0/
+maven.javadoc.author=false
+maven.javadoc.version=false
+
+######################################################################
+# Other opts
+######################################################################
+# uncomment the next line to work in offline mode (no jar download & no linkcheck)
+#maven.mode.online=
+
+maven.compile.debug=on
+maven.compile.deprecation=off
+maven.compile.optimize=off
+
+maven.compile.source=1.4
+maven.compile.target=1.4
+
+maven.jarResources.basedir=src/java
+maven.jar.excludes=**/package.html
+
+# specifying additional remote repository for downloading dependencies
+# not available at www.ibiblio.org/maven/
+maven.repo.remote = http://www.ibiblio.org/maven/,http://www.day.com/maven/
+
+######################################################################
+# Site L&F
+######################################################################
+# maven.xdoc.jsl=
+maven.xdoc.date=
+maven.xdoc.poweredby.image=maven-feather.png
+maven.xdoc.version=${pom.currentVersion}
+maven.xdoc.developmentProcessUrl=http://incubator.apache.org/projects/jackrabbit.html
+maven.changelog.range=60
+maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory
+
+######################################################################
+# Site Deploy (into ../jackrabbit-site for checkout on incubator.apache.org)
+######################################################################
+maven.site.deploy.method=fs
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/project.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/project.xml?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/project.xml (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/project.xml Mon Jul 25 08:50:40 2005
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project>
+ <pomVersion>3</pomVersion>
+ <artifactId>jackrabbit-bdb</artifactId>
+ <groupId>jackrabbit</groupId>
+ <name>JackRabbit BerkeleyDB Persistence Manager</name>
+ <currentVersion>1.0-SNAPSHOT</currentVersion>
+ <organization>
+ <name>The Apache Software Foundation</name>
+ <url>http://incubator.apache.org/projects/jackrabbit.html</url>
+ <logo>
+ http://incubator.apache.org/images/apache-incubator-logo.png
+ </logo>
+ </organization>
+ <inceptionYear>2005</inceptionYear>
+ <package>org.apache.jackrabbit.*</package>
+ <logo>/images/jackrabbitlogo.gif</logo>
+ <description>
+ A BerkeleyDB persistence manager for jackrabbit. It uses the
+ BerkeleyDB Java Edition
+ (http://www.sleepycat.com/products/je.shtml)
+ </description>
+ <shortDescription>
+ A BerkeleyDB persistence manager for jackrabbit
+ </shortDescription>
+
+ <repository>
+ <connection>scm:subversion:http://svn.apache.org/repos/asf/incubator/jackrabbit/trunk/contrib/bdb-persistence</connection>
+ <developerConnection>scm:subversion:https://svn.apache.org/repos/asf/incubator/jackrabbit/trunk/contrib/bdb-persistence</developerConnection>
+ <url>http://svn.apache.org/viewcvs</url>
+ </repository>
+ <developers>
+ <developer>
+ <name>Guillaume Bort</name>
+ <email>guillaume.bort@zenexity.fr</email>
+ <organization>zenexity.fr</organization>
+ <timezone>+1</timezone>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <groupId>berkeleydb</groupId>
+ <artifactId>je</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>jsr170</groupId>
+ <artifactId>jcr</artifactId>
+ <version>1.0</version>
+ <type>jar</type>
+ <url>http://www.day.com/maven/jsr170/jars/jcr-1.0.jar</url>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>jackrabbit</groupId>
+ <artifactId>jackrabbit-commons</artifactId>
+ <version>${pom.currentVersion}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>jackrabbit</groupId>
+ <artifactId>jackrabbit-core</artifactId>
+ <version>${pom.currentVersion}</version>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/*TestAll.java</include>
+ </includes>
+ </unitTest>
+ </build>
+
+ <reports>
+ <report>maven-changelog-plugin</report>
+ <report>maven-changes-plugin</report>
+ <report>maven-checkstyle-plugin</report>
+ <report>maven-javadoc-plugin</report>
+ <report>maven-junit-report-plugin</report>
+ <report>maven-jxr-plugin</report>
+ <report>maven-license-plugin</report>
+ <report>maven-tasklist-plugin</report>
+ </reports>
+
+</project>
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java Mon Jul 25 08:50:40 2005
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.state.bdb;
+
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.fs.FileSystemResource;
+
+import java.io.InputStream;
+
+public interface BLOBStore {
+
+ public String put(PropertyId id, int index, InputStream in, long size) throws Exception;
+ public FileSystemResource get(String blobId) throws Exception;
+ public boolean remove(String blobId) throws Exception;
+
+}
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BLOBStore.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java Mon Jul 25 08:50:40 2005
@@ -0,0 +1,385 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.state.bdb;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.fs.FileSystem;
+import org.apache.jackrabbit.core.fs.FileSystemPathUtil;
+import org.apache.jackrabbit.core.fs.FileSystemResource;
+import org.apache.jackrabbit.core.fs.local.LocalFileSystem;
+import org.apache.jackrabbit.core.state.AbstractPersistenceManager;
+import org.apache.jackrabbit.core.state.ChangeLog;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.NoSuchItemStateException;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PMContext;
+import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.name.QName;
+
+import com.sleepycat.je.Database;
+import com.sleepycat.je.DatabaseConfig;
+import com.sleepycat.je.DatabaseEntry;
+import com.sleepycat.je.Environment;
+import com.sleepycat.je.EnvironmentConfig;
+import com.sleepycat.je.LockMode;
+import com.sleepycat.je.OperationStatus;
+import com.sleepycat.je.Transaction;
+
+public class BerkeleyDBPersistenceManager extends AbstractPersistenceManager implements BLOBStore {
+
+ private static Log log = LogFactory.getLog(BerkeleyDBPersistenceManager.class);
+
+ protected static final String ENCODING = "UTF-8";
+
+ private boolean initialized = false;
+ private Environment environment;
+ private Database database;
+ private FileSystem blobFS;
+ private ThreadLocal localTransaction = new ThreadLocal(); // ?? are persistence managers thread-safes ???
+
+ //
+
+ public void init(PMContext context) throws Exception {
+ if (initialized) {
+ throw new IllegalStateException("already initialized");
+ }
+
+ // prepare the db directory
+ File envDir = new File(context.getHomeDir(), "db");
+ if (!envDir.exists())
+ envDir.mkdir();
+
+ log.debug("init berkeleyDb environment at " + envDir.getAbsolutePath());
+
+ // create environnement
+ EnvironmentConfig config = new EnvironmentConfig();
+ config.setAllowCreate(true);
+ config.setTransactional(true);
+ environment = new Environment(envDir, config);
+
+ // open database
+ DatabaseConfig dbConfig = new DatabaseConfig();
+ dbConfig.setAllowCreate(true);
+ dbConfig.setSortedDuplicates(false);
+ dbConfig.setTransactional(true);
+ database = environment.openDatabase(null, "jcrStore", dbConfig);
+
+ /**
+ * store blob's in local file system in a sub directory
+ * of the workspace home directory
+ */
+ LocalFileSystem blobFS = new LocalFileSystem();
+ blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
+ blobFS.init();
+ this.blobFS = blobFS;
+
+ initialized = true;
+ }
+
+ public void close() throws Exception {
+ if (!initialized) {
+ throw new IllegalStateException("not initialized");
+ }
+
+ log.debug("close berkeleyDb environment");
+
+ // close database
+ database.close();
+
+ // close environnement
+ environment.close();
+
+ // close blob store
+ blobFS.close();
+ blobFS = null;
+
+ initialized = false;
+ }
+
+ //
+
+ public NodeState load(NodeId id) throws NoSuchItemStateException, ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ NodeStateTupleBinding tupleBinding = new NodeStateTupleBinding(id);
+ key.setData(id.toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ if (operationStatus.equals(OperationStatus.NOTFOUND))
+ throw new NoSuchItemStateException();
+ return (NodeState) tupleBinding.entryToObject(value);
+ } catch (NoSuchItemStateException e) {
+ throw e;
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ public PropertyState load(PropertyId id) throws NoSuchItemStateException, ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ PropertyStateTupleBinding tupleBinding = new PropertyStateTupleBinding(id, this);
+ key.setData(id.toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ if (operationStatus.equals(OperationStatus.NOTFOUND))
+ throw new NoSuchItemStateException();
+ return (PropertyState) tupleBinding.entryToObject(value);
+ } catch (NoSuchItemStateException e) {
+ throw e;
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ public NodeReferences load(NodeReferencesId id) throws NoSuchItemStateException, ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ NodeReferencesTupleBinding tupleBinding = new NodeReferencesTupleBinding(id);
+ key.setData((id.toString() + ".references").getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ if (operationStatus.equals(OperationStatus.NOTFOUND))
+ throw new NoSuchItemStateException();
+ return (NodeReferences) tupleBinding.entryToObject(value);
+ } catch (NoSuchItemStateException e) {
+ throw e;
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ public boolean exists(NodeId id) throws ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ key.setData(id.toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ return operationStatus.equals(OperationStatus.SUCCESS);
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ public boolean exists(PropertyId id) throws ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ key.setData(id.toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ return operationStatus.equals(OperationStatus.SUCCESS);
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ public boolean exists(NodeReferencesId targetId) throws ItemStateException {
+ try {
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ key.setData((targetId.toString() + ".references").getBytes("UTF-8"));
+ OperationStatus operationStatus = database.get(null, key, value, LockMode.DEFAULT);
+ return operationStatus.equals(OperationStatus.SUCCESS);
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ //
+
+ public synchronized void store(ChangeLog changeLog) throws ItemStateException {
+ Transaction transaction = null;
+ try {
+ transaction = environment.beginTransaction(null, null);
+ localTransaction.set(transaction);
+ super.store(changeLog);
+ transaction.commit();
+ } catch (Exception e) {
+ try {
+ transaction.abort();
+ } catch (Exception fe) {
+ log.fatal(fe);
+ }
+ throw new ItemStateException(e);
+ } finally {
+ localTransaction.set(null);
+ }
+ }
+
+ //
+
+ protected void store(NodeState state) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ NodeStateTupleBinding tupleBinding = new NodeStateTupleBinding();
+ key.setData(state.getId().toString().getBytes("UTF-8"));
+ tupleBinding.objectToEntry(state, value);
+ OperationStatus operationStatus = database.put(transaction, key, value);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ protected void store(PropertyState state) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ PropertyStateTupleBinding tupleBinding = new PropertyStateTupleBinding(this);
+ key.setData(state.getId().toString().getBytes("UTF-8"));
+ tupleBinding.objectToEntry(state, value);
+ OperationStatus operationStatus = database.put(transaction, key, value);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ protected void store(NodeReferences refs) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ DatabaseEntry value = new DatabaseEntry();
+ NodeReferencesTupleBinding tupleBinding = new NodeReferencesTupleBinding();
+ key.setData((refs.getTargetId().toString() + ".references").getBytes("UTF-8"));
+ tupleBinding.objectToEntry(refs, value);
+ OperationStatus operationStatus = database.put(transaction, key, value);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ protected void destroy(NodeState state) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ key.setData(state.getId().toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.delete(transaction, key);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ protected void destroy(PropertyState state) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ key.setData(state.getId().toString().getBytes("UTF-8"));
+ OperationStatus operationStatus = database.delete(transaction, key);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ protected void destroy(NodeReferences refs) throws ItemStateException {
+ try {
+ Transaction transaction = (Transaction) localTransaction.get();
+ DatabaseEntry key = new DatabaseEntry();
+ key.setData((refs.getTargetId().toString() + ".references").getBytes("UTF-8"));
+ OperationStatus operationStatus = database.delete(transaction, key);
+ if (!operationStatus.equals(OperationStatus.SUCCESS))
+ throw new ItemStateException(operationStatus.toString());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ItemStateException(e);
+ }
+ }
+
+ // blobs
+
+ public FileSystemResource get(String blobId) throws Exception {
+ return new FileSystemResource(blobFS, blobId);
+ }
+
+ public String put(PropertyId id, int index, InputStream in, long size) throws Exception {
+ String path = buildBlobFilePath(id.getParentUUID(), id.getName(), index);
+ OutputStream out = null;
+ FileSystemResource internalBlobFile = new FileSystemResource(blobFS, path);
+ internalBlobFile.makeParentDirs();
+ try {
+ out = new BufferedOutputStream(internalBlobFile.getOutputStream());
+ byte[] buffer = new byte[8192];
+ int read;
+ while ((read = in.read(buffer)) > 0) {
+ out.write(buffer, 0, read);
+ }
+ } finally {
+ out.close();
+ }
+ return path;
+ }
+
+ public boolean remove(String blobId) throws Exception {
+ FileSystemResource res = new FileSystemResource(blobFS, blobId);
+ if (!res.exists()) {
+ return false;
+ }
+ // delete resource and prune empty parent folders
+ res.delete(true);
+ return true;
+ }
+
+ private static String buildBlobFilePath(String parentUUID, QName propName, int it) {
+ StringBuffer sb = new StringBuffer();
+ char[] chars = parentUUID.toCharArray();
+ int cnt = 0;
+ for (int i = 0; i < chars.length; i++) {
+ if (chars[i] == '-') {
+ continue;
+ }
+ if (cnt == 2 || cnt == 4) {
+ sb.append(FileSystem.SEPARATOR_CHAR);
+ }
+ sb.append(chars[i]);
+ cnt++;
+ }
+ return sb.toString() + FileSystem.SEPARATOR + FileSystemPathUtil.escapeName(propName.toString()) + "." + it + ".bin";
+ }
+
+}
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/BerkeleyDBPersistenceManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java?rev=225142&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java (added)
+++ incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java Mon Jul 25 08:50:40 2005
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.state.bdb;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
+
+import com.sleepycat.bind.tuple.TupleBinding;
+import com.sleepycat.bind.tuple.TupleInput;
+import com.sleepycat.bind.tuple.TupleOutput;
+
+public class NodeReferencesTupleBinding extends TupleBinding {
+
+ private NodeReferencesId id;
+
+ public NodeReferencesTupleBinding(NodeReferencesId id) {
+ this.id = id;
+ }
+
+ public NodeReferencesTupleBinding() {
+ }
+
+ public Object entryToObject(TupleInput in) {
+
+ NodeReferences refs = new NodeReferences(id);
+ refs.clearAllReferences();
+
+ // references
+ int count = in.readInt(); // count
+ for (int i = 0; i < count; i++) {
+ refs.addReference(PropertyId.valueOf(in.readString())); // propertyId
+ }
+
+ return refs;
+ }
+
+ public void objectToEntry(Object o, TupleOutput out) {
+
+ NodeReferences refs = (NodeReferences) o;
+
+ // references
+ Collection c = refs.getReferences();
+ out.writeInt(c.size()); // count
+ for (Iterator iter = c.iterator(); iter.hasNext();) {
+ PropertyId propId = (PropertyId) iter.next();
+ out.writeString(propId.toString()); // propertyId
+ }
+
+ }
+
+}
Propchange: incubator/jackrabbit/trunk/contrib/bdb-persistence/src/java/org/apache/jackrabbit/core/state/bdb/NodeReferencesTupleBinding.java
------------------------------------------------------------------------------
svn:eol-style = native