org.eclipse.aether.util.repository

## Class SimpleResolutionErrorPolicy

- java.lang.Object
- - org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy

- All Implemented Interfaces:
    ResolutionErrorPolicy

      public final class SimpleResolutionErrorPolicy
      extends Object
      implements ResolutionErrorPolicy

  A resolution error policy that allows to control caching for artifacts and metadata at a global level.

- - ### Field Summary

    - ### Fields inherited from interface org.eclipse.aether.resolution.ResolutionErrorPolicy

      `CACHE_ALL, CACHE_DISABLED, CACHE_NOT_FOUND, CACHE_TRANSFER_ERROR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleResolutionErrorPolicy(boolean cacheNotFound, boolean cacheTransferErrors)` Creates a new error policy with the specified behavior for both artifacts and metadata.
    `SimpleResolutionErrorPolicy(int policy)` Creates a new error policy with the specified bit mask for both artifacts and metadata.
    `SimpleResolutionErrorPolicy(int artifactPolicy, int metadataPolicy)` Creates a new error policy with the specified bit masks for artifacts and metadata.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getArtifactPolicy(RepositorySystemSession session, ResolutionErrorPolicyRequest<Artifact> request)` Gets the error policy for an artifact.
    `int` | `getMetadataPolicy(RepositorySystemSession session, ResolutionErrorPolicyRequest<Metadata> request)` Gets the error policy for some metadata.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleResolutionErrorPolicy

          public SimpleResolutionErrorPolicy(boolean cacheNotFound,
                                     boolean cacheTransferErrors)

      Creates a new error policy with the specified behavior for both artifacts and metadata.
      Parameters:
        `cacheNotFound` - `true` to enable caching of missing items, `false` to disable it.
        `cacheTransferErrors` - `true` to enable chaching of transfer errors, `false` to disable it.

    - #### SimpleResolutionErrorPolicy

          public SimpleResolutionErrorPolicy(int policy)

      Creates a new error policy with the specified bit mask for both artifacts and metadata.
      Parameters:
        `policy` - The bit mask describing the policy for artifacts and metadata.

    - #### SimpleResolutionErrorPolicy

          public SimpleResolutionErrorPolicy(int artifactPolicy,
                                     int metadataPolicy)

      Creates a new error policy with the specified bit masks for artifacts and metadata.
      Parameters:
        `artifactPolicy` - The bit mask describing the policy for artifacts.
        `metadataPolicy` - The bit mask describing the policy for metadata.

  - ### Method Detail

    - #### getArtifactPolicy

          public int getArtifactPolicy(RepositorySystemSession session,
                              ResolutionErrorPolicyRequest<Artifact> request)

      Description copied from interface: `ResolutionErrorPolicy`
      Gets the error policy for an artifact.
      Specified by:
        `getArtifactPolicy` in interface `ResolutionErrorPolicy`
      Parameters:
        `session` - The repository session during which the policy is determined, must not be `null`.
        `request` - The policy request holding further details, must not be `null`.
      Returns:
        The bit mask describing the desired error policy.

    - #### getMetadataPolicy

          public int getMetadataPolicy(RepositorySystemSession session,
                              ResolutionErrorPolicyRequest<Metadata> request)

      Description copied from interface: `ResolutionErrorPolicy`
      Gets the error policy for some metadata.
      Specified by:
        `getMetadataPolicy` in interface `ResolutionErrorPolicy`
      Parameters:
        `session` - The repository session during which the policy is determined, must not be `null`.
        `request` - The policy request holding further details, must not be `null`.
      Returns:
        The bit mask describing the desired error policy.

Copyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.