jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r884108 [1/10] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/ jackrabbit-core/ jackrabbit-core/src...
Date Wed, 25 Nov 2009 14:04:50 GMT
Author: jukka
Date: Wed Nov 25 14:04:38 2009
New Revision: 884108

URL: http://svn.apache.org/viewvc?rev=884108&view=rev
Log:
JCR-1456: Database connection pooling

Merged changes from trunk.

Added:
    jackrabbit/sandbox/JCR-1456/assembly.xml
      - copied unchanged from r884089, jackrabbit/trunk/assembly.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ImportConfig.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ImportConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/UserManagerConfig.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/UserManagerConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IOCounters.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IOCounters.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserPerWorkspaceUserManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManagerTest.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserPerWorkspaceSecurityManagerTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentialsTest.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentialsTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeCreationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/GenericRepositoryFactory.java
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/GenericRepositoryFactory.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/src/main/webapp/META-INF/LICENSE
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/META-INF/LICENSE
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/src/main/webapp/META-INF/NOTICE
      - copied unchanged from r884089, jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/META-INF/NOTICE
Removed:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/jndi/RepositoryFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryIterator.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/IdResolverTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/MimeResolver.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/src/main/webapp/META-INF/LICENSE.txt
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/src/main/webapp/META-INF/NOTICE.txt
Modified:
    jackrabbit/sandbox/JCR-1456/   (props changed)
    jackrabbit/sandbox/JCR-1456/README.txt
    jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Authorizable.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Group.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Impersonation.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryCopier.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SystemSession.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/SecurityManagerConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/SynchronousEventListener.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexInfos.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitIndexSearcher.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JackrabbitParser.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryHits.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PersistentIndex.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/directory/FSDirectoryManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplate.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/combined/CombinedProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/DefaultPrincipalProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalIteratorAdapter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleWorkspaceAccessManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/AuthorizableImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/ImpersonationImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserConstants.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/ReferenceChangeTracker.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/AccessControlImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DefaultProtectedNodeImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DefaultProtectedPropertyImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/ProtectedNodeImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/ProtectedPropertyImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/query/lucene/tika-config.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/AbstractUserTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/AuthorizableTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/GroupTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/ImpersonationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/NestedGroupTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/UserManagerCreateGroupTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/UserManagerCreateUserTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/UserManagerTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/user/UserTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/NodeImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/SecurityConfigTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/GQLTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RepositoryFactoryImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/XPathAxisTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/AccessManagerTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/TestAll.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractVersionManagementTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractWriteTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/WriteTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/combined/WriteTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/WriteTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/DefaultPrincipalProviderTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AuthorizableImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/GroupAdministratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/ImpersonationImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/IndexNodeResolverTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NodeResolverTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/NotUserAdministratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/TestAll.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/TraversingNodeResolverTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserAdministratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserManagerImplTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/xml/AccessControlImporterTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-client/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/GQL.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/AbstractExportContext.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContext.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContextImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/CreateActivity.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/IsSameTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveToNewTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderMoveTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultTraversingQOMTreeVisitor.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/src/main/webapp/about.jsp
    jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml
    jackrabbit/sandbox/JCR-1456/pom.xml

Propchange: jackrabbit/sandbox/JCR-1456/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 25 14:04:38 2009
@@ -2,4 +2,4 @@
 /jackrabbit/branches/1.5:794012,794100,794102
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:387422-827959
+/jackrabbit/trunk:387422-884089

Modified: jackrabbit/sandbox/JCR-1456/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/README.txt?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/README.txt (original)
+++ jackrabbit/sandbox/JCR-1456/README.txt Wed Nov 25 14:04:38 2009
@@ -20,14 +20,7 @@
 Building Jackrabbit
 ===================
 
-To build Jackrabbit, you first need to download the jcr-2.0-b114.jar and
-jcr-2.0-b114.xml files from https://issues.apache.org/jira/browse/JCR-1104
-and install them to your local Maven repository:
-
-    mvn install:install-file \
-        -Dfile=jcr-2.0-b114.jar -DpomFile=jcr-2.0-b114.xml
-
-Once you've installed the jar, you can build Jackrabbit like this:
+You can build Jackrabbit like this:
 
     mvn clean install
 

Modified: jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt (original)
+++ jackrabbit/sandbox/JCR-1456/RELEASE-NOTES.txt Wed Nov 25 14:04:38 2009
@@ -1,17 +1,13 @@
-Release Notes -- Apache Jackrabbit -- Version 2.0-alpha12
+Release Notes -- Apache Jackrabbit -- Version 2.0-beta3
 
 Introduction
 ------------
 
