1 /*******************************************************************************
2 * Copyright (c) 2010, 2013 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
;
15 import org
.eclipse
.aether
.artifact
.ArtifactTypeRegistry
;
16 import org
.eclipse
.aether
.collection
.DependencyGraphTransformer
;
17 import org
.eclipse
.aether
.collection
.DependencyManager
;
18 import org
.eclipse
.aether
.collection
.DependencySelector
;
19 import org
.eclipse
.aether
.collection
.DependencyTraverser
;
20 import org
.eclipse
.aether
.collection
.VersionFilter
;
21 import org
.eclipse
.aether
.repository
.AuthenticationSelector
;
22 import org
.eclipse
.aether
.repository
.LocalRepository
;
23 import org
.eclipse
.aether
.repository
.LocalRepositoryManager
;
24 import org
.eclipse
.aether
.repository
.MirrorSelector
;
25 import org
.eclipse
.aether
.repository
.ProxySelector
;
26 import org
.eclipse
.aether
.repository
.RepositoryPolicy
;
27 import org
.eclipse
.aether
.repository
.WorkspaceReader
;
28 import org
.eclipse
.aether
.resolution
.ArtifactDescriptorPolicy
;
29 import org
.eclipse
.aether
.resolution
.ResolutionErrorPolicy
;
30 import org
.eclipse
.aether
.transfer
.TransferListener
;
33 * Defines settings and components that control the repository system. Once initialized, the session object itself is
34 * supposed to be immutable and hence can safely be shared across an entire application and any concurrent threads
35 * reading it. Components that wish to tweak some aspects of an existing session should use the copy constructor of
36 * {@link DefaultRepositorySystemSession} and its mutators to derive a custom session.
38 * @noimplement This interface is not intended to be implemented by clients.
39 * @noextend This interface is not intended to be extended by clients.
41 public interface RepositorySystemSession
45 * Indicates whether the repository system operates in offline mode and avoids/refuses any access to remote
48 * @return {@code true} if the repository system is in offline mode, {@code false} otherwise.
53 * Indicates whether repositories declared in artifact descriptors should be ignored during transitive dependency
54 * collection. If enabled, only the repositories originally provided with the collect request will be considered.
56 * @return {@code true} if additional repositories from artifact descriptors are ignored, {@code false} to merge
57 * those with the originally specified repositories.
59 boolean isIgnoreArtifactDescriptorRepositories();
62 * Gets the policy which controls whether resolutions errors from remote repositories should be cached.
64 * @return The resolution error policy for this session or {@code null} if resolution errors should generally not be
67 ResolutionErrorPolicy
getResolutionErrorPolicy();
70 * Gets the policy which controls how errors related to reading artifact descriptors should be handled.
72 * @return The descriptor error policy for this session or {@code null} if descriptor errors should generally not be
75 ArtifactDescriptorPolicy
getArtifactDescriptorPolicy();
78 * Gets the global checksum policy. If set, the global checksum policy overrides the checksum policies of the remote
79 * repositories being used for resolution.
81 * @return The global checksum policy or {@code null}/empty if not set and the per-repository policies apply.
82 * @see RepositoryPolicy#CHECKSUM_POLICY_FAIL
83 * @see RepositoryPolicy#CHECKSUM_POLICY_IGNORE
84 * @see RepositoryPolicy#CHECKSUM_POLICY_WARN
86 String
getChecksumPolicy();
89 * Gets the global update policy. If set, the global update policy overrides the update policies of the remote
90 * repositories being used for resolution.
92 * @return The global update policy or {@code null}/empty if not set and the per-repository policies apply.
93 * @see RepositoryPolicy#UPDATE_POLICY_ALWAYS
94 * @see RepositoryPolicy#UPDATE_POLICY_DAILY
95 * @see RepositoryPolicy#UPDATE_POLICY_NEVER
97 String
getUpdatePolicy();
100 * Gets the local repository used during this session. This is a convenience method for
101 * {@link LocalRepositoryManager#getRepository()}.
103 * @return The local repository being during this session, never {@code null}.
105 LocalRepository
getLocalRepository();
108 * Gets the local repository manager used during this session.
110 * @return The local repository manager used during this session, never {@code null}.
112 LocalRepositoryManager
getLocalRepositoryManager();
115 * Gets the workspace reader used during this session. If set, the workspace reader will usually be consulted first
116 * to resolve artifacts.
118 * @return The workspace reader for this session or {@code null} if none.
120 WorkspaceReader
getWorkspaceReader();
123 * Gets the listener being notified of actions in the repository system.
125 * @return The repository listener or {@code null} if none.
127 RepositoryListener
getRepositoryListener();
130 * Gets the listener being notified of uploads/downloads by the repository system.
132 * @return The transfer listener or {@code null} if none.
134 TransferListener
getTransferListener();
137 * Gets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually
138 * collected from the runtime environment like {@link System#getProperties()} and environment variables.
140 * @return The (read-only) system properties, never {@code null}.
142 Map
<String
, String
> getSystemProperties();
145 * Gets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to
146 * system properties but are set on the discretion of the user and hence are considered of higher priority than
149 * @return The (read-only) user properties, never {@code null}.
151 Map
<String
, String
> getUserProperties();
154 * Gets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling,
155 * connector-specific behavior, etc.)
157 * @return The (read-only) configuration properties, never {@code null}.
158 * @see ConfigurationProperties
160 Map
<String
, Object
> getConfigProperties();
163 * Gets the mirror selector to use for repositories discovered in artifact descriptors. Note that this selector is
164 * not used for remote repositories which are passed as request parameters to the repository system, those
165 * repositories are supposed to denote the effective repositories.
167 * @return The mirror selector to use, never {@code null}.
168 * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
170 MirrorSelector
getMirrorSelector();
173 * Gets the proxy selector to use for repositories discovered in artifact descriptors. Note that this selector is
174 * not used for remote repositories which are passed as request parameters to the repository system, those
175 * repositories are supposed to have their proxy (if any) already set.
177 * @return The proxy selector to use, never {@code null}.
178 * @see org.eclipse.aether.repository.RemoteRepository#getProxy()
179 * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
181 ProxySelector
getProxySelector();
184 * Gets the authentication selector to use for repositories discovered in artifact descriptors. Note that this
185 * selector is not used for remote repositories which are passed as request parameters to the repository system,
186 * those repositories are supposed to have their authentication (if any) already set.
188 * @return The authentication selector to use, never {@code null}.
189 * @see org.eclipse.aether.repository.RemoteRepository#getAuthentication()
190 * @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
192 AuthenticationSelector
getAuthenticationSelector();
195 * Gets the registry of artifact types recognized by this session, for instance when processing artifact
198 * @return The artifact type registry, never {@code null}.
200 ArtifactTypeRegistry
getArtifactTypeRegistry();
203 * Gets the dependency traverser to use for building dependency graphs.
205 * @return The dependency traverser to use for building dependency graphs or {@code null} if dependencies are
206 * unconditionally traversed.
208 DependencyTraverser
getDependencyTraverser();
211 * Gets the dependency manager to use for building dependency graphs.
213 * @return The dependency manager to use for building dependency graphs or {@code null} if dependency management is
216 DependencyManager
getDependencyManager();
219 * Gets the dependency selector to use for building dependency graphs.
221 * @return The dependency selector to use for building dependency graphs or {@code null} if dependencies are
222 * unconditionally included.
224 DependencySelector
getDependencySelector();
227 * Gets the version filter to use for building dependency graphs.
229 * @return The version filter to use for building dependency graphs or {@code null} if versions aren't filtered.
231 VersionFilter
getVersionFilter();
234 * Gets the dependency graph transformer to use for building dependency graphs.
236 * @return The dependency graph transformer to use for building dependency graphs or {@code null} if none.
238 DependencyGraphTransformer
getDependencyGraphTransformer();
241 * Gets the custom data associated with this session.
243 * @return The session data, never {@code null}.
245 SessionData
getData();
248 * Gets the cache the repository system may use to save data for future reuse during the session.
250 * @return The repository cache or {@code null} if none.
252 RepositoryCache
getCache();