*/
private ReportGroup reportGroup;
+ private long lastIndexingTime = 0;
+
private static final int ARTIFACT_BUFFER_SIZE = 1000;
+ public long getLastIndexingTime()
+ {
+ return lastIndexingTime;
+ }
+
public void executeTask( Task task )
throws TaskExecutionException
{
}
time = System.currentTimeMillis() - time;
+ lastIndexingTime = System.currentTimeMillis();
getLogger().info( "Finished repository indexing process in " + time + "ms" );
}
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
import org.apache.maven.archiva.indexer.RepositoryIndexException;
import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
+import org.apache.maven.archiva.scheduler.executors.IndexerTaskExecutor;
import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.codehaus.plexus.scheduler.CronExpressionValidator;
import org.codehaus.plexus.security.rbac.Resource;
import java.io.File;
import java.io.IOException;
+import java.util.Date;
/**
* Configures the application.
*/
private ConfigurationStore configurationStore;
+ /**
+ * @plexus.requirement role="org.codehaus.plexus.taskqueue.execution.TaskExecutor" role-hint="indexer"
+ */
+ private IndexerTaskExecutor indexer;
+
/**
* The configuration.
*/
private String year;
+ private String lastIndexingTime;
+
public void validate()
{
//validate cron expression
i++;
}
+ if ( indexer.getLastIndexingTime() != 0 ) {
+ lastIndexingTime = new Date( indexer.getLastIndexingTime() ).toString();
+ }
+ else
+ {
+ lastIndexingTime = "Never been run.";
+ }
+
return INPUT;
}
configuration = configurationStore.getConfigurationFromStore();
}
+ public String getLastIndexingTime()
+ {
+ return lastIndexingTime;
+ }
+
+ public void setLastIndexingTime(String lastIndexingTime)
+ {
+ this.lastIndexingTime = lastIndexingTime;
+ }
+
public String getSecond()
{
return second;