-This is an alpha release of Apache Jackrabbit 2.0. This release implements
-a pre-release version of the JCR 2.0 API, specified by the Java Specification
-Request 283 (JSR 283, http://jcp.org/en/jsr/detail?id=283).
-
-The purpose of this alpha release is to allow people to test and review
-the new Jackrabbit and JCR 2.0 features before they are finalized. Feedback
-to both the Jackrabbit project and the JSR 283 expert group is highly
-appreciated. Note that an alpha release is not expected to be feature-complete
-or otherwise suitable for production use.
+This is a beta release of Apache Jackrabbit 2.0. This release is a fully
+compliant implementation of the JCR 2.0 API that was specified by the
+Java Specification Request 283 (JSR 283, http://jcp.org/en/jsr/detail?id=283).
+However, the beta status of this release means that some parts of the
+implementation are not yet ready for normal production use.
 
 Changes in this release
 -----------------------
@@ -20,8 +16,8 @@
 notable changes in this release are:
 
   * Upgrade to JCR 2.0. This Jackrabbit release implements and is based
-    on a pre-release version of the JCR 2.0 API. All of the features
-    required by the JSR 283 specification have been implemented.
+    on the official JCR 2.0 API. All of the features required by the
+    JSR 283 specification have been implemented.
 
   * Upgrade to Java 5. All of Jackrabbit (except the jcr-tests component)
     now requires Java 5 as the base platform. Java 1.4 environments are no
@@ -50,7 +46,7 @@
 Release Contents
 ----------------
 
-This release consists of a single source archive packaged as a jar file.
+This release consists of a single source archive packaged as a zip file.
 The archive can be unpacked with the jar tool from your JDK installation.
 See the README.txt file for instructions on how to build this release.
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/pom.xml?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/pom.xml Wed Nov 25 14:04:38 2009
@@ -17,10 +17,7 @@
    limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
 <!-- ====================================================================== -->

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java Wed Nov 25 14:04:38 2009
@@ -18,10 +18,12 @@
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.security.AccessControlException;
 import javax.jcr.security.AccessControlList;
 import javax.jcr.security.AccessControlPolicy;
 import javax.jcr.security.Privilege;
+import javax.jcr.security.AccessControlEntry;
 import java.security.Principal;
 import java.util.Map;
 
@@ -112,4 +114,22 @@
     boolean addEntry(Principal principal, Privilege[] privileges,
                      boolean isAllow, Map<String, Value> restrictions)
             throws AccessControlException, RepositoryException;
+
+    /**
+     * If the <code>AccessControlList</code> implementation supports
+     * reordering of entries the specified <code>srcEntry</code> is inserted
+     * at the position of the specified <code>destEntry</code>.<p/>
+     * If <code>destEntry</code> is <code>null</code> the entry is moved to the
+     * end of the list.<p/>
+     * If srcChildRelPath and destChildRelPath are the same no changes are made.
+     * 
+     * @param srcEntry The access control entry to be moved within the list.
+     * @param destEntry The entry before which the <code>srcEntry</code> will be moved.
+     * @throws AccessControlException If any of the given entries is invalid or
+     * cannot be handled by the implementation.
+     * @throws UnsupportedRepositoryOperationException If ordering is not supported.
+     * @throws RepositoryException If another error occurs.
+     */
+    void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry)
+            throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlManager.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlManager.java Wed Nov 25 14:04:38 2009
@@ -57,12 +57,15 @@
      * been set. This method reflects the binding state, including transient
      * policy modifications.
      *
-     * @param principal
-     * @return
-     * @throws AccessDeniedException
-     * @throws AccessControlException
-     * @throws UnsupportedRepositoryOperationException
-     * @throws RepositoryException
+     * @param principal A valid principal.
+     * @return The policies defined for the given principal or an empty array.
+     * @throws AccessDeniedException if the session lacks
+     * <code>READ_ACCESS_CONTROL</code> privilege.
+     * @throws AccessControlException  if the specified principal does not exist
+     * or if another access control related exception occurs.
+     * @throws UnsupportedRepositoryOperationException if editing access control
+     * policies by principal is not supported.
+     * @throws RepositoryException If another error occurs.
      */
     JackrabbitAccessControlPolicy[] getPolicies(Principal principal) throws AccessDeniedException, AccessControlException, UnsupportedRepositoryOperationException, RepositoryException;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Authorizable.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Authorizable.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Authorizable.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Authorizable.java Wed Nov 25 14:04:38 2009
@@ -81,14 +81,14 @@
 
     /**
      * @return all {@link Group}s, this Authorizable is declared member of.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     Iterator<Group> declaredMemberOf() throws RepositoryException;
 
     /**
      * @return all {@link Group}s, this Authorizable is member of included
      *         indirect group membership.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     Iterator<Group> memberOf() throws RepositoryException;
 
@@ -116,9 +116,9 @@
     /**
      * Tests if a the property with specified name exists.
      *
-     * @param name
-     * @return
-     * @throws RepositoryException
+     * @param name The name of the property to be tested.
+     * @return <code>true</code> if a property with the given name exists.
+     * @throws RepositoryException If an error occurs.
      * @see #getProperty(String)
      */
     boolean hasProperty(String name) throws RepositoryException;
@@ -126,8 +126,8 @@
     /**
      * Set an arbitrary property to this <code>Authorizable</code>.
      *
-     * @param name
-     * @param value
+     * @param name The name of the property to be added or modified.
+     * @param value The desired value.
      * @throws RepositoryException If the specified property could not be set.
      */
     void setProperty(String name, Value value) throws RepositoryException;
@@ -135,8 +135,8 @@
     /**
      * Set an arbitrary property to this <code>Authorizable</code>.
      *
-     * @param name
-     * @param value multiple values
+     * @param name The name of the property to be added or modified.
+     * @param value The desired property values.
      * @throws RepositoryException If the specified property could not be set.
      */
     void setProperty(String name, Value[] value) throws RepositoryException;
@@ -145,7 +145,7 @@
      * Returns the values for the properties with the specified name or
      * <code>null</code>.
      *
-     * @param name
+     * @param name The name of the property to be retrieved.
      * @return value of the property with the given name or <code>null</code>
      *         if no such property exists.
      * @throws RepositoryException If an error occurs.
@@ -155,7 +155,7 @@
     /**
      * Removes the property with the given name.
      *
-     * @param name
+     * @param name The name of the property to be removed.
      * @return true If the property with the specified name was successfully
      *         removed; false if no such property was present.
      * @throws RepositoryException If an error occurs.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Group.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Group.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Group.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Group.java Wed Nov 25 14:04:38 2009
@@ -27,7 +27,7 @@
     /**
      * @return Iterator of <code>Authorizable</code>s which are declared
      * members of this Group.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     Iterator<Authorizable> getDeclaredMembers() throws RepositoryException;
 
@@ -35,20 +35,23 @@
      * @return Iterator of <code>Authorizable</code>s which are members of
      * this Group. This includes both declared members and all authorizables
      * that are indirect group members.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     Iterator<Authorizable> getMembers() throws RepositoryException;
 
     /**
+     * @param authorizable The <code>Authorizable</code> to test.
      * @return true if the Authorizable to test is a direct or indirect member
      * of this Group.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean isMember(Authorizable authorizable) throws RepositoryException;
 
     /**
      * Add a member to this Group.
      *
+     * @param authorizable The <code>Authorizable</code> to be added as
+     * member to this group.
      * @return true if the <code>Authorizable</code> has successfully been added
      * to this Group, false otherwise (e.g. unknown implemention
      * or if it already is a member or if the passed authorizable is this
@@ -60,8 +63,10 @@
     /**
      * Remove a member from this Group.
      *
+     * @param authorizable The <code>Authorizable</code> to be removed from
+     * the list of group members.
      * @return true if the Authorizable was successfully removed. False otherwise.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean removeMember(Authorizable authorizable) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Impersonation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Impersonation.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Impersonation.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/Impersonation.java Wed Nov 25 14:04:38 2009
@@ -36,7 +36,7 @@
      * @return An iterator over the <code>Principal</code>s that are allowed
      * to impersonate the <code>User</code> this <code>Impersonation</code>
      * object has been created for.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     PrincipalIterator getImpersonators() throws RepositoryException;
 
@@ -46,15 +46,16 @@
      * @return true if the specified <code>Principal</code> has not been allowed
      * to impersonate before and if impersonation has been successfully
      * granted to it, false otherwise.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean grantImpersonation(Principal principal) throws RepositoryException;
 
     /**
-     * @param principal
+     * @param principal The principal that should no longer be allowed to
+     * impersonate.
      * @return If the granted impersonation has been successfully revoked for
      * the given principal; false otherwise.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean revokeImpersonation(Principal principal) throws RepositoryException;
 
@@ -65,7 +66,7 @@
      * @param subject to impersonate.
      * @return true if this <code>Impersonation</code> allows the specified
      * Subject to impersonate.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean allows(Subject subject) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java Wed Nov 25 14:04:38 2009
@@ -37,11 +37,13 @@
      * Returns <code>Credentials</code> for this user.
      *
      * @return <code>Credentials</code> for this user.
+     * @throws javax.jcr.RepositoryException If an error occurs.
      */
     Credentials getCredentials() throws RepositoryException;
 
     /**
      * @return <code>Impersonation</code> for this <code>User</code>.
+     * @throws javax.jcr.RepositoryException If an error occurs.
      */
     Impersonation getImpersonation() throws RepositoryException;
 
@@ -49,7 +51,7 @@
      * Change the password of this user.
      *
      * @param password The new password.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     void changePassword(String password) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java Wed Nov 25 14:04:38 2009
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.api.security.user;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import java.security.Principal;
 import java.util.Iterator;
 
@@ -49,9 +50,9 @@
     /**
      * Get the Authorizable by its id.
      *
-     * @param id
+     * @param id The user or group id.
      * @return Authorizable or <code>null</code>, if not present.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      * @see Authorizable#getID()
      */
     Authorizable getAuthorizable(String id) throws RepositoryException;
@@ -61,7 +62,7 @@
      *
      * @param principal
      * @return Authorizable or <code>null</code>, if not present.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     Authorizable getAuthorizable(Principal principal) throws RepositoryException;
 
@@ -74,10 +75,10 @@
      * @param value
      * @return All <code>Authorizable</code>s that have a property with the given
      * name exactly matching the given value.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      * @see Authorizable#getProperty(String)
      */
-    Iterator findAuthorizables(String propertyName, String value) throws RepositoryException;
+    Iterator<Authorizable> findAuthorizables(String propertyName, String value) throws RepositoryException;
 
     /**
      * Returns all <code>Authorizable</code>s that have
@@ -94,10 +95,10 @@
      * <li>{@link #SEARCH_TYPE_GROUP}</li>
      * <li>{@link #SEARCH_TYPE_USER}</li>
      * </ul>
-     * @return
-     * @throws RepositoryException
+     * @return An iterator of <code>Authorizable</code>.
+     * @throws RepositoryException If an error occurs.
      */
-    Iterator findAuthorizables(String propertyName, String value, int searchType) throws RepositoryException;
+    Iterator<Authorizable> findAuthorizables(String propertyName, String value, int searchType) throws RepositoryException;
 
     /**
      * Creates an User for the given userID / password pair; neither of the
@@ -106,7 +107,7 @@
      * the specified userID is equal to the principal name and the intermediate
      * path is <code>null</code>.
      *
-     * @param userID
+     * @param userID The id of the new user.
      * @param password The initial password of this user.
      * @return The new <code>User</code>.
      * @throws AuthorizableExistsException in case the given userID is already
@@ -163,4 +164,35 @@
      * @throws RepositoryException If another error occurs.
      */
     Group createGroup(Principal principal, String intermediatePath) throws AuthorizableExistsException, RepositoryException;
+
+    /**
+     * If any write operations executed through the User API are automatically
+     * persisted this method returns <code>true</code>. In this case there are
+     * no pending transient changes left and there is no need to explicitely call
+     * {@link javax.jcr.Session#save()}. If this method returns <code>false</code>
+     * any changes must be completed by an extra save call on the
+     * <code>Session</code> associated with this <code>UserManager</code>.
+     *
+     * @return <code>true</code> if changes are automatically persisted;
+     * <code>false</code> if changes made through this API (including method
+     * calls on  {@link Authorizable} and subclasses are only transient and
+     * must be persisted using {@link javax.jcr.Session#save()}.
+     * @see #autoSave(boolean)
+     */
+    boolean isAutoSave();
+
+    /**
+     * Changes the auto save behavior of this <code>UserManager</code>.
+     * <p/>
+     * Note, that this shouldn't be allowed in cases where the associated session
+     * is different from the original session accessing the user manager.
+     *
+     * @param enable If <code>true</code> changes made through this API will
+     * be automatically saved; otherwise an explict call to
+     * {@link javax.jcr.Session#save()} is required in order to persist changes.
+     * @throws UnsupportedRepositoryOperationException If the implementation
+     * does not allow to change the auto save behavior.
+     * @throws RepositoryException If some other error occurs.
+     */
+    void autoSave(boolean enable) throws UnsupportedRepositoryOperationException, RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml Wed Nov 25 14:04:38 2009
@@ -17,10 +17,7 @@
    limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/maven-v4_0_0.xsd ">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
   <modelVersion>4.0.0</modelVersion>
 
 <!-- ====================================================================== -->
@@ -47,10 +44,10 @@
             <configuration>
               <tasks>
                 <copy todir="${project.build.directory}/repository">
-                  <fileset dir="${basedir}/src/test/repository"/>
+                  <fileset dir="${basedir}/src/test/repository" />
                 </copy>
                 <copy todir="${project.build.directory}/repository-2">
-                  <fileset dir="${basedir}/src/test/repository"/>
+                  <fileset dir="${basedir}/src/test/repository" />
                 </copy>
               </tasks>
             </configuration>
@@ -102,6 +99,8 @@
                 org.apache.jackrabbit.core.ConcurrentImportTest
                 org.apache.jackrabbit.core.data.GarbageCollectorTest#testGC
                 org.apache.jackrabbit.core.data.GarbageCollectorTest#testCloseSessionWhileRunningGc
+                org.apache.jackrabbit.core.integration.ConcurrentQueryTest#testConcurrentQueryWithDeletes
+                org.apache.jackrabbit.core.security.user.AdministratorTest#testAdminNodeCollidingWithRandomNode
               </value>
             </property>
           </systemProperties>
@@ -195,7 +194,7 @@
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-spi</artifactId>
       <version>2.0-SNAPSHOT</version>
-      <classifier></classifier>
+      <classifier />
     </dependency>
       <dependency>
       <groupId>org.apache.jackrabbit</groupId>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java Wed Nov 25 14:04:38 2009
@@ -38,12 +38,12 @@
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.core.config.AccessManagerConfig;
-import org.apache.jackrabbit.core.config.BeanConfig;
 import org.apache.jackrabbit.core.config.LoginModuleConfig;
 import org.apache.jackrabbit.core.config.SecurityConfig;
 import org.apache.jackrabbit.core.config.SecurityManagerConfig;
 import org.apache.jackrabbit.core.config.WorkspaceConfig;
 import org.apache.jackrabbit.core.config.WorkspaceSecurityConfig;
+import org.apache.jackrabbit.core.config.UserManagerConfig;
 import org.apache.jackrabbit.core.security.AMContext;
 import org.apache.jackrabbit.core.security.AccessManager;
 import org.apache.jackrabbit.core.security.DefaultAccessManager;
@@ -57,7 +57,6 @@
 import org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager;
 import org.apache.jackrabbit.core.security.principal.AdminPrincipal;
 import org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider;
-import org.apache.jackrabbit.core.security.principal.PrincipalImpl;
 import org.apache.jackrabbit.core.security.principal.PrincipalManagerImpl;
 import org.apache.jackrabbit.core.security.principal.PrincipalProvider;
 import org.apache.jackrabbit.core.security.principal.PrincipalProviderRegistry;
@@ -94,9 +93,9 @@
     private RepositoryImpl repository;
 
     /**
-     * session on the system workspace.
+     * System session.
      */
-    private SystemSession securitySession;
+    private SystemSession systemSession;
 
     /**
      * System user manager. Implementation needed here for the DefaultPrincipalProvider.
@@ -104,11 +103,6 @@
     private UserManager systemUserManager;
 
     /**
-     * System Sessions PrincipalMangager used for internal access to Principals
-     */
-    private PrincipalManager systemPrincipalManager;
-
-    /**
      * The user id of the administrator. The value is retrieved from
      * configuration. If the config entry is missing a default id is used (see
      * {@link SecurityConstants#ADMIN_ID}).
@@ -120,7 +114,7 @@
      * configuration. If the config entry is missing a default id is used (see
      * {@link SecurityConstants#ANONYMOUS_ID}).
      */
-    private String anonymousId;
+    protected String anonymousId;
 
     /**
      * Contains the access control providers per workspace.
@@ -164,7 +158,7 @@
             throw new RepositoryException("SystemSession expected");
         }
 
-        securitySession = (SystemSession) systemSession;
+        this.systemSession = (SystemSession) systemSession;
         this.repository = (RepositoryImpl) repository;
 
         SecurityConfig config = this.repository.getConfig().getSecurityConfig();
@@ -204,28 +198,28 @@
         }
 
         // create the system userManager and make sure the system-users exist.
-        systemUserManager = createUserManager(securitySession);
-        createSystemUsers(systemUserManager, adminId, anonymousId);
+        systemUserManager = createUserManager(this.systemSession);
+        createSystemUsers(systemUserManager, this.systemSession, adminId, anonymousId);
 
         // init default ac-provider-factory
         acProviderFactory = new AccessControlProviderFactoryImpl();
-        acProviderFactory.init(securitySession);
+        acProviderFactory.init(this.systemSession);
 
         // create the workspace access manager
         SecurityManagerConfig smc = config.getSecurityManagerConfig();
         if (smc != null && smc.getWorkspaceAccessConfig() != null) {
-            workspaceAccessManager = (WorkspaceAccessManager) smc.getWorkspaceAccessConfig().newInstance();
+            workspaceAccessManager =
+                smc.getWorkspaceAccessConfig().newInstance(WorkspaceAccessManager.class);
         } else {
             // fallback -> the default implementation
             log.debug("No WorkspaceAccessManager configured; using default.");
-            workspaceAccessManager = new WorkspaceAccessManagerImpl();
+            workspaceAccessManager = createDefaultWorkspaceAccessManager();
         }
-        workspaceAccessManager.init(securitySession);
+        workspaceAccessManager.init(this.systemSession);
 
         // initialize principal-provider registry
         // 1) create default
-        PrincipalProvider defaultPP = new DefaultPrincipalProvider(securitySession, (UserManagerImpl) systemUserManager);
-        defaultPP.init(new Properties());
+        PrincipalProvider defaultPP = createDefaultPrincipalProvider();
         // 2) create registry instance
         principalProviderRegistry = new ProviderRegistryImpl(defaultPP);
         // 3) register all configured principal providers.
@@ -233,35 +227,10 @@
             principalProviderRegistry.registerProvider(props);
         }
 
-        // create the principal manager for the security workspace
-        systemPrincipalManager = new PrincipalManagerImpl(securitySession, principalProviderRegistry.getProviders());
-
         initialized = true;
     }
 
     /**
-     * Creates a {@link UserManagerImpl} for the given session. May be overridden
-     * to return a custom implementation.
-     *
-     * @param session session
-     * @return user manager
-     * @throws RepositoryException if an error occurs
-     */
-    protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException {
-        BeanConfig umc = repository.getConfig().getSecurityConfig().getSecurityManagerConfig().getUserManagerConfig();
-        Properties config = null;
-        if (umc != null) {
-            // TODO: deal with other user manager implementations.
-            String clName = umc.getClassName();
-            if (clName != null && !(UserManagerImpl.class.getName().equals(clName) || clName.length() == 0)) {
-                log.warn("Unsupported custom UserManager implementation: '" + clName + "' -> Ignored.");
-            }
-            config = umc.getParameters();
-        }
-        return new UserManagerImpl(session, adminId, config);
-    }
-
-    /**
      * @see JackrabbitSecurityManager#dispose(String)
      */
     public void dispose(String workspaceName) {
@@ -301,7 +270,7 @@
                 log.debug("No configuration entry for AccessManager. Using org.apache.jackrabbit.core.security.DefaultAccessManager");
                 accessMgr = new DefaultAccessManager();
             } else {
-                accessMgr = (AccessManager) amConfig.newInstance();
+                accessMgr = amConfig.newInstance(AccessManager.class);
             }
 
             accessMgr.init(amContext, pp, workspaceAccessManager);
@@ -323,11 +292,9 @@
      */
     public PrincipalManager getPrincipalManager(Session session) throws RepositoryException {
         checkInitialized();
-        if (session == securitySession) {
-            return systemPrincipalManager;
-        } else if (session instanceof SessionImpl) {
+        if (session instanceof SessionImpl) {
             SessionImpl sImpl = (SessionImpl) session;
-            return new PrincipalManagerImpl(sImpl, principalProviderRegistry.getProviders());
+            return createPrincipalManager(sImpl);
         } else {
             throw new RepositoryException("Internal error: SessionImpl expected.");
         }
@@ -338,10 +305,10 @@
      */
     public UserManager getUserManager(Session session) throws RepositoryException {
         checkInitialized();
-        if (session == securitySession) {
+        if (session == systemSession) {
             return systemUserManager;
         } else if (session instanceof SessionImpl) {
-            String workspaceName = securitySession.getWorkspace().getName();
+            String workspaceName = systemSession.getWorkspace().getName();
             try {
                 SessionImpl sImpl = (SessionImpl) session;
                 UserManagerImpl uMgr;
@@ -362,63 +329,208 @@
     }
 
     /**
-     * @see JackrabbitSecurityManager#getUserID(Subject)
+     * @see JackrabbitSecurityManager#getUserID(javax.security.auth.Subject, String)
      */
-    public String getUserID(Subject subject) throws RepositoryException {
+    public String getUserID(Subject subject, String workspaceName) throws RepositoryException {
         checkInitialized();
+
         /* shortcut if the subject contains the AdminPrincipal in which case
            the userID is already known. */
         if (!subject.getPrincipals(AdminPrincipal.class).isEmpty()) {
             return adminId;
         }
+        /* if there is a configure principal class that should be used to
+           determine the UserID -> try this one. */
+        Class cl = getConfig().getUserIdClass();
+        if (cl != null) {
+            Set<Principal> s = subject.getPrincipals(cl);
+            if (!s.isEmpty()) {
+                for (Principal p : s) {
+                    if (!(p instanceof java.security.acl.Group)) {
+                        return p.getName();
+                    }
+                }
+                // all principals found with the given p-Class were Group principals
+                log.debug("Only Group principals found with class '" + cl.getName() + "' -> Not used for UserID.");
+            } else {
+                log.debug("No principal found with class '" + cl.getName() + "'.");
+            }
+        }
+
         /*
-         Retrieve userID from the subject.
+         Fallback scenario to retrieve userID from the subject:
          Since the subject may contain multiple principals and the principal
-         name must not be equals to the UserID by definition, the userID
-         may either be obtained from the login-credentials or from the
-         user manager. in the latter case the set of principals present with
-         the specified subject is used to search for the user.
+         name may not be equals to the UserID, the id is retrieved by
+         searching for the corresponding authorizable and if this doesn't
+         succeed an attempt is made to obtained it from the login-credentials.
         */
         String uid = null;
-        // try simple access to userID over SimpleCredentials first.
-        Iterator<SimpleCredentials> creds = subject.getPublicCredentials(
-                SimpleCredentials.class).iterator();
-        if (creds.hasNext()) {
-            SimpleCredentials sc = creds.next();
-            uid = sc.getUserID();
-        } else {
-            // no SimpleCredentials: retrieve authorizables corresponding to
-            // a non-group principal. the first one present is used to determine
-            // the userID.
+
+        // first try to retrieve an authorizable corresponding to
+        // a non-group principal. the first one present is used
+        // to determine the userID.
+        try {
+            UserManager umgr = getSystemUserManager(workspaceName);
             for (Principal p : subject.getPrincipals()) {
                 if (!(p instanceof Group)) {
-                    Authorizable authorz = systemUserManager.getAuthorizable(p);
+                    Authorizable authorz = umgr.getAuthorizable(p);
                     if (authorz != null && !authorz.isGroup()) {
                         uid = authorz.getID();
                         break;
                     }
                 }
             }
+        } catch (RepositoryException e) {
+            // failed to access userid via user manager -> use fallback 2.
+            log.error("Unexpected error while retrieving UserID.", e);
+        }
+
+        // 2. if no matching user is found try simple access to userID over
+        // SimpleCredentials.
+        if (uid == null) {
+            Iterator<SimpleCredentials> creds = subject.getPublicCredentials(
+                    SimpleCredentials.class).iterator();
+            if (creds.hasNext()) {
+                SimpleCredentials sc = creds.next();
+                uid = sc.getUserID();
+            }
         }
+
         return uid;
     }
 
     /**
      * Creates an AuthContext for the given {@link Credentials} and
-     * {@link Subject}.<br>
+     * {@link Subject}. The workspace name is ignored and users are
+     * stored and retrieved from a specific (separate) workspace.<br>
      * This includes selection of application specific LoginModules and
      * initialization with credentials and Session to System-Workspace
      *
      * @return an {@link AuthContext} for the given Credentials, Subject
      * @throws RepositoryException in other exceptional repository states
      */
-    public AuthContext getAuthContext(Credentials creds, Subject subject)
+    public AuthContext getAuthContext(Credentials creds, Subject subject, String workspaceName)
             throws RepositoryException {
         checkInitialized();
-        return authContextProvider.getAuthContext(creds, subject, securitySession,
-                principalProviderRegistry, adminId, anonymousId);
+        return getAuthContextProvider().getAuthContext(creds, subject, systemSession,
+                getPrincipalProviderRegistry(), adminId, anonymousId);
     }
 
+    //----------------------------------------------------------< protected >---    
+    /**
+     * @return The <code>SecurityManagerConfig</code> configured for the
+     * repository this manager has been created for.
+     */
+    protected SecurityManagerConfig getConfig() {
+        return repository.getConfig().getSecurityConfig().getSecurityManagerConfig();
+    }   
+
+    /**
+     * @param workspaceName
+     * @return The system user manager. Since this implementation stores users
+     * in a dedicated workspace the system user manager is the same for all
+     * sessions irrespective of the workspace.
+     */
+    protected UserManager getSystemUserManager(String workspaceName) throws RepositoryException {
+        return systemUserManager;
+    }
+
+    /**
+     * Creates a {@link UserManagerImpl} for the given session. May be overridden
+     * to return a custom implementation.
+     *
+     * @param session session
+     * @return user manager
+     * @throws RepositoryException if an error occurs
+     */
+    protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException {
+        UserManagerConfig umc = getConfig().getUserManagerConfig();
+        Properties params = (umc == null) ? null : umc.getParameters();
+
+        // since users are stored in and retrieved from a dedicated workspace
+        // only the system session assigned with that workspace will get the
+        // system user manager (special implementation that asserts the existance
+        // of the admin user).
+        UserManagerImpl um;
+        if (umc != null) {
+            Class<?>[] paramTypes = new Class[] { SessionImpl.class, String.class, Properties.class };
+            um = (UserManagerImpl) umc.getUserManager(UserManagerImpl.class, paramTypes, (SessionImpl) session, adminId, params);
+            // TODO: should we make sure the implementation doesn't allow
+            // TODO: to change the autosave behavior? since the user manager
+            // TODO: writes to a separate workspace this would cause troubles.
+        } else {
+            um = new UserManagerImpl(session, adminId, params);
+        }
+        return um;
+    }
+
+    /**
+     * @param session The session used to create the principal manager.
+     * @return A new instance of PrincipalManagerImpl
+     * @throws javax.jcr.RepositoryException If an error occurs.
+     */
+    protected PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException {
+        return new PrincipalManagerImpl(session, getPrincipalProviderRegistry().getProviders());
+    }
+
+    /**
+     * @return A nwe instance of WorkspaceAccessManagerImpl to be used as
+     * default workspace access manager if the configuration doesn't specify one.
+     */
+    protected WorkspaceAccessManager createDefaultWorkspaceAccessManager() {
+        return new WorkspaceAccessManagerImpl();
+    }
+
+    /**
+     * Creates the default principal provider used to create the
+     * {@link PrincipalProviderRegistry}.
+     * 
+     * @return An new instance of <code>DefaultPrincipalProvider</code>.
+     * @throws RepositoryException If an error occurs.
+     */
+    protected PrincipalProvider createDefaultPrincipalProvider() throws RepositoryException {
+        PrincipalProvider defaultPP = new DefaultPrincipalProvider(this.systemSession, (UserManagerImpl) systemUserManager);
+        defaultPP.init(new Properties());
+        return defaultPP;
+    }
+
+    /**
+     * @return The PrincipalProviderRegistry created during initialization.
+     */
+    protected PrincipalProviderRegistry getPrincipalProviderRegistry() {
+        return principalProviderRegistry;
+    }
+
+    /**
+     * @return The AuthContextProvider created during initialization.
+     */
+    protected AuthContextProvider getAuthContextProvider() {
+        return authContextProvider;
+    }
+
+    /**
+     * Throws <code>IllegalStateException</code> if this manager hasn't been
+     * initialized.
+     */
+    protected void checkInitialized() {
+        if (!initialized) {
+            throw new IllegalStateException("Not initialized");
+        }
+    }
+
+    /**
+     * @return The system session used to initialize this SecurityManager.
+     */
+    protected Session getSystemSession() {
+        return systemSession;
+    }
+
+    /**
+     * @return The repository used to initialize this SecurityManager.
+     */
+    protected Repository getRepository() {
+        return repository;
+    }
     //--------------------------------------------------------------------------
     /**
      * Returns the access control provider for the specified
@@ -451,63 +563,62 @@
     }
 
     /**
-     * Make sure the 'administrators' group exists and the user with the
-     * configured (or default) adminID is member of this user-group.
+     * Make sure the sytem users (admin and anonymous) exist.
      *
      * @param userManager Manager to create users/groups.
+     * @param session
      * @param adminId UserID of the administrator.
      * @param anonymousId UserID of the anonymous user.
      * @throws RepositoryException If an error occurs.
      */
-    private static void createSystemUsers(UserManager userManager,
-                                          String adminId,
-                                          String anonymousId) throws RepositoryException {
-        Principal pr = new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME);
-        Group admins = (Group) userManager.getAuthorizable(pr);
-        if (admins == null) {
-            admins = userManager.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME));
-            log.debug("...created administrators group with name '"+SecurityConstants.ADMINISTRATORS_NAME+"'");
-        }
+    static void createSystemUsers(UserManager userManager,
+                                  SystemSession session,
+                                  String adminId,
+                                  String anonymousId) throws RepositoryException {
 
+        Authorizable admin = null;
         if (adminId != null) {
-            Authorizable admin = userManager.getAuthorizable(adminId);
+            admin = userManager.getAuthorizable(adminId);
             if (admin == null) {
                 admin = userManager.createUser(adminId, adminId);
-                log.info("...created admin-user with id \'" + adminId + "\' ...");
-                admins.addMember(admin);
-                log.info("...added admin \'" + adminId + "\' as member of the administrators group.");
+                if (!userManager.isAutoSave()) {
+                    session.save();
+                }
+                log.info("... created admin-user with id \'" + adminId + "\' ...");
             }
         }
 
         if (anonymousId != null) {
             Authorizable anonymous = userManager.getAuthorizable(anonymousId);
             if (anonymous == null) {
-                userManager.createUser(anonymousId, "");
-                log.info("...created anonymous-user with id \'" + anonymousId + "\' ...");
+                try {
+                    userManager.createUser(anonymousId, "");
+                    if (!userManager.isAutoSave()) {
+                        session.save();
+                    }
+                    log.info("... created anonymous user with id \'" + anonymousId + "\' ...");
+                } catch (RepositoryException e) {
+                    // exception while creating the anonymous user.
+                    // log an error but don't abort the repository start-up
+                    log.error("Failed to create anonymous user.", e);
+                }
             }
         }
     }
 
-    private void checkInitialized() {
-        if (!initialized) {
-            throw new IllegalStateException("Not initialized");
-        }
-    }
-
     //------------------------------------------------------< inner classes >---
     /**
      * <code>WorkspaceAccessManager</code> that upon {@link #grants(Set principals, String)}
      * evaluates if access to the root node of a workspace with the specified
      * name is granted.
      */
-    private class WorkspaceAccessManagerImpl implements SecurityConstants, WorkspaceAccessManager {
+    private final class WorkspaceAccessManagerImpl implements SecurityConstants, WorkspaceAccessManager {
 
         //-----------------------------------------< WorkspaceAccessManager >---
         /**
          * {@inheritDoc}
-         * @param securitySession
          */
-        public void init(Session securitySession) throws RepositoryException {
+        public void init(Session systemSession) throws RepositoryException {
             // nothing to do here.
         }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java Wed Nov 25 14:04:38 2009
@@ -47,6 +47,7 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.NodeTypeConflictException;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
@@ -389,6 +390,8 @@
                      child-item addition or removal or changes of protected
                      properties such as mixin-types which are covered separately
                    note: removed items are checked later on.
+                   note: reordering of child nodes has been covered upfront as
+                         this information isn't available here.
                 */
                 Path path = stateMgr.getHierarchyMgr().getPath(itemState.getId());
                 boolean isGranted = true;
@@ -425,11 +428,10 @@
                 if (nodeState.getStatus() == ItemState.STATUS_NEW
                         || !nodeState.getNodeTypeName().equals(
                             ((NodeState) nodeState.getOverlayedState()).getNodeTypeName())) {
-                    NodeType[] nta = nodeDef.getRequiredPrimaryTypes();
-                    for (int i = 0; i < nta.length; i++) {
-                        NodeTypeImpl ntReq = (NodeTypeImpl) nta[i];
-                        if (!(pnt.getQName().equals(ntReq.getQName())
-                                || pnt.isDerivedFrom(ntReq.getQName()))) {
+                    for (NodeType ntReq : nodeDef.getRequiredPrimaryTypes()) {
+                        Name ntName = ((NodeTypeImpl) ntReq).getQName();
+                        if (!(pnt.getQName().equals(ntName)
+                                || pnt.isDerivedFrom(ntName))) {
                             /**
                              * the transient node's primary node type does not
                              * satisfy the 'required primary types' constraint
@@ -443,9 +445,7 @@
                 }
 
                 // mandatory child properties
-                QPropertyDefinition[] pda = ent.getMandatoryPropDefs();
-                for (int i = 0; i < pda.length; i++) {
-                    QPropertyDefinition pd = pda[i];
+                for (QPropertyDefinition pd : ent.getMandatoryPropDefs()) {
                     if (pd.getDeclaringNodeType().equals(NameConstants.MIX_VERSIONABLE)
                             || pd.getDeclaringNodeType().equals(NameConstants.MIX_SIMPLE_VERSIONABLE)) {
                         /**
@@ -455,24 +455,52 @@
                          */
                         continue;
                     }
-                    if (!nodeState.hasPropertyName(pd.getName())) {
-                        String msg = itemMgr.safeGetJCRPath(id)
+                    String msg = itemMgr.safeGetJCRPath(id)
                                 + ": mandatory property " + pd.getName()
                                 + " does not exist";
+                    if (!nodeState.hasPropertyName(pd.getName())) {
                         log.debug(msg);
                         throw new ConstraintViolationException(msg);
+                    } else {
+                        /*
+                        there exists a property with the mandatory-name.
+                        make sure the property really has the expected mandatory
+                        property definition (and not another non-mandatory def,
+                        such as e.g. multivalued residual instead of single-value
+                        mandatory, named def).
+                        */
+                        PropertyId pi = new PropertyId(nodeState.getNodeId(), pd.getName());
+                        ItemData childData = itemMgr.getItemData(pi, null, false);
+                        if (!childData.getDefinition().isMandatory()) {
+                            throw new ConstraintViolationException(msg);
+                        }
                     }
                 }
                 // mandatory child nodes
-                QItemDefinition[] cnda = ent.getMandatoryNodeDefs();
-                for (int i = 0; i < cnda.length; i++) {
-                    QItemDefinition cnd = cnda[i];
-                    if (!nodeState.hasChildNodeEntry(cnd.getName())) {
-                        String msg = itemMgr.safeGetJCRPath(id)
+                for (QItemDefinition cnd : ent.getMandatoryNodeDefs()) {
+                    String msg = itemMgr.safeGetJCRPath(id)
                                 + ": mandatory child node " + cnd.getName()
                                 + " does not exist";
+                    if (!nodeState.hasChildNodeEntry(cnd.getName())) {                      
                         log.debug(msg);
                         throw new ConstraintViolationException(msg);
+                    } else {
+                        /*
+                        there exists a child node with the mandatory-name.
+                        make sure the node really has the expected mandatory
+                        node definition.
+                        */
+                        boolean hasMandatoryChild = false;
+                        for (ChildNodeEntry cne : nodeState.getChildNodeEntries(cnd.getName())) {
+                            ItemData childData = itemMgr.getItemData(cne.getId(), null, false);
+                            if (childData.getDefinition().isMandatory()) {
+                                hasMandatoryChild = true;
+                                break;
+                            }
+                        }
+                        if (!hasMandatoryChild) {
+                            throw new ConstraintViolationException(msg);
+                        }
                     }
                 }
             } else {
@@ -509,11 +537,11 @@
                         if (constraints.length > 0
                                 && (propDef.getRequiredType() == PropertyType.REFERENCE
                                     || propDef.getRequiredType() == PropertyType.WEAKREFERENCE)) {
-                            for (int i = 0; i < values.length; i++) {
+                            for (InternalValue internalV : values) {
                                 boolean satisfied = false;
                                 String constraintViolationMsg = null;
                                 try {
-                                    NodeId targetId = values[i].getNodeId();
+                                    NodeId targetId = internalV.getNodeId();
                                     if (propDef.getRequiredType() == PropertyType.WEAKREFERENCE
                                         && !itemMgr.itemExists(targetId)) {
                                         // target of weakref doesn;t exist, skip
@@ -524,14 +552,13 @@
                                      * constraints are OR-ed, i.e. at least one
                                      * has to be satisfied
                                      */
-                                    for (int j = 0; j < constraints.length; j++) {
+                                    for (String constrNtName : constraints) {
                                         /**
                                          * a [WEAK]REFERENCE value constraint specifies
                                          * the name of the required node type of
                                          * the target node
                                          */
-                                        String ntName = constraints[j];
-                                        if (targetNode.isNodeType(ntName)) {
+                                        if (targetNode.isNodeType(constrNtName)) {
                                             satisfied = true;
                                             break;
                                         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java?rev=884108&r1=884107&r2=884108&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java Wed Nov 25 14:04:38 2009
@@ -356,7 +356,7 @@
      *                               read the said item
      * @throws RepositoryException   if another error occurs
      */
-    private ItemData getItemData(ItemId itemId, Path path, boolean permissionCheck)
+    ItemData getItemData(ItemId itemId, Path path, boolean permissionCheck)
             throws ItemNotFoundException, AccessDeniedException,
             RepositoryException {
         ItemData data = retrieveItem(itemId);



Mime
View raw message