import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
*/
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.springframework.stereotype.Service;
/**
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.redback.role.RoleManagerException;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
*/
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.springframework.stereotype.Service;
/**
+++ /dev/null
-package org.apache.archiva.scheduler.repository;
-
-/*
- * 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.
- */
-
-import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
-import org.apache.archiva.scheduler.ArchivaTaskScheduler;
-
-/**
- * Scheduling component for archiva repositories
- */
-public interface RepositoryArchivaTaskScheduler
- extends ArchivaTaskScheduler<RepositoryTask>
-{
-
-
- boolean isProcessingRepositoryTask( String repositoryId );
-
-
- boolean isProcessingRepositoryTask( RepositoryTask task );
-
- void queueTask( RepositoryTask task )
- throws TaskQueueException;
-
- boolean unQueueTask( RepositoryTask task )
- throws TaskQueueException;
-
-
-}
+++ /dev/null
-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;
- }
-}
--- /dev/null
+package org.apache.archiva.scheduler.repository.model;
+
+/*
+ * 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.
+ */
+
+import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
+import org.apache.archiva.scheduler.ArchivaTaskScheduler;
+
+/**
+ * Scheduling component for archiva repositories
+ */
+public interface RepositoryArchivaTaskScheduler
+ extends ArchivaTaskScheduler<RepositoryTask>
+{
+
+
+ boolean isProcessingRepositoryTask( String repositoryId );
+
+
+ boolean isProcessingRepositoryTask( RepositoryTask task );
+
+ void queueTask( RepositoryTask task )
+ throws TaskQueueException;
+
+ boolean unQueueTask( RepositoryTask task )
+ throws TaskQueueException;
+
+
+}
--- /dev/null
+package org.apache.archiva.scheduler.repository.model;
+
+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;
+ }
+}
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
import org.apache.archiva.repository.scanner.RepositoryScanner;
import org.apache.archiva.repository.scanner.RepositoryScannerException;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.commons.lang.StringUtils;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.apache.archiva.redback.components.taskqueue.Task;
import org.apache.archiva.redback.components.scheduler.Scheduler;
import org.apache.archiva.redback.components.taskqueue.TaskQueue;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
-import org.apache.archiva.scheduler.ArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.quartz.SchedulerException;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.apache.archiva.redback.components.scheduler.AbstractJob;
import org.apache.archiva.redback.components.taskqueue.TaskQueue;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
*/
import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.Collection;
import org.apache.archiva.metadata.repository.MetadataRepositoryException;
import org.apache.archiva.metadata.repository.stats.RepositoryStatistics;
import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.codehaus.plexus.util.FileUtils;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.File;
import java.util.Calendar;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.services.utils.ArtifactBuilder;
import org.apache.archiva.scheduler.repository.DefaultRepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.security.AccessDeniedException;
import org.apache.archiva.security.ArchivaSecurityException;
import org.apache.archiva.security.PrincipalNotFoundException;
import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask;
import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexException;
import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.security.ArchivaSecurityException;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.archiva.xml.XMLException;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.services.AbstractRestService;
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.web.model.FileMetadata;
import org.apache.archiva.xml.XMLException;
import org.apache.commons.io.FilenameUtils;
import org.apache.archiva.audit.AuditListener;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryTask;
import org.apache.archiva.webdav.util.IndexWriter;
import org.apache.archiva.webdav.util.MimeTypes;
import org.apache.commons.io.FileUtils;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.repository.metadata.RepositoryMetadataMerge;
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
import org.apache.archiva.security.ServletAuthenticator;
import org.apache.archiva.webdav.util.MimeTypes;
import org.apache.archiva.webdav.util.RepositoryPathUtil;