View Javadoc
1   /*******************************************************************************
2    * Copyright (c) 2012, 2013 Sonatype, Inc.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *    Sonatype, Inc. - initial API and implementation
10   *******************************************************************************/
11  package org.eclipse.aether.resolution;
12  
13  import org.eclipse.aether.RepositorySystemSession;
14  
15  /**
16   * Controls the handling of errors related to reading an artifact descriptor.
17   * 
18   * @see RepositorySystemSession#getArtifactDescriptorPolicy()
19   */
20  public interface ArtifactDescriptorPolicy
21  {
22  
23      /**
24       * Bit mask indicating that errors while reading the artifact descriptor should not be tolerated.
25       */
26      int STRICT = 0x00;
27  
28      /**
29       * Bit flag indicating that missing artifact descriptors should be silently ignored.
30       */
31      int IGNORE_MISSING = 0x01;
32  
33      /**
34       * Bit flag indicating that existent but invalid artifact descriptors should be silently ignored.
35       */
36      int IGNORE_INVALID = 0x02;
37  
38      /**
39       * Bit mask indicating that all errors should be silently ignored.
40       */
41      int IGNORE_ERRORS = IGNORE_MISSING | IGNORE_INVALID;
42  
43      /**
44       * Gets the error policy for an artifact's descriptor.
45       * 
46       * @param session The repository session during which the policy is determined, must not be {@code null}.
47       * @param request The policy request holding further details, must not be {@code null}.
48       * @return The bit mask describing the desired error policy.
49       */
50      int getPolicy( RepositorySystemSession session, ArtifactDescriptorPolicyRequest request );
51  
52  }