]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r module redback-keys-api
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 21:51:32 +0000 (21:51 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 21:51:32 +0000 (21:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310880 13f79535-47bb-0310-9956-ffa450edef68

44 files changed:
redback-data-management/src/main/java/org/apache/archiva/redback/management/DataManagementTool.java
redback-data-management/src/main/java/org/apache/archiva/redback/management/JdoDataManagementTool.java
redback-data-management/src/test/java/org/apache/archiva/redback/management/DataManagementTest.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/mail/MailGenerator.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/mail/Mailer.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/mail/MailerImpl.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/mail/VelocityMailGenerator.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/AutoLoginCookies.java
redback-integrations/redback-common-integrations/src/test/java/org/codehaus/redback/integration/mail/MailGeneratorTest.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultLoginService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultPasswordService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultUserService.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/LoginAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/PasswordResetAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/RegisterAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/BackupRestoreAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/AutoLoginInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsActionTest.xml
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/org/codehaus/plexus/redback/struts2/action/admin/UserEditActionTest.xml
redback-integrations/redback-struts2/redback-struts2-integration/src/test/resources/spring-context.xml
redback-keys/redback-authentication-keys/src/main/java/org/codehaus/plexus/redback/authentication/keystore/KeyStoreAuthenticator.java
redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AbstractKeyManager.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManager.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManagerException.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyNotFoundException.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AbstractKeyManager.java [deleted file]
redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AuthenticationKey.java [deleted file]
redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManager.java [deleted file]
redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManagerException.java [deleted file]
redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyNotFoundException.java [deleted file]
redback-keys/redback-keys-api/src/test/java/org/apache/archiva/redback/keys/KeyManagerTest.java [new file with mode: 0644]
redback-keys/redback-keys-api/src/test/java/org/codehaus/plexus/redback/keys/KeyManagerTest.java [deleted file]
redback-keys/redback-keys-providers/redback-keys-cached/src/main/java/org/codehaus/plexus/redback/keys/cached/CachedKeyManager.java
redback-keys/redback-keys-providers/redback-keys-cached/src/test/java/org/codehaus/plexus/redback/keys/cached/CachedKeyManagerTest.java
redback-keys/redback-keys-providers/redback-keys-jdo/src/main/java/org/codehaus/plexus/redback/keys/jdo/JdoKeyManager.java
redback-keys/redback-keys-providers/redback-keys-jdo/src/main/mdo/keys.mdo
redback-keys/redback-keys-providers/redback-keys-jdo/src/test/java/org/codehaus/plexus/redback/keys/jdo/JdoKeyManagerTest.java
redback-keys/redback-keys-providers/redback-keys-memory/src/main/java/org/codehaus/plexus/redback/keys/memory/MemoryAuthenticationKey.java
redback-keys/redback-keys-providers/redback-keys-memory/src/main/java/org/codehaus/plexus/redback/keys/memory/MemoryKeyManager.java
redback-keys/redback-keys-providers/redback-keys-memory/src/test/java/org/codehaus/plexus/redback/keys/memory/MemoryKeyManagerTest.java
redback-keys/redback-keys-tests/src/main/java/org/codehaus/plexus/redback/keys/KeyManagerTestCase.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java

index 3df18005bb46886814051ff6cb3bbcd0d776a4b2..2c72d8ada7ce5837bef4f516caaf11bca15f16cf 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.redback.management;
  */
 
 import org.apache.archiva.redback.users.UserManager;
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.rbac.RbacManagerException;
 
index c0cb68933d09a14e046497aa9fa672df9ebe3c4c..c9460d920ea4ff027b39c3eadbf87c81950be9dd 100644 (file)
@@ -34,11 +34,10 @@ import java.util.Map;
 
 import javax.xml.stream.XMLStreamException;
 
-import org.apache.archiva.redback.management.DataManagementTool;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.users.UserManager;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.keys.jdo.AuthenticationKeyDatabase;
 import org.codehaus.plexus.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxReader;
 import org.codehaus.plexus.redback.keys.jdo.io.stax.RedbackKeyManagementJdoStaxWriter;
index 6540892048a4818b672c7228b2ba05eaca382b4e..d8ba8b8e671a4c78ac75ad7b1dd87e20ead5bd08 100644 (file)
@@ -21,12 +21,11 @@ package org.apache.archiva.redback.management;
 
 import junit.framework.TestCase;
 import org.apache.archiva.redback.common.jdo.UserConfigurableJdoFactory;
-import org.apache.archiva.redback.management.DataManagementTool;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.commons.lang.SystemUtils;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.rbac.Permission;
 import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.rbac.RbacManagerException;
index 7796a86ca3f243d37cee2a8815f9fd71da5b8d9c..8472582980071ca655097bab20630bdd525d6c8d 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.mail;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 
 /**
  * Mail generator component.
index 3aa3240f90a38665f500f54774b6764cafed4ea2..04aff225208d9be03708eaceaf2ea7776e5a288e 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.mail;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 
 import java.util.Collection;
 
index 0c30a13d524255122dfeba527aa2fb5bb832bb4a..e1e3f70fd373f5940147a1777885ffdf2f8a6140 100644 (file)
@@ -34,7 +34,7 @@ import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeMessage;
 
 import org.apache.archiva.redback.configuration.UserConfiguration;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
 import org.codehaus.plexus.redback.policy.UserValidationSettings;
 import org.codehaus.plexus.redback.system.SecuritySystem;
index 10b941285c87c40357a3a34c7a939b258b600d6e..c714d15622de3bcbf9d646cbde18307fc6797599 100644 (file)
@@ -19,13 +19,13 @@ package org.codehaus.redback.integration.mail;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.exception.MethodInvocationException;
 import org.apache.velocity.exception.ParseErrorException;
 import org.apache.velocity.exception.ResourceNotFoundException;
 import org.apache.archiva.redback.configuration.UserConfiguration;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
index a78611d8cb6c3f110e7090b6371921eb11f261ac..d0af0df709650325ebee3f0402c3ec4a4932dceb 100644 (file)
@@ -24,10 +24,10 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.redback.policy.CookieSettings;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
index 5814ffe9c35fd449647e003b43b227d612a2d1ee..f6f6989147f68862544b750ffa1162dffbfeaf35 100644 (file)
@@ -21,11 +21,10 @@ package org.codehaus.redback.integration.mail;
 
 import junit.framework.TestCase;
 import net.sf.ehcache.CacheManager;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
-import org.codehaus.plexus.jdo.JdoFactory;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
 import org.jpox.SchemaTool;
 import org.junit.Before;
index e81e83a30b09e31f792b3ed8652136142c95295a..f9cf65066fbd329fac4c4ba990cd432b39c16cd7 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.redback.rest.services;
  * under the License.
  */
 import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.jdo.JdoAuthenticationKey;
 import org.codehaus.plexus.redback.keys.memory.MemoryAuthenticationKey;
 import org.codehaus.plexus.redback.keys.memory.MemoryKeyManager;
index 00a9c4d36174c4e8d5299643a8913b27a649328c..f3088184b6418f3874b75665fe5393d90c4ef21f 100644 (file)
@@ -20,8 +20,8 @@ package org.codehaus.redback.rest.services;
 
 import org.apache.archiva.redback.users.User;
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.policy.PasswordEncoder;
 import org.codehaus.plexus.redback.policy.PasswordRuleViolationException;
 import org.codehaus.plexus.redback.policy.PasswordRuleViolations;
index 7272a5293dc6978a65313e0f6c682204fd81dc79..cf167faf4246ab6bcff0279f1680961e3dc80771 100644 (file)
@@ -21,16 +21,16 @@ package org.codehaus.redback.rest.services;
 
 import net.sf.ehcache.CacheManager;
 import org.apache.archiva.redback.configuration.UserConfiguration;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.plexus.cache.Cache;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.policy.PasswordEncoder;
index 4d1be692a6191220b4986a4336feb83c3a731a00..ccf43e89343c96a542cdab246b0caf814b634e30 100644 (file)
@@ -19,6 +19,7 @@ package org.codehaus.plexus.redback.struts2.action;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.users.User;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.authentication.AuthenticationConstants;
@@ -28,9 +29,8 @@ import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
 import org.apache.archiva.redback.configuration.UserConfiguration;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index e450e3ac83cc3ac226d3df9d4b5dfb8a3f9d2c86..81235f95c7397dea634ca69b3f96855852803b81 100644 (file)
@@ -19,11 +19,11 @@ package org.codehaus.plexus.redback.struts2.action;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.User;
index 41499765864b0ef7abdea53d7e5a01d6c3daa84e..f5873e128ab6f5f619ef4ae38351f518df7e46d4 100644 (file)
@@ -19,9 +19,9 @@ package org.codehaus.plexus.redback.struts2.action;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.users.User;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyManagerException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
index 04fbaa7f0b1925b49f4de9a6bd063d1d357ca414..871da592f4e0ee4f3b46374e014eb1a4e7035d3d 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.plexus.redback.struts2.action.admin;
 
 import com.opensymphony.xwork2.Preparable;
 import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.management.DataManagementTool;
 import org.codehaus.plexus.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.rbac.Resource;
index 40d2ce61aaf18995c7c52a6144b165b199538cd4..3677c7e6ab9459d3d5a2d6d546b2f121f3f376ef 100644 (file)
@@ -22,11 +22,11 @@ package org.codehaus.plexus.redback.struts2.interceptor;
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 79fb9a89d473657084fdd7290bd26c079065faa1..1705a1fc126c8415d1820c6e374f17e3f13d85c8 100644 (file)
       </requirements>
     </component>
     <component>
-      <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+      <role>org.apache.archiva.redback.keys.KeyManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.keys.cached.CachedKeyManager</implementation>
       <description>CachedKeyManager</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+          <role>org.apache.archiva.redback.keys.KeyManager</role>
           <role-hint>memory</role-hint>
           <field-name>keyImpl</field-name>
         </requirement>
index 79fb9a89d473657084fdd7290bd26c079065faa1..1705a1fc126c8415d1820c6e374f17e3f13d85c8 100644 (file)
       </requirements>
     </component>
     <component>
-      <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+      <role>org.apache.archiva.redback.keys.KeyManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.keys.cached.CachedKeyManager</implementation>
       <description>CachedKeyManager</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+          <role>org.apache.archiva.redback.keys.KeyManager</role>
           <role-hint>memory</role-hint>
           <field-name>keyImpl</field-name>
         </requirement>
index 62e3d199bc89864ed86703409532da03712490e4..aa9e46143155d4a9378d41509ad01d9ab28da1be 100755 (executable)
   </bean>
   <!--
     <component>
-      <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+      <role>org.apache.archiva.redback.keys.KeyManager</role>
       <role-hint>cached</role-hint>
       <implementation>org.codehaus.plexus.redback.keys.cached.CachedKeyManager</implementation>
       <description>CachedKeyManager</description>
       <requirements>
         <requirement>
-          <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+          <role>org.apache.archiva.redback.keys.KeyManager</role>
           <role-hint>memory</role-hint>
           <field-name>keyImpl</field-name>
         </requirement>
index 217422e7049735e0d67fedc03164ffe296770522..f2906879d89ff8349647e944865d844ccd91509d 100644 (file)
@@ -24,10 +24,10 @@ import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.Authenticator;
 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.apache.archiva.redback.users.User;
diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AbstractKeyManager.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AbstractKeyManager.java
new file mode 100644 (file)
index 0000000..e5d74bc
--- /dev/null
@@ -0,0 +1,171 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Copyright 2001-2006 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 java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Random;
+import java.util.TimeZone;
+
+import org.codehaus.plexus.digest.Hex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * AbstractKeyManager 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public abstract class AbstractKeyManager
+    implements KeyManager
+{
+    protected Logger log = LoggerFactory.getLogger( getClass() );
+    
+    private static final int KEY_LENGTH = 16;
+
+    private static final boolean SECURE = true;
+
+    private boolean randomMode = SECURE;
+
+    private SecureRandom secureRandom;
+
+    private Random random;
+
+    /**
+     * Generate a UUID using <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a> UUID generation of a 
+     * type 4 or randomly generated UUID.
+     * 
+     * @return the 32 character long UUID string.
+     * @throws KeyManagerException
+     */
+    protected String generateUUID()
+        throws KeyManagerException
+    {
+        byte vfour[] = new byte[KEY_LENGTH];
+
+        if ( isRandomMode() == SECURE )
+        {
+            if ( secureRandom == null )
+            {
+                try
+                {
+                    secureRandom = SecureRandom.getInstance( "SHA1PRNG" );
+                }
+                catch ( NoSuchAlgorithmException e )
+                {
+                    setRandomMode( !SECURE );
+                    log.warn( "Unable to use SecureRandom", e );
+                }
+            }
+
+            if ( isRandomMode() == SECURE )
+            {
+                secureRandom.nextBytes( vfour );
+            }
+        }
+
+        if ( isRandomMode() != SECURE )
+        {
+            if ( random == null )
+            {
+                random = new Random();
+            }
+
+            random.nextBytes( vfour );
+        }
+
+        vfour[6] &= 0x0F;
+        vfour[6] |= ( 4 << 4 );
+        vfour[8] &= 0x3F;
+        vfour[8] |= 0x80;
+
+        return Hex.encode( vfour );
+    }
+
+    /**
+     * Tests the key to see if it is expired or not.
+     * 
+     * If the key is expired, a call to {@link #removeExpiredKey(AuthenticationKey)} is issued,
+     * and a {@link KeyNotFoundException} is thrown.
+     * 
+     * @param authkey the key to test.
+     * @throws KeyNotFoundException if the key is expired.
+     * @throws KeyManagerException if there was a problem removing the key.
+     */
+    protected void assertNotExpired( AuthenticationKey authkey )
+        throws KeyNotFoundException, KeyManagerException
+    {
+        if ( authkey.getDateExpires() == null )
+        {
+            // No expiration means a permanent entry.
+            return;
+        }
+    
+        // Test for expiration.
+        Calendar now = getNowGMT();
+        Calendar expiration = getNowGMT();
+        expiration.setTime( authkey.getDateExpires() );
+    
+        if ( now.after( expiration ) )
+        {
+            deleteKey( authkey );
+            throw new KeyNotFoundException( "Key [" + authkey.getKey() + "] has expired." );
+        }
+    }
+
+    protected Calendar getNowGMT()
+    {
+        return Calendar.getInstance( TimeZone.getTimeZone( "GMT" ) );
+    }
+
+    public void setRandomMode( boolean randomMode )
+    {
+        this.randomMode = randomMode;
+    }
+
+    public boolean isRandomMode()
+    {
+        return randomMode;
+    }
+
+    public void removeExpiredKeys()
+        throws KeyManagerException
+    {
+        List<AuthenticationKey> allKeys = getAllKeys();
+
+        Calendar now = getNowGMT();
+        Calendar expiration = getNowGMT();
+
+        log.info( "Removing expired keys." );
+        for ( AuthenticationKey authkey : allKeys )
+        {
+            if ( authkey.getDateExpires() != null )
+            {
+                expiration.setTime( authkey.getDateExpires() );
+
+                if ( now.after( expiration ) )
+                {
+                    deleteKey( authkey );
+                }
+            }
+        }
+        log.info( "Expired keys removed." );
+    }
+}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java
new file mode 100644 (file)
index 0000000..1ddf00d
--- /dev/null
@@ -0,0 +1,60 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.util.Date;
+
+/**
+ * AuthenticationKey is an object representing a key established to
+ * automatically authenticate a user without the user providing typical
+ * login credentials.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface AuthenticationKey
+{
+    Date getDateCreated();
+
+    Date getDateExpires();
+
+    String getForPrincipal();
+
+    String getKey();
+
+    /**
+     * A String representation of what the purpose of existence is for this key.
+     * <p/>
+     * Examples: "selfservice password reset", "inter system communications", "remember me"
+     *
+     * @return
+     */
+    String getPurpose();
+
+    void setDateCreated( Date dateCreated );
+
+    void setDateExpires( Date dateExpires );
+
+    void setForPrincipal( String forPrincipal );
+
+    void setKey( String key );
+
+    void setPurpose( String requestedFrom );
+}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManager.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManager.java
new file mode 100644 (file)
index 0000000..4853080
--- /dev/null
@@ -0,0 +1,94 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.util.List;
+
+/**
+ * KeyManager
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface KeyManager
+{
+
+
+    /**
+     * String identifying the key manager implementation.
+     *
+     * @return the key manager implementation id.
+     */
+    String getId();
+
+    /**
+     * Attempt to find a specific key in the store.
+     * <p/>
+     * NOTE: Implementations of this interface should never return an expired key.
+     *
+     * @param key the key to find.
+     * @return the actual key found.
+     * @throws KeyNotFoundException when the requested, unexpired, key cannot be found.
+     * @throws KeyManagerException  when there is a fundamental problem with the KeyManager implementation.
+     */
+    AuthenticationKey findKey( String key )
+        throws KeyNotFoundException, KeyManagerException;
+
+    /**
+     * Create a key (and save it to the store) for the specified principal.
+     *
+     * @param principal         the principal to generate the key for.
+     * @param purpose           the purpose of the key. (Example: "selfservice password reset", "new user validation",
+     *                          "remember me")  This is a purely informational field .
+     * @param expirationMinutes the amount in minutes until this key expires. (-1 means no expiration)
+     * @return the key created
+     * @throws KeyManagerException if there is a fundamental problem with the KeyManager implementation.
+     */
+    AuthenticationKey createKey( String principal, String purpose, int expirationMinutes )
+        throws KeyManagerException;
+
+    /**
+     * Delete a key from the underlying store.
+     *
+     * @param key the key to delete.
+     */
+    void deleteKey( AuthenticationKey key )
+        throws KeyManagerException;
+
+    /**
+     * Delete a key from the underlying store.
+     *
+     * @param key the key to delete.
+     */
+    void deleteKey( String key )
+        throws KeyManagerException;
+
+    List<AuthenticationKey> getAllKeys();
+
+    AuthenticationKey addKey( AuthenticationKey key );
+
+    void eraseDatabase();
+
+    /**
+     * Remove all keys that are expired.
+     */
+    void removeExpiredKeys()
+        throws KeyManagerException;
+}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManagerException.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyManagerException.java
new file mode 100644 (file)
index 0000000..1cf5344
--- /dev/null
@@ -0,0 +1,52 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * KeyManagerException 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class KeyManagerException
+    extends Exception
+{
+
+    public KeyManagerException()
+    {
+        super();
+    }
+
+    public KeyManagerException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public KeyManagerException( String message )
+    {
+        super( message );
+    }
+
+    public KeyManagerException( Throwable cause )
+    {
+        super( cause );
+    }
+
+}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyNotFoundException.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/KeyNotFoundException.java
new file mode 100644 (file)
index 0000000..f43d248
--- /dev/null
@@ -0,0 +1,50 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Copyright 2001-2006 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.keys.KeyManagerException;
+
+/**
+ * KeyNotFoundException 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class KeyNotFoundException
+    extends KeyManagerException
+{
+    public KeyNotFoundException()
+    {
+        super();
+    }
+
+    public KeyNotFoundException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public KeyNotFoundException( String message )
+    {
+        super( message );
+    }
+
+    public KeyNotFoundException( Throwable cause )
+    {
+        super( cause );
+    }
+
+}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AbstractKeyManager.java b/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AbstractKeyManager.java
deleted file mode 100644 (file)
index 845417f..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Copyright 2001-2006 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 java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Random;
-import java.util.TimeZone;
-
-import org.codehaus.plexus.digest.Hex;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * AbstractKeyManager 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public abstract class AbstractKeyManager
-    implements KeyManager
-{
-    protected Logger log = LoggerFactory.getLogger( getClass() );
-    
-    private static final int KEY_LENGTH = 16;
-
-    private static final boolean SECURE = true;
-
-    private boolean randomMode = SECURE;
-
-    private SecureRandom secureRandom;
-
-    private Random random;
-
-    /**
-     * Generate a UUID using <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a> UUID generation of a 
-     * type 4 or randomly generated UUID.
-     * 
-     * @return the 32 character long UUID string.
-     * @throws KeyManagerException
-     */
-    protected String generateUUID()
-        throws KeyManagerException
-    {
-        byte vfour[] = new byte[KEY_LENGTH];
-
-        if ( isRandomMode() == SECURE )
-        {
-            if ( secureRandom == null )
-            {
-                try
-                {
-                    secureRandom = SecureRandom.getInstance( "SHA1PRNG" );
-                }
-                catch ( NoSuchAlgorithmException e )
-                {
-                    setRandomMode( !SECURE );
-                    log.warn( "Unable to use SecureRandom", e );
-                }
-            }
-
-            if ( isRandomMode() == SECURE )
-            {
-                secureRandom.nextBytes( vfour );
-            }
-        }
-
-        if ( isRandomMode() != SECURE )
-        {
-            if ( random == null )
-            {
-                random = new Random();
-            }
-
-            random.nextBytes( vfour );
-        }
-
-        vfour[6] &= 0x0F;
-        vfour[6] |= ( 4 << 4 );
-        vfour[8] &= 0x3F;
-        vfour[8] |= 0x80;
-
-        return Hex.encode( vfour );
-    }
-
-    /**
-     * Tests the key to see if it is expired or not.
-     * 
-     * If the key is expired, a call to {@link #removeExpiredKey(AuthenticationKey)} is issued,
-     * and a {@link KeyNotFoundException} is thrown.
-     * 
-     * @param authkey the key to test.
-     * @throws KeyNotFoundException if the key is expired.
-     * @throws KeyManagerException if there was a problem removing the key.
-     */
-    protected void assertNotExpired( AuthenticationKey authkey )
-        throws KeyNotFoundException, KeyManagerException
-    {
-        if ( authkey.getDateExpires() == null )
-        {
-            // No expiration means a permanent entry.
-            return;
-        }
-    
-        // Test for expiration.
-        Calendar now = getNowGMT();
-        Calendar expiration = getNowGMT();
-        expiration.setTime( authkey.getDateExpires() );
-    
-        if ( now.after( expiration ) )
-        {
-            deleteKey( authkey );
-            throw new KeyNotFoundException( "Key [" + authkey.getKey() + "] has expired." );
-        }
-    }
-
-    protected Calendar getNowGMT()
-    {
-        return Calendar.getInstance( TimeZone.getTimeZone( "GMT" ) );
-    }
-
-    public void setRandomMode( boolean randomMode )
-    {
-        this.randomMode = randomMode;
-    }
-
-    public boolean isRandomMode()
-    {
-        return randomMode;
-    }
-
-    public void removeExpiredKeys()
-        throws KeyManagerException
-    {
-        List<AuthenticationKey> allKeys = getAllKeys();
-
-        Calendar now = getNowGMT();
-        Calendar expiration = getNowGMT();
-
-        log.info( "Removing expired keys." );
-        for ( AuthenticationKey authkey : allKeys )
-        {
-            if ( authkey.getDateExpires() != null )
-            {
-                expiration.setTime( authkey.getDateExpires() );
-
-                if ( now.after( expiration ) )
-                {
-                    deleteKey( authkey );
-                }
-            }
-        }
-        log.info( "Expired keys removed." );
-    }
-}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AuthenticationKey.java b/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/AuthenticationKey.java
deleted file mode 100644 (file)
index 96d152e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 java.util.Date;
-
-/**
- * AuthenticationKey is an object representing a key established to 
- * automatically authenticate a user without the user providing typical
- * login credentials.  
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface AuthenticationKey
-{
-    public Date getDateCreated();
-    public Date getDateExpires();
-    public String getForPrincipal();
-    public String getKey();
-    
-    /**
-     * A String representation of what the purpose of existence is for this key.
-     * 
-     * Examples: "selfservice password reset", "inter system communications", "remember me"
-     * 
-     * @return
-     */
-    public String getPurpose();
-    
-    public void setDateCreated( Date dateCreated );
-    public void setDateExpires( Date dateExpires );
-    public void setForPrincipal( String forPrincipal );
-    public void setKey( String key );
-    public void setPurpose( String requestedFrom );
-}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManager.java b/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManager.java
deleted file mode 100644 (file)
index 2a93e21..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 java.util.List;
-
-/**
- * KeyManager
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface KeyManager
-{
-
-
-    /**
-     * String identifying the key manager implementation.
-     *
-     * @return the key manager implementation id.
-     */
-    String getId();
-
-    /**
-     * Attempt to find a specific key in the store.
-     * <p/>
-     * NOTE: Implementations of this interface should never return an expired key.
-     *
-     * @param key the key to find.
-     * @return the actual key found.
-     * @throws KeyNotFoundException when the requested, unexpired, key cannot be found.
-     * @throws KeyManagerException  when there is a fundamental problem with the KeyManager implementation.
-     */
-    AuthenticationKey findKey( String key )
-        throws KeyNotFoundException, KeyManagerException;
-
-    /**
-     * Create a key (and save it to the store) for the specified principal.
-     *
-     * @param principal         the principal to generate the key for.
-     * @param purpose           the purpose of the key. (Example: "selfservice password reset", "new user validation",
-     *                          "remember me")  This is a purely informational field .
-     * @param expirationMinutes the amount in minutes until this key expires. (-1 means no expiration)
-     * @return the key created
-     * @throws KeyManagerException if there is a fundamental problem with the KeyManager implementation.
-     */
-    AuthenticationKey createKey( String principal, String purpose, int expirationMinutes )
-        throws KeyManagerException;
-
-    /**
-     * Delete a key from the underlying store.
-     *
-     * @param key the key to delete.
-     */
-    void deleteKey( AuthenticationKey key )
-        throws KeyManagerException;
-
-    /**
-     * Delete a key from the underlying store.
-     *
-     * @param key the key to delete.
-     */
-    void deleteKey( String key )
-        throws KeyManagerException;
-
-    List<AuthenticationKey> getAllKeys();
-
-    AuthenticationKey addKey( AuthenticationKey key );
-
-    void eraseDatabase();
-
-    /**
-     * Remove all keys that are expired.
-     */
-    void removeExpiredKeys()
-        throws KeyManagerException;
-}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManagerException.java b/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyManagerException.java
deleted file mode 100644 (file)
index ed3f0b1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * KeyManagerException 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class KeyManagerException
-    extends Exception
-{
-
-    public KeyManagerException()
-    {
-        super();
-    }
-
-    public KeyManagerException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public KeyManagerException( String message )
-    {
-        super( message );
-    }
-
-    public KeyManagerException( Throwable cause )
-    {
-        super( cause );
-    }
-
-}
diff --git a/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyNotFoundException.java b/redback-keys/redback-keys-api/src/main/java/org/codehaus/plexus/redback/keys/KeyNotFoundException.java
deleted file mode 100644 (file)
index 0a541aa..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Copyright 2001-2006 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.
- */
-
-/**
- * KeyNotFoundException 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class KeyNotFoundException
-    extends KeyManagerException
-{
-    public KeyNotFoundException()
-    {
-        super();
-    }
-
-    public KeyNotFoundException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-    public KeyNotFoundException( String message )
-    {
-        super( message );
-    }
-
-    public KeyNotFoundException( Throwable cause )
-    {
-        super( cause );
-    }
-
-}
diff --git a/redback-keys/redback-keys-api/src/test/java/org/apache/archiva/redback/keys/KeyManagerTest.java b/redback-keys/redback-keys-api/src/test/java/org/apache/archiva/redback/keys/KeyManagerTest.java
new file mode 100644 (file)
index 0000000..56258bd
--- /dev/null
@@ -0,0 +1,98 @@
+package org.apache.archiva.redback.keys;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.util.List;
+
+import junit.framework.TestCase;
+import org.apache.archiva.redback.keys.AbstractKeyManager;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
+
+public class KeyManagerTest
+    extends TestCase
+{
+    private final class AbstractKeyManagerExtension
+        extends AbstractKeyManager
+    {
+        public AuthenticationKey addKey( AuthenticationKey key )
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        public AuthenticationKey createKey( String principal, String purpose, int expirationMinutes )
+            throws KeyManagerException
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        public void deleteKey( AuthenticationKey key )
+            throws KeyManagerException
+        {
+            // TODO Auto-generated method stub
+
+        }
+
+        public void deleteKey( String key )
+            throws KeyManagerException
+        {
+            // TODO Auto-generated method stub
+
+        }
+
+        public void eraseDatabase()
+        {
+            // TODO Auto-generated method stub
+
+        }
+
+        public AuthenticationKey findKey( String key )
+            throws KeyNotFoundException, KeyManagerException
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        public List<AuthenticationKey> getAllKeys()
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        public String getId()
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+    }
+
+    public void testUUID()
+        throws KeyManagerException
+    {
+        AbstractKeyManager manager = new AbstractKeyManagerExtension();
+
+        // verifies we can get the provider after change not to require Sun one
+        assertNotNull( manager.generateUUID() );
+        assertTrue( manager.isRandomMode() );
+    }
+}
diff --git a/redback-keys/redback-keys-api/src/test/java/org/codehaus/plexus/redback/keys/KeyManagerTest.java b/redback-keys/redback-keys-api/src/test/java/org/codehaus/plexus/redback/keys/KeyManagerTest.java
deleted file mode 100644 (file)
index d0946ce..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.codehaus.plexus.redback.keys;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 java.util.List;
-
-import junit.framework.TestCase;
-
-public class KeyManagerTest
-    extends TestCase
-{
-    private final class AbstractKeyManagerExtension
-        extends AbstractKeyManager
-    {
-        public AuthenticationKey addKey( AuthenticationKey key )
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public AuthenticationKey createKey( String principal, String purpose, int expirationMinutes )
-            throws KeyManagerException
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public void deleteKey( AuthenticationKey key )
-            throws KeyManagerException
-        {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void deleteKey( String key )
-            throws KeyManagerException
-        {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void eraseDatabase()
-        {
-            // TODO Auto-generated method stub
-
-        }
-
-        public AuthenticationKey findKey( String key )
-            throws KeyNotFoundException, KeyManagerException
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public List<AuthenticationKey> getAllKeys()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public String getId()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-    }
-
-    public void testUUID()
-        throws KeyManagerException
-    {
-        AbstractKeyManager manager = new AbstractKeyManagerExtension();
-
-        // verifies we can get the provider after change not to require Sun one
-        assertNotNull( manager.generateUUID() );
-        assertTrue( manager.isRandomMode() );
-    }
-}
index 43e8e416d5f4f845caaa8d747c19234f1f19d57a..7c1ea5c97fa2dc6ff1ee4d70d4885d054011361f 100644 (file)
@@ -21,16 +21,15 @@ package org.codehaus.plexus.redback.keys.cached;
 
 import java.util.List;
 
-import javax.annotation.Resource;
 import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.codehaus.plexus.cache.Cache;
-import org.codehaus.plexus.redback.keys.AbstractKeyManager;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManager;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.AbstractKeyManager;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.springframework.stereotype.Service;
 
 /**
index 39c9a92cf75756716de45fa930bfd5b55a44d88b..aaea862892c8682f336d84438b76216bd14e5391 100644 (file)
@@ -20,7 +20,7 @@ package org.codehaus.plexus.redback.keys.cached;
  */
 
 import net.sf.ehcache.CacheManager;
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.keys.KeyManagerTestCase;
 import org.junit.Before;
 
