org.sonatype.aether.util.repository
Class ConservativeAuthenticationSelector

java.lang.Object
  extended by org.sonatype.aether.util.repository.ConservativeAuthenticationSelector
All Implemented Interfaces:
AuthenticationSelector

public class ConservativeAuthenticationSelector
extends java.lang.Object
implements AuthenticationSelector

An authentication selector that delegates to another selector but only if a repository has no authentication data yet. If authentication has already been assigned to a repository, that is selected.

Author:
Benjamin Bentmann

Constructor Summary
ConservativeAuthenticationSelector(AuthenticationSelector selector)
          Creates a new selector that delegates to the specified selector.
 
Method Summary
 Authentication getAuthentication(RemoteRepository repository)
          Selects authentication for the specified remote repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConservativeAuthenticationSelector

public ConservativeAuthenticationSelector(AuthenticationSelector selector)
Creates a new selector that delegates to the specified selector.

Parameters:
selector - The selector to delegate to in case a repository has no authentication yet, must not be null.
Method Detail

getAuthentication

public Authentication getAuthentication(RemoteRepository repository)
Description copied from interface: AuthenticationSelector
Selects authentication for the specified remote repository.

Specified by:
getAuthentication in interface AuthenticationSelector
Parameters:
repository - The repository for which to select authentication, must not be null.
Returns:
The selected authentication or null if none.


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.