Interface RepositorySystemSession

    • Method Detail

      • isOffline

        boolean isOffline()
        Indicates whether the repository system operates in offline mode and avoids/refuses any access to remote repositories.
        Returns:
        true if the repository system is in offline mode, false otherwise.
      • isIgnoreArtifactDescriptorRepositories

        boolean isIgnoreArtifactDescriptorRepositories()
        Indicates whether repositories declared in artifact descriptors should be ignored during transitive dependency collection. If enabled, only the repositories originally provided with the collect request will be considered.
        Returns:
        true if additional repositories from artifact descriptors are ignored, false to merge those with the originally specified repositories.
      • getResolutionErrorPolicy

        ResolutionErrorPolicy getResolutionErrorPolicy()
        Gets the policy which controls whether resolutions errors from remote repositories should be cached.
        Returns:
        The resolution error policy for this session or null if resolution errors should generally not be cached.
      • getArtifactDescriptorPolicy

        ArtifactDescriptorPolicy getArtifactDescriptorPolicy()
        Gets the policy which controls how errors related to reading artifact descriptors should be handled.
        Returns:
        The descriptor error policy for this session or null if descriptor errors should generally not be tolerated.
      • getWorkspaceReader

        WorkspaceReader getWorkspaceReader()
        Gets the workspace reader used during this session. If set, the workspace reader will usually be consulted first to resolve artifacts.
        Returns:
        The workspace reader for this session or null if none.
      • getTransferListener

        TransferListener getTransferListener()
        Gets the listener being notified of uploads/downloads by the repository system.
        Returns:
        The transfer listener or null if none.
      • getSystemProperties

        java.util.Map<java.lang.String,​java.lang.String> getSystemProperties()
        Gets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually collected from the runtime environment like System.getProperties() and environment variables.
        Returns:
        The (read-only) system properties, never null.
      • getUserProperties

        java.util.Map<java.lang.String,​java.lang.String> getUserProperties()
        Gets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to system properties but are set on the discretion of the user and hence are considered of higher priority than system properties.
        Returns:
        The (read-only) user properties, never null.
      • getConfigProperties

        java.util.Map<java.lang.String,​java.lang.Object> getConfigProperties()
        Gets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling, connector-specific behavior, etc.)
        Returns:
        The (read-only) configuration properties, never null.
        See Also:
        ConfigurationProperties
      • getArtifactTypeRegistry

        ArtifactTypeRegistry getArtifactTypeRegistry()
        Gets the registry of artifact types recognized by this session, for instance when processing artifact descriptors.
        Returns:
        The artifact type registry, never null.
      • getDependencyTraverser

        DependencyTraverser getDependencyTraverser()
        Gets the dependency traverser to use for building dependency graphs.
        Returns:
        The dependency traverser to use for building dependency graphs or null if dependencies are unconditionally traversed.
      • getDependencyManager

        DependencyManager getDependencyManager()
        Gets the dependency manager to use for building dependency graphs.
        Returns:
        The dependency manager to use for building dependency graphs or null if dependency management is not performed.
      • getDependencySelector

        DependencySelector getDependencySelector()
        Gets the dependency selector to use for building dependency graphs.
        Returns:
        The dependency selector to use for building dependency graphs or null if dependencies are unconditionally included.
      • getVersionFilter

        VersionFilter getVersionFilter()
        Gets the version filter to use for building dependency graphs.
        Returns:
        The version filter to use for building dependency graphs or null if versions aren't filtered.
      • getData

        SessionData getData()
        Gets the custom data associated with this session.
        Returns:
        The session data, never null.
      • getCache

        RepositoryCache getCache()
        Gets the cache the repository system may use to save data for future reuse during the session.
        Returns:
        The repository cache or null if none.
      • getScopeManager

        ScopeManager getScopeManager()
        Returns the scope manager to be used in this session, may be null if not set.
        Returns:
        The scope manager or null if not set.
        Since:
        2.0.0
      • addOnSessionEndedHandler

        boolean addOnSessionEndedHandler​(java.lang.Runnable handler)
        Registers a handler to execute when this session closed.

        Note: Resolver 1.x sessions will not be able to register handlers. Migrate to Resolver 2.x way of handling sessions to make full use of new features. New features (like HTTP/2 transport) depend on this functionality. While they will function with Resolver 1.x sessions, they may produce resource leaks.

        Parameters:
        handler - the handler, never null.
        Returns:
        true if handler successfully registered, false otherwise.
        Since:
        2.0.0