Moving around a lot of files to work towards production components.
authorErik Brakkee <erik@brakkee.org>
Tue, 13 May 2008 22:24:45 +0000 (22:24 +0000)
committerErik Brakkee <erik@brakkee.org>
Tue, 13 May 2008 22:24:45 +0000 (22:24 +0000)
27 files changed:
security/src/main/java/org/wamblee/usermgt/HibernateComponent.java [moved from security/src/test/java/org/wamblee/usermgt/hibernate/HibernateComponent.java with 98% similarity]
security/src/main/java/org/wamblee/usermgt/UserAdministrationComponent.java [new file with mode: 0644]
security/src/main/java/org/wamblee/usermgt/UserAdministrationLightComponent.java [new file with mode: 0644]
security/src/main/java/org/wamblee/usermgt/UserGroupRepositoryComponent.java [moved from security/src/test/java/org/wamblee/usermgt/hibernate/UserGroupRepositoryComponent.java with 95% similarity]
security/src/main/java/org/wamblee/usermgt/hibernate/UsermgtHibernateMappingFiles.java [moved from security/src/test/java/org/wamblee/usermgt/UsermgtHibernateMappingFiles.java with 96% similarity]
security/src/main/resources/hbm/AuthorizationRule.hbm.xml [moved from security/src/test/resources/hbm/AuthorizationRule.hbm.xml with 100% similarity]
security/src/main/resources/hbm/AuthorizationService.hbm.xml [moved from security/src/test/resources/hbm/AuthorizationService.hbm.xml with 100% similarity]
security/src/main/resources/hbm/Group.hbm.xml [moved from security/src/test/resources/hbm/Group.hbm.xml with 100% similarity]
security/src/main/resources/hbm/OperationCondition.hbm.xml [moved from security/src/test/resources/hbm/OperationCondition.hbm.xml with 100% similarity]
security/src/main/resources/hbm/OperationCondition.hbm.xmlxx [moved from security/src/test/resources/hbm/OperationCondition.hbm.xmlxx with 100% similarity]
security/src/main/resources/hbm/PageAuthorizationRule.hbm.xml [moved from security/src/test/resources/hbm/PageAuthorizationRule.hbm.xml with 100% similarity]
security/src/main/resources/hbm/PathCondition.hbm.xml [moved from security/src/test/resources/hbm/PathCondition.hbm.xml with 100% similarity]
security/src/main/resources/hbm/PhotoAuthorizationRule.hbm.xml [moved from security/src/test/resources/hbm/PhotoAuthorizationRule.hbm.xml with 100% similarity]
security/src/main/resources/hbm/TestAuthorizationRule.hbm.xml [moved from security/src/test/resources/hbm/TestAuthorizationRule.hbm.xml with 100% similarity]
security/src/main/resources/hbm/User.hbm.xml [moved from security/src/test/resources/hbm/User.hbm.xml with 100% similarity]
security/src/main/resources/hbm/UserCondition.hbm.xml [moved from security/src/test/resources/hbm/UserCondition.hbm.xml with 100% similarity]
security/src/main/resources/hbm/ehcache.xml [moved from security/src/test/resources/hbm/ehcache.xml with 100% similarity]
security/src/main/resources/hbm/hibernate.properties [moved from security/src/test/resources/hbm/hibernate.properties with 100% similarity]
security/src/main/resources/properties/test.org.wamblee.security.ehcache.xml [moved from security/src/test/resources/properties/test.org.wamblee.security.ehcache.xml with 100% similarity]
security/src/main/resources/spring/test.org.wamblee.security.authorization.xml [moved from security/src/test/resources/spring/test.org.wamblee.security.authorization.xml with 100% similarity]
security/src/main/resources/spring/test.org.wamblee.security.database.xml [moved from security/src/test/resources/spring/test.org.wamblee.security.database.xml with 100% similarity]
security/src/main/resources/spring/test.org.wamblee.security.usermgt-repositories.xml [moved from security/src/test/resources/spring/test.org.wamblee.security.usermgt-repositories.xml with 100% similarity]
security/src/main/resources/spring/test.org.wamblee.security.usermgt.xml [moved from security/src/test/resources/spring/test.org.wamblee.security.usermgt.xml with 100% similarity]
security/src/test/java/org/wamblee/security/authorization/hibernate/AuthorizationMappingFiles.java
security/src/test/java/org/wamblee/usermgt/hibernate/HibernateUserAdministrationTest.java
security/src/test/java/org/wamblee/usermgt/hibernate/HibernateUserSetTest.java
security/src/test/java/org/wamblee/usermgt/hibernate/UserMgtRepositoryTestContainer.java

