return real bean id and add a flag to say if users can choose this implementation or not

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1413018 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-11-23 18:32:55 +00:00
parent 9b5bc72ae7
commit f0b5140e1a
7 changed files with 30 additions and 23 deletions

View File

@ -147,4 +147,9 @@ public abstract class AbstractUserManager
// no op prevent sub classes to need implement this method // no op prevent sub classes to need implement this method
// sub classes can implement their own // sub classes can implement their own
} }
public boolean isFinalImplementation()
{
return false;
}
} }

View File

@ -206,4 +206,10 @@ public interface UserManager
* @since 2.1 * @since 2.1
*/ */
void initialize(); void initialize();
/**
* @since 2.1
* @return true if this implementation is a final one and not a wrapper (configurable, cached)
*/
boolean isFinalImplementation();
} }

View File

@ -204,7 +204,7 @@ public class CachedUserManager
public String getId() public String getId()
{ {
return "Cached User Manager [" + this.userImpl.getId() + "]"; return "cached";
} }
public List<User> getUsers() public List<User> getUsers()
@ -323,4 +323,9 @@ public class CachedUserManager
{ {
// no op configurable impl do the job // no op configurable impl do the job
} }
public boolean isFinalImplementation()
{
return false;
}
} }

View File

@ -143,7 +143,7 @@ public class ConfigurableUserManager
public String getId() public String getId()
{ {
return ConfigurableUserManager.class.getName() + " wrapping " + userManagerImpl.getId(); return "configurable";
} }
public List<User> getUsers() public List<User> getUsers()

View File

@ -65,7 +65,7 @@ public class JdoUserManager
public String getId() public String getId()
{ {
return "JDO UserManager - " + this.getClass().getName(); return "jdo";
} }
@ -485,4 +485,9 @@ public class JdoUserManager
{ {
return userSecurityPolicy; return userSecurityPolicy;
} }
public boolean isFinalImplementation()
{
return true;
}
} }

View File

@ -358,7 +358,7 @@ public class LdapUserManager
public String getId() public String getId()
{ {
return "LDAP User-Manager: " + getClass().getName(); return "ldap";
} }
/** /**
@ -501,4 +501,8 @@ public class LdapUserManager
ldapCacheService.removeLdapUserDn( username ); ldapCacheService.removeLdapUserDn( username );
} }
public boolean isFinalImplementation()
{
return true;
}
} }

View File

@ -55,25 +55,7 @@ public class MemoryUserManager
public String getId() public String getId()
{ {
Properties props = new Properties(); return "memory";
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)";
} }
public boolean isReadOnly() public boolean isReadOnly()