summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2006-09-06 04:02:08 +0000
committerBrett Porter <brett@apache.org>2006-09-06 04:02:08 +0000
commite4cfdac7b32ee1cdc0c76a01914cd33d0d5b704b (patch)
treed15035dab52769e92b468f7d64a36491c8d6ba05
parent1b940da8671bb5d0ee49fe4881edf86bcb95aaf4 (diff)
downloadarchiva-e4cfdac7b32ee1cdc0c76a01914cd33d0d5b704b.tar.gz
archiva-e4cfdac7b32ee1cdc0c76a01914cd33d0d5b704b.zip
[MRM-161] remove scheduled execution, as it will be synchronised with the indexing
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@440607 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-configuration/src/main/mdo/configuration.mdo7
-rw-r--r--archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java20
-rw-r--r--archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java2
-rw-r--r--archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java2
-rw-r--r--archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/ReporterTask.java98
-rw-r--r--archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/RepositoryTask.java4
-rw-r--r--archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java8
-rw-r--r--archiva-webapp/src/main/resources/xwork.xml4
8 files changed, 4 insertions, 141 deletions
diff --git a/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-configuration/src/main/mdo/configuration.mdo
index 17d9ddfc2..9fd042427 100644
--- a/archiva-configuration/src/main/mdo/configuration.mdo
+++ b/archiva-configuration/src/main/mdo/configuration.mdo
@@ -73,13 +73,6 @@
<defaultValue>0 0 * * * ?</defaultValue>
</field>
<field>
- <name>reporterCronExpression</name>
- <version>1.0.0</version>
- <type>String</type>
- <description>When to run the indexing mechanism. Default is every hour on the half hour.</description>
- <defaultValue>0 30 * * * ?</defaultValue>
- </field>
- <field>
<name>globalBlackListPatterns</name>
<version>1.0.0</version>
<description>Blacklisted patterns in the discovery process</description>
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java
index f300e5bcd..3db17e8ed 100644
--- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java
+++ b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java
@@ -61,18 +61,11 @@ public class DefaultRepositoryTaskScheduler
private static final String INDEXER_JOB = "indexerTask";
- private static final String REPORTER_JOB = "reporterTask";
-
/**
* @plexus.requirement role-hint="indexer"
*/
private RepositoryTask indexerTask;
- /**
- * @plexus.requirement role-hint="reporter"
- */
- private RepositoryTask reporterTask;
-
public void start()
throws StartingException
{
@@ -128,13 +121,6 @@ public class DefaultRepositoryTaskScheduler
{
getLogger().info( "Not scheduling indexer - index path is not configured" );
}
-
- JobDetail jobDetail = createJobDetail( REPORTER_JOB, reporterTask );
-
- getLogger().info( "Scheduling reporter: " + configuration.getReporterCronExpression() );
- CronTrigger trigger =
- new CronTrigger( REPORTER_JOB + "Trigger", DISCOVERER_GROUP, configuration.getReporterCronExpression() );
- scheduler.scheduleJob( jobDetail, trigger );
}
private JobDetail createJobDetail( String jobName, RepositoryTask task )
@@ -153,7 +139,6 @@ public class DefaultRepositoryTaskScheduler
try
{
scheduler.unscheduleJob( INDEXER_JOB, DISCOVERER_GROUP );
- scheduler.unscheduleJob( REPORTER_JOB, DISCOVERER_GROUP );
}
catch ( SchedulerException e )
{
@@ -190,9 +175,4 @@ public class DefaultRepositoryTaskScheduler
indexerTask.execute();
}
- public void runReporter()
- throws TaskExecutionException
- {
- reporterTask.execute();
- }
}
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java
index 08b1ca5cc..04b2b62ea 100644
--- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java
+++ b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java
@@ -31,6 +31,4 @@ public interface RepositoryTaskScheduler
void runIndexer()
throws TaskExecutionException;
- void runReporter()
- throws TaskExecutionException;
}
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java
index 534039461..c15f3f4c6 100644
--- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java
+++ b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java
@@ -153,6 +153,8 @@ public class IndexerTask
List artifacts = discoverer.discoverArtifacts( repository, blacklistedPatterns, filter );
if ( !artifacts.isEmpty() )
{
+ // TODO! reporting
+
getLogger().info( "Indexing " + artifacts.size() + " new artifacts" );
index.indexArtifacts( artifacts, recordFactory );
}
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/ReporterTask.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/ReporterTask.java
deleted file mode 100644
index 641e920bf..000000000
--- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/ReporterTask.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.apache.maven.archiva.scheduler.task;
-
-/*
- * Copyright 2005-2006 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.
- */
-
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.ConfigurationStore;
-import org.apache.maven.archiva.configuration.ConfigurationStoreException;
-import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory;
-import org.apache.maven.archiva.scheduler.TaskExecutionException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-
-import java.util.Map;
-
-/**
- * Task for discovering problems in the repository.
- *
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @plexus.component role="org.apache.maven.archiva.scheduler.task.RepositoryTask" role-hint="reporter"
- */
-public class ReporterTask
- extends AbstractLogEnabled
- implements RepositoryTask
-{
- /**
- * Configuration store.
- *
- * @plexus.requirement
- */
- private ConfigurationStore configurationStore;
-
- /**
- * @plexus.requirement
- */
- private ConfiguredRepositoryFactory repoFactory;
-
- /**
- * @plexus.requirement role="org.apache.maven.archiva.discoverer.ArtifactDiscoverer"
- */
- private Map artifactDiscoverers;
-
- public void execute()
- throws TaskExecutionException
- {
- Configuration configuration;
- try
- {
- configuration = configurationStore.getConfigurationFromStore();
- }
- catch ( ConfigurationStoreException e )
- {
- throw new TaskExecutionException( e.getMessage(), e );
- }
-
- execute( configuration );
- }
-
- private void execute( Configuration configuration )
- throws TaskExecutionException
- {
- long time = System.currentTimeMillis();
- getLogger().info( "Starting repository reporting process" );
-
- // TODO!
-
- time = System.currentTimeMillis() - time;
- getLogger().info( "Finished repository reporting process in " + time + "ms" );
- }
-
- public void executeNowIfNeeded()
- throws TaskExecutionException
- {
- Configuration configuration;
- try
- {
- configuration = configurationStore.getConfigurationFromStore();
- }
- catch ( ConfigurationStoreException e )
- {
- throw new TaskExecutionException( e.getMessage(), e );
- }
-
- // TODO!
- }
-}
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/RepositoryTask.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/RepositoryTask.java
index 3b1bc16eb..ae4162c29 100644
--- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/RepositoryTask.java
+++ b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/RepositoryTask.java
@@ -1,7 +1,5 @@
package org.apache.maven.archiva.scheduler.task;
-import org.apache.maven.archiva.scheduler.TaskExecutionException;
-
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
@@ -18,6 +16,8 @@ import org.apache.maven.archiva.scheduler.TaskExecutionException;
* limitations under the License.
*/
+import org.apache.maven.archiva.scheduler.TaskExecutionException;
+
/**
* A repository task.
*
diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java
index fcafe3307..a87e861fa 100644
--- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java
+++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java
@@ -40,12 +40,4 @@ public class RunRepositoryTaskAction
return SUCCESS;
}
-
- public String runReporter()
- throws TaskExecutionException
- {
- taskScheduler.runReporter();
-
- return SUCCESS;
- }
}
diff --git a/archiva-webapp/src/main/resources/xwork.xml b/archiva-webapp/src/main/resources/xwork.xml
index f228e57c3..c90d005bf 100644
--- a/archiva-webapp/src/main/resources/xwork.xml
+++ b/archiva-webapp/src/main/resources/xwork.xml
@@ -211,10 +211,6 @@
<action name="runIndexer" class="runRepositoryTaskAction" method="runIndexer">
<result type="redirect-action">index</result>
</action>
-
- <action name="runReporter" class="runRepositoryTaskAction" method="runReporter">
- <result type="redirect-action">index</result>
- </action>
</package>
</xwork>