1 package org.apache.archiva.scheduler.repository.model;
3 import org.apache.archiva.redback.components.taskqueue.Task;
4 import org.apache.archiva.repository.storage.StorageAsset;
8 * Licensed to the Apache Software Foundation (ASF) under one
9 * or more contributor license agreements. See the NOTICE file
10 * distributed with this work for additional information
11 * regarding copyright ownership. The ASF licenses this file
12 * to you under the Apache License, Version 2.0 (the
13 * "License"); you may not use this file except in compliance
14 * with the License. You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing,
19 * software distributed under the License is distributed on an
20 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 * KIND, either express or implied. See the License for the
22 * specific language governing permissions and limitations
27 * DataRefreshTask - task for discovering changes in the repository
28 * and updating all associated data.
30 public class RepositoryTask
33 private String repositoryId;
35 private StorageAsset resourceFile;
37 private boolean updateRelatedArtifacts;
39 private boolean scanAll;
41 public RepositoryTask()
46 public RepositoryTask( String repositoryId )
48 this.repositoryId = repositoryId;
51 public RepositoryTask( String repositoryId, boolean scanAll )
53 this.repositoryId = repositoryId;
54 this.scanAll = scanAll;
57 public boolean isScanAll()
62 public void setScanAll( boolean scanAll )
64 this.scanAll = scanAll;
67 public String getRepositoryId()
72 public void setRepositoryId( String repositoryId )
74 this.repositoryId = repositoryId;
78 public long getMaxExecutionTime()
83 public StorageAsset getResourceFile()
88 public void setResourceFile( StorageAsset resourceFile )
90 this.resourceFile = resourceFile;
93 public boolean isUpdateRelatedArtifacts()
95 return updateRelatedArtifacts;
98 public void setUpdateRelatedArtifacts( boolean updateRelatedArtifacts )
100 this.updateRelatedArtifacts = updateRelatedArtifacts;
104 public String toString()
106 return "RepositoryTask [repositoryId=" + repositoryId + ", resourceFile=" + resourceFile + ", scanAll="
107 + scanAll + ", updateRelatedArtifacts=" + updateRelatedArtifacts + "]";
111 public int hashCode()
113 final int prime = 31;
115 result = prime * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() );
116 result = prime * result + ( ( resourceFile == null ) ? 0 : resourceFile.hashCode() );
121 public boolean equals( Object obj )
131 if ( getClass() != obj.getClass() )
135 RepositoryTask other = (RepositoryTask) obj;
136 if ( repositoryId == null )
138 if ( other.repositoryId != null )
143 else if ( !repositoryId.equals( other.repositoryId ) )
147 if ( resourceFile == null )
149 if ( other.resourceFile != null )
154 else if ( !resourceFile.equals( other.resourceFile ) )