org.apache.maven.mercury.plexus
Class DefaultPlexusMercury

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.mercury.plexus.DefaultPlexusMercury
All Implemented Interfaces:
PlexusMercury, org.codehaus.plexus.logging.LogEnabled

@Component(role=PlexusMercury.class)
public class DefaultPlexusMercury
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements PlexusMercury

default implementation of Mercury plexus wrapper

Author:
Oleg Gusakov

Field Summary
 
Fields inherited from interface org.apache.maven.mercury.plexus.PlexusMercury
ROLE
 
Constructor Summary
DefaultPlexusMercury()
           
 
Method Summary
 LocalRepositoryM2 constructLocalRepositoryM2(java.lang.String id, java.io.File rootDir, java.util.Set<StreamObserverFactory> readerStreamObservers, java.util.Set<StreamVerifierFactory> readerStreamVerifiers, java.util.Set<StreamObserverFactory> writerStreamObservers, java.util.Set<StreamVerifierFactory> writerStreamVerifiers)
          construct local M2 repository and configure it with supplied attributes
 RemoteRepositoryM2 constructRemoteRepositoryM2(java.lang.String id, java.net.URL serverUrl, java.lang.String serverUser, java.lang.String serverPass, java.net.URL proxyUrl, java.lang.String proxyUser, java.lang.String proxyPass, java.util.Set<StreamObserverFactory> readerStreamObservers, java.util.Set<StreamVerifierFactory> readerStreamVerifiers, java.util.Set<StreamObserverFactory> writerStreamObservers, java.util.Set<StreamVerifierFactory> writerStreamVerifiers)
          construct remote M2 repository and configure it with supplied attributes
 PgpStreamVerifierFactory createPgpReaderFactory(boolean lenient, boolean sufficient, java.io.InputStream pubRing)
          create PGP factory to configure into repository reader for signature verification
 PgpStreamVerifierFactory createPgpWriterFactory(boolean lenient, boolean sufficient, java.io.InputStream secRing, java.lang.String keyId, java.lang.String keyPass)
          create PGP factory to configure into repository writer for signature generation
 DependencyProcessor findDependencyProcessor()
          lookup dependency processor in plexus and return the "default" implementation
 DependencyProcessor findDependencyProcessor(java.lang.String hint)
          lookup dependency processor in plexus and return the requested implementation
 java.util.List<Artifact> read(java.util.List<Repository> repo, ArtifactMetadata... artifacts)
           
 java.util.List<Artifact> read(java.util.List<Repository> repos, java.util.List<ArtifactMetadata> artifacts)
          read given Artifact(s) from the repository
 java.util.List<ArtifactMetadata> resolve(java.util.List<Repository> repos, ArtifactScopeEnum scope, ArtifactMetadata metadata)
           
 java.util.List<ArtifactMetadata> resolve(java.util.List<Repository> repos, ArtifactScopeEnum scope, ArtifactQueryList artifacts, ArtifactInclusionList inclusions, ArtifactExclusionList exclusions)
          resolve Artifact dependencies.
 void write(Repository repo, Artifact... artifacts)
          write (deploy) given Artifact(s) to the repository
 void write(Repository repo, java.util.Collection<Artifact> artifacts)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPlexusMercury

public DefaultPlexusMercury()
Method Detail

findDependencyProcessor

public DependencyProcessor findDependencyProcessor(java.lang.String hint)
                                            throws RepositoryException
Description copied from interface: PlexusMercury
lookup dependency processor in plexus and return the requested implementation

Specified by:
findDependencyProcessor in interface PlexusMercury
Parameters:
hint - the plexus hint to lookup by
Returns:
the dependency processor
Throws:
RepositoryException

findDependencyProcessor

public DependencyProcessor findDependencyProcessor()
                                            throws RepositoryException
Description copied from interface: PlexusMercury
lookup dependency processor in plexus and return the "default" implementation

Specified by:
findDependencyProcessor in interface PlexusMercury
Returns:
the dependency processor
Throws:
RepositoryException

constructRemoteRepositoryM2

public RemoteRepositoryM2 constructRemoteRepositoryM2(java.lang.String id,
                                                      java.net.URL serverUrl,
                                                      java.lang.String serverUser,
                                                      java.lang.String serverPass,
                                                      java.net.URL proxyUrl,
                                                      java.lang.String proxyUser,
                                                      java.lang.String proxyPass,
                                                      java.util.Set<StreamObserverFactory> readerStreamObservers,
                                                      java.util.Set<StreamVerifierFactory> readerStreamVerifiers,
                                                      java.util.Set<StreamObserverFactory> writerStreamObservers,
                                                      java.util.Set<StreamVerifierFactory> writerStreamVerifiers)
                                               throws RepositoryException
