import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.redback.common.ldap.connection.ConfigurableLdapConnectionFactory;
import org.apache.archiva.redback.common.ldap.connection.LdapConnectionConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
extends ConfigurableLdapConnectionFactory
{
+ private final Logger log = LoggerFactory.getLogger(ArchivaLdapConnectionFactory.class);
+
+ private boolean valid = false;
+
@Inject
private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
ldapConnectionConfiguration.setPassword( ldapConfiguration.getPassword() );
ldapConnectionConfiguration.setAuthenticationMethod( ldapConfiguration.getAuthenticationMethod() );
ldapConnectionConfiguration.setExtraProperties( toProperties( ldapConfiguration.getExtraProperties() ) );
+ valid=true;
}
catch ( InvalidNameException e )
{
- throw new RuntimeException( "Error while initializing connection factory.", e );
+ log.error("Error during initialization of LdapConnectionFactory "+e.getMessage(),e);
+ // throw new RuntimeException( "Error while initializing connection factory.", e );
}
catch ( RepositoryAdminException e )
{
{
this.ldapConnectionConfiguration = ldapConnectionConfiguration;
}
+
+ @Override
+ public boolean isValid() {
+ return valid;
+ }
}
private List<UserManager> userManagers;
+ private boolean valid = false;
+
@PostConstruct
@Override
public void initialize()
{
userManagers.add( applicationContext.getBean( "userManager#" + beanId, UserManager.class ) );
}
+ valid=true;
}
catch ( RepositoryAdminException e )
{
- throw new AuthenticationException( e.getMessage(), e );
+ log.error("Error during repository initialization "+e.getMessage(),e);
+ // throw new AuthenticationException( e.getMessage(), e );
}
}
{
return "ArchivaUserManagerAuthenticator";
}
+
+ public boolean isValid() {
+ return valid;
+ }
}