[Ts2-pm-cvs-commit] ts2-pm/ts2-pm-artifact/src/main/java/net/sf/ts2/pm/artifact/manager ArtifactMana
Status: Pre-Alpha
Brought to you by:
nchalumeau
From: Nicolas C. <nch...@us...> - 2005-05-27 16:33:06
|
Update of /cvsroot/ts2-pm/ts2-pm/ts2-pm-artifact/src/main/java/net/sf/ts2/pm/artifact/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29222/ts2-pm-artifact/src/main/java/net/sf/ts2/pm/artifact/manager Modified Files: ArtifactManager.java DefaultArtifactManager.java Log Message: model general usage Index: ArtifactManager.java =================================================================== RCS file: /cvsroot/ts2-pm/ts2-pm/ts2-pm-artifact/src/main/java/net/sf/ts2/pm/artifact/manager/ArtifactManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ArtifactManager.java 11 May 2005 22:22:45 -0000 1.5 --- ArtifactManager.java 27 May 2005 16:32:23 -0000 1.6 *************** *** 22,31 **** import java.util.List; - import net.sf.ts2.pm.artifact.Artifact; - import net.sf.ts2.pm.artifact.ArtifactFactory; import net.sf.ts2.pm.artifact.deployer.ArtifactDeployer; import net.sf.ts2.pm.artifact.installer.ArtifactInstallationException; import net.sf.ts2.pm.artifact.installer.ArtifactInstaller; ! import net.sf.ts2.pm.artifact.repository.ArtifactRepository; /** --- 22,30 ---- import java.util.List; import net.sf.ts2.pm.artifact.deployer.ArtifactDeployer; import net.sf.ts2.pm.artifact.installer.ArtifactInstallationException; import net.sf.ts2.pm.artifact.installer.ArtifactInstaller; ! import net.sf.ts2.pm.model.Artifact; ! import net.sf.ts2.pm.model.Repository; /** *************** *** 35,46 **** { ! ArtifactRepository getLocalRepository(); ! void setLocalRepository( ArtifactRepository localRepo ); ArtifactDeployer getArtifactDeployer(); void setArtifactDeployer( ArtifactDeployer artifactDeployer ); ArtifactInstaller getArtifactInstaller(); void setArtifactInstaller( ArtifactInstaller artifactInstaller ); - ArtifactFactory getArtifactFactory(); - void setArtifactFactory( ArtifactFactory artifactFactory ); // main fonctionnality : creation, research, modification, delete, installation --- 34,43 ---- { ! Repository getLocalRepository(); ! void setLocalRepository( Repository localRepo ); ArtifactDeployer getArtifactDeployer(); void setArtifactDeployer( ArtifactDeployer artifactDeployer ); ArtifactInstaller getArtifactInstaller(); void setArtifactInstaller( ArtifactInstaller artifactInstaller ); // main fonctionnality : creation, research, modification, delete, installation *************** *** 55,76 **** * partialArtifact. */ ! List getArtifacts( Artifact partialArtifact, ArtifactRepository repo ) throws ArtifactManagerException; ! void createArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException; ! Artifact searchArtifact( Artifact partialArtifact, ArtifactRepository repo ) throws ArtifactManagerException; ! void modifyArtifact( Artifact partialArtifact, ArtifactRepository repo ) throws ArtifactManagerException; ! void deleteArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException; void installArtifact( String downloadDir, Artifact artifact, boolean rename ) throws ArtifactInstallationException, ArtifactManagerException; ! void uninstallArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException; ! void deployArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException; ! //boolean verifyUIDCritere( Artifact critere, ArtifactRepository repo ) throws ArtifactManagerException; ! //boolean verifyCritere( Artifact critere, ArtifactRepository repo ) throws ArtifactManagerException; } --- 52,73 ---- * partialArtifact. */ ! List getArtifacts( Artifact partialArtifact, Repository repo ) throws ArtifactManagerException; ! void createArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException; ! Artifact searchArtifact( Artifact partialArtifact, Repository repo ) throws ArtifactManagerException; ! void modifyArtifact( Artifact partialArtifact, Repository repo ) throws ArtifactManagerException; ! void deleteArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException; void installArtifact( String downloadDir, Artifact artifact, boolean rename ) throws ArtifactInstallationException, ArtifactManagerException; ! void uninstallArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException; ! void deployArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException; ! //boolean verifyUIDCritere( Artifact critere, Repository repo ) throws ArtifactManagerException; ! //boolean verifyCritere( Artifact critere, Repository repo ) throws ArtifactManagerException; } Index: DefaultArtifactManager.java =================================================================== RCS file: /cvsroot/ts2-pm/ts2-pm/ts2-pm-artifact/src/main/java/net/sf/ts2/pm/artifact/manager/DefaultArtifactManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultArtifactManager.java 17 May 2005 20:06:46 -0000 1.7 --- DefaultArtifactManager.java 27 May 2005 16:32:23 -0000 1.8 *************** *** 25,37 **** import java.util.List; - import org.apache.commons.lang.StringUtils; - - import net.sf.ts2.pm.artifact.Artifact; - import net.sf.ts2.pm.artifact.ArtifactFactory; import net.sf.ts2.pm.artifact.deployer.ArtifactDeployer; import net.sf.ts2.pm.artifact.installer.ArtifactInstallationException; import net.sf.ts2.pm.artifact.installer.ArtifactInstaller; ! import net.sf.ts2.pm.artifact.repository.ArtifactRepository; ! import net.sf.ts2.pm.model.ArtifactDescriptor; /** --- 25,33 ---- import java.util.List; import net.sf.ts2.pm.artifact.deployer.ArtifactDeployer; import net.sf.ts2.pm.artifact.installer.ArtifactInstallationException; import net.sf.ts2.pm.artifact.installer.ArtifactInstaller; ! import net.sf.ts2.pm.model.Artifact; ! import net.sf.ts2.pm.model.Repository; /** *************** *** 40,45 **** public class DefaultArtifactManager implements ArtifactManager { ! private ArtifactRepository localRepo; ! private ArtifactFactory artifactFactory; private ArtifactDeployer artifactDeployer; private ArtifactInstaller artifactInstaller; --- 36,40 ---- public class DefaultArtifactManager implements ArtifactManager { ! private Repository localRepo; private ArtifactDeployer artifactDeployer; private ArtifactInstaller artifactInstaller; *************** *** 59,63 **** * @throws ArtifactManagerException */ ! public void createArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException { Artifact existingArtifact = searchArtifact( artifact, repo ); --- 54,58 ---- * @throws ArtifactManagerException */ ! public void createArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException { Artifact existingArtifact = searchArtifact( artifact, repo ); *************** *** 68,73 **** else { ! Artifact createdArtifact = artifactFactory.createArtifact( (ArtifactDescriptor) artifact ); ! repo.addArtifact( createdArtifact ); } } --- 63,67 ---- else { ! repo.addArtifact( artifact ); } } *************** *** 79,83 **** * @throws ArtifactManagerException */ ! public void deleteArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException { Artifact artifactReal = searchArtifact( artifact, repo ); --- 73,77 ---- * @throws ArtifactManagerException */ ! public void deleteArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException { Artifact artifactReal = searchArtifact( artifact, repo ); *************** *** 94,98 **** * @throws ArtifactManagerException */ ! public void deployArtifact( Artifact artifact, ArtifactRepository repo ) throws ArtifactManagerException { Artifact artifactReal = searchArtifact( artifact, repo ); --- 88,92 ---- * @throws ArtifactManagerException */ ! public void deployArtifact( Artifact artifact, Repository repo ) throws ArtifactManagerException { Artifact artifactReal = searchArtifact( artifact, repo ); *************** *** 107,111 **** * @throws ArtifactManagerException */ ! public List getArtifacts( Artifact partialArtifact, ArtifactRepository repo ) throws ArtifactManagerException { if ( partialArtifact == null ) --- 101,105 ---- * @throws ArtifactManagerException */ ! public List getArtifacts( Artifact partialArtifact, Repository repo ) throws ArtifactManagerException { if ( partialArtifact == null ) *************** *** 120,124 **** } } ! ArtifactRepository targetRepo = repo == null ? localRepo : repo; List artifacts = targetRepo.getArtifacts(); System.out.println("NB artifacts in the list : " + artifacts.size() ); --- 114,118 ---- } } ! Repository targetRepo = repo == null ? localRepo : repo; List artifacts = targetRepo.getArtifacts(); System.out.println("NB artifacts in the list : " + artifacts.size() ); *************** *** 127,135 **** { Artifact artifact = (Artifact) it.next(); ! if ( artifact.isMatchCriteria( partialArtifact ) ) ! { ! System.out.println("Add an artifact in the list : " + artifact.getUId() ); selectedArtifacts.add( artifact ); ! } } return selectedArtifacts; --- 121,129 ---- { Artifact artifact = (Artifact) it.next(); ! // if ( artifact.isMatchCriteria( partialArtifact ) ) ! // { ! System.out.println("Add an artifact in the list : " + artifact.getId() ); selectedArtifacts.add( artifact ); ! // } } return selectedArtifacts; *************** *** 159,163 **** * @throws ArtifactManagerException */ ! public void uninstallArtifact(Artifact artifact, ArtifactRepository repo) throws ArtifactManagerException { Artifact target = searchArtifact( artifact, repo ); --- 153,157 ---- * @throws ArtifactManagerException */ ! public void uninstallArtifact(Artifact artifact, Repository repo) throws ArtifactManagerException { Artifact target = searchArtifact( artifact, repo ); *************** *** 171,175 **** * @throws ArtifactManagerException */ ! public void modifyArtifact( Artifact partialArtifact, ArtifactRepository repo ) throws ArtifactManagerException { Artifact artifact = searchArtifact( partialArtifact, repo ); --- 165,169 ---- * @throws ArtifactManagerException */ ! public void modifyArtifact( Artifact partialArtifact, Repository repo ) throws ArtifactManagerException { Artifact artifact = searchArtifact( partialArtifact, repo ); *************** *** 185,189 **** * @todo */ ! public Artifact searchArtifact(Artifact partialArtifact, ArtifactRepository repo) throws ArtifactManagerException { if ( partialArtifact == null ) --- 179,183 ---- * @todo */ ! public Artifact searchArtifact(Artifact partialArtifact, Repository repo) throws ArtifactManagerException { if ( partialArtifact == null ) *************** *** 192,196 **** } // todo identify an invalide / incomplete UID ! ArtifactRepository targetRepo = repo == null ? localRepo : repo; List artifacts = targetRepo.getArtifacts(); if ( artifacts.contains( partialArtifact ) ) --- 186,190 ---- } // todo identify an invalide / incomplete UID ! Repository targetRepo = repo == null ? localRepo : repo; List artifacts = targetRepo.getArtifacts(); if ( artifacts.contains( partialArtifact ) ) *************** *** 228,232 **** * @return */ ! public ArtifactRepository getLocalRepository() { return localRepo; --- 222,226 ---- * @return */ ! public Repository getLocalRepository() { return localRepo; *************** *** 237,241 **** * @param localRepo */ ! public void setLocalRepository( ArtifactRepository localRepo ) { this.localRepo = localRepo; --- 231,235 ---- * @param localRepo */ ! public void setLocalRepository( Repository localRepo ) { this.localRepo = localRepo; *************** *** 243,262 **** /** - * @return Returns the artifactFactory. - */ - public ArtifactFactory getArtifactFactory() - { - return artifactFactory; - } - - /** - * @param artifactFactory The artifactFactory to set. - */ - public void setArtifactFactory( ArtifactFactory artifactFactory ) - { - this.artifactFactory = artifactFactory; - } - - /** * @see net.sf.ts2.pm.artifact.manager.ArtifactManager#getArtifactDeployer() * @return --- 237,240 ---- |