index d159b83dc40615aea517e0a9ef7a0d5e4d0d23a8..3235841c78658b4f3519a50e79aa3f5c5a2f7ab5 100644 (file)
@@ -19,14 +19,14 @@ package org.codehaus.plexus.redback.keys.jdo;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.jdo.JdoFactory;
 import org.codehaus.plexus.jdo.PlexusJdoUtils;
 import org.codehaus.plexus.jdo.PlexusObjectNotFoundException;
 import org.codehaus.plexus.jdo.PlexusStoreException;
-import org.codehaus.plexus.redback.keys.AbstractKeyManager;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.AbstractKeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.util.StringUtils;
 import org.jpox.PersistenceManagerFactoryImpl;
 import org.springframework.stereotype.Service;
index 15557f468f4b1636e4b50b7ff14f897950146641..e0986c0f940ba7be592b230254d4887902409310 100644 (file)
       <name>JdoAuthenticationKey</name>
       <version>1.0.0+</version>
       <interfaces>
-        <interface>org.codehaus.plexus.redback.keys.AuthenticationKey</interface>
+        <interface>org.apache.archiva.redback.keys.AuthenticationKey</interface>
       </interfaces>
       <description>
-        @plexus.component role="org.codehaus.plexus.redback.keys.AuthenticationKey"
+        @plexus.component role="org.apache.archiva.redback.keys.AuthenticationKey"
         role-hint="jdo"
       </description>
       <fields>