Description copied from interface: PlexusMercury
construct remote M2 repository and configure it with supplied attributes

Specified by:
constructRemoteRepositoryM2 in interface PlexusMercury
Returns:
repository instance
Throws:
RepositoryException

constructLocalRepositoryM2

public LocalRepositoryM2 constructLocalRepositoryM2(java.lang.String id,
                                                    java.io.File rootDir,
                                                    java.util.Set<StreamObserverFactory> readerStreamObservers,
                                                    java.util.Set<StreamVerifierFactory> readerStreamVerifiers,
                                                    java.util.Set<StreamObserverFactory> writerStreamObservers,
                                                    java.util.Set<StreamVerifierFactory> writerStreamVerifiers)
                                             throws RepositoryException
Description copied from interface: PlexusMercury
construct local M2 repository and configure it with supplied attributes

Specified by:
constructLocalRepositoryM2 in interface PlexusMercury
Returns:
repository instance
Throws:
RepositoryException

write

public void write(Repository repo,
                  Artifact... artifacts)
           throws RepositoryException
Description copied from interface: PlexusMercury
write (deploy) given Artifact(s) to the repository

Specified by:
write in interface PlexusMercury
Parameters:
repo - repository instance to search
Throws:
RepositoryException

write

public void write(Repository repo,
                  java.util.Collection<Artifact> artifacts)
           throws RepositoryException
Specified by:
write in interface PlexusMercury
Throws:
RepositoryException

read

public java.util.List<Artifact> read(java.util.List<Repository> repos,
                                     java.util.List<ArtifactMetadata> artifacts)
                              throws RepositoryException
Description copied from interface: PlexusMercury
read given Artifact(s) from the repository

Specified by:
read in interface PlexusMercury
Parameters:
repos - repository instance to search
Returns:
Throws:
RepositoryException

read

public java.util.List<Artifact> read(java.util.List<Repository> repo,
                                     ArtifactMetadata... artifacts)
                              throws RepositoryException
Specified by:
read in interface PlexusMercury
Throws:
RepositoryException

createPgpReaderFactory

public PgpStreamVerifierFactory createPgpReaderFactory(boolean lenient,
                                                       boolean sufficient,
                                                       java.io.InputStream pubRing)
                                                throws StreamVerifierException
Description copied from interface: PlexusMercury
create PGP factory to configure into repository reader for signature verification

Specified by:
createPgpReaderFactory in interface PlexusMercury
pubRing - - keyring with all acceptable public keys
Returns:
pgp verifier factory to be sent to Repository
Throws:
StreamVerifierException

createPgpWriterFactory

public PgpStreamVerifierFactory createPgpWriterFactory(boolean lenient,
                                                       boolean sufficient,
                                                       java.io.InputStream secRing,
                                                       java.lang.String keyId,
                                                       java.lang.String keyPass)
                                                throws StreamVerifierException
Description copied from interface: PlexusMercury
create PGP factory to configure into repository writer for signature generation

Specified by:
createPgpWriterFactory in interface PlexusMercury
Returns:
pgp verifier factory to be sent to Repository
Throws:
StreamVerifierException

resolve

public java.util.List<ArtifactMetadata> resolve(java.util.List<Repository> repos,
                                                ArtifactScopeEnum scope,
                                                ArtifactMetadata metadata)
                                         throws RepositoryException
Specified by:
resolve in interface PlexusMercury
Throws:
RepositoryException

resolve

public java.util.List<ArtifactMetadata> resolve(java.util.List<Repository> repos,
                                                ArtifactScopeEnum scope,
                                                ArtifactQueryList artifacts,
                                                ArtifactInclusionList inclusions,
                                                ArtifactExclusionList exclusions)
                                         throws RepositoryException
Description copied from interface: PlexusMercury
resolve Artifact dependencies. The inclusions and exclusions accept version ranges as parameters

Specified by:
resolve in interface PlexusMercury
scope - scope enumeration member indication the scope to resolve for
inclusions - list of artifact metadatas to include - only these will be in the resolved classpath
exclusions - list of artifact metadatas to exclude - is applied after the inclusion, if one is present
Returns:
Throws:
RepositoryException


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.