org.sonatype.aether.util.repository
Class DefaultMirrorSelector

java.lang.Object
  extended by org.sonatype.aether.util.repository.DefaultMirrorSelector
All Implemented Interfaces:
MirrorSelector

public class DefaultMirrorSelector
extends java.lang.Object
implements MirrorSelector

A simple mirror selector that selects mirrors based on repository identifiers.

Author:
Benjamin Bentmann

Constructor Summary
DefaultMirrorSelector()
           
 
Method Summary
 DefaultMirrorSelector add(java.lang.String id, java.lang.String url, java.lang.String type, boolean repositoryManager, java.lang.String mirrorOfIds, java.lang.String mirrorOfTypes)
          Adds the specified mirror to this selector.
 RemoteRepository getMirror(RemoteRepository repository)
          Selects a mirror for the specified repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMirrorSelector

public DefaultMirrorSelector()
Method Detail

add

public DefaultMirrorSelector add(java.lang.String id,
                                 java.lang.String url,
                                 java.lang.String type,
                                 boolean repositoryManager,
                                 java.lang.String mirrorOfIds,
                                 java.lang.String mirrorOfTypes)
Adds the specified mirror to this selector.

Parameters:
id - The identifier of the mirror, must not be null.
url - The URL of the mirror, must not be null.
type - The content type of the mirror, must not be null.
repositoryManager - A flag whether the mirror is a repository manager or a simple server.
mirrorOfIds - The identifier(s) of remote repositories to mirror, must not be null. Multiple identifiers can be separated by comma and additionally the wildcards "*" and "external:*" can be used to match all (external) repositories, prefixing a repo id with an exclamation mark allows to express an exclusion. For example "external:*,!central".
mirrorOfTypes - The content type(s) of remote repositories to mirror, may be null or empty to match any content type. Similar to the repo id specification, multiple types can be comma-separated, the wildcard "*" and the "!" negation syntax are supported. For example "*,!p2".
Returns:
This selector for chaining, never null.

getMirror

public RemoteRepository getMirror(RemoteRepository repository)
Description copied from interface: MirrorSelector
Selects a mirror for the specified repository.

Specified by:
getMirror in interface MirrorSelector
Parameters:
repository - The repository to select a mirror for, must not be null.
Returns:
The selected mirror or null if none.
See Also:
RemoteRepository.getMirroredRepositories()


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