incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 21612 - in incubator/depot/trunk/update/src/java: . org/apache/depot/update org/apache/depot/update/ant/cache org/apache/depot/update/impl org/apache/depot/update/repository
Date Wed, 23 Jun 2004 21:12:24 GMT
Author: ajack
Date: Wed Jun 23 14:12:23 2004
New Revision: 21612

Modified:
   incubator/depot/trunk/update/src/java/depot-update-antlib.xml
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManager.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySetSortContext.java
Log:
More of the same..


Modified: incubator/depot/trunk/update/src/java/depot-update-antlib.xml
==============================================================================
--- incubator/depot/trunk/update/src/java/depot-update-antlib.xml	(original)
+++ incubator/depot/trunk/update/src/java/depot-update-antlib.xml	Wed Jun 23 14:12:23 2004
@@ -14,9 +14,9 @@
 limitations under the License.
 -->
 <antlib>
-    <typedef name="cachedset" classname="org.apache.depot.update.ant.cache.CachedResourceSet"/>
-    <taskdef name="cachedsetexport" classname="org.apache.depot.update.ant.cache.CachedResourceSetExportTask"/>
   
-    <typedef name="resource" classname="org.apache.depot.update.ant.cache.ResourceElement"/>
+    <typedef name="cachedset" classname="org.apache.depot.update.ant.cache.CachedArtifactSet"/>
+    <taskdef name="cachedsetexport" classname="org.apache.depot.update.ant.cache.CachedArtifactSetExportTask"/>
   
+    <typedef name="resource" classname="org.apache.depot.update.ant.cache.ArtifactElement"/>
     <typedef name="repository" classname="org.apache.depot.update.ant.cache.RepositoryElement"/>
     
     <taskdef name="repoenv" classname="org.apache.depot.update.ant.tool.EnvironmentToolTask"/>

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactUpdater.java	Wed
Jun 23 14:12:23 2004
@@ -27,15 +27,13 @@
 import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.impl.ArtifactUpdaterContext;
-import org.apache.depot.update.impl.ReferenceManager;
-import org.apache.depot.update.impl.RepositoryObject;
-import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.impl.ArtifactUpdaterEngine;
+import org.apache.depot.update.impl.DefaultArtifactUpdater;
+import org.apache.depot.update.impl.ReferenceManager;
 import org.apache.depot.update.query.ArtifactQuery;
 import org.apache.depot.update.query.ArtifactQueryHelper;
 import org.apache.depot.update.query.ResourceResult;
 import org.apache.depot.update.query.ResourceResultHelper;
-import org.apache.depot.update.repository.DefaultRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.repository.RepositorySetSortContext;
 import org.apache.depot.update.util.UpdateConstants;