index fa7573970244e3fa8ce96067e6faea87e6e222e8..ec6a16de096c345967ad6e2be31043735e472934 100644 (file)
@@ -19,8 +19,8 @@ package org.codehaus.plexus.redback.keys.jdo;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
-import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.keys.KeyManagerTestCase;
 import org.jpox.SchemaTool;
 import org.junit.Before;
index 5690152240e54b31bbc5e5cf25783d0d627c3223..ead07ca59ce975672166689c0044adf1d0f2ede0 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.keys.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.AuthenticationKey;
 
 import java.util.Date;
 
index 3934e588735f7be6b2e804eb46f1a4a6d87d7fc9..4823f8133a7cc991092ea318b8d5ce5f06f478c7 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.plexus.redback.keys.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.keys.AbstractKeyManager;
-import org.codehaus.plexus.redback.keys.AuthenticationKey;
-import org.codehaus.plexus.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.keys.KeyNotFoundException;
+import org.apache.archiva.redback.keys.AbstractKeyManager;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.codehaus.plexus.util.StringUtils;
 import org.springframework.stereotype.Service;
 
index 4459ff4b182b320ab6922f87b848dcd59a044d87..e1a502e036f3242b3516d9c4fdc1caad4aaeaff2 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.plexus.redback.keys.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.keys.KeyManagerTestCase;
 import org.junit.Before;
 
index d2ee02e7408529bd5d761194d65ddfbf0d7b558c..adc3224e88ebfa37813c196cf3482971448481ff 100644 (file)
@@ -17,6 +17,10 @@ package org.codehaus.plexus.redback.keys;
  */
 
 import junit.framework.TestCase;
+import org.apache.archiva.redback.keys.AuthenticationKey;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManagerException;
+import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.test.context.ContextConfiguration;
index 862c66f0531f1695817d433a303c152b2b5a7e5b..553b839ed421c1e6faad8fde4e4075b8a24a7248 100644 (file)
@@ -19,6 +19,7 @@ package org.codehaus.plexus.redback.system;
  * under the License.
  */
 
+import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
@@ -30,7 +31,6 @@ import org.apache.archiva.redback.authorization.AuthorizationDataSource;
 import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.apache.archiva.redback.authorization.AuthorizationResult;
 import org.apache.archiva.redback.authorization.Authorizer;
-import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;
index 13c5b4cecba115e72451ce2acabc327ecade9ec7..4b888c27220acd2f748ff7ea4d3fced1cc855b20 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.redback.authentication.AuthenticationDataSource;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.apache.archiva.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.keys.KeyManager;
+import org.apache.archiva.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.policy.UserSecurityPolicy;