org.eclipse.aether.repository

## Class RepositoryPolicy

- java.lang.Object
- - org.eclipse.aether.repository.RepositoryPolicy

-     public final class RepositoryPolicy
      extends Object

  A policy controlling access to a repository.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CHECKSUM_POLICY_FAIL` Verify checksums and fail the resolution if they do not match.
    `static String` | `CHECKSUM_POLICY_IGNORE` Do not verify checksums.
    `static String` | `CHECKSUM_POLICY_WARN` Verify checksums and warn if they do not match.
    `static String` | `UPDATE_POLICY_ALWAYS` Always update locally cached data.
    `static String` | `UPDATE_POLICY_DAILY` Update locally cached data once a day.
    `static String` | `UPDATE_POLICY_INTERVAL` Update locally cached data every X minutes as given by "interval:X".
    `static String` | `UPDATE_POLICY_NEVER` Never update locally cached data.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepositoryPolicy()` Creates a new policy with checksum warnings and daily update checks.
    `RepositoryPolicy(boolean enabled, String updatePolicy, String checksumPolicy)` Creates a new policy with the specified settings.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `String` | `getChecksumPolicy()` Gets the policy for checksum validation.
    `String` | `getUpdatePolicy()` Gets the update policy for locally cached data from the repository.
    `int` | `hashCode()`
    `boolean` | `isEnabled()` Indicates whether the associated repository should be contacted or not.
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### UPDATE_POLICY_NEVER

          public static final String UPDATE_POLICY_NEVER

      Never update locally cached data.
      See Also:
        Constant Field Values

    - #### UPDATE_POLICY_ALWAYS

          public static final String UPDATE_POLICY_ALWAYS

      Always update locally cached data.
      See Also:
        Constant Field Values

    - #### UPDATE_POLICY_DAILY

          public static final String UPDATE_POLICY_DAILY

      Update locally cached data once a day.
      See Also:
        Constant Field Values

    - #### UPDATE_POLICY_INTERVAL

          public static final String UPDATE_POLICY_INTERVAL

      Update locally cached data every X minutes as given by "interval:X".
      See Also:
        Constant Field Values

    - #### CHECKSUM_POLICY_FAIL

          public static final String CHECKSUM_POLICY_FAIL

      Verify checksums and fail the resolution if they do not match.
      See Also:
        Constant Field Values

    - #### CHECKSUM_POLICY_WARN

          public static final String CHECKSUM_POLICY_WARN

      Verify checksums and warn if they do not match.
      See Also:
        Constant Field Values

    - #### CHECKSUM_POLICY_IGNORE

          public static final String CHECKSUM_POLICY_IGNORE

      Do not verify checksums.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RepositoryPolicy

          public RepositoryPolicy()

      Creates a new policy with checksum warnings and daily update checks.

    - #### RepositoryPolicy

          public RepositoryPolicy(boolean enabled,
                          String updatePolicy,
                          String checksumPolicy)

      Creates a new policy with the specified settings.
      Parameters:
        `enabled` - A flag whether the associated repository should be accessed or not.
        `updatePolicy` - The update interval after which locally cached data from the repository is considered stale and should be refetched, may be `null`.
        `checksumPolicy` - The way checksum verification should be handled, may be `null`.

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

      Indicates whether the associated repository should be contacted or not.
      Returns:
        `true` if the repository should be contacted, `false` otherwise.

    - #### getUpdatePolicy

          public String getUpdatePolicy()

      Gets the update policy for locally cached data from the repository.
      Returns:
        The update policy, never `null`.

    - #### getChecksumPolicy

          public String getChecksumPolicy()

      Gets the policy for checksum validation.
      Returns:
        The checksum policy, never `null`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

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