Search in sources :

Example 1 with PostProcessPlugin

use of org.codice.ddf.catalog.async.plugin.api.internal.PostProcessPlugin in project ddf by codice.

the class InMemoryProcessingFramework method submitCreate.

@Override
public void submitCreate(ProcessRequest<ProcessCreateItem> input) {
    if (postProcessPlugins == null || postProcessPlugins.isEmpty()) {
        LOGGER.debug("postProcessPlugins is empty. Not starting post process thread");
    } else {
        threadPool.submit(() -> {
            ProcessRequest<ProcessCreateItem> request = input;
            for (PostProcessPlugin plugin : postProcessPlugins) {
                try {
                    request = plugin.processCreate(request);
                } catch (PluginExecutionException e) {
                    LOGGER.debug("Unable to process create request through plugin: {}", plugin.getClass().getCanonicalName(), e);
                }
            }
            storeProcessRequest(request);
            closeInputStream(request);
        });
    }
}
Also used : PostProcessPlugin(org.codice.ddf.catalog.async.plugin.api.internal.PostProcessPlugin) ProcessCreateItem(org.codice.ddf.catalog.async.data.api.internal.ProcessCreateItem) PluginExecutionException(ddf.catalog.plugin.PluginExecutionException)

Example 2 with PostProcessPlugin

use of org.codice.ddf.catalog.async.plugin.api.internal.PostProcessPlugin in project ddf by codice.

the class InMemoryProcessingFramework method submitUpdate.

@Override
public void submitUpdate(ProcessRequest<ProcessUpdateItem> input) {
    if (postProcessPlugins == null || postProcessPlugins.isEmpty()) {
        LOGGER.debug("postProcessPlugins is empty. Not starting post process thread");
    } else {
        threadPool.submit(() -> {
            ProcessRequest<ProcessUpdateItem> request = input;
            for (PostProcessPlugin plugin : postProcessPlugins) {
                try {
                    request = plugin.processUpdate(request);
                } catch (PluginExecutionException e) {
                    LOGGER.debug("Unable to process update request through plugin: {}", plugin.getClass().getCanonicalName(), e);
                }
            }
            storeProcessRequest(request);
            closeInputStream(request);
        });
    }
}
Also used : PostProcessPlugin(org.codice.ddf.catalog.async.plugin.api.internal.PostProcessPlugin) ProcessUpdateItem(org.codice.ddf.catalog.async.data.api.internal.ProcessUpdateItem) PluginExecutionException(ddf.catalog.plugin.PluginExecutionException)

Aggregations

PluginExecutionException (ddf.catalog.plugin.PluginExecutionException)2 PostProcessPlugin (org.codice.ddf.catalog.async.plugin.api.internal.PostProcessPlugin)2 ProcessCreateItem (org.codice.ddf.catalog.async.data.api.internal.ProcessCreateItem)1 ProcessUpdateItem (org.codice.ddf.catalog.async.data.api.internal.ProcessUpdateItem)1