Search in sources :

Example 1 with ProcessRequestImpl

use of org.codice.ddf.catalog.async.data.impl.ProcessRequestImpl in project ddf by codice.

the class ProcessingPostIngestPlugin method createCreateRequest.

private ProcessRequest<ProcessCreateItem> createCreateRequest(CreateResponse createResponse) {
    List<ProcessCreateItem> processCreateItems;
    processCreateItems = createResponse.getCreatedMetacards().stream().map(metacard -> new ProcessCreateItemImpl(getProcessResource(metacard, getSubject(createResponse)), metacard, false)).collect(Collectors.toList());
    return new ProcessRequestImpl(processCreateItems, putPostProcessCompleteFlagAndGet(createResponse.getProperties()));
}
Also used : ProcessRequestImpl(org.codice.ddf.catalog.async.data.impl.ProcessRequestImpl) ProcessCreateItem(org.codice.ddf.catalog.async.data.api.internal.ProcessCreateItem) ProcessCreateItemImpl(org.codice.ddf.catalog.async.data.impl.ProcessCreateItemImpl)

Example 2 with ProcessRequestImpl

use of org.codice.ddf.catalog.async.data.impl.ProcessRequestImpl in project ddf by codice.

the class ProcessingPostIngestPlugin method createUpdateRequest.

private ProcessRequest<ProcessUpdateItem> createUpdateRequest(UpdateResponse updateResponse) {
    List<Update> updates = updateResponse.getUpdatedMetacards();
    List<ProcessUpdateItem> processUpdateItems = new ArrayList<>();
    for (Update update : updates) {
        Metacard oldCard = update.getOldMetacard();
        Metacard newCard = update.getNewMetacard();
        ProcessUpdateItem processItem = new ProcessUpdateItemImpl(getProcessResource(newCard, getSubject(updateResponse)), newCard, oldCard, false);
        processUpdateItems.add(processItem);
    }
    return new ProcessRequestImpl(processUpdateItems, putPostProcessCompleteFlagAndGet(updateResponse.getProperties()));
}
Also used : ProcessRequestImpl(org.codice.ddf.catalog.async.data.impl.ProcessRequestImpl) Metacard(ddf.catalog.data.Metacard) ArrayList(java.util.ArrayList) Update(ddf.catalog.operation.Update) ProcessUpdateItem(org.codice.ddf.catalog.async.data.api.internal.ProcessUpdateItem) ProcessUpdateItemImpl(org.codice.ddf.catalog.async.data.impl.ProcessUpdateItemImpl)

Aggregations

ProcessRequestImpl (org.codice.ddf.catalog.async.data.impl.ProcessRequestImpl)2 Metacard (ddf.catalog.data.Metacard)1 Update (ddf.catalog.operation.Update)1 ArrayList (java.util.ArrayList)1 ProcessCreateItem (org.codice.ddf.catalog.async.data.api.internal.ProcessCreateItem)1 ProcessUpdateItem (org.codice.ddf.catalog.async.data.api.internal.ProcessUpdateItem)1 ProcessCreateItemImpl (org.codice.ddf.catalog.async.data.impl.ProcessCreateItemImpl)1 ProcessUpdateItemImpl (org.codice.ddf.catalog.async.data.impl.ProcessUpdateItemImpl)1