public final class DefaultMirrorSelector extends Object implements MirrorSelector
Constructor and Description |
---|
DefaultMirrorSelector() |
Modifier and Type | Method and Description |
---|---|
DefaultMirrorSelector |
add(String id,
String url,
String type,
boolean repositoryManager,
String mirrorOfIds,
String mirrorOfTypes)
Adds the specified mirror to this selector.
|
RemoteRepository |
getMirror(RemoteRepository repository)
Selects a mirror for the specified repository.
|
public DefaultMirrorSelector()
public DefaultMirrorSelector add(String id, String url, String type, boolean repositoryManager, String mirrorOfIds, String mirrorOfTypes)
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".null
.public RemoteRepository getMirror(RemoteRepository repository)
MirrorSelector
getMirror
in interface MirrorSelector
repository
- The repository to select a mirror for, must not be null
.null
if none.RemoteRepository.getMirroredRepositories()
Copyright © 2010–2018 The Apache Software Foundation. All rights reserved.