1 /*******************************************************************************
2 * Copyright (c) 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
.WorkspaceReader
;
27 import org
.eclipse
.aether
.resolution
.ArtifactDescriptorPolicy
;
28 import org
.eclipse
.aether
.resolution
.ResolutionErrorPolicy
;
29 import org
.eclipse
.aether
.transfer
.TransferListener
;
32 * A special repository system session to enable decorating or proxying another session. To do so, clients have to
33 * create a subclass and implement {@link #getSession()}.
35 public abstract class AbstractForwardingRepositorySystemSession
36 implements RepositorySystemSession
40 * Creates a new forwarding session.
42 protected AbstractForwardingRepositorySystemSession()
47 * Gets the repository system session to which this instance forwards calls. It's worth noting that this class does
48 * not save/cache the returned reference but queries this method before each forwarding. Hence, the session
49 * forwarded to may change over time or depending on the context (e.g. calling thread).
51 * @return The repository system session to forward calls to, never {@code null}.
53 protected abstract RepositorySystemSession
getSession();
55 public boolean isOffline()
57 return getSession().isOffline();
60 public boolean isIgnoreArtifactDescriptorRepositories()
62 return getSession().isIgnoreArtifactDescriptorRepositories();
65 public ResolutionErrorPolicy
getResolutionErrorPolicy()
67 return getSession().getResolutionErrorPolicy();
70 public ArtifactDescriptorPolicy
getArtifactDescriptorPolicy()
72 return getSession().getArtifactDescriptorPolicy();
75 public String
getChecksumPolicy()
77 return getSession().getChecksumPolicy();
80 public String
getUpdatePolicy()
82 return getSession().getUpdatePolicy();
85 public LocalRepository
getLocalRepository()
87 return getSession().getLocalRepository();
90 public LocalRepositoryManager
getLocalRepositoryManager()
92 return getSession().getLocalRepositoryManager();
95 public WorkspaceReader
getWorkspaceReader()
97 return getSession().getWorkspaceReader();
100 public RepositoryListener
getRepositoryListener()
102 return getSession().getRepositoryListener();
105 public TransferListener
getTransferListener()
107 return getSession().getTransferListener();
110 public Map
<String
, String
> getSystemProperties()
112 return getSession().getSystemProperties();
115 public Map
<String
, String
> getUserProperties()
117 return getSession().getUserProperties();
120 public Map
<String
, Object
> getConfigProperties()
122 return getSession().getConfigProperties();
125 public MirrorSelector
getMirrorSelector()
127 return getSession().getMirrorSelector();
130 public ProxySelector
getProxySelector()
132 return getSession().getProxySelector();
135 public AuthenticationSelector
getAuthenticationSelector()
137 return getSession().getAuthenticationSelector();
140 public ArtifactTypeRegistry
getArtifactTypeRegistry()
142 return getSession().getArtifactTypeRegistry();
145 public DependencyTraverser
getDependencyTraverser()
147 return getSession().getDependencyTraverser();
150 public DependencyManager
getDependencyManager()
152 return getSession().getDependencyManager();
155 public DependencySelector
getDependencySelector()
157 return getSession().getDependencySelector();
160 public VersionFilter
getVersionFilter()
162 return getSession().getVersionFilter();
165 public DependencyGraphTransformer
getDependencyGraphTransformer()
167 return getSession().getDependencyGraphTransformer();
170 public SessionData
getData()
172 return getSession().getData();
175 public RepositoryCache
getCache()
177 return getSession().getCache();