001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.eclipse.aether.scope;
020
021import java.util.Collection;
022import java.util.Optional;
023
024/**
025 * Scope manager.
026 *
027 * @since 2.0.0
028 *
029 * @noimplement This interface is not intended to be implemented by clients.
030 * @noextend This interface is not intended to be extended by clients.
031 */
032public interface ScopeManager {
033    /**
034     * The label.
035     */
036    String getId();
037
038    /**
039     * Returns the "system" scope, if exists.
040     * <p>
041     * This is a special scope. In this scope case, Resolver should handle it specially, as it has no POM (so is
042     * always a leaf on graph), is not in any repository, but is actually hosted on host OS file system. On resolution
043     * resolver merely checks is file present or not.
044     */
045    Optional<SystemDependencyScope> getSystemDependencyScope();
046
047    /**
048     * Returns a specific dependency scope by label.
049     * <p>
050     * Note: despite returns optional, this method may throw as well, if manager set in "strict" mode.
051     */
052    Optional<DependencyScope> getDependencyScope(String id);
053
054    /**
055     * Returns the "universe" (all) of dependency scopes.
056     */
057    Collection<DependencyScope> getDependencyScopeUniverse();
058
059    /**
060     * Returns a specific resolution scope by label.
061     * <p>
062     * Note: despite returns optional, this method may throw as well, if manager set in "strict" mode.
063     */
064    Optional<ResolutionScope> getResolutionScope(String id);
065
066    /**
067     * Returns the "universe" (all) of resolution scopes.
068     */
069    Collection<ResolutionScope> getResolutionScopeUniverse();
070}