@@ -46,7 +44,7 @@
 import org.apache.depot.update.util.text.Messages;
 
 /**
- * A ResourceUpdater is the main (low level) API into Depot.
+ * An ArtifactUpdater is the main (low level) API into Depot.
  * 
  * @see DefaultArtifactUpdater, StandardResourceUpdater
  * 
@@ -54,14 +52,14 @@
  */
 public class ArtifactUpdater implements IReferenceable {
 	
-	public class Identifier extends GenericIdentifier {
+	public static class Identifier extends GenericIdentifier {
 
-		public static final String RUPER_URI =
+		public static final String UPDATER_URI =
 			"http://depot.apache.org/update";
-		public static final String RUPER_PREFIX = "update";
+		public static final String UPDATER_PREFIX = "update";
 
 		public Identifier(final String id) {
-			super(RUPER_URI, RUPER_PREFIX, id);
+			super(UPDATER_URI, UPDATER_PREFIX, id);
 		}
 	}
 	static {
@@ -218,35 +216,6 @@
 		return RepositorySetSortContext.getDefaultRepositorySetSortContext();
 	}
 
-	public RepositoryObject getRepositoryObject(String repositoryId)
-		throws UpdateException {
-
-		RepositoryObject repositoryObject = null;
-
-		Repository repository =
-			DefaultRepository.getRepository(repositoryId, true);
-		if (repository != null) {
-			repositoryObject = getRepositoryObject(repository);
-		}
-		return repositoryObject;
-	}
-
-	public RepositoryObject getRepositoryObject(Repository repository)
-		throws UpdateException {
-
-		RepositoryWrapper wrapper =
-			new RepositoryWrapper(repository, getContext());
-		RepositoryObject repositoryObject =
-			new RepositoryObject(
-				repository.getIdentifier().getId(),
-				RepositoryObject.REPOSITORY_ROOT,
-				wrapper);
-
-		// make sure the first level of children are got from the repository
-		repositoryObject.syncChildren();
-		return repositoryObject;
-	}
-
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#updateResources(java.util.List)
 	 */
@@ -481,21 +450,21 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#copyResources(java.util.List)
 	 */
-	public void downloadResources(List resources) throws UpdateException {
+	public void downloadArtifacts(List resources) throws UpdateException {
 		downloadResources(resources, null);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#copyResource(org.apache.depot.update.resource.Resource)
 	 */
-	public void downloadResource(Artifact resource) throws UpdateException {
-		downloadResource(resource, null);
+	public void downloadArtifact(Artifact resource) throws UpdateException {
+		downloadArtifact(resource, null);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#copyResource(org.apache.depot.update.resource.Resource)
 	 */
-	public void downloadResource(
+	public void downloadArtifact(
 		Artifact resource,
 		Repository targetRepository)
 		throws UpdateException {
@@ -533,7 +502,7 @@
 		m_updateEngine.copyTo(resources, targetRepository);
 	}
 
-	public void downloadResourceGroup(
+	public void downloadArtifactGroup(
 		ArtifactGroup group,
 		Repository targetRepository)
 		throws UpdateException {
@@ -542,7 +511,7 @@
 			// get the resource specifier query
 			ArtifactQuery resourceQuery =
 				ArtifactQueryHelper.getResourceGroupQuery(group);
-			downloadResource(resourceQuery, targetRepository);
+			downloadArtifact(resourceQuery, targetRepository);
 		}
 		else {
 			String message = Messages.getString(MessageConstants.NULL_GROUP);
@@ -552,7 +521,7 @@
 		}
 	}
 
-	public void downloadResource(
+	public void downloadArtifact(
 		ArtifactQuery resourceQuery,
 		Repository targetRepository)
 		throws UpdateException {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java	Wed Jun
23 14:12:23 2004
@@ -24,6 +24,7 @@
 import org.apache.depot.update.repository.RepositoryCapability;
 import org.apache.depot.update.repository.RepositoryCapabilitySet;
 import org.apache.depot.update.repository.RepositoryManifest;
+import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.reference.IReferenceable;
 import org.apache.depot.update.util.select.ISelector;
@@ -32,7 +33,16 @@
  * @author anou_mana
  */
 public interface Repository extends IReferenceable {
+	public static class Identifier extends GenericIdentifier {
 
+		public final static String REPO_URI =
+			"http://apache.org/repository/";
+		public final static String REPO_PREFIX = "repo";
+
+		public Identifier(String id) {
+			super(REPO_URI, REPO_PREFIX, id);
+		}
+	}
 	/**
 	* Determines if this set has a particular capability.
 	*

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java
Wed Jun 23 14:12:23 2004
@@ -256,7 +256,7 @@
 	 */
 	private void downLoadRemoteResult(Artifact resource) throws UpdateException {
 		ArtifactUpdater ru = new ArtifactUpdater();
-		ru.downloadResource(resource, getLocalRepository());
+		ru.downloadArtifact(resource, getLocalRepository());
 	}
 	/**
 	 * @return Returns the unmodifiableList of resources.

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
Wed Jun 23 14:12:23 2004
@@ -32,7 +32,7 @@
  */
 public class ArtifactUpdaterContext implements IReferenceable {
 
-	public class Identifier extends GenericIdentifier {
+	public static class Identifier extends GenericIdentifier {
 
 		public final static String UPDATE_CONTEXT_URI =
 			"http://depot.apache.org/update/context";

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractRepository.java
Wed Jun 23 14:12:23 2004
@@ -50,7 +50,7 @@
 
 	private RepositoryCapabilitySet m_capabilities = null;
 	private RepositoryAttributeMap m_attributes = null;
-	private RepositoryIdentifier m_identifier = null;
+	private Repository.Identifier m_identifier = null;
 	private VirtualResourceLocator m_repositoryRoot = null;
 
 	private IResourceFilenameAnalyzer m_analyzer = null;
@@ -71,8 +71,7 @@
 	}
 
 	private void init(String id) {
-
-		m_identifier = new RepositoryIdentifier(id);
+		m_identifier = new Repository.Identifier(id);
 		m_capabilities = new RepositoryCapabilitySet();
 		m_attributes = new RepositoryAttributeMap();
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/DefaultRepository.java
Wed Jun 23 14:12:23 2004
@@ -159,17 +159,17 @@
 
 	public static Repository getRepository(String identifier) {
 
-		return getRepository(new RepositoryIdentifier(identifier), false);
+		return getRepository(new Repository.Identifier(identifier), false);
 	}
 
 	public static Repository getRepository(String identifier,
 			final boolean createIfRequired) {
 
-		return getRepository(new RepositoryIdentifier(identifier),
+		return getRepository(new Repository.Identifier(identifier),
 				createIfRequired);
 	}
 
-	public static Repository getRepository(RepositoryIdentifier identifier,
+	public static Repository getRepository(Repository.Identifier identifier,
 			final boolean createIfRequired) {
 
 		Repository repo = null;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManager.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManager.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManager.java
Wed Jun 23 14:12:23 2004
@@ -49,11 +49,11 @@
 		SelectorHandlerChain selectors =
 			new SelectorHandlerChain(UpdateConstants.SELECTOR);
 
-		// first add the selectors
-		this.addHandlerChain(selectors);
-		this.addHandlerChain(comparators);
+		// First add the selectors
+		addHandlerChain(selectors);
+		addHandlerChain(comparators);
 
-		// set the default sort context
+		// Set the default sort context
 		// default selectors and comparators are used
 		setDefaultRepositorySortContext(
 			RepositorySetSortContext.getDefaultRepositorySetSortContext());
@@ -74,7 +74,7 @@
 		else{
 		
 			m_defaultSortedRepositorySet = RepositorySet.getRepositorySet(
-						new RepositorySetIdentifier(UpdateConstants.DEFAULT),
+						new RepositorySet.Identifier(UpdateConstants.DEFAULT),
 						true);
 		}
 	}
@@ -82,10 +82,10 @@
 	private void sortDefaultRepositorySet() {
 		RepositorySet repositorySet =
 			RepositorySet.getRepositorySet(
-				new RepositorySetIdentifier(UpdateConstants.DEFAULT),
+				new RepositorySet.Identifier(UpdateConstants.DEFAULT),
 				true);
 		try {
-			this.m_defaultSortedRepositorySet =
+			m_defaultSortedRepositorySet =
 				getSortedRepositorySet(repositorySet);
 		}
 		catch (UpdateException exp) {
@@ -96,7 +96,7 @@
 	}
 
 	public void setDefaultSortedRepositorySet(RepositorySet set){
-		this.m_defaultSortedRepositorySet = set;
+		m_defaultSortedRepositorySet = set;
 	}
 	public RepositorySetSortContext getDefaultRepositorySortContext() {
 		return RepositorySetSortContext.getDefaultRepositorySetSortContext();
@@ -115,11 +115,11 @@
 		handlerChain.setHandlers(
 			repositorySetSortContext.getRepositoryComparators());
 
-		this.m_sortContextID = repositorySetSortContext.getIdentifier().getId();
+		m_sortContextID = repositorySetSortContext.getIdentifier().getId();
 	}
 
 	public RepositorySet getDefaultSortedRepositorySet() {
-		return this.m_defaultSortedRepositorySet;
+		return m_defaultSortedRepositorySet;
 	}
 
 	public RepositorySet getSortedRepositorySet(
@@ -131,6 +131,7 @@
 		return getSortedRepositorySet(repositorySet);
 
 	}
+	
 	public RepositorySet getSortedRepositorySet(RepositorySet repositorySet)
 		throws UpdateException {
 
@@ -143,7 +144,7 @@
 		String repositorySetID =
 			repositorySet.getIdentifier().getId()
 				+ "."
-				+ this.m_sortContextID
+				+ m_sortContextID
 				+ "."
 				+ RepositoryConstants.SORTED;
 
@@ -186,7 +187,7 @@
 			if (repositorySet == null) {
 				repositorySet =
 					RepositorySet.getRepositorySet(
-						new RepositorySetIdentifier(UpdateConstants.DEFAULT),
+						new RepositorySet.Identifier(UpdateConstants.DEFAULT),
 						false);
 			}
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySet.java
Wed Jun 23 14:12:23 2004
@@ -31,43 +31,53 @@
  * @author anou_mana
  */
 public class RepositorySet implements IReferenceable {
+	public static class Identifier extends GenericIdentifier {
+
+		public final static String REPO_SET_URI =
+			"http://apache.org/repository/set";
+		public final static String REPO_SET_PREFIX = "repoSet";
+
+		public Identifier(String id) {
+			super(REPO_SET_URI, REPO_SET_PREFIX, id);
+		}
+	}
 
 	public static final String REPOSITORYSET_CLASSNAME = RepositorySet.class.getName();
 
-	private RepositorySetIdentifier m_identifier = null;
+	private RepositorySet.Identifier m_identifier = null;
 	private ArrayList m_repositories = new ArrayList();
 
 	/**
 	 *  
 	 */
 	public RepositorySet() {
-		this(new RepositorySetIdentifier(UpdateConstants.UNNAMED));
+		this(new RepositorySet.Identifier(UpdateConstants.UNNAMED));
 	}
 
 	public RepositorySet(ArrayList list) {
-		this(new RepositorySetIdentifier(UpdateConstants.UNNAMED));
+		this(new RepositorySet.Identifier(UpdateConstants.UNNAMED));
 		this.m_repositories = list;
 	}
 
 	public RepositorySet(String id, ArrayList list) {
-		this(new RepositorySetIdentifier(id));
+		this(new RepositorySet.Identifier(id));
 		this.m_repositories = list;
 	}
 
 	public RepositorySet(Repository target) {
-		this(new RepositorySetIdentifier(UpdateConstants.UNNAMED));
+		this(new RepositorySet.Identifier(UpdateConstants.UNNAMED));
 		m_repositories.add(target);
 	}
 
 	public RepositorySet(String id, Repository target) {
-		this(new RepositorySetIdentifier(id));
+		this(new RepositorySet.Identifier(id));
 		m_repositories.add(target);
 	}
 
 	/**
 	 *  
 	 */
-	public RepositorySet(RepositorySetIdentifier identifier) {
+	public RepositorySet(RepositorySet.Identifier identifier) {
 		m_identifier = identifier;
 	}
 
@@ -75,7 +85,7 @@
 	 *  
 	 */
 	public RepositorySet(String identifier) {
-		m_identifier = new RepositorySetIdentifier(identifier);
+		m_identifier = new RepositorySet.Identifier(identifier);
 	}
 
 	/**
@@ -88,7 +98,7 @@
 	public static RepositorySet getRepositorySet(String identifier,
 			final boolean createIfRequired) {
 
-		return getRepositorySet(new RepositorySetIdentifier(identifier),
+		return getRepositorySet(new RepositorySet.Identifier(identifier),
 				createIfRequired);
 	}
 
@@ -102,7 +112,7 @@
 	/**
 	 * @param identifier
 	 */
-	public void setIdentifier(RepositorySetIdentifier identifier) {
+	public void setIdentifier(RepositorySet.Identifier identifier) {
 		m_identifier = identifier;
 	}
 
@@ -143,7 +153,7 @@
 	}
 
 	public static RepositorySet getRepositorySet(
-			RepositorySetIdentifier identifier, final boolean createIfRequired) {
+			RepositorySet.Identifier identifier, final boolean createIfRequired) {
 
 		RepositorySet set = null;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySetSortContext.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySetSortContext.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositorySetSortContext.java
Wed Jun 23 14:12:23 2004
@@ -32,7 +32,19 @@
  * @author anou_mana
  */
 public class RepositorySetSortContext implements IReferenceable {
-	private RepositorySetSortContextIdentifier m_identifier;
+
+	public static class Identifier extends GenericIdentifier {
+
+		public final static String REPO_SET_SORT_CONTEXT_URI =
+			"http://apache.org/repository/set/sort/context";
+		public final static String REPO_SET_SORT_CONTEXT_PREFIX = "repoSetSortContext";
+
+		public Identifier(String id) {
+			super(REPO_SET_SORT_CONTEXT_URI, REPO_SET_SORT_CONTEXT_PREFIX, id);
+		}
+	}
+	
+	private RepositorySetSortContext.Identifier m_identifier;
 	//handlers who can sort the repository list
 	private List m_repositoryComparators;
 	private List m_repositorySelectors;
@@ -42,7 +54,7 @@
 	 */
 	public RepositorySetSortContext(String identifier) {
 		super();
-		m_identifier = new RepositorySetSortContextIdentifier(identifier);
+		m_identifier = new RepositorySetSortContext.Identifier(identifier);
 	}
 
 	/**
@@ -108,8 +120,8 @@
 	public static RepositorySetSortContext getRepositorySetSortContext(String identifier) {
 
 		RepositorySetSortContext context = null;
-		RepositorySetSortContextIdentifier id =
-			new RepositorySetSortContextIdentifier(identifier);
+		RepositorySetSortContext.Identifier id =
+			new RepositorySetSortContext.Identifier(identifier);
 		try {
 			if (ReferenceManager.hasReference(id)) {
 				context =
@@ -158,7 +170,7 @@
 	/**
 	 * @param identifier
 	 */
-	public void setIdentifier(RepositorySetSortContextIdentifier identifier) {
+	public void setIdentifier(RepositorySetSortContext.Identifier identifier) {
 		m_identifier = identifier;
 	}
 

Mime
View raw message