org.apache.maven.dotnet.dao.impl
Class ProjectDaoImpl

java.lang.Object
  extended by org.apache.maven.dotnet.dao.impl.ProjectDaoImpl
All Implemented Interfaces:
ProjectDao, DataAccessObject

public final class ProjectDaoImpl
extends java.lang.Object
implements ProjectDao


Field Summary
 
Fields inherited from interface org.apache.maven.dotnet.dao.ProjectDao
ROLE
 
Constructor Summary
ProjectDaoImpl()
           
 
Method Summary
 boolean closeConnection()
          Closes the repository connection specified within ProjectDao#setRdfRepository or DataAccessObject#init method
 java.util.Set<Project> getAllProjects()
          Returns all projects.
 java.lang.String getClassName()
          Returns class name.
 java.lang.String getID()
          Accessor for ID
 Project getProjectFor(org.apache.maven.project.MavenProject mavenProject)
          Returns a project that matches the information contained within the specified maven project.
 Project getProjectFor(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String artifactType, java.lang.String publicKeyTokenId)
          Returns a project that matches the specified parameters.
 void init(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory, org.apache.maven.artifact.manager.WagonManager wagonManager)
          Initializes the data access object
 void init(java.lang.Object dataStoreObject, java.lang.String id, java.lang.String className)
           
