org.apache.archiva.policies
Class PropagateErrorsOnUpdateDownloadPolicy

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

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

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


Field Summary
static String ALWAYS
          Signifies any error should cause a failure whether the artifact is already present or not.
static String NOT_PRESENT
          Signifies any error should cause a failure only if the artifact is not already present.
private  List<String> options
           
 
Constructor Summary
PropagateErrorsOnUpdateDownloadPolicy()
           
 
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

ALWAYS

public static final String ALWAYS
Signifies any error should cause a failure whether the artifact is already present or not.

See Also:
Constant Field Values

NOT_PRESENT

public static final String NOT_PRESENT
Signifies any error should cause a failure only if the artifact is not already present.

See Also:
Constant Field Values

options

private List<String> options
Constructor Detail

PropagateErrorsOnUpdateDownloadPolicy

public PropagateErrorsOnUpdateDownloadPolicy()
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.