org.apache.archiva.policies
Class CachedFailuresPolicy

java.lang.Object
  extended by org.apache.archiva.policies.CachedFailuresPolicy
All Implemented Interfaces:
DownloadPolicy, Policy, PreDownloadPolicy

@Service(value="preDownloadPolicy#cache-failures")
public class CachedFailuresPolicy
extends Object
implements PreDownloadPolicy

PreDownloadPolicy to check if the requested url has failed before.


Field Summary
private  org.slf4j.Logger log
           
static String NO
          The NO policy setting means that the the existence of old failures is not checked.
private  List<String> options
           
private  UrlFailureCache urlFailureCache
           
static String YES
          The YES policy setting means that the existence of old failures is checked, and will prevent the request from being performed against the remote repo.
 
Constructor Summary
CachedFailuresPolicy()
           
 
Method Summary
 void applyPolicy(String policySetting, Properties request, File localFile)
          Apply the download policy.
 String getDefaultOption()
          Get the default option for this policy.
 String getId()
          Get the id for this policy.
 String getName()
          Get the display name for this policy.
 List<String> getOptions()
          Get the list of options for this policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.slf4j.Logger log

NO

public static final String NO
The NO policy setting means that the the existence of old failures is not checked. All resource requests are allowed thru to the remote repo.

See Also:
Constant Field Values

YES

public static final String YES
The YES policy setting means that the existence of old failures is checked, and will prevent the request from being performed against the remote repo.

See Also:
Constant Field Values

urlFailureCache

@Inject
private UrlFailureCache urlFailureCache

options

private List<String> options
Constructor Detail

CachedFailuresPolicy

public CachedFailuresPolicy()
Method Detail

applyPolicy

public void applyPolicy(String policySetting,
                        Properties request,
                        File localFile)
                 throws PolicyViolationException,
                        PolicyConfigurationException
Description copied from interface: DownloadPolicy
Apply the download policy.

Specified by:
applyPolicy in interface DownloadPolicy
Parameters:
policySetting - the policy setting.
request - the list of request properties that the policy might use.
Throws:
PolicyViolationException - if the policy has been violated.
PolicyConfigurationException

getDefaultOption

public String getDefaultOption()
Description copied from interface: Policy
Get the default option for this policy.

Specified by:
getDefaultOption in interface Policy
Returns:
the default policy for this policy.

getId

public String getId()
Description copied from interface: Policy
Get the id for this policy.

Specified by:
getId in interface Policy
Returns:
the id for this policy.

getName

public String getName()
Description copied from interface: Policy
Get the display name for this policy.

Specified by:
getName in interface Policy
Returns:
the name for this policy

getOptions

public List<String> getOptions()
Description copied from interface: Policy
Get the list of options for this policy.

Specified by:
getOptions in interface Policy
Returns:
the list of options for this policy.


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.