public final class DefaultRepositorySystemSession extends Object implements RepositorySystemSession
Note: This class is not thread-safe. It is assumed that the mutators get only called during an
initialization phase and that the session itself is not changed once initialized and being used by the repository
system. It is recommended to call setReadOnly()
once the session has been fully initialized to prevent
accidental manipulation of it afterwards.
Constructor and Description |
---|
DefaultRepositorySystemSession()
Creates an uninitialized session.
|
DefaultRepositorySystemSession(RepositorySystemSession session)
Creates a shallow copy of the specified session.
|
Modifier and Type | Method and Description |
---|---|
ArtifactDescriptorPolicy |
getArtifactDescriptorPolicy()
Gets the policy which controls how errors related to reading artifact descriptors should be handled.
|
ArtifactTypeRegistry |
getArtifactTypeRegistry()
Gets the registry of artifact types recognized by this session, for instance when processing artifact
descriptors.
|
AuthenticationSelector |
getAuthenticationSelector()
Gets the authentication selector to use for repositories discovered in artifact descriptors.
|
RepositoryCache |
getCache()
Gets the cache the repository system may use to save data for future reuse during the session.
|
String |
getChecksumPolicy()
Gets the global checksum policy.
|
Map<String,Object> |
getConfigProperties()
Gets the configuration properties used to tweak internal aspects of the repository system (e.g.
|
SessionData |
getData()
Gets the custom data associated with this session.
|
DependencyGraphTransformer |
getDependencyGraphTransformer()
Gets the dependency graph transformer to use for building dependency graphs.
|
DependencyManager |
getDependencyManager()
Gets the dependency manager to use for building dependency graphs.
|
DependencySelector |
getDependencySelector()
Gets the dependency selector to use for building dependency graphs.
|
DependencyTraverser |
getDependencyTraverser()
Gets the dependency traverser to use for building dependency graphs.
|
FileTransformerManager |
getFileTransformerManager()
Get the file transformer manager
|
LocalRepository |
getLocalRepository()
Gets the local repository used during this session.
|
LocalRepositoryManager |
getLocalRepositoryManager()
Gets the local repository manager used during this session.
|
MirrorSelector |
getMirrorSelector()
Gets the mirror selector to use for repositories discovered in artifact descriptors.
|
ProxySelector |
getProxySelector()
Gets the proxy selector to use for repositories discovered in artifact descriptors.
|
RepositoryListener |
getRepositoryListener()
Gets the listener being notified of actions in the repository system.
|
ResolutionErrorPolicy |
getResolutionErrorPolicy()
Gets the policy which controls whether resolutions errors from remote repositories should be cached.
|
Map<String,String> |
getSystemProperties()
Gets the system properties to use, e.g.
|
TransferListener |
getTransferListener()
Gets the listener being notified of uploads/downloads by the repository system.
|
String |
getUpdatePolicy()
Gets the global update policy.
|
Map<String,String> |
getUserProperties()
Gets the user properties to use, e.g.
|
VersionFilter |
getVersionFilter()
Gets the version filter to use for building dependency graphs.
|
WorkspaceReader |
getWorkspaceReader()
Gets the workspace reader used during this session.
|
boolean |
isIgnoreArtifactDescriptorRepositories()
Indicates whether repositories declared in artifact descriptors should be ignored during transitive dependency
collection.
|
boolean |
isOffline()
Indicates whether the repository system operates in offline mode and avoids/refuses any access to remote
repositories.
|
DefaultRepositorySystemSession |
setArtifactDescriptorPolicy(ArtifactDescriptorPolicy artifactDescriptorPolicy)
Sets the policy which controls how errors related to reading artifact descriptors should be handled.
|
DefaultRepositorySystemSession |
setArtifactTypeRegistry(ArtifactTypeRegistry artifactTypeRegistry)
Sets the registry of artifact types recognized by this session.
|
DefaultRepositorySystemSession |
setAuthenticationSelector(AuthenticationSelector authenticationSelector)
Sets the authentication selector to use for repositories discovered in artifact descriptors.
|
DefaultRepositorySystemSession |
setCache(RepositoryCache cache)
Sets the cache the repository system may use to save data for future reuse during the session.
|
DefaultRepositorySystemSession |
setChecksumPolicy(String checksumPolicy)
Sets the global checksum policy.
|
DefaultRepositorySystemSession |
setConfigProperties(Map<?,?> configProperties)
Sets the configuration properties used to tweak internal aspects of the repository system (e.g.
|
DefaultRepositorySystemSession |
setConfigProperty(String key,
Object value)
Sets the specified configuration property.
|
DefaultRepositorySystemSession |
setData(SessionData data)
Sets the custom data associated with this session.
|
DefaultRepositorySystemSession |
setDependencyGraphTransformer(DependencyGraphTransformer dependencyGraphTransformer)
Sets the dependency graph transformer to use for building dependency graphs.
|
DefaultRepositorySystemSession |
setDependencyManager(DependencyManager dependencyManager)
Sets the dependency manager to use for building dependency graphs.
|
DefaultRepositorySystemSession |
setDependencySelector(DependencySelector dependencySelector)
Sets the dependency selector to use for building dependency graphs.
|
DefaultRepositorySystemSession |
setDependencyTraverser(DependencyTraverser dependencyTraverser)
Sets the dependency traverser to use for building dependency graphs.
|
DefaultRepositorySystemSession |
setFileTransformerManager(FileTransformerManager fileTransformerManager) |
DefaultRepositorySystemSession |
setIgnoreArtifactDescriptorRepositories(boolean ignoreArtifactDescriptorRepositories)
Controls whether repositories declared in artifact descriptors should be ignored during transitive dependency
collection.
|
DefaultRepositorySystemSession |
setLocalRepositoryManager(LocalRepositoryManager localRepositoryManager)
Sets the local repository manager used during this session.
|
DefaultRepositorySystemSession |
setMirrorSelector(MirrorSelector mirrorSelector)
Sets the mirror selector to use for repositories discovered in artifact descriptors.
|
DefaultRepositorySystemSession |
setOffline(boolean offline)
Controls whether the repository system operates in offline mode and avoids/refuses any access to remote
repositories.
|
DefaultRepositorySystemSession |
setProxySelector(ProxySelector proxySelector)
Sets the proxy selector to use for repositories discovered in artifact descriptors.
|
void |
setReadOnly()
Marks this session as read-only such that any future attempts to call its mutators will fail with an exception.
|
DefaultRepositorySystemSession |
setRepositoryListener(RepositoryListener repositoryListener)
Sets the listener being notified of actions in the repository system.
|
DefaultRepositorySystemSession |
setResolutionErrorPolicy(ResolutionErrorPolicy resolutionErrorPolicy)
Sets the policy which controls whether resolutions errors from remote repositories should be cached.
|
DefaultRepositorySystemSession |
setSystemProperties(Map<?,?> systemProperties)
Sets the system properties to use, e.g.
|
DefaultRepositorySystemSession |
setSystemProperty(String key,
String value)
Sets the specified system property.
|
DefaultRepositorySystemSession |
setTransferListener(TransferListener transferListener)
Sets the listener being notified of uploads/downloads by the repository system.
|
DefaultRepositorySystemSession |
setUpdatePolicy(String updatePolicy)
Sets the global update policy.
|
DefaultRepositorySystemSession |
setUserProperties(Map<?,?> userProperties)
Sets the user properties to use, e.g.
|
DefaultRepositorySystemSession |
setUserProperty(String key,
String value)
Sets the specified user property.
|
DefaultRepositorySystemSession |
setVersionFilter(VersionFilter versionFilter)
Sets the version filter to use for building dependency graphs.
|
DefaultRepositorySystemSession |
setWorkspaceReader(WorkspaceReader workspaceReader)
Sets the workspace reader used during this session.
|
public DefaultRepositorySystemSession()
setLocalRepositoryManager(LocalRepositoryManager)
needs to be called but usually other settings also
need to be customized to achieve meaningful behavior.public DefaultRepositorySystemSession(RepositorySystemSession session)
session
- The session to copy, must not be null
.public boolean isOffline()
RepositorySystemSession
isOffline
in interface RepositorySystemSession
true
if the repository system is in offline mode, false
otherwise.public DefaultRepositorySystemSession setOffline(boolean offline)
offline
- true
if the repository system is in offline mode, false
otherwise.null
.public boolean isIgnoreArtifactDescriptorRepositories()
RepositorySystemSession
isIgnoreArtifactDescriptorRepositories
in interface RepositorySystemSession
true
if additional repositories from artifact descriptors are ignored, false
to merge
those with the originally specified repositories.public DefaultRepositorySystemSession setIgnoreArtifactDescriptorRepositories(boolean ignoreArtifactDescriptorRepositories)
ignoreArtifactDescriptorRepositories
- true
to ignore additional repositories from artifact
descriptors, false
to merge those with the originally specified repositories.null
.public ResolutionErrorPolicy getResolutionErrorPolicy()
RepositorySystemSession
getResolutionErrorPolicy
in interface RepositorySystemSession
null
if resolution errors should generally not be
cached.public DefaultRepositorySystemSession setResolutionErrorPolicy(ResolutionErrorPolicy resolutionErrorPolicy)
resolutionErrorPolicy
- The resolution error policy for this session, may be null
if resolution
errors should generally not be cached.null
.public ArtifactDescriptorPolicy getArtifactDescriptorPolicy()
RepositorySystemSession
getArtifactDescriptorPolicy
in interface RepositorySystemSession
null
if descriptor errors should generally not be
tolerated.public DefaultRepositorySystemSession setArtifactDescriptorPolicy(ArtifactDescriptorPolicy artifactDescriptorPolicy)
artifactDescriptorPolicy
- The descriptor error policy for this session, may be null
if descriptor
errors should generally not be tolerated.null
.public String getChecksumPolicy()
RepositorySystemSession
getChecksumPolicy
in interface RepositorySystemSession
null
/empty if not set and the per-repository policies apply.RepositoryPolicy.CHECKSUM_POLICY_FAIL
,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE
,
RepositoryPolicy.CHECKSUM_POLICY_WARN
public DefaultRepositorySystemSession setChecksumPolicy(String checksumPolicy)
checksumPolicy
- The global checksum policy, may be null
/empty to apply the per-repository policies.null
.RepositoryPolicy.CHECKSUM_POLICY_FAIL
,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE
,
RepositoryPolicy.CHECKSUM_POLICY_WARN
public String getUpdatePolicy()
RepositorySystemSession
getUpdatePolicy
in interface RepositorySystemSession
null
/empty if not set and the per-repository policies apply.RepositoryPolicy.UPDATE_POLICY_ALWAYS
,
RepositoryPolicy.UPDATE_POLICY_DAILY
,
RepositoryPolicy.UPDATE_POLICY_NEVER
public DefaultRepositorySystemSession setUpdatePolicy(String updatePolicy)
updatePolicy
- The global update policy, may be null
/empty to apply the per-repository policies.null
.RepositoryPolicy.UPDATE_POLICY_ALWAYS
,
RepositoryPolicy.UPDATE_POLICY_DAILY
,
RepositoryPolicy.UPDATE_POLICY_NEVER
public LocalRepository getLocalRepository()
RepositorySystemSession
LocalRepositoryManager.getRepository()
.getLocalRepository
in interface RepositorySystemSession
null
.public LocalRepositoryManager getLocalRepositoryManager()
RepositorySystemSession
getLocalRepositoryManager
in interface RepositorySystemSession
null
.public DefaultRepositorySystemSession setLocalRepositoryManager(LocalRepositoryManager localRepositoryManager)
localRepositoryManager
- The local repository manager used during this session, may be null
.null
.public FileTransformerManager getFileTransformerManager()
RepositorySystemSession
getFileTransformerManager
in interface RepositorySystemSession
null
public DefaultRepositorySystemSession setFileTransformerManager(FileTransformerManager fileTransformerManager)
public WorkspaceReader getWorkspaceReader()
RepositorySystemSession
getWorkspaceReader
in interface RepositorySystemSession
null
if none.public DefaultRepositorySystemSession setWorkspaceReader(WorkspaceReader workspaceReader)
workspaceReader
- The workspace reader for this session, may be null
if none.null
.public RepositoryListener getRepositoryListener()
RepositorySystemSession
getRepositoryListener
in interface RepositorySystemSession
null
if none.public DefaultRepositorySystemSession setRepositoryListener(RepositoryListener repositoryListener)
repositoryListener
- The repository listener, may be null
if none.null
.public TransferListener getTransferListener()
RepositorySystemSession
getTransferListener
in interface RepositorySystemSession
null
if none.public DefaultRepositorySystemSession setTransferListener(TransferListener transferListener)
transferListener
- The transfer listener, may be null
if none.null
.public Map<String,String> getSystemProperties()
RepositorySystemSession
System.getProperties()
and environment variables.getSystemProperties
in interface RepositorySystemSession
null
.public DefaultRepositorySystemSession setSystemProperties(Map<?,?> systemProperties)
System.getProperties()
and environment variables.
Note: System properties are of type Map<String, String>
and any key-value pair in the input map
that doesn't match this type will be silently ignored.
systemProperties
- The system properties, may be null
or empty if none.null
.public DefaultRepositorySystemSession setSystemProperty(String key, String value)
key
- The property key, must not be null
.value
- The property value, may be null
to remove/unset the property.null
.public Map<String,String> getUserProperties()
RepositorySystemSession
getUserProperties
in interface RepositorySystemSession
null
.public DefaultRepositorySystemSession setUserProperties(Map<?,?> userProperties)
Note: User properties are of type Map<String, String>
and any key-value pair in the input map
that doesn't match this type will be silently ignored.
userProperties
- The user properties, may be null
or empty if none.null
.public DefaultRepositorySystemSession setUserProperty(String key, String value)
key
- The property key, must not be null
.value
- The property value, may be null
to remove/unset the property.null
.public Map<String,Object> getConfigProperties()
RepositorySystemSession
getConfigProperties
in interface RepositorySystemSession
null
.ConfigurationProperties
public DefaultRepositorySystemSession setConfigProperties(Map<?,?> configProperties)
Note: Configuration properties are of type Map<String, Object>
and any key-value pair in the
input map that doesn't match this type will be silently ignored.
configProperties
- The configuration properties, may be null
or empty if none.null
.public DefaultRepositorySystemSession setConfigProperty(String key, Object value)
key
- The property key, must not be null
.value
- The property value, may be null
to remove/unset the property.null
.public MirrorSelector getMirrorSelector()
RepositorySystemSession
getMirrorSelector
in interface RepositorySystemSession
null
.RepositorySystem.newResolutionRepositories(RepositorySystemSession, java.util.List)
public DefaultRepositorySystemSession setMirrorSelector(MirrorSelector mirrorSelector)
mirrorSelector
- The mirror selector to use, may be null
.null
.public ProxySelector getProxySelector()
RepositorySystemSession
getProxySelector
in interface RepositorySystemSession
null
.RemoteRepository.getProxy()
,
RepositorySystem.newResolutionRepositories(RepositorySystemSession, java.util.List)
public DefaultRepositorySystemSession setProxySelector(ProxySelector proxySelector)
proxySelector
- The proxy selector to use, may be null
.null
.RemoteRepository.getProxy()
public AuthenticationSelector getAuthenticationSelector()
RepositorySystemSession
getAuthenticationSelector
in interface RepositorySystemSession
null
.RemoteRepository.getAuthentication()
,
RepositorySystem.newResolutionRepositories(RepositorySystemSession, java.util.List)
public DefaultRepositorySystemSession setAuthenticationSelector(AuthenticationSelector authenticationSelector)
authenticationSelector
- The authentication selector to use, may be null
.null
.RemoteRepository.getAuthentication()
public ArtifactTypeRegistry getArtifactTypeRegistry()
RepositorySystemSession
getArtifactTypeRegistry
in interface RepositorySystemSession
null
.public DefaultRepositorySystemSession setArtifactTypeRegistry(ArtifactTypeRegistry artifactTypeRegistry)
artifactTypeRegistry
- The artifact type registry, may be null
.null
.public DependencyTraverser getDependencyTraverser()
RepositorySystemSession
getDependencyTraverser
in interface RepositorySystemSession
null
if dependencies are
unconditionally traversed.public DefaultRepositorySystemSession setDependencyTraverser(DependencyTraverser dependencyTraverser)
dependencyTraverser
- The dependency traverser to use for building dependency graphs, may be null
.null
.public DependencyManager getDependencyManager()
RepositorySystemSession
getDependencyManager
in interface RepositorySystemSession
null
if dependency management is
not performed.public DefaultRepositorySystemSession setDependencyManager(DependencyManager dependencyManager)
dependencyManager
- The dependency manager to use for building dependency graphs, may be null
.null
.public DependencySelector getDependencySelector()
RepositorySystemSession
getDependencySelector
in interface RepositorySystemSession
null
if dependencies are
unconditionally included.public DefaultRepositorySystemSession setDependencySelector(DependencySelector dependencySelector)
dependencySelector
- The dependency selector to use for building dependency graphs, may be null
.null
.public VersionFilter getVersionFilter()
RepositorySystemSession
getVersionFilter
in interface RepositorySystemSession
null
if versions aren't filtered.public DefaultRepositorySystemSession setVersionFilter(VersionFilter versionFilter)
versionFilter
- The version filter to use for building dependency graphs, may be null
to not filter
versions.null
.public DependencyGraphTransformer getDependencyGraphTransformer()
RepositorySystemSession
getDependencyGraphTransformer
in interface RepositorySystemSession
null
if none.public DefaultRepositorySystemSession setDependencyGraphTransformer(DependencyGraphTransformer dependencyGraphTransformer)
dependencyGraphTransformer
- The dependency graph transformer to use for building dependency graphs, may be
null
.null
.public SessionData getData()
RepositorySystemSession
getData
in interface RepositorySystemSession
null
.public DefaultRepositorySystemSession setData(SessionData data)
data
- The session data, may be null
.null
.public RepositoryCache getCache()
RepositorySystemSession
getCache
in interface RepositorySystemSession
null
if none.public DefaultRepositorySystemSession setCache(RepositoryCache cache)
cache
- The repository cache, may be null
if none.null
.public void setReadOnly()
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.