similarity index 98%
rename from security/src/test/java/org/wamblee/usermgt/hibernate/HibernateComponent.java
rename to security/src/main/java/org/wamblee/usermgt/HibernateComponent.java
index bbe1aefd5e8eecf9d7ffccbcd6f3d3ca0bdc4c23..3ba1f785f20bc21e391a1e1c6838deb7a93cc8d3 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */ 
-package org.wamblee.usermgt.hibernate;
+package org.wamblee.usermgt;
 
 import java.io.IOException;
 import java.util.HashMap;
diff --git a/security/src/main/java/org/wamblee/usermgt/UserAdministrationComponent.java b/security/src/main/java/org/wamblee/usermgt/UserAdministrationComponent.java
new file mode 100644 (file)
index 0000000..9c11c1b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2008 the original author or authors.
+ * 
+ * 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.wamblee.usermgt;
+
+import java.io.IOException;
+
+import javax.sql.DataSource;
+
+import org.hibernate.cache.EhCacheProvider;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.wamblee.system.adapters.DefaultContainer;
+import org.wamblee.system.core.Component;
+import org.wamblee.system.core.DefaultProvidedInterface;
+import org.wamblee.system.core.DefaultRequiredInterface;
+import org.wamblee.usermgt.hibernate.UsermgtHibernateMappingFiles;
+
+public class UserAdministrationComponent extends DefaultContainer {
+
+    public UserAdministrationComponent(String aName, boolean aExposeInternals)
+            throws IOException {
+        super(aName);
+        addComponent("mappingFiles", new UsermgtHibernateMappingFiles());
+        Component<?> hibernate = new HibernateComponent("hibernate");
+        addComponent(hibernate);
+
+        Component<?> repository = new UserGroupRepositoryComponent(
+                "usersgroups");
+        addComponent(repository);
+
+        Component<?> usermgt = new UserAdministrationLightComponent(
+                "usermgtlight");
+        addComponent(usermgt);
+
+        addRequiredInterface(new DefaultRequiredInterface("datasource",
+                DataSource.class));
+
+        if (aExposeInternals) {
+            addProvidedInterface(new DefaultProvidedInterface(
+                    "transactionManager", PlatformTransactionManager.class));
+            addProvidedInterface(new DefaultProvidedInterface("userCache",
+                    EhCacheProvider.class));
+        }
+        addProvidedInterface(new DefaultProvidedInterface("usermgt",
+                UserAdministration.class));
+
+    }
+}
diff --git a/security/src/main/java/org/wamblee/usermgt/UserAdministrationLightComponent.java b/security/src/main/java/org/wamblee/usermgt/UserAdministrationLightComponent.java
new file mode 100644 (file)
index 0000000..a030dc9
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2008 the original author or authors.
+ * 
+ * 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.wamblee.usermgt;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.wamblee.system.core.DefaultProvidedInterface;
+import org.wamblee.system.core.DefaultRequiredInterface;
+import org.wamblee.system.core.ProvidedInterface;
+import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.spring.SpringComponent;
+
+/**
+ * Light version of the user administration component that requires external
+ * datasource, and userset and group set components, as well as an external
+ * hibernate session factory. 
+ * @author Erik Brakkee
+ *
+ */
+public class UserAdministrationLightComponent extends SpringComponent {
+
+    public UserAdministrationLightComponent(String aName) { 
+        super(aName, new String[] { "spring/test.org.wamblee.security.usermgt.xml" },
+                createProvided(), createRequired() );    
+    }
+
+    private static Map<RequiredInterface, String> createRequired() {
+        Map<RequiredInterface, String> required = new HashMap<RequiredInterface,String>();
+        required.put(new DefaultRequiredInterface("userSet", UserSet.class), UserSet.class.getName());
+        required.put(new DefaultRequiredInterface("groupSet", GroupSet.class), GroupSet.class.getName());
+        return required; 
+    }
+
+    private static Map<String, ProvidedInterface> createProvided() {
+        Map<String, ProvidedInterface> provided = new HashMap<String, ProvidedInterface>();
+        provided.put("userAdministration", new DefaultProvidedInterface("org.wamblee.usermgt.UserAdministration",
+                UserAdministration.class));
+        return provided;
+    }
+}
similarity index 95%
rename from security/src/test/java/org/wamblee/usermgt/hibernate/UserGroupRepositoryComponent.java
rename to security/src/main/java/org/wamblee/usermgt/UserGroupRepositoryComponent.java
index 31350fc933759e5b468fdd5c0fc4f011a8e04da5..fa547e5d9278725fb3e5944adccf069aba12e341 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */ 
-package org.wamblee.usermgt.hibernate;
+package org.wamblee.usermgt;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -28,8 +28,6 @@ import org.wamblee.system.core.DefaultRequiredInterface;
 import org.wamblee.system.core.ProvidedInterface;
 import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.spring.SpringComponent;
