Skip to content

Commit

Permalink
created processing logic method to support generic job plugin info
Browse files Browse the repository at this point in the history
  • Loading branch information
nunovieira220 authored and luis100 committed Sep 4, 2018
1 parent 2168e78 commit b0a75a0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void process(IndexService index, ModelService model, StorageService stora
report.setPluginState(PluginState.FAILURE);
}
}

}
}, index, model, storage, liteList);
}
Expand Down Expand Up @@ -148,7 +147,6 @@ protected Report executeOnIncidence(IndexService index, ModelService model, Stor
return report;
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public List<Class<T>> getObjectClasses() {
List<Class<? extends IsRODAObject>> list = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ public interface RODAObjectProcessingLogic<T extends IsRODAObject> extends RODAO
* @deprecated use {@link #process(IndexService, ModelService, StorageService, Report, Job, JobPluginInfo, Plugin, IsRODAObject)} instead.
*/
@Deprecated
public void process(IndexService index, ModelService model, StorageService storage, Report report, Job cachedJob,
SimpleJobPluginInfo jobPluginInfo, Plugin<T> plugin, T object);
public default void process(IndexService index, ModelService model, StorageService storage, Report report, Job cachedJob,
SimpleJobPluginInfo jobPluginInfo, Plugin<T> plugin, T object) {
throw new IllegalStateException("Should implement this method or non-deprecated version of it.");
}

public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, JobPluginInfo jobPluginInfo, Plugin<T> plugin, T object) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
import org.roda.core.index.IndexService;
import org.roda.core.model.ModelService;
import org.roda.core.plugins.orchestrate.JobPluginInfo;
import org.roda.core.plugins.orchestrate.SimpleJobPluginInfo;
import org.roda.core.storage.StorageService;

@FunctionalInterface
//@FunctionalInterface
public interface RODAObjectProcessingLogicNew<T extends IsRODAObject> {
public void process(IndexService index, ModelService model, StorageService storage, Report report, Job cachedJob,
JobPluginInfo jobPluginInfo, Plugin<T> plugin, T object);
@Deprecated
public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, SimpleJobPluginInfo jobPluginInfo, Plugin<T> plugin, T object) {
throw new IllegalStateException("Should implement this method or non-deprecated version of it.");
}

public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, JobPluginInfo jobPluginInfo, Plugin<T> plugin, T object) {
process(index, model, storage, report, cachedJob, (SimpleJobPluginInfo) jobPluginInfo, plugin, object);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@
import org.roda.core.index.IndexService;
import org.roda.core.model.ModelService;
import org.roda.core.plugins.orchestrate.JobPluginInfo;
import org.roda.core.plugins.orchestrate.SimpleJobPluginInfo;
import org.roda.core.storage.StorageService;

@FunctionalInterface
//@FunctionalInterface
public interface RODAObjectsProcessingLogic<T extends IsRODAObject> {
public void process(IndexService index, ModelService model, StorageService storage, Report report, Job cachedJob,
JobPluginInfo jobPluginInfo, Plugin<T> plugin, List<T> objects);
@Deprecated
public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, SimpleJobPluginInfo jobPluginInfo, Plugin<T> plugin, List<T> objects) {
throw new IllegalStateException("Should implement this method or non-deprecated version of it.");
}

public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, JobPluginInfo jobPluginInfo, Plugin<T> plugin, List<T> objects) {
process(index, model, storage, report, cachedJob, (SimpleJobPluginInfo) jobPluginInfo, plugin, objects);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
import org.roda.core.index.IndexService;
import org.roda.core.model.ModelService;
import org.roda.core.plugins.orchestrate.JobPluginInfo;
import org.roda.core.plugins.orchestrate.SimpleJobPluginInfo;
import org.roda.core.storage.StorageService;

@FunctionalInterface
//@FunctionalInterface
public interface RODAProcessingLogic<T extends IsRODAObject> {
public void process(IndexService index, ModelService model, StorageService storage, Report report, Job cachedJob,
JobPluginInfo jobPluginInfo, Plugin<T> plugin);
@Deprecated
public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, SimpleJobPluginInfo jobPluginInfo, Plugin<T> plugin) {
throw new IllegalStateException("Should implement this method or non-deprecated version of it.");
}

public default void process(IndexService index, ModelService model, StorageService storage, Report report,
Job cachedJob, JobPluginInfo jobPluginInfo, Plugin<T> plugin) {
process(index, model, storage, report, cachedJob, (SimpleJobPluginInfo) jobPluginInfo, plugin);
}
}

0 comments on commit b0a75a0

Please sign in to comment.