1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.resolver.internal.ant.types;
20
21 import java.util.List;
22
23 import org.apache.tools.ant.Task;
24
25 /**
26 * Common interface for Ant data types that hold one or more {@link RemoteRepository} definitions.
27 * <p>
28 * This abstraction allows reuse of repository containers across tasks such as
29 * dependency resolution, deployment, and installation.
30 * </p>
31 *
32 * <h2>Typical Implementations:</h2>
33 * <ul>
34 * <li>{@link RemoteRepository} — represents a single remote repository</li>
35 * <li>{@link RemoteRepositories} — represents a collection of repositories</li>
36 * </ul>
37 *
38 * <p>
39 * Implementing classes must support validation and retrieval of all contained {@link RemoteRepository} instances.
40 * </p>
41 *
42 * @see RemoteRepository
43 * @see RemoteRepositories
44 */
45 public interface RemoteRepositoryContainer {
46
47 /**
48 * Validates the repository configuration in the context of the given Ant task.
49 *
50 * @param task the Ant task requesting validation (typically for logging or error reporting)
51 * @throws org.apache.tools.ant.BuildException if the configuration is invalid
52 */
53 void validate(Task task);
54
55 /**
56 * Returns the list of remote repositories represented by this container.
57 *
58 * @return list of {@link RemoteRepository} objects; never {@code null}
59 */
60 List<RemoteRepository> getRepositories();
61 }