-import org.wamblee.usermgt.GroupSet;
-import org.wamblee.usermgt.UserSet;
 
 public class UserGroupRepositoryComponent extends SpringComponent {
 
similarity index 96%
rename from security/src/test/java/org/wamblee/usermgt/UsermgtHibernateMappingFiles.java
rename to security/src/main/java/org/wamblee/usermgt/hibernate/UsermgtHibernateMappingFiles.java
index 6fcdfaf42e027bc8260e7a43f59abe12d563646f..8d523c2e4e685fd1dffea1316a7398a181164951 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */ 
 
-package org.wamblee.usermgt;
+package org.wamblee.usermgt.hibernate;
 
 import java.util.Collections;
 
index f77f71dc24e0821bd276281418dd814231e833e6..6bd87f6c0ff6c2a8d6c02a4790593cf811814fe1 100644 (file)
@@ -16,7 +16,7 @@
 
 package org.wamblee.security.authorization.hibernate;
 
-import org.wamblee.usermgt.UsermgtHibernateMappingFiles;
+import org.wamblee.usermgt.hibernate.UsermgtHibernateMappingFiles;
 
 /**
  * Mapping files for authorization. 
index 1af6e774849304270f707b028a148f27e12226f4..e9aa46889f1bad74755aa4bbb501d83e24b83b37 100644 (file)
@@ -26,7 +26,6 @@ import org.wamblee.general.BeanKernel;
 import org.wamblee.test.spring.TestTransactionCallbackWithoutResult;
 import org.wamblee.usermgt.UserAdministration;
 import org.wamblee.usermgt.UserAdministrationImplTest;
-import org.wamblee.usermgt.UsermgtHibernateMappingFiles;
 import org.wamblee.usermgt.UsermgtSpringConfigFiles;
 
 /**
index 22ed9cd524636dca999759fa85365bc54177aba8..3d6f8c54d99a52f74db6ec84f1a9d31b21d68fa2 100644 (file)
@@ -36,7 +36,6 @@ import org.wamblee.usermgt.InMemoryUserSetTest;
 import org.wamblee.usermgt.User;
 import org.wamblee.usermgt.UserMgtException;
 import org.wamblee.usermgt.UserSet;
-import org.wamblee.usermgt.UsermgtHibernateMappingFiles;
 import org.wamblee.usermgt.UsermgtSpringConfigFiles;
 
 /**
index 028e3ed58ed73b3ca6137e54345201cd9e28b2c5..d5031f4e9f41f6f70ff7a44668f6263923cba555 100644 (file)
@@ -19,7 +19,8 @@ import java.io.IOException;
 
 import org.wamblee.system.adapters.DefaultContainer;
 import org.wamblee.system.spring.DatabaseTesterComponent;
-import org.wamblee.usermgt.UsermgtHibernateMappingFiles;
+import org.wamblee.usermgt.HibernateComponent;
+import org.wamblee.usermgt.UserGroupRepositoryComponent;
 
 /**
  *