protected  void initForUnitTest(java.lang.Object dataStoreObject, java.lang.String id, java.lang.String className, org.apache.maven.artifact.manager.WagonManager wagonManager, org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
           
 boolean openConnection()
          Opens the repository connection specified within ProjectDao#setRdfRepository or DataAccessObject#init method
 void removeProjectFor(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String artifactType)
           
 void setRdfRepository(org.openrdf.repository.Repository repository)
          Sets the repository for the data access object.
 void setRepositoryRegistry(RepositoryRegistry repositoryRegistry)
           
 java.util.Set<org.apache.maven.artifact.Artifact> storeModelAndResolveDependencies(org.apache.maven.model.Model model, java.io.File pomFileDirectory, java.io.File localArtifactRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
          Stores the project object model and resolves and stores the model's dependencies.
 void storeProject(Project project, java.io.File localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
          Method not implemented.
 java.util.Set<org.apache.maven.artifact.Artifact> storeProjectAndResolveDependencies(Project project, java.io.File localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
          Stores the specified project and resolves and stores the project's dependencies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectDaoImpl

public ProjectDaoImpl()
Method Detail

init

public void init(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory,
                 org.apache.maven.artifact.manager.WagonManager wagonManager)
Description copied from interface: ProjectDao
Initializes the data access object

Specified by:
init in interface ProjectDao
Parameters:
artifactFactory - the artifact factory used in creating artifacts
wagonManager - the manager used for downloading artifacts

getAllProjects

public java.util.Set<Project> getAllProjects()
                                      throws java.io.IOException
Description copied from interface: ProjectDao
Returns all projects.

Specified by:
getAllProjects in interface ProjectDao
Returns:
all projects
Throws:
java.io.IOException - if there is a problem retrieving the projects

setRdfRepository

public void setRdfRepository(org.openrdf.repository.Repository repository)
Description copied from interface: ProjectDao
Sets the repository for the data access object. This method overrides the data source object set in the DataAccessObject#init

Specified by:
setRdfRepository in interface ProjectDao
Parameters:
repository - the rdf repository

openConnection

public boolean openConnection()
Description copied from interface: ProjectDao
Opens the repository connection specified within ProjectDao#setRdfRepository or DataAccessObject#init method

Specified by:
openConnection in interface ProjectDao
Returns:
true if the rdf repository successfully opens, otherwise return false

closeConnection

public boolean closeConnection()
Description copied from interface: ProjectDao
Closes the repository connection specified within ProjectDao#setRdfRepository or DataAccessObject#init method

Specified by:
closeConnection in interface ProjectDao
Returns:
true if the rdf repository successfully closes, otherwise return false

removeProjectFor

public void removeProjectFor(java.lang.String groupId,
                             java.lang.String artifactId,
                             java.lang.String version,
                             java.lang.String artifactType)
                      throws java.io.IOException
Specified by:
removeProjectFor in interface ProjectDao
Throws:
java.io.IOException

getProjectFor

public Project getProjectFor(java.lang.String groupId,
                             java.lang.String artifactId,
                             java.lang.String version,
                             java.lang.String artifactType,
                             java.lang.String publicKeyTokenId)
                      throws java.io.IOException
Description copied from interface: ProjectDao
Returns a project that matches the specified parameters.

Specified by:
getProjectFor in interface ProjectDao
Parameters:
groupId - the group id of the project
artifactId - the artifact id of the project
version - the version of the project
artifactType - the type of artifact: library, exe, winexe, netmodule
publicKeyTokenId - the public key token id. This should match the token id within the manifest of a signed .NET assesmbly. This value may be null.
Returns:
a project that matches the specified parameters
Throws:
java.io.IOException - if there was a problem retrieving the project

getProjectFor

public Project getProjectFor(org.apache.maven.project.MavenProject mavenProject)
                      throws java.io.IOException
Description copied from interface: ProjectDao
Returns a project that matches the information contained within the specified maven project.

Specified by:
getProjectFor in interface ProjectDao
Parameters:
mavenProject - the maven project used in finding the returned project
Returns:
a project that matches the information contained within the specified maven project
Throws:
java.io.IOException - if there was a problem retrieving the project

storeProject

public void storeProject(Project project,
                         java.io.File localRepository,
                         java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
                  throws java.io.IOException
Description copied from interface: ProjectDao
Method not implemented.

Specified by:
storeProject in interface ProjectDao
Throws:
java.io.IOException

storeProjectAndResolveDependencies

public java.util.Set<org.apache.maven.artifact.Artifact> storeProjectAndResolveDependencies(Project project,
                                                                                            java.io.File localRepository,
                                                                                            java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
                                                                                     throws java.io.IOException,
                                                                                            java.lang.IllegalArgumentException
Description copied from interface: ProjectDao
Stores the specified project and resolves and stores the project's dependencies.

Specified by:
storeProjectAndResolveDependencies in interface ProjectDao
Parameters:
project - the project to store
localRepository - the local artifact repository
artifactRepositories - the remote artifact repositories used in resolving dependencies
Returns:
a set of artifacts, including the project and its dependencies
Throws:
java.io.IOException - if there was a problem in storing or resolving the artifacts
java.lang.IllegalArgumentException

storeModelAndResolveDependencies

public java.util.Set<org.apache.maven.artifact.Artifact> storeModelAndResolveDependencies(org.apache.maven.model.Model model,
                                                                                          java.io.File pomFileDirectory,
                                                                                          java.io.File localArtifactRepository,
                                                                                          java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> artifactRepositories)
                                                                                   throws java.io.IOException
Description copied from interface: ProjectDao
Stores the project object model and resolves and stores the model's dependencies.

Specified by:
storeModelAndResolveDependencies in interface ProjectDao
Parameters:
model - the project object model
pomFileDirectory - the directory containing the pom file
localArtifactRepository - the local repository
artifactRepositories - the remote artifact repositories used in resolving dependencies
Returns:
a set of artifacts, including the model and its dependencies
Throws:
java.io.IOException - if there was a problem in storing or resolving the artifacts

getClassName

public java.lang.String getClassName()
Description copied from interface: DataAccessObject
Returns class name.

Specified by:
getClassName in interface DataAccessObject
Returns:
class name of the DataAccessObject

getID

public java.lang.String getID()
Description copied from interface: DataAccessObject
Accessor for ID

Specified by:
getID in interface DataAccessObject
Returns:
id of the DataAccessObject

init

public void init(java.lang.Object dataStoreObject,
                 java.lang.String id,
                 java.lang.String className)
          throws java.lang.IllegalArgumentException
Specified by:
init in interface DataAccessObject
id - of the data access object
Throws:
java.lang.IllegalArgumentException

setRepositoryRegistry

public void setRepositoryRegistry(RepositoryRegistry repositoryRegistry)
Specified by:
setRepositoryRegistry in interface DataAccessObject

initForUnitTest

protected void initForUnitTest(java.lang.Object dataStoreObject,
                               java.lang.String id,
                               java.lang.String className,
                               org.apache.maven.artifact.manager.WagonManager wagonManager,
                               org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)


Copyright © 2007 NMaven. All Rights Reserved.