aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-scheduler
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-29 20:58:54 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-29 20:58:54 +0000
commit9074bfb0f42034b5f1248d9d022594e4f4556599 (patch)
treeae8a859156afbcccdd6f161eb68ff1e0fe9927e0 /archiva-modules/archiva-scheduler
parentdcc622b870ff561b5d08cab70eee4810ec9ef175 (diff)
downloadarchiva-9074bfb0f42034b5f1248d9d022594e4f4556599.tar.gz
archiva-9074bfb0f42034b5f1248d9d022594e4f4556599.zip
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403504 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler')
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml5
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java (renamed from archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryArchivaTaskScheduler.java)9
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java145
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java4
-rw-r--r--archiva-modules/archiva-scheduler/pom.xml1
5 files changed, 12 insertions, 152 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
index fb3b73664..5bb2b77ef 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
@@ -33,6 +33,11 @@
<artifactId>archiva-scheduler-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-scheduler-repository-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryArchivaTaskScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
index 65894ac78..90a28a3fa 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryArchivaTaskScheduler.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
@@ -55,10 +55,10 @@ import java.util.Set;
* Default implementation of a scheduling component for archiva.
*/
@Service ("archivaTaskScheduler#repository")
-public class RepositoryArchivaTaskScheduler
- implements ArchivaTaskScheduler<RepositoryTask>, ConfigurationListener
+public class DefaultRepositoryArchivaTaskScheduler
+ implements RepositoryArchivaTaskScheduler, ConfigurationListener
{
- private Logger log = LoggerFactory.getLogger( RepositoryArchivaTaskScheduler.class );
+ private Logger log = LoggerFactory.getLogger( getClass() );
/**
*
@@ -200,8 +200,7 @@ public class RepositoryArchivaTaskScheduler
}
}
- @SuppressWarnings ("unchecked")
- private boolean isProcessingRepositoryTask( RepositoryTask task )
+ public boolean isProcessingRepositoryTask( RepositoryTask task )
{
synchronized ( repositoryScanningQueue )
{
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java
deleted file mode 100644
index b023cdd2f..000000000
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package org.apache.archiva.scheduler.repository;
-
-import org.apache.archiva.redback.components.taskqueue.Task;
-
-import java.io.File;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-/**
- * DataRefreshTask - task for discovering changes in the repository
- * and updating all associated data.
- *
- *
- */
-public class RepositoryTask
- implements Task
-{
- private String repositoryId;
-
- private File resourceFile;
-
- private boolean updateRelatedArtifacts;
-
- private boolean scanAll;
-
- public boolean isScanAll()
- {
- return scanAll;
- }
-
- public void setScanAll( boolean scanAll )
- {
- this.scanAll = scanAll;
- }
-
- public String getRepositoryId()
- {
- return repositoryId;
- }
-
- public void setRepositoryId( String repositoryId )
- {
- this.repositoryId = repositoryId;
- }
-
- public long getMaxExecutionTime()
- {
- return 0;
- }
-
- public File getResourceFile()
- {
- return resourceFile;
- }
-
- public void setResourceFile( File resourceFile )
- {
- this.resourceFile = resourceFile;
- }
-
- public boolean isUpdateRelatedArtifacts()
- {
- return updateRelatedArtifacts;
- }
-
- public void setUpdateRelatedArtifacts( boolean updateRelatedArtifacts )
- {
- this.updateRelatedArtifacts = updateRelatedArtifacts;
- }
-
- @Override
- public String toString()
- {
- return "RepositoryTask [repositoryId=" + repositoryId + ", resourceFile=" + resourceFile + ", scanAll="
- + scanAll + ", updateRelatedArtifacts=" + updateRelatedArtifacts + "]";
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() );
- result = prime * result + ( ( resourceFile == null ) ? 0 : resourceFile.hashCode() );
- return result;
- }
-
- @Override
- public boolean equals( Object obj )
- {
- if ( this == obj )
- {
- return true;
- }
- if ( obj == null )
- {
- return false;
- }
- if ( getClass() != obj.getClass() )
- {
- return false;
- }
- RepositoryTask other = (RepositoryTask) obj;
- if ( repositoryId == null )
- {
- if ( other.repositoryId != null )
- {
- return false;
- }
- }
- else if ( !repositoryId.equals( other.repositoryId ) )
- {
- return false;
- }
- if ( resourceFile == null )
- {
- if ( other.resourceFile != null )
- {
- return false;
- }
- }
- else if ( !resourceFile.equals( other.resourceFile ) )
- {
- return false;
- }
- return true;
- }
-}
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java
index eea487d72..6789459b9 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java
@@ -44,9 +44,9 @@ public class RepositoryTaskJob
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
setJobDataMap( dataMap );
- TaskQueue taskQueue = (TaskQueue) dataMap.get( RepositoryArchivaTaskScheduler.TASK_QUEUE );
+ TaskQueue taskQueue = (TaskQueue) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_QUEUE );
- String repositoryId = (String) dataMap.get( RepositoryArchivaTaskScheduler.TASK_REPOSITORY );
+ String repositoryId = (String) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_REPOSITORY );
RepositoryTask task = new RepositoryTask();
task.setRepositoryId( repositoryId );
diff --git a/archiva-modules/archiva-scheduler/pom.xml b/archiva-modules/archiva-scheduler/pom.xml
index 4e215012a..df0fe7289 100644
--- a/archiva-modules/archiva-scheduler/pom.xml
+++ b/archiva-modules/archiva-scheduler/pom.xml
@@ -31,6 +31,7 @@
<modules>
<module>archiva-scheduler-api</module>
<module>archiva-scheduler-indexing</module>
+ <module>archiva-scheduler-repository-api</module>
<module>archiva-scheduler-repository</module>
</modules>
</project>