diff --git a/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/AbstractUserManager.java b/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/AbstractUserManager.java index a093b273..7ba96af2 100644 --- a/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/AbstractUserManager.java +++ b/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/AbstractUserManager.java @@ -147,4 +147,9 @@ public abstract class AbstractUserManager // no op prevent sub classes to need implement this method // sub classes can implement their own } + + public boolean isFinalImplementation() + { + return false; + } } diff --git a/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/UserManager.java b/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/UserManager.java index e8afaf06..054a09e6 100644 --- a/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/UserManager.java +++ b/redback-users/redback-users-api/src/main/java/org/apache/archiva/redback/users/UserManager.java @@ -206,4 +206,10 @@ public interface UserManager * @since 2.1 */ void initialize(); + + /** + * @since 2.1 + * @return true if this implementation is a final one and not a wrapper (configurable, cached) + */ + boolean isFinalImplementation(); } diff --git a/redback-users/redback-users-providers/redback-users-cached/src/main/java/org/apache/archiva/redback/users/cached/CachedUserManager.java b/redback-users/redback-users-providers/redback-users-cached/src/main/java/org/apache/archiva/redback/users/cached/CachedUserManager.java index 7c4d4c4f..890841a6 100644 --- a/redback-users/redback-users-providers/redback-users-cached/src/main/java/org/apache/archiva/redback/users/cached/CachedUserManager.java +++ b/redback-users/redback-users-providers/redback-users-cached/src/main/java/org/apache/archiva/redback/users/cached/CachedUserManager.java @@ -204,7 +204,7 @@ public class CachedUserManager public String getId() { - return "Cached User Manager [" + this.userImpl.getId() + "]"; + return "cached"; } public List getUsers() @@ -323,4 +323,9 @@ public class CachedUserManager { // no op configurable impl do the job } + + public boolean isFinalImplementation() + { + return false; + } } 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 index 5d1fb868..54851a89 100644 --- 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 @@ -143,7 +143,7 @@ public class ConfigurableUserManager public String getId() { - return ConfigurableUserManager.class.getName() + " wrapping " + userManagerImpl.getId(); + return "configurable"; } public List getUsers() diff --git a/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java b/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java index c5513921..a334b4d6 100644 --- a/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java +++ b/redback-users/redback-users-providers/redback-users-jdo/src/main/java/org/apache/archiva/redback/users/jdo/JdoUserManager.java @@ -65,7 +65,7 @@ public class JdoUserManager public String getId() { - return "JDO UserManager - " + this.getClass().getName(); + return "jdo"; } @@ -485,4 +485,9 @@ public class JdoUserManager { return userSecurityPolicy; } + + public boolean isFinalImplementation() + { + return true; + } } diff --git a/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserManager.java b/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserManager.java index 8b58508c..8bbd23f5 100644 --- a/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserManager.java +++ b/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/LdapUserManager.java @@ -358,7 +358,7 @@ public class LdapUserManager public String getId() { - return "LDAP User-Manager: " + getClass().getName(); + return "ldap"; } /** @@ -501,4 +501,8 @@ public class LdapUserManager ldapCacheService.removeLdapUserDn( username ); } + public boolean isFinalImplementation() + { + return true; + } } diff --git a/redback-users/redback-users-providers/redback-users-memory/src/main/java/org/apache/archiva/redback/users/memory/MemoryUserManager.java b/redback-users/redback-users-providers/redback-users-memory/src/main/java/org/apache/archiva/redback/users/memory/MemoryUserManager.java index ca7e4a55..3bf7d6ea 100644 --- a/redback-users/redback-users-providers/redback-users-memory/src/main/java/org/apache/archiva/redback/users/memory/MemoryUserManager.java +++ b/redback-users/redback-users-providers/redback-users-memory/src/main/java/org/apache/archiva/redback/users/memory/MemoryUserManager.java @@ -55,25 +55,7 @@ public class MemoryUserManager public String getId() { - Properties props = new Properties(); - URL url = this - .getClass() - .getResource( - "META-INF/maven/org/codehaus/plexus/redback/redback-users-memory/pom.properties" ); - - if ( url != null ) - { - try - { - props.load( url.openStream() ); - return "MemoryUserManager - " + props.getProperty( "version" ); - } - catch ( IOException e ) - { - // Fall thru - } - } - return "MemoryUserManager - (unknown version)"; + return "memory"; } public boolean isReadOnly()