org.apache.archiva.policies
Class PropagateErrorsDownloadPolicy

java.lang.Object
  extended by org.apache.archiva.policies.PropagateErrorsDownloadPolicy
All Implemented Interfaces:
DownloadErrorPolicy, Policy

@Service(value="downloadErrorPolicy#propagate-errors")
public class PropagateErrorsDownloadPolicy
extends Object
implements DownloadErrorPolicy

PropagateErrorsPolicy - a policy applied on error to determine how to treat the error.


Field Summary
static String IGNORE
          Ignore errors and treat as if it were not found.
private  org.slf4j.Logger log
           
private  List<String> options
           
static String QUEUE
          Propagate errors at the end after all are gathered, if there was no successful download from other proxies.
static String STOP
          Signifies any error should stop searching for other proxies.
 
Constructor Summary
PropagateErrorsDownloadPolicy()
           
 
Method Summary
 boolean applyPolicy(String policySetting, Properties request, File localFile, Exception exception, Map<String,Exception> previousExceptions)
          Apply the download error 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

STOP

public static final String STOP
Signifies any error should stop searching for other proxies.

See Also:
Constant Field Values

QUEUE

public static final String QUEUE
Propagate errors at the end after all are gathered, if there was no successful download from other proxies.

See Also:
Constant Field Values

IGNORE

public static final String IGNORE
Ignore errors and treat as if it were not found.

See Also:
Constant Field Values

options

private List<String> options
Constructor Detail

PropagateErrorsDownloadPolicy

public PropagateErrorsDownloadPolicy()
Method Detail

applyPolicy

public boolean applyPolicy(String policySetting,
                           Properties request,
                           File localFile,
                           Exception exception,
                           Map<String,Exception> previousExceptions)
                    throws PolicyConfigurationException
Description copied from interface: DownloadErrorPolicy
Apply the download error policy.

Specified by:
applyPolicy in interface DownloadErrorPolicy
Parameters:
policySetting - the policy setting.
request - the list of request properties that the policy might use.
exception - the exception that triggered the error
previousExceptions - any previously triggered exceptions
Returns:
whether to process the exception or not
Throws:
PolicyConfigurationException - if the policy is improperly configured

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.