Package org.eclipse.aether.repository
Class RepositoryPolicy
- java.lang.Object
-
- org.eclipse.aether.repository.RepositoryPolicy
-
public final class RepositoryPolicy extends java.lang.ObjectA policy controlling access to a repository.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHECKSUM_POLICY_FAILVerify checksums and fail the resolution if they do not match.static java.lang.StringCHECKSUM_POLICY_IGNOREDo not verify checksums.static java.lang.StringCHECKSUM_POLICY_WARNVerify checksums and warn if they do not match.private java.lang.StringchecksumPolicyprivate booleanenabledstatic java.lang.StringUPDATE_POLICY_ALWAYSAlways update locally cached data.static java.lang.StringUPDATE_POLICY_DAILYUpdate locally cached data once a day.static java.lang.StringUPDATE_POLICY_INTERVALUpdate locally cached data every X minutes as given by "interval:X".static java.lang.StringUPDATE_POLICY_NEVERNever update locally cached data.private java.lang.StringupdatePolicy
-
Constructor Summary
Constructors Constructor Description RepositoryPolicy()Creates a new policy with checksum warnings and daily update checks.RepositoryPolicy(boolean enabled, java.lang.String updatePolicy, java.lang.String checksumPolicy)Creates a new policy with the specified settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetChecksumPolicy()Gets the policy for checksum validation.java.lang.StringgetUpdatePolicy()Gets the update policy for locally cached data from the repository.inthashCode()booleanisEnabled()Indicates whether the associated repository should be contacted or not.java.lang.StringtoString()
-
-
-
Field Detail
-
UPDATE_POLICY_NEVER
public static final java.lang.String UPDATE_POLICY_NEVER
Never update locally cached data.- See Also:
- Constant Field Values
-
UPDATE_POLICY_ALWAYS
public static final java.lang.String UPDATE_POLICY_ALWAYS
Always update locally cached data.- See Also:
- Constant Field Values
-
UPDATE_POLICY_DAILY
public static final java.lang.String UPDATE_POLICY_DAILY
Update locally cached data once a day.- See Also:
- Constant Field Values
-
UPDATE_POLICY_INTERVAL
public static final java.lang.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 java.lang.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 java.lang.String CHECKSUM_POLICY_WARN
Verify checksums and warn if they do not match.- See Also:
- Constant Field Values
-
CHECKSUM_POLICY_IGNORE
public static final java.lang.String CHECKSUM_POLICY_IGNORE
Do not verify checksums.- See Also:
- Constant Field Values
-
enabled
private final boolean enabled
-
updatePolicy
private final java.lang.String updatePolicy
-
checksumPolicy
private final java.lang.String checksumPolicy
-
-
Constructor Detail
-
RepositoryPolicy
public RepositoryPolicy()
Creates a new policy with checksum warnings and daily update checks.
-
RepositoryPolicy
public RepositoryPolicy(boolean enabled, java.lang.String updatePolicy, java.lang.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 benull.checksumPolicy- The way checksum verification should be handled, may benull.
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Indicates whether the associated repository should be contacted or not.- Returns:
trueif the repository should be contacted,falseotherwise.
-
getUpdatePolicy
public java.lang.String getUpdatePolicy()
Gets the update policy for locally cached data from the repository.- Returns:
- The update policy, never
null.
-
getChecksumPolicy
public java.lang.String getChecksumPolicy()
Gets the policy for checksum validation.- Returns:
- The checksum policy, never
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-