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:
parent
9b5bc72ae7
commit
f0b5140e1a
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ public class CachedUserManager
|
|||
|
||||
public String getId()
|
||||
{
|
||||
return "Cached User Manager [" + this.userImpl.getId() + "]";
|
||||
return "cached";
|
||||
}
|
||||
|
||||
public List<User> getUsers()
|
||||
|
@ -323,4 +323,9 @@ public class CachedUserManager
|
|||
{
|
||||
// no op configurable impl do the job
|
||||
}
|
||||
|
||||
public boolean isFinalImplementation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ public class ConfigurableUserManager
|
|||
|
||||
public String getId()
|
||||
{
|
||||
return ConfigurableUserManager.class.getName() + " wrapping " + userManagerImpl.getId();
|
||||
return "configurable";
|
||||
}
|
||||
|
||||
public List<User> getUsers()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue