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 21610 - in incubator/depot/trunk/update/src: java/org/apache/depot/update java/org/apache/depot/update/ant java/org/apache/depot/update/ant/cache java/org/apache/depot/update/ant/sync java/org/apache/depot/update/ant/tool java/org/apache/depot/update/artifact java/org/apache/depot/update/artifact/compare java/org/apache/depot/update/artifact/select java/org/apache/depot/update/files java/org/apache/depot/update/impl java/org/apache/depot/update/messaging java/org/apache/depot/update/protocols java/org/apache/depot/update/protocols/impl java/org/apache/depot/update/query java/org/apache/depot/update/repository java/org/apache/depot/update/resource java/org/apache/depot/update/sample java/org/apache/depot/update/tool test/org/apache/depot/update/ant test/org/apache/depot/update/ant/cache test/org/apache/depot/update/artifact test/org/apache/depot/update/files test/org/apache/depot/update/protocols test/org/apache/depot/update/query test/org/apache/depot/update/repository test/org/apache/depot/update/resource test/org/apache/depot/update/usecases test/org/apache/depot/update/util/io test/org/apache/depot/update/util/net
Date Wed, 23 Jun 2004 19:02:13 GMT
Author: ajack
Date: Wed Jun 23 12:02:12 2004
New Revision: 21610

Added:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ArtifactElement.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactFileSet.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/ant/cache/CachedArtifactSetExportTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/
      - copied from rev 21605, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttribute.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttribute.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttributeMap.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttributeMap.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactConstants.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactConstants.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactGroup.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactGroup.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactIdentifier.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactIdentifier.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactLocator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactSpecifier.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactSpecifier.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactType.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactType.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/
      - copied from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/
      - copied from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterEngine.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterOptions.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQuery.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQueryHelper.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/
      - copied from rev 21605, incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/
   incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java
      - copied, changed from rev 21609, incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ArtifactTests.java
Removed:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceFileSet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSet.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterContext.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterContextIdentifier.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterEngine.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterIdentifier.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ResourceUpdaterOptions.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQuery.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ResourceQueryHelper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/
   incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/
Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ArtifactUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultArtifactUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/Repository.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardArtifactUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/EnvironmentToolTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactGroupComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/ArtifactGroupNameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/FilenameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/NameComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/StandardArtifactComparisons.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/TypeComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/VersionComparator.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/AbstractArtifactSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/FilenameSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/NameSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/ReleaseLevelSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/StandardSelections.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/TypeSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionConstraintsSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionSelector.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/messaging/ResourceRequest.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/IProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/ProtocolOperationsManager.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/AbstractProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/BasicProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/FileProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/HttpClientProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/VfsProtocolOperationsProvider.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.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/ApacheRepository.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/MockRepository.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/RepositoryManifest.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/ArtifactTool.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/Tool.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/protocols/ProtocolOperationsManagerTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/query/QueryTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/repository/RepositoryTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/FileTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/util/net/VirtualResourceLocatorTests.java
Log:
Third try...


Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/Artifact.java	Wed Jun 23 12:02:12 2004
@@ -22,11 +22,11 @@
 
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
-import org.apache.depot.update.resource.ArtifactAttributeMap;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.ArtifactIdentifier;
-import org.apache.depot.update.resource.ArtifactSpecifier;
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactAttributeMap;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactIdentifier;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.flag.Flag;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.update.util.net.VirtualResourceLocator;

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 12:02:12 2004
@@ -24,21 +24,20 @@
 import java.util.Set;
 
 import org.apache.depot.common.log.Logger;
+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.ResourceUpdaterContext;
-import org.apache.depot.update.impl.ResourceUpdaterEngine;
-import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
-import org.apache.depot.update.query.ResourceQuery;
-import org.apache.depot.update.query.ResourceQueryHelper;
+import org.apache.depot.update.impl.ArtifactUpdaterEngine;
+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.resource.ArtifactGroup;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.update.util.reference.IReferenceable;
@@ -54,7 +53,17 @@
  * @author anou_mana
  */
 public class ArtifactUpdater implements IReferenceable {
+	
+	public class Identifier extends GenericIdentifier {
 
+		public static final String RUPER_URI =
+			"http://depot.apache.org/update";
+		public static final String RUPER_PREFIX = "update";
+
+		public Identifier(final String id) {
+			super(RUPER_URI, RUPER_PREFIX, id);
+		}
+	}
 	static {
 		// Configure from the shared XML file...
 		//:TODO: *Maybe* move later, or allow user to pass filename
@@ -63,7 +72,7 @@
 	}
 
 	// The identity...
-	private ResourceUpdaterIdentifier m_identifier = null;
+	private ArtifactUpdater.Identifier m_identifier = null;
 
 	// Options for configuring the Updater
 	private Map m_resourceConfigOptions = new HashMap();
@@ -72,7 +81,7 @@
 	private Repository m_targetRepository;
 
 	//Updater
-	private ResourceUpdaterEngine m_updateEngine;
+	private ArtifactUpdaterEngine m_updateEngine;
 
 	/**
 	 * Get the default (locally configured) ResourceUpdater.
@@ -129,8 +138,8 @@
 	 * @throws UpdateException
 	 */
 	public ArtifactUpdater(String id) throws UpdateException {
-		m_identifier = new ResourceUpdaterIdentifier(id);
-		m_updateEngine = new ResourceUpdaterEngine();
+		m_identifier = new ArtifactUpdater.Identifier(id);
+		m_updateEngine = new ArtifactUpdaterEngine();
 		resourceConfigInit();
 	}
 
@@ -139,10 +148,10 @@
 	 * @param id the public name
 	 * @throws UpdateException
 	 */
-	public ArtifactUpdater(ResourceUpdaterIdentifier id)
+	public ArtifactUpdater(ArtifactUpdater.Identifier id)
 		throws UpdateException {
 		m_identifier = id;
-		m_updateEngine = new ResourceUpdaterEngine();
+		m_updateEngine = new ArtifactUpdaterEngine();
 		resourceConfigInit();
 	}
 
@@ -152,8 +161,8 @@
 	 * @throws UpdateException
 	 */
 	public ArtifactUpdater() {
-		m_identifier = new ResourceUpdaterIdentifier(UpdateConstants.DEFAULT);
-		m_updateEngine = new ResourceUpdaterEngine();
+		m_identifier = new ArtifactUpdater.Identifier(UpdateConstants.DEFAULT);
+		m_updateEngine = new ArtifactUpdaterEngine();
 		resourceConfigInit();
 	}
 
@@ -178,7 +187,7 @@
 	 * 
 	 * @return
 	 */
-	public ResourceUpdaterContext getContext() {
+	public ArtifactUpdaterContext getContext() {
 		return m_updateEngine.getContext();
 	}
 
@@ -270,8 +279,8 @@
 		if (resource != null) {
 
 			// get the resource specifier query
-			ResourceQuery resourceQuery =
-				ResourceQueryHelper.getResourceQuery(resource);
+			ArtifactQuery resourceQuery =
+				ArtifactQueryHelper.getResourceQuery(resource);
 			updateResource(resourceQuery, targetRepository);
 		}
 		else {
@@ -298,8 +307,8 @@
 
 		if (group != null) {
 			// get the resource specifier query
-			ResourceQuery resourceQuery =
-				ResourceQueryHelper.getResourceGroupQuery(group);
+			ArtifactQuery resourceQuery =
+				ArtifactQueryHelper.getResourceGroupQuery(group);
 			updateResource(resourceQuery, targetRepository);
 		}
 		else {
@@ -313,7 +322,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#updateResource(org.apache.depot.update.resource.Resource, org.apache.depot.update.query.ResourceQuery)
 	 */
-	public void updateResource(ResourceQuery resourceQuery)
+	public void updateResource(ArtifactQuery resourceQuery)
 		throws UpdateException {
 		updateResource(resourceQuery, null);
 	}
@@ -322,7 +331,7 @@
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#updateResource(org.apache.depot.update.resource.Resource, org.apache.depot.update.query.ResourceQuery)
 	 */
 	public void updateResource(
-		ResourceQuery resourceQuery,
+		ArtifactQuery resourceQuery,
 		Repository targetRepository)
 		throws UpdateException {
 
@@ -363,7 +372,7 @@
 	 * @return
 	 */
 	private List determineUpdates(
-		ResourceQuery resourceQuery,
+		ArtifactQuery resourceQuery,
 		ResourceResult resourceResult,
 		ResourceResult targetResult) {
 
@@ -443,8 +452,8 @@
 	public List findResource(Artifact resource, Repository target)
 		throws UpdateException {
 		// get the resource specifier query
-		ResourceQuery resourceQuery =
-			ResourceQueryHelper.getResourceSpecifierQuery(resource);
+		ArtifactQuery resourceQuery =
+			ArtifactQueryHelper.getResourceSpecifierQuery(resource);
 		//set the target repository
 		if (target != null)
 			resourceQuery.setRepositorySet(new RepositorySet(target));
@@ -459,7 +468,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.depot.update.api.ResourceAPIInterface#findResource(org.apache.depot.update.resource.Resource, org.apache.depot.update.query.ResourceQuery)
 	 */
-	public List findResource(ResourceQuery resourceQuery)
+	public List findResource(ArtifactQuery resourceQuery)
 		throws UpdateException {
 		// Query the repositories to get the result	
 		ResourceResult resourceResult = m_updateEngine.query(resourceQuery);
@@ -531,8 +540,8 @@
 
 		if (group != null) {
 			// get the resource specifier query
-			ResourceQuery resourceQuery =
-				ResourceQueryHelper.getResourceGroupQuery(group);
+			ArtifactQuery resourceQuery =
+				ArtifactQueryHelper.getResourceGroupQuery(group);
 			downloadResource(resourceQuery, targetRepository);
 		}
 		else {
@@ -544,7 +553,7 @@
 	}
 
 	public void downloadResource(
-		ResourceQuery resourceQuery,
+		ArtifactQuery resourceQuery,
 		Repository targetRepository)
 		throws UpdateException {
 
@@ -567,8 +576,8 @@
 
 		// Query & sort by version
 		//		get the resource specifier query
-		ResourceQuery resourceQuery =
-			ResourceQueryHelper.getResourceGroupQuery(group);
+		ArtifactQuery resourceQuery =
+			ArtifactQueryHelper.getResourceGroupQuery(group);
 
 		// Where to look
 		resourceQuery.setRepositorySet(new RepositorySet(repository));
@@ -601,12 +610,12 @@
 	public static ArtifactUpdater getDefaultResourceUpdater()
 		throws UpdateException {
 		return getResourceUpdater(
-			new ResourceUpdaterIdentifier(UpdateConstants.DEFAULT),
+			UpdateConstants.DEFAULT,
 			true);
 	}
 
 	public static ArtifactUpdater getResourceUpdater(
-		ResourceUpdaterIdentifier identifier,
+		ArtifactUpdater.Identifier identifier,
 		final boolean createIfRequired)
 		throws UpdateException {
 
@@ -661,7 +670,7 @@
 	 * :TODO: temporary, until we figure out what RU and RE both do.
 	 * @return
 	 */
-	ResourceUpdaterEngine getUpdateEngine() {
+	ArtifactUpdaterEngine getUpdateEngine() {
 		return m_updateEngine;
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultArtifactUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultArtifactUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/DefaultArtifactUpdater.java	Wed Jun 23 12:02:12 2004
@@ -16,7 +16,6 @@
 
 package org.apache.depot.update;
 
-import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
 import org.apache.depot.update.sample.FileUpdater;
 
 
@@ -45,7 +44,7 @@
 	 * @param id
 	 * @throws UpdateException
 	 */
-	public DefaultArtifactUpdater(ResourceUpdaterIdentifier id)
+	public DefaultArtifactUpdater(ArtifactUpdater.Identifier id)
 		throws UpdateException {
 		super(id);
 		// TODO Auto-generated constructor stub

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 12:02:12 2004
@@ -19,11 +19,11 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 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.resource.ArtifactGroup;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.reference.IReferenceable;
 import org.apache.depot.update.util.select.ISelector;
@@ -59,7 +59,7 @@
 	 * 
 	 * @param context
 	 */
-	void initialize(ResourceUpdaterContext context) throws Exception;
+	void initialize(ArtifactUpdaterContext context) throws Exception;
 
 	/**
 	 * Return the root for this repository 
@@ -73,7 +73,7 @@
 	 * @param selector
 	 * @return
 	 */
-	List listGroups(ResourceUpdaterContext context, ISelector selector)
+	List listGroups(ArtifactUpdaterContext context, ISelector selector)
 		throws Exception;
 
 	/**
@@ -82,7 +82,7 @@
 	 * @return
 	 */
 	List listSpecifiers(
-		ResourceUpdaterContext context,
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception;
@@ -93,7 +93,7 @@
 	 * @return
 	 */
 	RepositoryManifest getManifest(
-		ResourceUpdaterContext context,
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception;
@@ -104,8 +104,8 @@
 	 * @param selector
 	 * @return
 	 */
-	List listResources(
-		ResourceUpdaterContext context,
+	List listArtifacts(
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception;
@@ -116,7 +116,7 @@
 	 * @param selector
 	 * @return
 	*/
-	void deleteResource(ResourceUpdaterContext context, Artifact resource)
+	void deleteArtifact(ArtifactUpdaterContext context, Artifact resource)
 		throws Exception;
 
 	/**
@@ -125,7 +125,7 @@
 	 * @param selector
 	 * @return
 	*/
-	Artifact publishResource(ResourceUpdaterContext context, Artifact resource)
+	Artifact publishArtifact(ArtifactUpdaterContext context, Artifact resource)
 		throws Exception;
 
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardArtifactUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardArtifactUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/StandardArtifactUpdater.java	Wed Jun 23 12:02:12 2004
@@ -17,7 +17,6 @@
 package org.apache.depot.update;
 
 import org.apache.depot.update.config.UpdateConfig;
-import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
 
 /**
  * A StandardResourceUpdater is a {@link org.apache.depot.update.DefaultArtifactUpdater }
@@ -40,7 +39,7 @@
 	 * @param id
 	 * @throws UpdateException
 	 */
-	public StandardArtifactUpdater(ResourceUpdaterIdentifier id)
+	public StandardArtifactUpdater(ArtifactUpdater.Identifier id)
 		throws UpdateException {
 		super(id);
 		initClass();

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/AntUtils.java	Wed Jun 23 12:02:12 2004
@@ -17,6 +17,7 @@
  */
 package org.apache.depot.update.ant;
 import java.io.File;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 /**

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ArtifactElement.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ArtifactElement.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,273 @@
+/*
+ * ========================================================================
+ * Copyright 2004 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * ========================================================================
+ */
+package org.apache.depot.update.ant.cache;
+import java.io.File;
+
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactType;
+import org.apache.depot.update.artifact.compare.VersionComparator;
+import org.apache.depot.update.artifact.select.NameSelector;
+import org.apache.depot.update.artifact.select.TypeSelector;
+import org.apache.depot.update.artifact.select.VersionSelector;
+import org.apache.depot.update.impl.RepositorySetWrapper;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
+import org.apache.depot.update.protocols.DefaultProtocolOperationsManager;
+import org.apache.depot.update.query.ArtifactQuery;
+import org.apache.depot.update.query.DefaultQueryEngine;
+import org.apache.depot.update.query.ResourceResult;
+import org.apache.depot.update.repository.DefaultRepository;
+import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.util.io.ResolvedFile;
+import org.apache.depot.update.util.net.VirtualResourceLocator;
+import org.apache.depot.update.util.select.ISelector;
+import org.apache.depot.update.util.select.logic.AndSelector;
+import org.apache.depot.version.Version;
+import org.apache.depot.version.VersionException;
+import org.apache.depot.version.impl.VersionImporter;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+/**
+ * @version $Revision: $
+ */
+public class ArtifactElement extends DataType {
+	private String group;
+	private String name;
+	private String version;
+	private String repository;
+	private String ext;
+	private Artifact bestRemoteResource;
+	private final Project project;
+	/**
+	 * @return Returns the name.
+	 */
+	public String getName() {
+		return name;
+	}
+	/**
+	 * @param name
+	 *            The name to set.
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	/**
+	 * @return Returns the repository.
+	 */
+	public String getRepository() {
+		return repository;
+	}
+	/**
+	 * @param repository
+	 *            The repository to set.
+	 */
+	public void setRepository(String repository) {
+		this.repository = repository;
+	}
+	/**
+	 * @return Returns the version.
+	 */
+	public String getVersion() {
+		return version;
+	}
+	/**
+	 * @param version
+	 *            The version to set.
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	/**
+	 * @return Returns the ext.
+	 */
+	public String getExt() {
+		return ext;
+	}
+	/**
+	 * * The ext to set.
+	 */
+	public void setExt(String ext) {
+		this.ext = ext;
+	}
+	public String toString() {
+		return name + "-" + version + "." + ext + "@" + repository;
+	}
+	/**
+	 * @return
+	 */
+	Artifact initResource() {
+		Artifact r = new Artifact(getResourceGroup(), name, getVersionObject(),
+				getResourceType(), ext, getFileName(), getLocation());
+		return r;
+	}
+	/**
+	 * @return
+	 */
+	private VirtualResourceLocator getLocation() {
+		ResolvedFile rf = ResolvedFile.resolve(new File(getFileName()));
+		VirtualResourceLocator vrl = new VirtualResourceLocator(rf);
+		// TODO Auto-generated method stub
+		return vrl;
+	}
+	/**
+	 * @return
+	 */
+	private String getFileName() {
+		// TODO Auto-generated method stub
+		return getName() + "-" + getVersion() + "." + getExt();
+	}
+	/**
+	 * @return
+	 */
+	ArtifactType getResourceType() {
+		return ArtifactType.JAVA_BINARY;// TODO fix
+	}
+	/**
+	 * @return
+	 */
+	private Version getVersionObject() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	/**
+	 * @return
+	 */
+	ArtifactGroup getResourceGroup() {
+		ArtifactGroup rg = new ArtifactGroup(group == null ? name : group);
+		return rg;
+	}
+	/**
+	 * @return Returns the group.
+	 */
+	public String getGroup() {
+		return group;
+	}
+	/**
+	 * @param group
+	 *            The group to set.
+	 */
+	public void setGroup(String group) {
+		this.group = group;
+	}
+	/**
+	 * @return
+	 */
+	public TypeSelector getResourceTypeSelector() {
+		// TODO Auto-generated method stub
+		return new TypeSelector(getResourceType());
+	}
+	/**
+	 * @return
+	 */
+	public Repository getIRepository() {
+		RepositoryElement repositoryElement = (RepositoryElement) project
+				.getReference(getRepository());
+		return new DefaultRepository(repositoryElement.getId(),
+				new VirtualResourceLocator(repositoryElement.getUrl()));
+	}
+	/**
+	 *  
+	 */
+	public ArtifactElement(Project project) {
+		super();
+		this.project = project;
+	}
+	public ISelector getResourceSelector() throws VersionException {
+		AndSelector set = new AndSelector();
+		set.addSelector(new NameSelector(name));
+		set.addSelector(new TypeSelector(getResourceType()));
+		if (null != version) {
+			set.addSelector(new VersionSelector(VersionImporter
+					.importVersion(version)));
+		}
+		return (ISelector) set;
+	}
+	/**
+	 * @return
+	 */
+	public String getDownloadedFrom() {
+		if (bestRemoteResource == null) {
+			bestRemoteResource = findBestRemoteResource();
+		}
+		if (bestRemoteResource != null) {
+			return bestRemoteResource.getLocation().toExternalForm();
+		} else {
+			return null;
+		}
+	}
+	/**
+	 * @return
+	 */
+	public Version getDownloadedVersion() {
+		if (bestRemoteResource == null) {
+			bestRemoteResource = findBestRemoteResource();
+		}
+		if (bestRemoteResource != null) {
+			return bestRemoteResource.getVersion();
+		} else {
+			return null;
+		}
+	}
+	/**
+	 * @param this
+	 * @return
+	 */
+	Artifact findBestRemoteResource() {
+		ResourceResult res = query(getIRepository());
+		Artifact resource = null;
+		if (res.size() == 0) {
+			resource = null;
+		} else if (res.size() == 1) {
+			resource = ResourceResult.getFirstResource(res);
+		} else {
+			getProject().log(
+					"Found " + res.size() + " matches for " + this
+							+ " returning first", Project.MSG_VERBOSE);
+			resource = ResourceResult.getFirstResource(res);
+		}
+		bestRemoteResource = resource;
+		return resource;
+	}
+	ResourceResult query(Repository repo) { //TODO
+		// experiment
+		getProject().log("Looking for " + this, Project.MSG_DEBUG);
+		try {
+			DefaultQueryEngine dqe = new DefaultQueryEngine();
+			ArtifactQuery query = new ArtifactQuery(getResourceGroup(),
+					getResourceSelector(), null, VersionComparator.REVERSE);
+			//TODO need to be a better way to sort by.
+			ArtifactUpdaterContext context = new ArtifactUpdaterContext();
+			context.setProtocolManager(new DefaultProtocolOperationsManager(
+					context));
+			RepositorySet repositorySet = RepositorySet.getRepositorySet(repo
+					.getIdentifier().getId(), true);
+			repositorySet.addRepository(repo);
+			RepositorySetWrapper rw = new RepositorySetWrapper(repositorySet,
+					context);
+			ResourceResult result = dqe.queryRepositories(rw, query);
+			return result;
+		} catch (VersionException e) {
+			throw new BuildException("Unable to process " + this, e);
+		} catch (UpdateException e) {
+			throw new BuildException("Unable to get " + this, e);
+		}
+	}
+}
\ No newline at end of file

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactFileSet.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactFileSet.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,66 @@
+/*
+ * ========================================================================
+ * Copyright 2004 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * ========================================================================
+ */
+package org.apache.depot.update.ant.cache;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.FileScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.FileSet;
+/**
+ *  
+ */
+final class CachedArtifactFileSet extends FileSet {
+	private final CachedArtifactSet updateSet;
+	private boolean initialized = false;
+	private FileScanner scanner;
+	CachedArtifactFileSet(CachedArtifactSet updateSet) {
+		this.updateSet = updateSet;
+	}
+	private synchronized void initialize() {
+		if (!initialized) {
+			try {
+				scanner = updateSet.getFileScanner();
+				scanner.getIncludedFiles();
+				setDir(scanner.getBasedir());
+				setupDirectoryScanner(scanner, updateSet.getProject());
+			} catch (BuildException e) {
+				throw e;
+			} catch (Exception e) {
+				throw new BuildException("error initializing " + getDataTypeName(), e);
+			}
+		}
+		initialized = true;
+	}
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.tools.ant.types.AbstractFileSet#getDirectoryScanner(org.apache.tools.ant.Project)
+	 */
+	public DirectoryScanner getDirectoryScanner(Project p) {
+		initIfNeeded();
+		return super.getDirectoryScanner(p);
+	}
+	/**
+	 *  
+	 */
+	private void initIfNeeded() {
+		if (!initialized) {
+			initialize();
+		}
+	}
+}
\ No newline at end of file

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSet.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,267 @@
+/*
+ * ========================================================================
+ * Copyright 2004 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * ========================================================================
+ */
+package org.apache.depot.update.ant.cache;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.depot.common.ant.util.AntLogListener;
+import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.ArtifactUpdater;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.ant.AntUtils;
+import org.apache.depot.update.query.ResourceResult;
+import org.apache.depot.update.repository.DefaultRepository;
+import org.apache.depot.update.util.io.ResolvedFile;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.FileScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+/**
+ * A locally cached repository backed set of resources.
+ * 
+ * @version $Revision: $
+ */
+public class CachedArtifactSet extends DataType {
+	public static final String DEFAULT_LOCAL_REPOSITORY_DIR_NAME = "local-repository";
+	public static final String LOCAL_REPOSITORY_ID = "local.repository";
+	public static final String REPOSITORY_DIR_PROPERTY = "repository.dir";
+	private final Project project;
+	private String id;
+	private final CachedArtifactFileSet fileSet = new CachedArtifactFileSet(
+			this);
+	private final List resourceList = new ArrayList();
+	private ArtifactUpdater m_updater = null;
+	private boolean isAlwaysCheckRemote = false;
+	private boolean checkClassPath = true;
+	/**
+	 *  
+	 */
+	public CachedArtifactSet(Project project) {
+		super();
+		this.project = project;
+	}
+	/**
+	 * @param resource
+	 * @return Resource
+	 */
+	public ArtifactElement createResource() {
+		ArtifactElement resource = new ArtifactElement(project);
+		resourceList.add(resource);
+		return resource;
+	}
+	/**
+	 * @return Returns the id.
+	 */
+	public String getId() {
+		return id;
+	}
+	/**
+	 * @param id
+	 *            The id to set.
+	 */
+	public void setId(String id) {
+		this.id = id;
+		project.addReference(id + ".fileset", fileSet);
+	}
+	/**
+	 * @return
+	 */
+	FileScanner getFileScanner() throws UpdateException {		
+		final DirectoryScanner scanner = new DirectoryScanner();
+		
+		// Set logging context..
+		Logger logger = Logger.pushContext(new AntLogListener(this));
+
+		try {			
+			scanner.setBasedir(getRepoDir());
+			addResources(scanner);
+		}
+		finally {
+			Logger.popContext(logger);
+		}
+		
+		return scanner;
+	}
+	/**
+	 * @param scanner
+	 */
+	private void addResources(DirectoryScanner scanner) throws UpdateException {
+		for (Iterator i = resourceList.iterator(); i.hasNext();) {
+			ArtifactElement r = (ArtifactElement) i.next();
+			add(scanner, r);
+		}
+	}
+	/**
+	 * @param scanner
+	 * @param r
+	 */
+	private void add(DirectoryScanner scanner, ArtifactElement r)
+			throws UpdateException {
+		log("Looking for " + r, Project.MSG_DEBUG);
+		File f = getLocalFile(r);
+		if (f != null) {
+			String path = f.getAbsolutePath();
+			String basepath = scanner.getBasedir().getAbsolutePath();
+			if (path.startsWith(basepath)) {
+				path = path.substring(basepath.length() + 1);
+			}
+			scanner.setIncludes(new String[]{path});
+			scanner.scan();
+		} else {
+			throw new BuildException("Unable to find " + r);
+		}
+	}
+	/**
+	 * Find and download if needed a the best local cached copy of a file. First
+	 * check if a compitable file is available locally. If not down load the
+	 * best one available from the repository. And finally return the best
+	 * compatible file.
+	 * 
+	 * @param r
+	 *            resourceElement the ant element describeing the resouce to
+	 *            find
+	 * @return File null if a compatible file can't be found.
+	 * @throws UpdateException
+	 */
+	private File getLocalFile(ArtifactElement r) throws UpdateException {
+		// TODO respect the ant build.classpath property.
+		File file = null;
+		if (!isAlwaysCheckRemote) {
+			file = getCachedFile(r);
+		}
+		if (file == null) {
+			cacheFile(r);
+		}
+		file = getCachedFile(r);
+		return file;
+	}
+	/**
+	 * @param r
+	 */
+	private void cacheFile(ArtifactElement r) {
+		try {
+			Artifact resource = findBestRemoteResource(r);
+			if (resource != null) {
+				
+				downLoadRemoteResult(resource);
+			}
+			return;
+		} catch (Exception e) {
+			throw new BuildException("Unable to get local copy of " + r, e);
+		}
+	}
+	/**
+	 * @param r
+	 * @return
+	 */
+	Artifact findBestRemoteResource(ArtifactElement r) {
+		return r.findBestRemoteResource();
+	}
+	/**
+	 * @param r
+	 */
+	private File getCachedFile(ArtifactElement r) throws UpdateException {
+		try {
+			ResourceResult res = query(r, getLocalRepository());
+			if (res.size() == 0) {
+				return null;
+			} else if (res.size() == 1) {
+				return getFirstFile(res);
+			} else {
+				log("Found " + res.size() + " matches for " + r
+						+ " returning first", Project.MSG_VERBOSE);
+				return getFirstFile(res);
+			}
+		} catch (Exception e) {
+			throw new BuildException("Error trying to get local copy of " + r,
+					e);
+		}
+	}
+	/**
+	 * @return
+	 */
+	private File getRepoDir() {
+		// TODO cache this.
+		File repo = AntUtils.findAndCreateDirFromProperty(getProject(),
+				REPOSITORY_DIR_PROPERTY);
+		if (repo == null) {
+			repo = new File(AntUtils.getDepotHome(getProject()),
+					DEFAULT_LOCAL_REPOSITORY_DIR_NAME);
+		}
+		AntUtils.createAndValidateDir(getProject(), repo,
+				"Local Repository Cache", true);
+		return repo;
+	}
+	/**
+	 * Should the cached set always look the remore repository for updates
+	 * 
+	 * @return Returns the isAlwaysCheckRemote.
+	 */
+	public boolean isAlwaysCheckRemote() {
+		return isAlwaysCheckRemote;
+	}
+	/**
+	 * Should the cached set always look the remore repository for updates
+	 * 
+	 * @param isAlwaysCheckRemote
+	 *            The isAlwaysCheckRemote to set.
+	 */
+	public void setAlwaysCheckRemote(boolean isAlwaysCheckRemote) {
+		this.isAlwaysCheckRemote = isAlwaysCheckRemote;
+	}
+	/**
+	 * @param r
+	 * @param res
+	 * @return
+	 */
+	private File getFirstFile(ResourceResult res) throws Exception {
+		Artifact resource = ResourceResult.getFirstResource(res);
+		return resource.getLocation().getFile();
+	}
+	private ResourceResult query(ArtifactElement r, Repository repo) {
+		return r.query(repo);
+	}
+	/**
+	 * @return
+	 */
+	private Repository getLocalRepository() {
+		DefaultRepository repository = new DefaultRepository(
+				LOCAL_REPOSITORY_ID, ResolvedFile.resolve(getRepoDir()));
+		return repository;
+	}
+	/**
+	 * @param resource
+	 * @throws UpdateException
+	 */
+	private void downLoadRemoteResult(Artifact resource) throws UpdateException {
+		ArtifactUpdater ru = new ArtifactUpdater();
+		ru.downloadResource(resource, getLocalRepository());
+	}
+	/**
+	 * @return Returns the unmodifiableList of resources.
+	 */
+	List getResourceList() {
+		return Collections.unmodifiableList(resourceList);
+	}
+}
\ No newline at end of file

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSetExportTask.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedArtifactSetExportTask.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,127 @@
+/*
+ * ========================================================================
+ * Copyright 2004 The Apache Software Foundation
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * ========================================================================
+ */
+package org.apache.depot.update.ant.cache;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.depot.version.Version;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+/**
+ * Export a cached resource set to xml file. <code>
+ * <cachedresourceset>
+ *      <resource name="foo" 
+ *                version="1.2.3"  
+ *                href="http://mydownload.com/bar/foo-1.2.3.jar" 
+ *                local="${local.repository}/bar/jars/foo-1.2.3.jar"/>
+ * </cachedresourceset>
+ * </code>
+ */
+public class CachedArtifactSetExportTask extends Task {
+	private String refid;
+	private File toFile;
+	/**
+	 * The refid of the cachedset to export.
+	 * 
+	 * @return Returns the refid.
+	 */
+	public String getRefid() {
+		return refid;
+	}
+	/**
+	 * SEt the refid of the cachedset to export
+	 * 
+	 * @param refid
+	 *            The refid to set.
+	 */
+	public void setRefid(String refid) {
+		this.refid = refid;
+	}
+	/**
+	 * The file to export the Cached set to
+	 * 
+	 * @return Returns the toFile.
+	 */
+	public File getToFile() {
+		return toFile;
+	}
+	/**
+	 * The file to export the Cached set to
+	 * 
+	 * @param toFile
+	 *            The toFile to set.
+	 */
+	public void setToFile(File toFile) {
+		this.toFile = toFile;
+	}
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.tools.ant.Task#execute()
+	 */
+	public void execute() throws BuildException {
+		try {
+			CachedArtifactSet cachedResourceSet = (CachedArtifactSet) getProject()
+					.getReference(getRefid());
+			// TODO use real XML stuff
+			// njc Feeling lazy tonight
+			Writer writer = new FileWriter(getToFile());
+			PrintWriter out = new PrintWriter(writer);
+			List resourceList = cachedResourceSet.getResourceList();
+			out.println("<?xml " + nameValue("version", "1.0") + "?>");
+			out
+					.println("<!DOCTYPE cachedresourceset PUBLIC \"-//APACHE//DTD CachedResource V0.1//EN\" \"http://incubator.apache.org/depot/dtd/cachedresource-v01.dtd\">");
+			out.println("<cachedresourceset " + nameValue("id", getRefid())
+					+ ">");
+			for (Iterator i = resourceList.iterator(); i.hasNext();) {
+				ArtifactElement resource = (ArtifactElement) i.next();
+				out.println("    <resource "
+						+ nameValue("name", resource.getName()));
+				out.println("              "
+						+ nameValue("group", resource.getGroup() == null
+								? resource.getName()
+								: resource.getGroup()));
+				Version version = resource.getDownloadedVersion();
+				if (version == null) {
+					version = Version.UNKNOWN;
+				}
+			
+				out.println("              "
+						+ nameValue("version", version.toString()));
+				out.println("              "
+						+ nameValue("href", resource.getDownloadedFrom()));
+				out.println("     />");
+				log(resource + "  from  " + resource.getDownloadedFrom());
+			}
+			out.println("</cachedresourceset>");
+			out.close();
+			writer.close();
+		} catch (Exception e) {
+			throw new BuildException("Error exporting cached resource set "
+					+ getRefid(), e);
+		}
+	}
+	private String nameValue(final String name, final String value) {
+		String togther = name + "=\"" + value + "\"";
+		return togther;
+	}
+}
\ No newline at end of file

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/sync/SynchronizeTask.java	Wed Jun 23 12:02:12 2004
@@ -16,13 +16,13 @@
 
 package org.apache.depot.update.ant.sync;
 
+import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.ArtifactUpdater;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.resource.ArtifactGroup;
 import org.apache.depot.update.util.UpdateConstants;
-import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/EnvironmentToolTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/EnvironmentToolTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/EnvironmentToolTask.java	Wed Jun 23 12:02:12 2004
@@ -16,10 +16,10 @@
 
 package org.apache.depot.update.ant.tool;
 
+import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.envsafe.ClassLoaderContext;
 import org.apache.depot.update.protocols.DefaultProtocolOperationsManager;
-import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/tool/RepositoryToolTask.java	Wed Jun 23 12:02:12 2004
@@ -19,21 +19,21 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.depot.common.log.LogConstants;
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.impl.RepositoryWrapper;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.StatisticsMonitor;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.ArtifactSpecifier;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.select.AllSelector;
-import org.apache.depot.common.ant.util.AntLogListener;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
@@ -82,7 +82,7 @@
 		try {
 			log("RepositorySet: " + m_repositories);
 
-			ResourceUpdaterContext context = ResourceUpdaterContext.getDefaultContext();
+			ArtifactUpdaterContext context = ArtifactUpdaterContext.getDefaultContext();
 
 			//
 			// This uses default or configured stuff..

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttribute.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttribute.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttribute.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttribute.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import org.apache.depot.update.util.flag.Flag;
 import org.apache.depot.update.util.xml.IXMLAttribute;

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttributeMap.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttributeMap.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactAttributeMap.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactAttributeMap.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import java.util.List;
 

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactConstants.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactConstants.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactConstants.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactConstants.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 /**
  * @author anou_mana

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactGroup.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactGroup.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactGroup.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactGroup.java	Wed Jun 23 12:02:12 2004
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 /**
  * @author <a href="http://incubator.apache.org/depot">The Apache Incubator Depot Project</a>
  */

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactIdentifier.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactIdentifier.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactIdentifier.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactIdentifier.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import org.apache.depot.update.util.identity.GenericIdentifier;
 

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactLocator.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactLocator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactLocator.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import java.io.PrintWriter;
 

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactSpecifier.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactSpecifier.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactSpecifier.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactSpecifier.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import java.io.PrintWriter;
 

Copied: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactType.java (from rev 21609, incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactType.java)
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/ArtifactType.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/ArtifactType.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import org.apache.depot.update.util.identity.GenericNamespace;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractArtifactComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 
@@ -74,6 +74,6 @@
 	}
 
 	public abstract int compareResources(
-		final Artifact resource1,
-		final Artifact resource2);
+		final Artifact artifact1,
+		final Artifact artifact2);
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactGroupComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/AbstractArtifactGroupComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/AbstractArtifactGroupComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,11 +14,11 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 
@@ -74,6 +74,6 @@
 	}
 
 	public abstract int compareResourceGroups(
-		final ArtifactGroup resourceGroup1,
-		final ArtifactGroup resourceGroup2);
+		final ArtifactGroup artifactGroup1,
+		final ArtifactGroup artifactGroup2);
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/ArtifactGroupNameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/ArtifactGroupNameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/ArtifactGroupNameComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,11 +14,11 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/FilenameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/FilenameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/FilenameComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/NameComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/NameComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/NameComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/StandardArtifactComparisons.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/StandardArtifactComparisons.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/StandardArtifactComparisons.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import org.apache.depot.update.util.compare.ComparatorSequence;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/TypeComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/TypeComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/TypeComparator.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 
 import java.util.Comparator;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/VersionComparator.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/compare/VersionComparator.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/compare/VersionComparator.java	Wed Jun 23 12:02:12 2004
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.depot.update.resource.compare;
+package org.apache.depot.update.artifact.compare;
 import java.util.Comparator;
 
 import org.apache.depot.update.Artifact;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/AbstractArtifactSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/AbstractArtifactSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/AbstractArtifactSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.common.util.SystemUtils;
 import org.apache.depot.update.Artifact;
@@ -36,7 +36,7 @@
 		boolean selected = false;
 
 		if (object instanceof Artifact) {
-			selected = selectResource((Artifact) object);
+			selected = selectArtifact((Artifact) object);
 		}
 		else {
 			throw new IllegalArgumentException(
@@ -53,5 +53,5 @@
 		return SystemUtils.getShortName(getClass());
 	}
 
-	public abstract boolean selectResource(final Artifact resource);
+	public abstract boolean selectArtifact(final Artifact artifact);
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/FilenameSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/FilenameSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/FilenameSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.util.regexp.RegularExpression;
@@ -45,8 +45,8 @@
 		m_regexp = new RegularExpressionSelector(expression);
 	}
 
-	public boolean selectResource(Artifact resource) {
-		return m_regexp.select(resource.getFilename());
+	public boolean selectArtifact(Artifact artifact) {
+		return m_regexp.select(artifact.getFilename());
 	}
 
 	public String toString() {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/NameSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/NameSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/NameSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.util.regexp.RegularExpression;
@@ -46,8 +46,8 @@
 		m_regexp = new RegularExpressionSelector(expression);
 	}
 
-	public boolean selectResource(Artifact resource) {
-		return m_regexp.select(resource.getIdentifier().getId());
+	public boolean selectArtifact(Artifact artifact) {
+		return m_regexp.select(artifact.getIdentifier().getId());
 	}
 
 	public String toString() {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/ReleaseLevelSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/ReleaseLevelSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/ReleaseLevelSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.Artifact;
@@ -38,12 +38,12 @@
 		m_comparisonLevel = comparisonLevel;
 	}
 
-	public boolean selectResource(Artifact resource) {
+	public boolean selectArtifact(Artifact artifact) {
 		boolean selected = false;
 
 		Logger log = Logger.g_loggingOn ? Logger.getLogger() : null;
 
-		Version version = resource.getVersion();
+		Version version = artifact.getVersion();
 
 		if (null != version) {
 			//:TODO: More features...
@@ -67,7 +67,7 @@
 					"Non-ApacheVersion " + version.getClass().getName());
 		}
 		else
-			log.debug("No Version on " + resource);
+			log.debug("No Version on " + artifact);
 
 		return selected;
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/StandardSelections.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/StandardSelections.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/StandardSelections.java	Wed Jun 23 12:02:12 2004
@@ -14,9 +14,9 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
-import org.apache.depot.update.resource.ArtifactSpecifier;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.select.logic.AndSelector;
 
@@ -29,13 +29,13 @@
 	 * @param resource - -a specifier
 	 * @return
 	 */
-	public static ISelector getNamedTypedVersion(ArtifactSpecifier resource) {
+	public static ISelector getNamedTypedVersion(ArtifactSpecifier artifact) {
 		AndSelector set = new AndSelector();
 
-		set.addSelector(new NameSelector(resource.getIdentifier().getId()));
-		set.addSelector(new TypeSelector(resource.getType()));
-		if (null != resource.getVersion()) {
-			set.addSelector(new VersionSelector(resource.getVersion()));
+		set.addSelector(new NameSelector(artifact.getIdentifier().getId()));
+		set.addSelector(new TypeSelector(artifact.getType()));
+		if (null != artifact.getVersion()) {
+			set.addSelector(new VersionSelector(artifact.getVersion()));
 		}
 
 		return set;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/TypeSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/TypeSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/TypeSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,10 +14,10 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.update.Artifact;
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
 
@@ -35,10 +35,10 @@
 		m_comparisonType = comparisonType;
 	}
 
-	public boolean selectResource(Artifact resource) {
+	public boolean selectArtifact(Artifact artifact) {
 		boolean selected = false;
 
-		ArtifactType type = resource.getType();
+		ArtifactType type = artifact.getType();
 
 		if (null != type) {
 			//:TODO: More features...

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionConstraintsSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionConstraintsSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionConstraintsSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.Artifact;
@@ -40,12 +40,12 @@
 		m_constraints = constraints;
 	}
 
-	public boolean selectResource(Artifact resource) {
+	public boolean selectArtifact(Artifact artifact) {
 		boolean selected = false;
 
 		Logger log = Logger.g_loggingOn ? Logger.getLogger() : null;
 
-		Version version = resource.getVersion();
+		Version version = artifact.getVersion();
 
 		if (null != version) {
 			//:TODO: More features...
@@ -72,7 +72,7 @@
 					"Non-ApacheVersion " + version.getClass().getName());
 		}
 		else
-			log.debug("No Version on " + resource);
+			log.debug("No Version on " + artifact);
 
 		return selected;
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionSelector.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/resource/select/VersionSelector.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/artifact/select/VersionSelector.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource.select;
+package org.apache.depot.update.artifact.select;
 
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.util.text.MessageConstants;
@@ -35,10 +35,10 @@
 		m_comparisonVersion = comparisonVersion;
 	}
 
-	public boolean selectResource(Artifact resource) {
+	public boolean selectArtifact(Artifact artifact) {
 		boolean selected = false;
 
-		Version version = resource.getVersion();
+		Version version = artifact.getVersion();
 
 		if (null != version) {
 			//:TODO: More features...

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceFilenameAnalyzer.java	Wed Jun 23 12:02:12 2004
@@ -29,11 +29,11 @@
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.UpdateRuntimeException;
+import org.apache.depot.update.artifact.ArtifactAttribute;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.monitor.FileEvent;
 import org.apache.depot.update.monitor.Monitor;
-import org.apache.depot.update.resource.ArtifactAttribute;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.ArtifactType;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/DefaultResourceGroupFilenameAnalyzer.java	Wed Jun 23 12:02:12 2004
@@ -23,9 +23,9 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.monitor.FileEvent;
 import org.apache.depot.update.monitor.Monitor;
-import org.apache.depot.update.resource.ArtifactGroup;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.text.MessageConstants;

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/ExtensionTable.java	Wed Jun 23 12:02:12 2004
@@ -19,7 +19,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactType;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/files/IResourceGroupFilenameAnalyzer.java	Wed Jun 23 12:02:12 2004
@@ -19,7 +19,7 @@
 import java.util.List;
 
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactGroup;
 
 /**
  * @author arb_jack

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,160 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.depot.update.impl;
+
+import java.io.File;
+
+import org.apache.depot.common.util.SystemUtils;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.config.UpdateConfig;
+import org.apache.depot.update.protocols.DefaultProtocolOperationsManager;
+import org.apache.depot.update.protocols.ProtocolOperationsManager;
+import org.apache.depot.update.util.UpdateConstants;
+import org.apache.depot.update.util.identity.GenericIdentifier;
+import org.apache.depot.update.util.reference.IReferenceable;
+
+/**
+ * @author arb_jack
+ */
+public class ArtifactUpdaterContext implements IReferenceable {
+
+	public class Identifier extends GenericIdentifier {
+
+		public final static String UPDATE_CONTEXT_URI =
+			"http://depot.apache.org/update/context";
+		public final static String UPDATE_CONTEXT_PREFIX = "context";
+
+		public Identifier(String id) {
+			super(UPDATE_CONTEXT_URI, UPDATE_CONTEXT_PREFIX, id);
+		}
+	}
+	
+	static {
+		// Configure from the shared XML file...
+		//:TODO: *Maybe* move later, or allow user to pass filename
+		// in order to override
+		UpdateConfig.configure();
+	}
+
+	private ArtifactUpdaterContext.Identifier m_identifier = null;
+
+	private ProtocolOperationsManager m_protocolManager = null;
+
+	private File m_baseFile = null;
+
+	private ArtifactUpdaterOptions m_options = null;
+
+	public ArtifactUpdaterContext(String identifier) {
+		m_baseFile = SystemUtils.getCWD();
+		initClass(new ArtifactUpdaterContext.Identifier(identifier));
+	}
+	
+	public ArtifactUpdaterContext(ArtifactUpdaterContext.Identifier identifier) {
+		m_baseFile = SystemUtils.getCWD();
+		initClass(identifier);
+	}
+
+	public ArtifactUpdaterContext() {
+		m_baseFile = SystemUtils.getCWD();
+		initClass(new ArtifactUpdaterContext.Identifier(UpdateConstants.DEFAULT));
+	}
+
+	public ArtifactUpdaterContext(File baseFile) {
+		m_baseFile = baseFile;
+		initClass(new ArtifactUpdaterContext.Identifier(UpdateConstants.DEFAULT));
+	}
+
+	private void initClass(ArtifactUpdaterContext.Identifier identifier) {
+		m_identifier = identifier;
+	}
+
+	public static ArtifactUpdaterContext getDefaultContext() {
+		ArtifactUpdaterContext context = new ArtifactUpdaterContext();
+		context.setProtocolManager(
+			new DefaultProtocolOperationsManager(context));
+		return context;
+	}
+	
+	public static ArtifactUpdaterContext getTestContext() {
+		ArtifactUpdaterContext context = new ArtifactUpdaterContext();
+		context.setProtocolManager(
+			new DefaultProtocolOperationsManager(context));
+		return context;
+	}
+
+	/**
+	 * @return
+	 */
+	public ProtocolOperationsManager getProtocolManager() {
+		return m_protocolManager;
+	}
+
+	/**
+	 * @param manager
+	 */
+	public void setProtocolManager(ProtocolOperationsManager manager) {
+		m_protocolManager = manager;
+	}
+
+	/**
+	 * @return
+	 */
+	public File getBaseFile() {
+		return m_baseFile;
+	}
+
+	/**
+	 * @param file
+	 */
+	public void setBaseFile(File file) {
+		m_baseFile = file;
+	}
+
+	/**
+	 * @return
+	 */
+	public GenericIdentifier getIdentifier() {
+		return m_identifier;
+	}
+
+	public static ArtifactUpdaterContext getResourceUpdaterContext(
+		ArtifactUpdaterContext.Identifier identifier,
+		boolean createIfRequired)
+		throws UpdateException {
+
+		ArtifactUpdaterContext context = null;
+
+		if (ReferenceManager.hasReference(identifier)) {
+			context =
+				(ArtifactUpdaterContext) ReferenceManager.getReference(
+					identifier);
+		}
+		else {
+			if (!createIfRequired)
+				throw new UpdateException(
+					"Failed to access ResourceUpdaterContext ["
+						+ identifier
+						+ "]");
+
+			context = new ArtifactUpdaterContext(identifier);
+
+			ReferenceManager.createReference(context);
+		}
+
+		return context;
+	}
+}

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterEngine.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterEngine.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,220 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.depot.update.impl;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactIdentifier;
+import org.apache.depot.update.messaging.ResourceRequest;
+import org.apache.depot.update.protocols.DefaultProtocolOperationsManager;
+import org.apache.depot.update.query.ArtifactQuery;
+import org.apache.depot.update.query.DefaultQueryEngine;
+import org.apache.depot.update.query.ResourceResult;
+import org.apache.depot.update.repository.RepositoryException;
+import org.apache.depot.update.repository.RepositoryManager;
+import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.repository.RepositorySetSortContext;
+import org.apache.depot.update.util.text.Messages;
+
+/**
+ * @author arb_jack
+ * @author anou_mana
+ */
+public class ArtifactUpdaterEngine {
+
+	private ArtifactUpdaterContext m_context = null;
+	private DefaultQueryEngine m_engine = null;
+
+	// repository
+	private RepositoryManager m_repositoryManager;
+
+	/**
+	 * 
+	 */
+	public ArtifactUpdaterEngine(ArtifactUpdaterContext context) {
+		m_context = context;
+		initClass();
+	}
+
+	public ArtifactUpdaterEngine() {
+		initClass();
+	}
+
+	private void initClass() {
+		if (null == m_context)
+			m_context = ArtifactUpdaterContext.getDefaultContext();
+
+		m_engine = new DefaultQueryEngine();
+
+		//	initialize the repository management
+		m_repositoryManager = new RepositoryManager();
+
+		getContext().setProtocolManager(
+			new DefaultProtocolOperationsManager(getContext()));
+	}
+
+	//
+	// Queries/Helper Methods
+	// 
+	public final ArtifactIdentifier resolveResource(final String id) {
+		return new ArtifactIdentifier(id);
+	}
+
+	/**
+	 * @return
+	 */
+	public ArtifactUpdaterContext getContext() {
+		return m_context;
+	}
+
+	/**
+	 * @param context
+	 */
+	public void setContext(ArtifactUpdaterContext context) {
+		m_context = context;
+	}
+
+	public void perform(ResourceRequest request) throws UpdateException {
+		ResourceResult result = performRequest(request);
+
+		// Now what? Perform actions??
+	}
+
+	public ResourceResult performRequest(ResourceRequest request)
+		throws UpdateException {
+
+		Logger.getLogger().debug(Messages.getString("ResourceRequest", request));
+
+		ArtifactQuery query = request.getQuery();
+
+		return query(query);
+	}
+
+	public ResourceResult query(ArtifactQuery query) throws UpdateException {
+
+		// delegate the work to the repository manager to sort the repositories 
+		// based on the query
+		RepositorySet repositorySet =
+			m_repositoryManager.performRepositoryQuery(this, query);
+
+		RepositorySetWrapper wrappers =
+			new RepositorySetWrapper(repositorySet, m_context);
+
+		return m_engine.queryRepositories(wrappers, query);
+	}
+
+	public void copyTo(List resources, Repository targetRepository)
+		throws UpdateException {
+
+		RepositoryWrapper target =
+			new RepositoryWrapper(targetRepository, m_context);
+
+		//		for (Iterator i = result.iterator(); i.hasNext();) {
+		//			List group = (List) i.next();
+		//
+		//			for (Iterator j = group.iterator(); j.hasNext();) {
+		//				Resource resource = (Resource) j.next();
+		//
+
+		for (Iterator i = resources.iterator(); i.hasNext();) {
+			Artifact resource = (Artifact) i.next();
+			try {
+				target.publishResource(resource);
+			}
+			catch (Exception e) {
+				//
+				// (1) log (2) stash in result set error table
+				//
+				throw new RepositoryException(
+					targetRepository,
+					"Failed to publish resource: " + resource,
+					e);
+			}
+		}
+	}
+
+
+	public void delete(Repository repository, List resources)
+		throws UpdateException {
+
+		RepositoryWrapper repo =
+			new RepositoryWrapper(repository, m_context);
+
+		for (Iterator i = resources.iterator(); i.hasNext();) {
+			Artifact resource = (Artifact) i.next();
+			try {
+				repo.deleteResource(resource);
+			}
+			catch (Exception e) {
+				//
+				// (1) log (2) stash in result set error table
+				//
+				throw new RepositoryException(
+					repository,
+					"Failed to delete resource: " + resource,
+					e);
+			}
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	public RepositorySet getDefaultSortedRepositorySet() {
+		return this.m_repositoryManager.getDefaultSortedRepositorySet();
+	}
+
+	/**
+	 * @return
+	 */
+	public RepositorySetSortContext getDefaultRepositorySetSortContext() {
+		return m_repositoryManager.getDefaultRepositorySortContext();
+	}
+
+	/**
+	 * @return
+	 */
+	public void setDefaultRepositorySetSortContext(RepositorySetSortContext sortContext) {
+		m_repositoryManager.setDefaultRepositorySortContext(sortContext);
+	}
+
+	/**
+	 * @return
+	 */
+	public RepositoryManager getRepositoryManager() {
+		return m_repositoryManager;
+	}
+
+	/**
+	 * @param set
+	 */
+	public void setDefaultSortedRepositorySet(RepositorySet set) {
+		this.m_repositoryManager.setDefaultSortedRepositorySet(set);
+	}
+
+	/**
+	 * @param manager
+	 */
+	public void setRepositoryManager(RepositoryManager manager) {
+		m_repositoryManager = manager;
+	}
+}

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterOptions.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterOptions.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,28 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.depot.update.impl;
+
+/**
+ * @author arb_jack
+ */
+public class ArtifactUpdaterOptions {
+
+// :TODO:
+// Low Bandwidth
+// Latest/Greatest...
+
+}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryObject.java	Wed Jun 23 12:02:12 2004
@@ -22,7 +22,7 @@
 
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.util.select.AllSelector;
 
 public class RepositoryObject {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java	Wed Jun 23 12:02:12 2004
@@ -23,9 +23,9 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.repository.DefaultRepository;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.ArtifactGroup;
 import org.apache.depot.update.util.select.AllSelector;
 
 /**
@@ -33,14 +33,14 @@
  */
 public class RepositorySetWrapper {
 
-	private ResourceUpdaterContext m_context = null;
+	private ArtifactUpdaterContext m_context = null;
 
 	private RepositorySet m_repositorySet = null;
 	private List m_repositoryWrappers = null;
 
 	public RepositorySetWrapper(
 		RepositorySet repositorySet,
-		ResourceUpdaterContext context) {
+		ArtifactUpdaterContext context) {
 		m_context = context;
 		m_repositorySet = repositorySet;
 
@@ -49,7 +49,7 @@
 
 	public RepositorySetWrapper(
 		DefaultRepository repository,
-		ResourceUpdaterContext context) {
+		ArtifactUpdaterContext context) {
 		m_context = context;
 		m_repositorySet = new RepositorySet(repository);
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java	Wed Jun 23 12:02:12 2004
@@ -23,15 +23,15 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.ResourceEvent;
 import org.apache.depot.update.repository.RepositoryCapability;
 import org.apache.depot.update.repository.RepositoryException;
 import org.apache.depot.update.repository.RepositoryManifest;
-import org.apache.depot.update.resource.ArtifactGroup;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.text.MessageConstants;
 import org.apache.depot.update.util.text.Messages;
@@ -42,18 +42,18 @@
 public class RepositoryWrapper implements Dumpable {
 
 	private Repository m_repository = null;
-	private ResourceUpdaterContext m_context = null;
+	private ArtifactUpdaterContext m_context = null;
 
 	private boolean m_initialized = false;
 
 	public RepositoryWrapper(
 		Repository repository,
-		ResourceUpdaterContext context) {
+		ArtifactUpdaterContext context) {
 		m_repository = repository;
 		m_context = context;
 	}
 
-	private synchronized void initialize(ResourceUpdaterContext context)
+	private synchronized void initialize(ArtifactUpdaterContext context)
 		throws UpdateException {
 		if (m_initialized)
 			return;
@@ -194,7 +194,7 @@
 
 		List resources = null;
 		try {
-			resources = m_repository.listResources(m_context, group, selector);
+			resources = m_repository.listArtifacts(m_context, group, selector);
 
 			//
 			// Notify what resources were listed
@@ -236,7 +236,7 @@
 			initialize(m_context);
 
 		try {
-			m_repository.deleteResource(m_context, resource);
+			m_repository.deleteArtifact(m_context, resource);
 		}
 		catch (Exception e) {
 			throw new RepositoryException(
@@ -266,15 +266,15 @@
 		if (!m_initialized)
 			initialize(m_context);
 
-		Artifact publishedResource = null;
+		Artifact publishedArtifact = null;
 		try {
-			publishedResource =
-				m_repository.publishResource(m_context, resource);
+			publishedArtifact =
+				m_repository.publishArtifact(m_context, resource);
 		}
 		catch (Exception e) {
 			throw new RepositoryException(m_repository, "Publish Failed", e);
 		}
-		return publishedResource;
+		return publishedArtifact;
 	}
 
 	private void testCapability(RepositoryCapability capability)

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/messaging/ResourceRequest.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/messaging/ResourceRequest.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/messaging/ResourceRequest.java	Wed Jun 23 12:02:12 2004
@@ -16,7 +16,7 @@
 
 package org.apache.depot.update.messaging;
 
-import org.apache.depot.update.query.ResourceQuery;
+import org.apache.depot.update.query.ArtifactQuery;
 import org.apache.depot.update.util.flag.FlagSet;
 
 
@@ -24,10 +24,10 @@
  *
  */
 public class ResourceRequest {
-	private ResourceQuery m_query;
+	private ArtifactQuery m_query;
 	private FlagSet m_actions;
 	
-	public ResourceRequest(ResourceQuery query)
+	public ResourceRequest(ArtifactQuery query)
 	{
 		m_query=query;
 		m_actions = new FlagSet(ResourceAction.DISPLAY); // :TODO: configure default...
@@ -43,7 +43,7 @@
 	/**
 	 * @return
 	 */
-	public ResourceQuery getQuery() {
+	public ArtifactQuery getQuery() {
 		return m_query;
 	}
 
@@ -57,7 +57,7 @@
 	/**
 	 * @param query
 	 */
-	public void setQuery(ResourceQuery query) {
+	public void setQuery(ArtifactQuery query) {
 		m_query = query;
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/DefaultProtocolOperationsManager.java	Wed Jun 23 12:02:12 2004
@@ -20,7 +20,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.envsafe.ClassLoaderContext;
 import org.apache.depot.update.UpdateRuntimeException;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 
 /**
  * @author ajack
@@ -34,7 +34,7 @@
 	/**
 	 * @param context
 	 */
-	public DefaultProtocolOperationsManager(ResourceUpdaterContext context) {
+	public DefaultProtocolOperationsManager(ArtifactUpdaterContext context) {
 		super(context);
 
 		// Shoot for VFS, but fallback to HttpClient or basic URL
@@ -55,7 +55,7 @@
 
 	public static void main(String args[]) {
 		ProtocolOperationsManager pom = new DefaultProtocolOperationsManager(
-				ResourceUpdaterContext.getTestContext());
+				ArtifactUpdaterContext.getTestContext());
 
 		DebugUtils.dump(pom);
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/IProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/IProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/IProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -18,7 +18,7 @@
 
 import java.util.List;
 
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.ISelector;
 
@@ -28,7 +28,7 @@
 public interface IProtocolOperationsProvider {
 
 	//	Configuration...
-	void init(ResourceUpdaterContext context) throws Exception ;
+	void init(ArtifactUpdaterContext context) throws Exception ;
 	List getSupportedSourceProtocols();
 	List getSupportedDestinationProtocols();
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/ProtocolOperationsManager.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/ProtocolOperationsManager.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/ProtocolOperationsManager.java	Wed Jun 23 12:02:12 2004
@@ -28,7 +28,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.select.DestinationProtocolProviderSelector;
 import org.apache.depot.update.protocols.select.SourceDestinationProtocolProviderSelector;
 import org.apache.depot.update.protocols.select.SourceProtocolProviderSelector;
@@ -44,13 +44,13 @@
 public class ProtocolOperationsManager
 	extends HandlerManager
 	implements Dumpable {
-	private ResourceUpdaterContext m_context = null;
+	private ArtifactUpdaterContext m_context = null;
 	private List m_providers = new ArrayList();
 
 	private Map m_sourceProtocolMap = new HashMap();
 	private Map m_destinationProtocolMap = new HashMap();
 
-	ProtocolOperationsManager(ResourceUpdaterContext context) {
+	ProtocolOperationsManager(ArtifactUpdaterContext context) {
 		m_context = context;
 		configureSelectors();
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/AbstractProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/AbstractProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/AbstractProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -19,7 +19,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.IProtocolOperationsProvider;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.AllSelector;
@@ -30,7 +30,7 @@
 public abstract class AbstractProtocolOperationsProvider
 	implements IProtocolOperationsProvider {
 
-	protected ResourceUpdaterContext m_context = null;
+	protected ArtifactUpdaterContext m_context = null;
 
 	protected List m_sourceProtocols = new ArrayList();
 	protected List m_destinationProtocols = new ArrayList();
@@ -54,7 +54,7 @@
 		return m_destinationProtocols;
 	}
 
-	public void init(ResourceUpdaterContext context)  throws Exception  {
+	public void init(ArtifactUpdaterContext context)  throws Exception  {
 		m_context = context;
 	}
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/BasicProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/BasicProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/BasicProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -19,7 +19,7 @@
 import java.net.URL;
 import java.util.List;
 
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.Protocol;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.ISelector;
@@ -30,7 +30,7 @@
 public class BasicProtocolOperationsProvider
 	extends AbstractProtocolOperationsProvider {
 
-	public void init(ResourceUpdaterContext context)  throws Exception {
+	public void init(ArtifactUpdaterContext context)  throws Exception {
 		super.init(context);
 
 		// We can read files or HTTP

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/FileProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/FileProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/FileProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -21,7 +21,7 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.Protocol;
 import org.apache.depot.update.util.io.FileUtils;
 import org.apache.depot.update.util.io.ResolvedFile;
@@ -35,7 +35,7 @@
 		extends
 			AbstractProtocolOperationsProvider {
 
-	public void init(ResourceUpdaterContext context) throws Exception {
+	public void init(ArtifactUpdaterContext context) throws Exception {
 		super.init(context);
 
 		addSourceProtocol(Protocol.FILE_PROTOCOL);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/HttpClientProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/HttpClientProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/HttpClientProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -24,7 +24,7 @@
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.logging.LogFactory;
 import org.apache.depot.common.util.io.IOUtils;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.Protocol;
 import org.apache.depot.update.util.io.HtmlUtils;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -51,7 +51,7 @@
 		Class causeAFailedLoadAtConstructionIfGoingToHappen4 = Encoder.class;
 		}
 
-	public void init(ResourceUpdaterContext context) throws Exception {
+	public void init(ArtifactUpdaterContext context) throws Exception {
 		super.init(context);
 
 		addSourceProtocol(Protocol.HTTP_PROTOCOL);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/VfsProtocolOperationsProvider.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/VfsProtocolOperationsProvider.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/protocols/impl/VfsProtocolOperationsProvider.java	Wed Jun 23 12:02:12 2004
@@ -23,7 +23,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.FileSystemManager;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.protocols.Protocol;
 import org.apache.depot.update.util.io.VfsUtils;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -44,7 +44,7 @@
 		Class causeAFailedLoadAtConstructionIfGoingToHappen2 = LogFactory.class;
 	}
 
-	public void init(ResourceUpdaterContext context) throws Exception {
+	public void init(ArtifactUpdaterContext context) throws Exception {
 		super.init(context);
 
 		addSourceProtocol(Protocol.HTTP_PROTOCOL);

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQuery.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQuery.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,264 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.depot.update.query;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+import org.apache.depot.common.util.debug.DebugUtils;
+import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.repository.RepositorySetSortContext;
+import org.apache.depot.update.util.select.ISelector;
+
+/**
+ * @author arb_jack
+ * @author anou_mana
+ * 
+ * A ResourceQuery is (primarily) an internal class derived from
+ * simpler user ResourceRequest objects.
+ * 
+ * A ResourceQuery is effectively an SQL statement like this:
+ * 
+ * <pre>
+ * 
+ * SELECT * FROM {REPOSITORIES:group}
+ *     WHERE ((name='junit' AND version>=1.0))
+ * 	   GROUP BY name, version
+ *     ORDER BY name, version, type
+ * 
+ * </pre>
+ * 
+ * The REPOSITORIES are a list of repositories, imaging them as tables.
+ * The "group" is which group on those repositories (if it exists).
+ * The * means resources, imagine resources as rows in the tables
+ * The GROUP BY is a bit of a stretch (it groups results this way)
+ * The ORDER BY is self explanatory.
+ *
+ */
+public class ArtifactQuery implements Dumpable {
+
+	private List m_groups = null;
+
+	// Repository
+	// :TODO: Hmm, ought repositories be on query at all?
+	private RepositorySet m_repositorySet = null;
+	
+	// :TODO: I'm not sure this ought be on here, I don't think
+	// how to pick the repositories ought be on the query over
+	// repositories. I don't know, same w/ above I guess...
+	private RepositorySetSortContext m_repositorySetSortContext = null;
+
+	private ISelector m_where = null;
+	private Comparator m_orderBy = null;
+	private Comparator m_groupBy = null;
+
+	//
+	// :TODO: Nice if we could make queries referenceable
+	// to allow re-use (especially for the more generic) 
+	//
+	public ArtifactQuery(
+		ArtifactGroup group,
+		RepositorySet repositories,
+		ISelector where,
+		Comparator groupBy,
+		Comparator orderBy) {
+		m_groups = new ArrayList();
+		m_groups.add(group);
+
+		m_repositorySet = repositories;
+		m_where = where;
+		m_groupBy = groupBy;
+		m_orderBy = orderBy;
+	}
+
+	public ArtifactQuery(
+		ArtifactGroup group,
+		ISelector where,
+		Comparator groupBy,
+		Comparator orderBy) {
+		m_groups = new ArrayList();
+		m_groups.add(group);
+
+		m_where = where;
+		m_groupBy = groupBy;
+		m_orderBy = orderBy;
+	}
+
+	public ArtifactQuery(ArtifactGroup group) {
+		m_groups = new ArrayList();
+		m_groups.add(group);
+	}
+
+	//
+	// :TODO: Nice if we could make queries referenceable
+	// to allow re-use (especially for the more generic) 
+	//
+	public ArtifactQuery(ArtifactQuery other) {
+		m_groups = other.m_groups;
+
+		m_repositorySet = other.m_repositorySet;
+		m_where = other.m_where;
+		m_groupBy = other.m_groupBy;
+		m_orderBy = other.m_orderBy;
+	}
+
+	//
+	// Same query, different repositories 
+	//
+	public ArtifactQuery(ArtifactQuery other, RepositorySet repositories) {
+		this(other);
+		m_repositorySet = repositories;
+	}
+
+	/**
+	 * @return
+	 */
+	public Comparator getGroupBy() {
+		return m_groupBy;
+	}
+
+	/**
+	 * @return
+	 */
+	public Comparator getOrderBy() {
+		return m_orderBy;
+	}
+
+	/**
+	 * @return
+	 */
+	public RepositorySet getRepositorySet() {
+		return m_repositorySet;
+	}
+
+	/**
+	 * @return
+	 */
+	public ISelector getWhere() {
+		return m_where;
+	}
+
+	/**
+	 * @param comparator
+	 */
+	public void setGroupBy(Comparator comparator) {
+		m_groupBy = comparator;
+	}
+
+	/**
+	 * @param comparator
+	 */
+	public void setOrderBy(Comparator comparator) {
+		m_orderBy = comparator;
+	}
+
+	/**
+	 * @param set
+	 */
+	public void setRepositorySet(RepositorySet set) {
+		m_repositorySet = set;
+	}
+
+	/**
+	 * @param selector
+	 */
+	public void setWhere(ISelector selector) {
+		m_where = selector;
+	}
+
+	/**
+	 * @return
+	 */
+	public List getGroups() {
+		return m_groups;
+	}
+
+	/**
+	 * @param list
+	 */
+	public void setGroups(List list) {
+		m_groups = list;
+	}
+
+	public void dump(PrintWriter out, int depth, boolean verbose) {
+		//String indent = DebugUtils.getIndent(depth);
+
+		DebugUtils.dump(out, depth + 1, "Resource Groups: ", verbose, m_groups);
+
+		DebugUtils.printSeparator(out, depth + 1);
+		DebugUtils.dump(
+			out,
+			depth + 1,
+			"Repositories: ",
+			verbose,
+			m_repositorySet);
+
+		DebugUtils.printSeparator(out, depth + 1);
+		DebugUtils.dump(out, depth + 1, "Where: ", verbose, m_where);
+		DebugUtils.printSeparator(out, depth + 1);
+		DebugUtils.dump(out, depth + 1, "Group By: ", verbose, m_groupBy);
+		DebugUtils.printSeparator(out, depth + 1);
+		DebugUtils.dump(out, depth + 1, "Order By: ", verbose, m_orderBy);
+	}
+
+	public String toString() {
+		StringBuffer buffer = new StringBuffer();
+
+		buffer.append("SELECT * FROM ");
+		if (null != m_repositorySet) {
+			buffer.append(m_repositorySet.getIdentifier());
+		}
+		else {
+			buffer.append("Default Repositories");
+		}
+
+		if (null != m_groups) {
+			buffer.append(":");
+			buffer.append(m_groups);
+		}
+		buffer.append(" WHERE ");
+		buffer.append(m_where);
+		if (null != m_groupBy) {
+			buffer.append(" GROUP_BY ");
+			buffer.append(m_groupBy);
+		}
+		if (null != m_orderBy) {
+			buffer.append(" ORDER_BY ");
+			buffer.append(m_orderBy);
+		}
+		//:TODO:Anou's stuff?
+		return buffer.toString();
+	}
+
+	/**
+	 * @return
+	 */
+	public RepositorySetSortContext getRepositorySetSortContext() {
+		return m_repositorySetSortContext;
+	}
+
+	/**
+	 * @param context
+	 */
+	public void setRepositorySetSortContext(RepositorySetSortContext context) {
+		m_repositorySetSortContext = context;
+	}
+}

Added: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQueryHelper.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/ArtifactQueryHelper.java	Wed Jun 23 12:02:12 2004
@@ -0,0 +1,135 @@
+/*
+ * Copyright  2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.depot.update.query;
+
+import java.util.Comparator;
+
+import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.Artifact;
+import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
+import org.apache.depot.update.artifact.compare.StandardArtifactComparisons;
+import org.apache.depot.update.artifact.select.StandardSelections;
+import org.apache.depot.update.repository.RepositorySet;
+import org.apache.depot.update.util.UpdateConstants;
+import org.apache.depot.update.util.select.AllSelector;
+import org.apache.depot.update.util.select.ISelector;
+import org.apache.depot.update.util.text.MessageConstants;
+import org.apache.depot.update.util.text.Messages;
+
+/**
+ * @author arb_jack
+ */
+public class ArtifactQueryHelper {
+
+	public static ArtifactQuery getResourceQuery(Artifact resource)
+		throws UpdateException {
+		return getResourceSpecifierQuery(resource.getSpecifier());
+	}
+
+	public static ArtifactQuery getResourceSpecifierQuery(Artifact resource)
+		throws UpdateException {
+		return getResourceSpecifierQuery(resource.getSpecifier());
+	}
+
+	public static ArtifactQuery getResourceSpecifierQuery(
+		Artifact resource,
+		RepositorySet repos)
+		throws UpdateException {
+		return getResourceSpecifierQuery(resource.getSpecifier(), repos);
+	}
+
+	public static ArtifactQuery getResourceSpecifierQuery(ArtifactSpecifier specifier)
+		throws UpdateException {
+		return getResourceSpecifierQuery(
+			specifier,
+			RepositorySet.getRepositorySet(UpdateConstants.DEFAULT, true));
+	}
+
+	public static ArtifactQuery getResourceSpecifierQuery(
+		ArtifactSpecifier specifier,
+		RepositorySet repos)
+		throws UpdateException {
+
+		ArtifactQuery resourceQuery = null;
+		if (specifier != null) {
+
+			ISelector where = StandardSelections.getNamedTypedVersion(specifier);
+			Comparator orderBy =
+				StandardArtifactComparisons
+					.getNameTypeVersionComparatorSequence();
+			//Comparator groupBy = StandardResourceComparisons.getNameVersion();
+			Comparator groupBy =
+				StandardArtifactComparisons.getNameVersionComparatorSequence();
+
+			resourceQuery =
+				new ArtifactQuery(
+					specifier.getGroup(),
+					repos,
+					where,
+					groupBy,
+					orderBy);
+		}
+		else {
+			String message = Messages.getString(MessageConstants.NULL_RESOURCE);
+			Logger.getLogger().error(message);
+
+			throw new UpdateException(message);
+		}
+		return resourceQuery;
+	}
+
+	public static ArtifactQuery getResourceGroupQuery(ArtifactGroup group)
+		throws UpdateException {
+		return getResourceGroupQuery(
+			group,
+			RepositorySet.getRepositorySet(UpdateConstants.DEFAULT, true));
+	}
+
+	public static ArtifactQuery getResourceGroupQuery(
+		ArtifactGroup group,
+		RepositorySet repos)
+		throws UpdateException {
+
+		ArtifactQuery resourceQuery = null;
+		if (group != null) {
+
+			//
+			// Extract the query
+			//
+			ISelector where = AllSelector.getInstance();
+			Comparator orderBy =
+				StandardArtifactComparisons
+					.getNameTypeVersionComparatorSequence();
+			Comparator groupBy =
+				StandardArtifactComparisons.getNameVersionComparatorSequence();
+
+			resourceQuery =
+				new ArtifactQuery(group, repos, where, groupBy, orderBy);
+
+		}
+		else {
+			String message = Messages.getString(MessageConstants.NULL_GROUP);
+			Logger.getLogger().error(message);
+
+			throw new UpdateException(message);
+		}
+		return resourceQuery;
+	}
+
+}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/query/DefaultQueryEngine.java	Wed Jun 23 12:02:12 2004
@@ -26,12 +26,12 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.compare.StandardArtifactComparisons;
 import org.apache.depot.update.impl.RepositorySetWrapper;
 import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.monitor.Monitor;
 import org.apache.depot.update.monitor.ResourceEvent;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.compare.StandardArtifactComparisons;
 import org.apache.depot.update.util.select.AllSelector;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.text.MessageConstants;
@@ -52,7 +52,7 @@
 	 */
 	public ResourceResult queryRepositories(
 		RepositorySetWrapper wrappers,
-		ResourceQuery query)
+		ArtifactQuery query)
 		throws UpdateException {
 
 		// Extract query components
@@ -73,7 +73,7 @@
 	 * @param query
 	 * @return
 	 */
-	public ResourceResult queryResources(List resources, ResourceQuery query) {
+	public ResourceResult queryResources(List resources, ArtifactQuery query) {
 		//		if (Logger.getLog().isDebug()) {
 		//			DebugUtils.printSeparator();
 		//			DebugUtils.dump(query);
@@ -141,7 +141,7 @@
 	private List gatherResources(
 		RepositorySetWrapper wrappers,
 		List resourceGroups,
-		ResourceQuery query) {
+		ArtifactQuery query) {
 		List results = new ArrayList();
 
 		ISelector whereClause = query.getWhere();

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/AbstractHierarchicalRepository.java	Wed Jun 23 12:02:12 2004
@@ -22,9 +22,9 @@
 import java.util.List;
 
 import org.apache.depot.update.Artifact;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.compare.StandardArtifactComparisons;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.compare.StandardArtifactComparisons;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.compare.ComparisonHelper;
 import org.apache.depot.update.util.flag.Flag;
@@ -115,18 +115,18 @@
 	}
 
 	public List listSpecifiers(
-		ResourceUpdaterContext context,
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception {
 
 		List results = null;
-		List resources = listResources(context, group, selector);
+		List artifacts = listArtifacts(context, group, selector);
 
-		if (!resources.isEmpty()) {
+		if (!artifacts.isEmpty()) {
 			List unique =
 				ComparisonHelper.sortUnique(
-					resources,
+						artifacts,
 					StandardArtifactComparisons
 						.getNameTypeComparatorSequence());
 
@@ -157,12 +157,12 @@
 	}
 
 	public RepositoryManifest getManifest(
-		ResourceUpdaterContext context,
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception {
 
-		return new RepositoryManifest(listResources(context, group, selector));
+		return new RepositoryManifest(listArtifacts(context, group, selector));
 	}
 
 	public VirtualResourceLocator folderForGroup(ArtifactGroup group) {

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 12:02:12 2004
@@ -23,15 +23,15 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.files.DefaultResourceFilenameAnalyzer;
 import org.apache.depot.update.files.DefaultResourceGroupFilenameAnalyzer;
 import org.apache.depot.update.files.IResourceFilenameAnalyzer;
 import org.apache.depot.update.files.IResourceGroupFilenameAnalyzer;
 import org.apache.depot.update.impl.ReferenceManager;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.net.select.MatchingVrlSelector;
@@ -155,7 +155,7 @@
 	}
 
 	public List listSpecifiers(
-		ResourceUpdaterContext context,
+		ArtifactUpdaterContext context,
 		ArtifactGroup group,
 		ISelector selector)
 		throws Exception {
@@ -165,18 +165,18 @@
 				+ RepositoryCapability.LISTABLE_SPECIFIERS);
 	}
 
-	public void deleteResource(
-		ResourceUpdaterContext context,
-		Artifact resource)
+	public void deleteArtifact(
+		ArtifactUpdaterContext context,
+		Artifact artifact)
 		throws Exception {
 		throw new RepositoryException(
 			this,
 			"Unsupported Capability: " + RepositoryCapability.DELETABLE);
 	}
 
-	public Artifact publishResource(
-		ResourceUpdaterContext context,
-		Artifact resource)
+	public Artifact publishArtifact(
+		ArtifactUpdaterContext context,
+		Artifact artifact)
 		throws Exception {
 		if (true)
 			throw new RepositoryException(
@@ -218,7 +218,7 @@
 
 	public abstract VirtualResourceLocator folderForGroup(ArtifactGroup group);
 
-	public void initialize(ResourceUpdaterContext context) throws Exception {
+	public void initialize(ArtifactUpdaterContext context) throws Exception {
 		if (m_init)
 			return;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/ApacheRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/ApacheRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/ApacheRepository.java	Wed Jun 23 12:02:12 2004
@@ -15,8 +15,9 @@
  */
 package org.apache.depot.update.repository;
 import java.util.List;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
+
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.ISelector;
 /**
@@ -55,7 +56,7 @@
 	 * @see org.apache.depot.update.repository.IRepository#listGroups(org.apache.depot.update.impl.ResourceUpdaterContext,
 	 *      org.apache.depot.update.util.select.ISelector)
 	 */
-	public List listGroups(ResourceUpdaterContext context, ISelector selector)
+	public List listGroups(ArtifactUpdaterContext context, ISelector selector)
 			throws Exception {
 		// TODO Auto-generated method stub
 		return null;
@@ -67,7 +68,7 @@
 	 *      org.apache.depot.update.resource.ResourceGroup,
 	 *      org.apache.depot.update.util.select.ISelector)
 	 */
-	public RepositoryManifest getManifest(ResourceUpdaterContext context,
+	public RepositoryManifest getManifest(ArtifactUpdaterContext context,
 			ArtifactGroup group, ISelector selector) throws Exception {
 		// TODO Auto-generated method stub
 		return null;
@@ -79,7 +80,7 @@
 	 *      org.apache.depot.update.resource.ResourceGroup,
 	 *      org.apache.depot.update.util.select.ISelector)
 	 */
-	public List listResources(ResourceUpdaterContext context,
+	public List listArtifacts(ArtifactUpdaterContext context,
 			ArtifactGroup group, ISelector selector) throws Exception {
 		// TODO Auto-generated method stub
 		return null;

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 12:02:12 2004
@@ -20,11 +20,11 @@
 
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.SystemUtils;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.impl.ReferenceManager;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -72,7 +72,7 @@
 		super(id, root, hierarchical);
 	}
 
-	public List listGroups(ResourceUpdaterContext context, ISelector selector)
+	public List listGroups(ArtifactUpdaterContext context, ISelector selector)
 			throws Exception {
 
 		List results = null;
@@ -99,7 +99,7 @@
 		return results;
 	}
 
-	public List listResources(final ResourceUpdaterContext context,
+	public List listArtifacts(final ArtifactUpdaterContext context,
 			final ArtifactGroup group, final ISelector selector)
 			throws Exception {
 
@@ -125,7 +125,7 @@
 		return results;
 	}
 
-	public Artifact publishResource(ResourceUpdaterContext context,
+	public Artifact publishArtifact(ArtifactUpdaterContext context,
 			Artifact resource) throws Exception {
 
 		// Create the 'remote' resource
@@ -140,7 +140,7 @@
 		return publishedResource;
 	}
 
-	public void deleteResource(ResourceUpdaterContext context, Artifact resource)
+	public void deleteArtifact(ArtifactUpdaterContext context, Artifact resource)
 			throws Exception {
 
 		// Perform copy

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/MockRepository.java	Wed Jun 23 12:02:12 2004
@@ -19,10 +19,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.update.util.select.ISelector;
 import org.apache.depot.update.util.select.SelectionHelper;
@@ -38,7 +38,7 @@
 		super(id, new VirtualResourceLocator("http://mockrepo.org/stuff"), true);
 	}
 
-	public List listGroups(ResourceUpdaterContext context, ISelector selector)
+	public List listGroups(ArtifactUpdaterContext context, ISelector selector)
 			throws Exception {
 
 		List groups = new ArrayList();
@@ -51,7 +51,7 @@
 		return groups;
 	}
 
-	public List listResources(final ResourceUpdaterContext context,
+	public List listArtifacts(final ArtifactUpdaterContext context,
 			final ArtifactGroup group, final ISelector selector)
 			throws Exception {
 
@@ -66,7 +66,7 @@
 		return results;
 	}
 
-	public Artifact publishResource(ResourceUpdaterContext context,
+	public Artifact publishArtifact(ArtifactUpdaterContext context,
 			Artifact resource) throws Exception {
 
 		Artifact publishedResource = new Artifact(resource);
@@ -77,7 +77,7 @@
 		return publishedResource;
 	}
 	
-	public void initialize(ResourceUpdaterContext context) throws Exception {
+	public void initialize(ArtifactUpdaterContext context) throws Exception {
 		
 	}
 

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 12:02:12 2004
@@ -22,8 +22,8 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.impl.ReferenceManager;
-import org.apache.depot.update.impl.ResourceUpdaterEngine;
-import org.apache.depot.update.query.ResourceQuery;
+import org.apache.depot.update.impl.ArtifactUpdaterEngine;
+import org.apache.depot.update.query.ArtifactQuery;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.chainprocess.HandlerChain;
 import org.apache.depot.update.util.chainprocess.HandlerManager;
@@ -154,8 +154,8 @@
 	}
 
 	public RepositorySet performRepositoryQuery(
-		final ResourceUpdaterEngine ruper,
-		final ResourceQuery query) {
+		final ArtifactUpdaterEngine ruper,
+		final ArtifactQuery query) {
 
 		RepositorySet repositorySet = null;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/repository/RepositoryManifest.java	Wed Jun 23 12:02:12 2004
@@ -24,7 +24,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.common.util.debug.Dumpable;
 import org.apache.depot.update.Artifact;
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.identity.GenericIdentifier;
 import org.apache.depot.version.Version;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileAssistant.java	Wed Jun 23 12:02:12 2004
@@ -23,9 +23,9 @@
 import org.apache.depot.common.util.SystemUtils;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
 import org.apache.depot.update.files.DefaultResourceFilenameAnalyzer;
 import org.apache.depot.update.files.IResourceFilenameAnalyzer;
-import org.apache.depot.update.resource.ArtifactSpecifier;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/sample/FileUpdater.java	Wed Jun 23 12:02:12 2004
@@ -21,12 +21,12 @@
 import java.util.List;
 
 import org.apache.depot.common.log.Logger;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.ArtifactUpdater;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.UpdateException;
 import org.apache.depot.update.messaging.ResourceRequest;
-import org.apache.depot.update.query.ResourceQuery;
-import org.apache.depot.update.query.ResourceQueryHelper;
+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;
@@ -135,13 +135,13 @@
 		//
 		ResourceRequest request =
 			new ResourceRequest(
-				ResourceQueryHelper.getResourceSpecifierQuery(
+				ArtifactQueryHelper.getResourceSpecifierQuery(
 					m_filer.getResourceSpecifierForFile(file)));
 
 		//
 		// Extract the query for this request
 		//
-		ResourceQuery resourceQuery = request.getQuery();
+		ArtifactQuery resourceQuery = request.getQuery();
 
 		Logger.getLogger().debug(
 			Messages.getString(MessageConstants.RESOURCE_REQUEST, request));
@@ -279,7 +279,7 @@
 
 		ResourceRequest request =
 			new ResourceRequest(
-				ResourceQueryHelper.getResourceSpecifierQuery(
+				ArtifactQueryHelper.getResourceSpecifierQuery(
 					m_filer.getResourceSpecifierForFile(file)));
 
 		if (!resolved.isDirectory()) {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/ArtifactTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/ArtifactTool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/ArtifactTool.java	Wed Jun 23 12:02:12 2004
@@ -19,11 +19,11 @@
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
 import org.apache.depot.common.util.debug.DebugUtils;
-import org.apache.depot.update.impl.ResourceUpdaterEngine;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
+import org.apache.depot.update.impl.ArtifactUpdaterEngine;
 import org.apache.depot.update.messaging.ResourceRequest;
-import org.apache.depot.update.query.ResourceQueryHelper;
+import org.apache.depot.update.query.ArtifactQueryHelper;
 import org.apache.depot.update.query.ResourceResult;
-import org.apache.depot.update.resource.ArtifactSpecifier;
 
 /**
  */
@@ -33,11 +33,11 @@
 
 	static {
 		l_resourceOption =
-			new Option("r", "resource", true, "The resource to work on");
+			new Option("a", "artifact", true, "The artifact to work on");
 	}
 
 	protected String getTitle() {
-		return "Depot Resource Tool";
+		return "Depot Artifact Tool";
 	}
 	
 	protected void init() {
@@ -48,7 +48,7 @@
 
 		String resource = cmdline.getMandatoryOptionValue(l_resourceOption);
 
-		ResourceUpdaterEngine ru = new ResourceUpdaterEngine();
+		ArtifactUpdaterEngine ru = new ArtifactUpdaterEngine();
 
 		ArtifactSpecifier specifier = new ArtifactSpecifier(resource);
 
@@ -57,7 +57,7 @@
 		//
 		ResourceRequest request =
 			new ResourceRequest(
-				ResourceQueryHelper.getResourceSpecifierQuery(specifier));
+				ArtifactQueryHelper.getResourceSpecifierQuery(specifier));
 
 		// :TODO: Hmm, ought request reply w/ Response (Query->Result)
 		ResourceResult result = ru.performRequest(request);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java	Wed Jun 23 12:02:12 2004
@@ -16,12 +16,12 @@
 package org.apache.depot.update.tool;
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.ArtifactUpdater;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.repository.DefaultRepository;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.ArtifactGroup;
 /**
  */
 public class DownloaderTool extends Tool {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/RepositoryTool.java	Wed Jun 23 12:02:12 2004
@@ -24,13 +24,13 @@
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
 import org.apache.depot.common.util.debug.DebugUtils;
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.ArtifactUpdater;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.impl.RepositoryWrapper;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.repository.DefaultRepository;
-import org.apache.depot.update.resource.ArtifactGroup;
 import org.apache.depot.update.util.select.AllSelector;
 
 /**
@@ -85,7 +85,7 @@
 			RepositoryWrapper repo =
 				new RepositoryWrapper(
 					repository,
-					ResourceUpdaterContext.getDefaultContext());
+					ArtifactUpdaterContext.getDefaultContext());
 
 			DebugUtils.printSeparator();
 			out.println("Repository: " + repo);

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/Tool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/Tool.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/Tool.java	Wed Jun 23 12:02:12 2004
@@ -15,6 +15,7 @@
  */
 package org.apache.depot.update.tool;
 import java.io.PrintWriter;
+
 import org.apache.depot.common.log.LogConstants;
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.log.StandardLogListener;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/CachedResourceSetTaskTest.java	Wed Jun 23 12:02:12 2004
@@ -20,7 +20,9 @@
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+
 import javax.xml.parsers.ParserConfigurationException;
+
 import org.apache.depot.common.log.Logger;
 import org.apache.tools.ant.BuildFileTest;
 import org.custommonkey.xmlunit.XMLAssert;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/ant/cache/CachedResourceSetTaskTest.java	Wed Jun 23 12:02:12 2004
@@ -20,7 +20,9 @@
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+
 import javax.xml.parsers.ParserConfigurationException;
+
 import org.apache.depot.common.log.Logger;
 import org.apache.tools.ant.BuildFileTest;
 import org.custommonkey.xmlunit.XMLAssert;

Copied: incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java (from rev 21609, incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ArtifactTests.java)
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/resource/ArtifactTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/artifact/ArtifactTests.java	Wed Jun 23 12:02:12 2004
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.apache.depot.update.resource;
+package org.apache.depot.update.artifact;
 
 import junit.framework.TestCase;
 

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/files/DefaultResourceAnalyzerTests.java	Wed Jun 23 12:02:12 2004
@@ -23,7 +23,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.VersionImporter;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/files/ResourceAnalyzerTests.java	Wed Jun 23 12:02:12 2004
@@ -24,7 +24,7 @@
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.UpdateException;
-import org.apache.depot.update.resource.ArtifactType;
+import org.apache.depot.update.artifact.ArtifactType;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 import org.apache.depot.version.impl.ApacheVersion;
 

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/protocols/ProtocolOperationsManagerTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/protocols/ProtocolOperationsManagerTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/protocols/ProtocolOperationsManagerTests.java	Wed Jun 23 12:02:12 2004
@@ -20,7 +20,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
@@ -31,8 +31,8 @@
  */
 public class ProtocolOperationsManagerTests extends TestCase {
 
-	private ResourceUpdaterContext m_testContext =
-		ResourceUpdaterContext.getTestContext();
+	private ArtifactUpdaterContext m_testContext =
+		ArtifactUpdaterContext.getTestContext();
 
 	private ProtocolOperationsManager m_pom = null;
 	private VirtualResourceLocator m_http = null;

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/query/QueryTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/query/QueryTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/query/QueryTests.java	Wed Jun 23 12:02:12 2004
@@ -20,16 +20,16 @@
 
 import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.update.UpdateException;
+import org.apache.depot.update.artifact.ArtifactGroup;
+import org.apache.depot.update.artifact.ArtifactType;
+import org.apache.depot.update.artifact.compare.VersionComparator;
+import org.apache.depot.update.artifact.select.ReleaseLevelSelector;
+import org.apache.depot.update.artifact.select.TypeSelector;
+import org.apache.depot.update.artifact.select.VersionSelector;
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.impl.RepositorySetWrapper;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.ArtifactGroup;
-import org.apache.depot.update.resource.ArtifactType;
-import org.apache.depot.update.resource.compare.VersionComparator;
-import org.apache.depot.update.resource.select.ReleaseLevelSelector;
-import org.apache.depot.update.resource.select.TypeSelector;
-import org.apache.depot.update.resource.select.VersionSelector;
 import org.apache.depot.update.util.UpdateConstants;
 import org.apache.depot.update.util.select.logic.AndSelector;
 import org.apache.depot.update.util.select.logic.OrSelector;
@@ -42,7 +42,7 @@
 public class QueryTests extends TestCase {
 
 	private DefaultQueryEngine m_engine = null;
-	private ResourceUpdaterContext m_context = null;
+	private ArtifactUpdaterContext m_context = null;
 	private RepositorySetWrapper m_repoSet = null;
 
 	static {
@@ -55,7 +55,7 @@
 	}
 
 	public void setUp() throws Exception {
-		m_context = ResourceUpdaterContext.getTestContext();
+		m_context = ArtifactUpdaterContext.getTestContext();
 
 		m_engine = new DefaultQueryEngine();
 
@@ -66,13 +66,13 @@
 	}
 
 	public void testQuery1() throws UpdateException {
-		ResourceQuery query = new ResourceQuery(new ArtifactGroup("test"));
+		ArtifactQuery query = new ArtifactQuery(new ArtifactGroup("test"));
 		perform(query);
 	}
 
 	public void testQuery2() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new TypeSelector(ArtifactType.SOURCE_CODE),
 				null,
@@ -81,8 +81,8 @@
 	}
 
 	public void testQuery3() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new VersionSelector(ApacheVersion.getTestVersion(1, 3)),
 				null,
@@ -91,8 +91,8 @@
 	}
 
 	public void testQuery4() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new AndSelector(
 					new TypeSelector(ArtifactType.SOURCE_CODE),
@@ -103,8 +103,8 @@
 	}
 
 	public void testQuery5() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new OrSelector(
 					new TypeSelector(ArtifactType.SOURCE_CODE),
@@ -115,8 +115,8 @@
 	}
 
 	public void testQuery6() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new OrSelector(
 					new TypeSelector(ArtifactType.SOURCE_CODE),
@@ -127,8 +127,8 @@
 	}
 
 	public void testQuery7() throws UpdateException {
-		ResourceQuery query =
-			new ResourceQuery(
+		ArtifactQuery query =
+			new ArtifactQuery(
 				new ArtifactGroup("junit"),
 				new ReleaseLevelSelector(ReleaseLevel.RELEASE),
 				VersionComparator.getInstance(),
@@ -136,7 +136,7 @@
 		performAndCount(query, 10, 20);
 	}
 
-	private ResourceResult performAndCountGroups(ResourceQuery query, int size)
+	private ResourceResult performAndCountGroups(ArtifactQuery query, int size)
 		throws UpdateException {
 		ResourceResult result = perform(query);
 
@@ -149,7 +149,7 @@
 	}
 
 	private ResourceResult performAndCount(
-		ResourceQuery query,
+		ArtifactQuery query,
 		int groups,
 		int resources)
 		throws UpdateException {
@@ -168,7 +168,7 @@
 		return result;
 	}
 
-	private ResourceResult perform(ResourceQuery query) throws UpdateException {
+	private ResourceResult perform(ArtifactQuery query) throws UpdateException {
 		ResourceResult result = m_engine.queryRepositories(m_repoSet, query);
 
 		DebugUtils.dump(query);

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/repository/RepositoryTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/repository/RepositoryTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/repository/RepositoryTests.java	Wed Jun 23 12:02:12 2004
@@ -21,9 +21,9 @@
 import junit.framework.TestCase;
 
 import org.apache.depot.common.log.Logger;
+import org.apache.depot.update.artifact.ArtifactGroup;
 import org.apache.depot.update.impl.RepositoryWrapper;
-import org.apache.depot.update.impl.ResourceUpdaterContext;
-import org.apache.depot.update.resource.ArtifactGroup;
+import org.apache.depot.update.impl.ArtifactUpdaterContext;
 import org.apache.depot.update.util.select.AllSelector;
 
 /**
@@ -48,10 +48,10 @@
 
 		m_repo1 = new RepositoryWrapper(
 				DefaultRepository.getLocalTestRepository(),
-				ResourceUpdaterContext.getTestContext());
+				ArtifactUpdaterContext.getTestContext());
 
 		m_repo2 = new RepositoryWrapper(MockRepository.getMockRepository(),
-				ResourceUpdaterContext.getTestContext());
+				ArtifactUpdaterContext.getTestContext());
 	}
 
 	public void testListGroups1() throws Exception {

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/FindTests.java	Wed Jun 23 12:02:12 2004
@@ -23,14 +23,14 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.Artifact;
 import org.apache.depot.update.ArtifactUpdater;
-import org.apache.depot.update.query.ResourceQuery;
-import org.apache.depot.update.query.ResourceQueryHelper;
+import org.apache.depot.update.Repository;
+import org.apache.depot.update.artifact.ArtifactSpecifier;
+import org.apache.depot.update.query.ArtifactQuery;
+import org.apache.depot.update.query.ArtifactQueryHelper;
 import org.apache.depot.update.repository.DefaultRepository;
 import org.apache.depot.update.repository.RepositorySet;
-import org.apache.depot.update.resource.ArtifactSpecifier;
 import org.apache.depot.update.util.io.ResolvedFile;
 import org.apache.depot.update.util.net.VirtualResourceLocator;
 
@@ -70,8 +70,8 @@
 
 		//  2. User supplies resource query and asks Depot process it
 		ArtifactSpecifier specifier = new ArtifactSpecifier("gorilla");
-		ResourceQuery query =
-				ResourceQueryHelper.getResourceSpecifierQuery(
+		ArtifactQuery query =
+				ArtifactQueryHelper.getResourceSpecifierQuery(
 					specifier,
 					repos);
 		List results = ruper.findResource(query);

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/usecases/SynchronizeTests.java	Wed Jun 23 12:02:12 2004
@@ -22,9 +22,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.depot.update.Repository;
 import org.apache.depot.update.ArtifactUpdater;
-import org.apache.depot.update.impl.ResourceUpdaterIdentifier;
+import org.apache.depot.update.Repository;
 import org.apache.depot.update.repository.DefaultRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.sample.FileAssistant;
@@ -59,10 +58,8 @@
 			m_fileHelper.setupExpectedFile(m_targetDir, "cat-2.3.1.jar");
 
 		//  1. User configures Depot
-		ResourceUpdaterIdentifier identifier =
-			new ResourceUpdaterIdentifier("synchronizeTest");
 		ArtifactUpdater ruper =
-			ArtifactUpdater.getResourceUpdater(identifier, true);
+			ArtifactUpdater.getResourceUpdater("synchronizeTest", true);
 
 		Repository fileRepo =
 			new DefaultRepository("test", m_repoDir.toURL().toString());

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/FileTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/FileTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/FileTests.java	Wed Jun 23 12:02:12 2004
@@ -16,9 +16,9 @@
 
 package org.apache.depot.update.util.io;
 
-import org.apache.depot.common.util.SystemUtils;
-
 import junit.framework.TestCase;
+
+import org.apache.depot.common.util.SystemUtils;
 
 /**
  * @author arb_jack

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/util/net/VirtualResourceLocatorTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/util/net/VirtualResourceLocatorTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/util/net/VirtualResourceLocatorTests.java	Wed Jun 23 12:02:12 2004
@@ -20,7 +20,6 @@
 
 import junit.framework.TestCase;
 
-import org.apache.depot.common.util.debug.DebugUtils;
 import org.apache.depot.update.protocols.Protocol;
 import org.apache.depot.update.util.io.ResolvedFile;
 

Mime
View raw message