]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r redback-users-configurable
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 16:57:36 +0000 (16:57 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 16:57:36 +0000 (16:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310801 13f79535-47bb-0310-9956-ffa450edef68

redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/apache/archiva/redback/users/configurable/ConfigurableUserManager.java [new file with mode: 0644]
redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/codehaus/plexus/redback/users/configurable/ConfigurableUserManager.java [deleted file]
redback-users/redback-users-providers/redback-users-configurable/src/main/resources/META-INF/spring-context.xml

diff --git a/redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/apache/archiva/redback/users/configurable/ConfigurableUserManager.java b/redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/apache/archiva/redback/users/configurable/ConfigurableUserManager.java
new file mode 100644 (file)
index 0000000..eba794f
--- /dev/null
@@ -0,0 +1,179 @@
+package org.apache.archiva.redback.users.configurable;
+
+/*
+ * Copyright 2001-2007 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+import org.apache.archiva.redback.users.AbstractUserManager;
+import org.apache.archiva.redback.users.User;
+import org.apache.archiva.redback.users.UserManager;
+import org.apache.archiva.redback.users.UserNotFoundException;
+import org.codehaus.plexus.redback.configuration.UserConfiguration;
+import org.apache.archiva.redback.users.UserQuery;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.util.List;
+
+/**
+ * @author <a href="jesse@codehaus.org"> jesse
+ * @version "Id$
+ */
+@Service( "userManager#configurable" )
+public class ConfigurableUserManager
+    extends AbstractUserManager
+{
+    @Inject
+    @Named( value = "userConfiguration" )
+    private UserConfiguration config;
+
+    @Inject
+    private ApplicationContext applicationContext;
+
+    private UserManager userManagerImpl;
+
+    public static final String USER_MANAGER_IMPL = "user.manager.impl";
+
+    @PostConstruct
+    public void initialize()
+    {
+        String userManagerRole = config.getString( USER_MANAGER_IMPL );
+
+        if ( userManagerRole == null )
+        {
+            throw new RuntimeException(
+                "User Manager Configuration Missing: " + USER_MANAGER_IMPL + " configuration property" );
+        }
+
+        userManagerImpl = applicationContext.getBean( "userManager#" + userManagerRole, UserManager.class );
+        // (UserManager) container.lookup( UserManager.class.getName(), userManagerRole );
+    }
+
+    public User addUser( User user )
+    {
+        return userManagerImpl.addUser( user );
+    }
+
+    public void addUserUnchecked( User user )
+    {
+        userManagerImpl.addUserUnchecked( user );
+    }
+
+    public User createUser( String username, String fullName, String emailAddress )
+    {
+        return userManagerImpl.createUser( username, fullName, emailAddress );
+    }
+
+    public UserQuery createUserQuery()
+    {
+        return userManagerImpl.createUserQuery();
+    }
+
+    public void deleteUser( Object principal )
+        throws UserNotFoundException
+    {
+        userManagerImpl.deleteUser( principal );
+    }
+
+    public void deleteUser( String username )
+        throws UserNotFoundException
+    {
+        userManagerImpl.deleteUser( username );
+    }
+
+    public void eraseDatabase()
+    {
+        userManagerImpl.eraseDatabase();
+    }
+
+    public User findUser( String username )
+        throws UserNotFoundException
+    {
+        return userManagerImpl.findUser( username );
+    }
+
+    public User findUser( Object principal )
+        throws UserNotFoundException
+    {
+        return userManagerImpl.findUser( principal );
+    }
+
+    @Override
+    public User getGuestUser()
+        throws UserNotFoundException
+    {
+        return userManagerImpl.getGuestUser();
+    }
+
+    public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
+    {
+        return userManagerImpl.findUsersByEmailKey( emailKey, orderAscending );
+    }
+
+    public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscending )
+    {
+        return userManagerImpl.findUsersByFullNameKey( fullNameKey, orderAscending );
+    }
+
+    public List<User> findUsersByQuery( UserQuery query )
+    {
+        return userManagerImpl.findUsersByQuery( query );
+    }
+
+    public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending )
+    {
+        return userManagerImpl.findUsersByUsernameKey( usernameKey, orderAscending );
+    }
+
+    public String getId()
+    {
+        return ConfigurableUserManager.class.getName() + " wrapping " + userManagerImpl.getId();
+    }
+
+    public List<User> getUsers()
+    {
+        return userManagerImpl.getUsers();
+    }
+
+    public List<User> getUsers( boolean orderAscending )
+    {
+        return userManagerImpl.getUsers( orderAscending );
+    }
+
+    public boolean isReadOnly()
+    {
+        return userManagerImpl.isReadOnly();
+    }
+
+    public User updateUser( User user )
+        throws UserNotFoundException
+    {
+        return updateUser( user, false );
+    }
+
+    public User updateUser( User user, boolean passwordChangeRequired )
+        throws UserNotFoundException
+    {
+        return userManagerImpl.updateUser( user, passwordChangeRequired );
+    }
+
+    public boolean userExists( Object principal )
+    {
+        return userManagerImpl.userExists( principal );
+    }
+}
diff --git a/redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/codehaus/plexus/redback/users/configurable/ConfigurableUserManager.java b/redback-users/redback-users-providers/redback-users-configurable/src/main/java/org/codehaus/plexus/redback/users/configurable/ConfigurableUserManager.java
deleted file mode 100644 (file)
index 7ecaa88..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-package org.codehaus.plexus.redback.users.configurable;
-
-/*
- * Copyright 2001-2007 The Apache Software Foundation.
- *
- * 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.
- */
-
-import org.apache.archiva.redback.users.AbstractUserManager;
-import org.apache.archiva.redback.users.User;
-import org.apache.archiva.redback.users.UserManager;
-import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.configuration.UserConfiguration;
-import org.apache.archiva.redback.users.UserQuery;
-import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.util.List;
-
-/**
- * @author <a href="jesse@codehaus.org"> jesse
- * @version "Id$
- */
-@Service( "userManager#configurable" )
-public class ConfigurableUserManager
-    extends AbstractUserManager
-{
-    @Inject
-    @Named( value = "userConfiguration" )
-    private UserConfiguration config;
-
-    @Inject
-    private ApplicationContext applicationContext;
-
-    private UserManager userManagerImpl;
-
-    public static final String USER_MANAGER_IMPL = "user.manager.impl";
-
-    @PostConstruct
-    public void initialize()
-    {
-        String userManagerRole = config.getString( USER_MANAGER_IMPL );
-
-        if ( userManagerRole == null )
-        {
-            throw new RuntimeException(
-                "User Manager Configuration Missing: " + USER_MANAGER_IMPL + " configuration property" );
-        }
-
-        userManagerImpl = applicationContext.getBean( "userManager#" + userManagerRole, UserManager.class );
-        // (UserManager) container.lookup( UserManager.class.getName(), userManagerRole );
-    }
-
-    public User addUser( User user )
-    {
-        return userManagerImpl.addUser( user );
-    }
-
-    public void addUserUnchecked( User user )
-    {
-        userManagerImpl.addUserUnchecked( user );
-    }
-
-    public User createUser( String username, String fullName, String emailAddress )
-    {
-        return userManagerImpl.createUser( username, fullName, emailAddress );
-    }
-
-    public UserQuery createUserQuery()
-    {
-        return userManagerImpl.createUserQuery();
-    }
-
-    public void deleteUser( Object principal )
-        throws UserNotFoundException
-    {
-        userManagerImpl.deleteUser( principal );
-    }
-
-    public void deleteUser( String username )
-        throws UserNotFoundException
-    {
-        userManagerImpl.deleteUser( username );
-    }
-
-    public void eraseDatabase()
-    {
-        userManagerImpl.eraseDatabase();
-    }
-
-    public User findUser( String username )
-        throws UserNotFoundException
-    {
-        return userManagerImpl.findUser( username );
-    }
-
-    public User findUser( Object principal )
-        throws UserNotFoundException
-    {
-        return userManagerImpl.findUser( principal );
-    }
-
-    @Override
-    public User getGuestUser()
-        throws UserNotFoundException
-    {
-        return userManagerImpl.getGuestUser();
-    }
-
-    public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
-    {
-        return userManagerImpl.findUsersByEmailKey( emailKey, orderAscending );
-    }
-
-    public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscending )
-    {
-        return userManagerImpl.findUsersByFullNameKey( fullNameKey, orderAscending );
-    }
-
-    public List<User> findUsersByQuery( UserQuery query )
-    {
-        return userManagerImpl.findUsersByQuery( query );
-    }
-
-    public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending )
-    {
-        return userManagerImpl.findUsersByUsernameKey( usernameKey, orderAscending );
-    }
-
-    public String getId()
-    {
-        return ConfigurableUserManager.class.getName() + " wrapping " + userManagerImpl.getId();
-    }
-
-    public List<User> getUsers()
-    {
-        return userManagerImpl.getUsers();
-    }
-
-    public List<User> getUsers( boolean orderAscending )
-    {
-        return userManagerImpl.getUsers( orderAscending );
-    }
-
-    public boolean isReadOnly()
-    {
-        return userManagerImpl.isReadOnly();
-    }
-
-    public User updateUser( User user )
-        throws UserNotFoundException
-    {
-        return updateUser( user, false );
-    }
-
-    public User updateUser( User user, boolean passwordChangeRequired )
-        throws UserNotFoundException
-    {
-        return userManagerImpl.updateUser( user, passwordChangeRequired );
-    }
-
-    public boolean userExists( Object principal )
-    {
-        return userManagerImpl.userExists( principal );
-    }
-}
index 6b39e503b08226ebef422a7d5061a68c002253c5..86261b80efdf2b48bcbb78b3ae17f45e1a881b04 100644 (file)
@@ -28,6 +28,6 @@
        default-lazy-init="true">
 
   <context:annotation-config />
-  <context:component-scan base-package="org.codehaus.plexus.redback.users.configurable"/>
+  <context:component-scan base-package="org.apache.archiva.redback.users.configurable"/>
  
 </beans>
\ No newline at end of file