org.sonatype.aether.repository
Class LocalArtifactRegistration

java.lang.Object
  extended by org.sonatype.aether.repository.LocalArtifactRegistration

public class LocalArtifactRegistration
extends java.lang.Object

A request to register an artifact within the local repository. Certain local repository implementations can refuse to serve physically present artifacts if those haven't been previously registered to them.

Author:
Benjamin Bentmann
See Also:
LocalRepositoryManager.add(RepositorySystemSession, LocalArtifactRegistration)

Constructor Summary
LocalArtifactRegistration()
          Creates an uninitialized registration.
LocalArtifactRegistration(Artifact artifact)
          Creates a registration request for the specified (locally built) artifact.
LocalArtifactRegistration(Artifact artifact, RemoteRepository repository, java.util.Collection<java.lang.String> contexts)
          Creates a registration request for the specified (remotely resolved) artifact.
 
Method Summary
 Artifact getArtifact()
          Gets the artifact to register.
 java.util.Collection<java.lang.String> getContexts()
          Gets the resolution contexts in which the artifact is available.
 RemoteRepository getRepository()
          Gets the remote repository from which the artifact was resolved.
 LocalArtifactRegistration setArtifact(Artifact artifact)
          Sets the artifact to register.
 LocalArtifactRegistration setContexts(java.util.Collection<java.lang.String> contexts)
          Sets the resolution contexts in which the artifact is available.
 LocalArtifactRegistration setRepository(RemoteRepository repository)
          Sets the remote repository from which the artifact was resolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalArtifactRegistration

public LocalArtifactRegistration()
Creates an uninitialized registration.


LocalArtifactRegistration

public LocalArtifactRegistration(Artifact artifact)
Creates a registration request for the specified (locally built) artifact.

Parameters:
artifact - The artifact to register, may be null.

LocalArtifactRegistration

public LocalArtifactRegistration(Artifact artifact,
                                 RemoteRepository repository,
                                 java.util.Collection<java.lang.String> contexts)
Creates a registration request for the specified (remotely resolved) artifact.

Parameters:
artifact - The artifact to register, may be null.
repository - The remote repository from which the artifact was resolved or null if the artifact was locally built.
contexts - The resolution contexts, may be null.
Method Detail

getArtifact

public Artifact getArtifact()
Gets the artifact to register.

Returns:
The artifact or null if not set.

setArtifact

public LocalArtifactRegistration setArtifact(Artifact artifact)
Sets the artifact to register.

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

getRepository

public RemoteRepository getRepository()
Gets the remote repository from which the artifact was resolved.

Returns:
The remote repositories or null if the artifact was locally built.

setRepository

public LocalArtifactRegistration setRepository(RemoteRepository repository)
Sets the remote repository from which the artifact was resolved.

Parameters:
repository - The remote repository or null if the artifact was locally built.
Returns:
This request for chaining, never null.

getContexts

public java.util.Collection<java.lang.String> getContexts()
Gets the resolution contexts in which the artifact is available.

Returns:
The resolution contexts in which the artifact is available, never null.

setContexts

public LocalArtifactRegistration setContexts(java.util.Collection<java.lang.String> contexts)
Sets the resolution contexts in which the artifact is available.

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


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