001package org.eclipse.aether.impl;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 * 
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 * 
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.eclipse.aether.RepositorySystem;
023import org.eclipse.aether.RepositorySystemSession;
024import org.eclipse.aether.resolution.VersionRangeRequest;
025import org.eclipse.aether.resolution.VersionRangeResolutionException;
026import org.eclipse.aether.resolution.VersionRangeResult;
027
028/**
029 * Parses and evaluates version ranges encountered in dependency declarations.
030 * 
031 * @provisional This type is provisional and can be changed, moved or removed without prior notice.
032 */
033public interface VersionRangeResolver
034{
035
036    /**
037     * Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to
038     * "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their
039     * contents, the list is not processed by the {@link RepositorySystemSession#getVersionFilter() session's version
040     * filter}.
041     * <p>
042     * The supplied request may also refer to a single concrete version rather than a version range. In this case
043     * though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.
044     * 
045     * @param session The repository session, must not be {@code null}.
046     * @param request The version range request, must not be {@code null}.
047     * @return The version range result, never {@code null}.
048     * @throws VersionRangeResolutionException If the requested range could not be parsed. Note that an empty range does
049     *             not raise an exception.
050     * @see RepositorySystem#resolveVersionRange(RepositorySystemSession, VersionRangeRequest)
051     */
052    VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request )
053        throws VersionRangeResolutionException;
054
055}