org.sonatype.aether.resolution
Class ArtifactRequest

java.lang.Object
  extended by org.sonatype.aether.resolution.ArtifactRequest

public class ArtifactRequest
extends java.lang.Object

A request to resolve an artifact.

Author:
Benjamin Bentmann
See Also:
RepositorySystem.resolveArtifacts(RepositorySystemSession, java.util.Collection), Artifact.getFile()

Constructor Summary
ArtifactRequest()
          Creates an unitialized request.
ArtifactRequest(Artifact artifact, java.util.List<RemoteRepository> repositories, java.lang.String context)
          Creates a request with the specified properties.
ArtifactRequest(DependencyNode node)
          Creates a request from the specified dependency node.
 
Method Summary
 ArtifactRequest addRepository(RemoteRepository repository)
          Adds the specified repository for the resolution.
 Artifact getArtifact()
          Gets the artifact to resolve.
 DependencyNode getDependencyNode()
          Gets the dependency node (if any) for which to resolve the artifact.
 java.util.List<RemoteRepository> getRepositories()
          Gets the repositories to resolve the version range from.
 java.lang.String getRequestContext()
          Gets the context in which this request is made.
 ArtifactRequest setArtifact(Artifact artifact)
          Sets the artifact to resolve.
 ArtifactRequest setDependencyNode(DependencyNode node)
          Sets the dependency node to resolve.
 ArtifactRequest setRepositories(java.util.List<RemoteRepository> repositories)
          Sets the repositories to resolve the artifact from.
 ArtifactRequest setRequestContext(java.lang.String context)
          Sets the context in which this request is made.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArtifactRequest

public ArtifactRequest()
Creates an unitialized request.


ArtifactRequest

public ArtifactRequest(Artifact artifact,
                       java.util.List<RemoteRepository> repositories,
                       java.lang.String context)
Creates a request with the specified properties.

Parameters:
artifact - The artifact to resolve, may be null.
repositories - The repositories to resolve the artifact from, may be null.
context - The context in which this request is made, may be null.

ArtifactRequest

public ArtifactRequest(DependencyNode node)
Creates a request from the specified dependency node.

Parameters:
node - The dependency node to resolve, may be null.
Method Detail

getArtifact

public Artifact getArtifact()
Gets the artifact to resolve.

Returns:
The artifact to resolve or null.

setArtifact

public ArtifactRequest setArtifact(Artifact artifact)
Sets the artifact to resolve.

Parameters:
artifact - The artifact to resolve, may be null.
Returns:
This request for chaining, never null.

getDependencyNode

public DependencyNode getDependencyNode()
Gets the dependency node (if any) for which to resolve the artifact.

Returns:
The dependency node to resolve or null if unknown.

setDependencyNode

public ArtifactRequest setDependencyNode(DependencyNode node)
Sets the dependency node to resolve.

Parameters:
node - The dependency node to resolve, may be null.
Returns:
This request for chaining, never null.

getRepositories

public java.util.List<RemoteRepository> getRepositories()
Gets the repositories to resolve the version range from.

Returns:
The repositories, never null.

setRepositories

public ArtifactRequest setRepositories(java.util.List<RemoteRepository> repositories)
Sets the repositories to resolve the artifact from.

Parameters:
repositories - The repositories, may be null.
Returns:
This request for chaining, never null.

addRepository

public ArtifactRequest addRepository(RemoteRepository repository)
Adds the specified repository for the resolution.

Parameters:
repository - The repository to add, may be null.
Returns:
This request for chaining, never null.

getRequestContext

public java.lang.String getRequestContext()
Gets the context in which this request is made.

Returns:
The context, never null.

setRequestContext

public ArtifactRequest setRequestContext(java.lang.String context)
Sets the context in which this request is made.

Parameters:
context - The context, may be null.
Returns:
This request for chaining, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.