use of org.talend.dataprofiler.migration.IWorkspaceMigrationTask in project tdq-studio-se by Talend.
the class MigrationTaskManagerWithoutUI method getValidTasks.
/**
* DOC bZhou Comment method "getValidTasks".
*
* @param workspaceVersion
* @param currentVersion
* @param tasks
* @return
*/
public static List<IMigrationTask> getValidTasks(ProductVersion workspaceVersion, ProductVersion currentVersion, List<IMigrationTask> tasks) {
List<IMigrationTask> validTasks = new ArrayList<IMigrationTask>();
for (IMigrationTask task : tasks) {
if (task.getTaskCategory() == MigrationTaskCategory.WORKSPACE) {
IWorkspaceMigrationTask wTask = (IWorkspaceMigrationTask) task;
ProductVersion taskVersion = ProductVersion.fromString(wTask.getVersion());
if (taskVersion.compareTo(workspaceVersion) > 0 && taskVersion.compareTo(currentVersion) <= 0) {
validTasks.add(task);
}
}
if (task.getTaskCategory() == MigrationTaskCategory.PROJECT) {
validTasks.add(task);
}
}
return validTasks;
}
Aggregations