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.eclipse.aether.spi.version; 20 21 import java.util.Map; 22 23 import org.eclipse.aether.RepositorySystemSession; 24 import org.eclipse.aether.version.VersionScheme; 25 26 /** 27 * Selects a version scheme from the installed version schemes. 28 * 29 * @noimplement This interface is not intended to be implemented by clients. 30 * @noextend This interface is not intended to be extended by clients. 31 * @since 2.0.0 32 */ 33 public interface VersionSchemeSelector { 34 /** 35 * Tries to select a version scheme from the specified scheme name. 36 * 37 * @param schemeName The schemeName to select scheme for, must not be {@code null}. 38 * @return The scheme selected, never {@code null}. 39 * @throws IllegalArgumentException if asked scheme name is not supported. 40 * @throws NullPointerException if passed in names is {@code null}. 41 */ 42 VersionScheme selectVersionScheme(String schemeName); 43 44 /** 45 * Tries to select a version scheme from the specified scheme name. 46 * 47 * @param session The repository system session from which to configure the scheme, must not be {@code null}. 48 * @return The scheme selected, never {@code null}. 49 * @throws IllegalArgumentException If none of the installed schemes cannot be selected. 50 * @throws NullPointerException if passed in session is {@code null}. 51 */ 52 VersionScheme selectVersionScheme(RepositorySystemSession session); 53 54 /** 55 * Returns immutable map of all supported version schemes (maps scheme name to scheme instance). This represents 56 * ALL the schemes supported by Resolver, either provided out of the box, or extension installed. 57 */ 58 Map<String, VersionScheme> getVersionSchemes(); 59 }