Search in sources :

Example 16 with DeleteRequestImpl

use of ddf.catalog.operation.impl.DeleteRequestImpl in project ddf by codice.

the class CatalogComponentFrameworkTest method testDeleteWithListOfIds.

@Test
public /**
     * Operation: DELETE
     * Body contains: List<String>
     */
void testDeleteWithListOfIds() throws Exception {
    resetMocks();
    // Setup expectations to verify
    final MockEndpoint mockVerifierEndpoint = getMockEndpoint("mock:result");
    mockVerifierEndpoint.expectedMessageCount(1);
    final List<Metacard> metacards = new ArrayList<Metacard>();
    metacards.add(metacard1);
    metacards.add(metacard2);
    // setup mock catalog framework
    final String[] metacardIds = new String[metacards.size()];
    for (int i = 0; i < metacards.size(); i++) {
        metacardIds[i] = metacards.get(i).getId();
    }
    final List<String> metacardIdList = Arrays.asList(metacardIds);
    DeleteRequest deleteRequest = new DeleteRequestImpl(metacardIds);
    DeleteResponse deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap(), metacards);
    when(catalogFramework.delete(any(DeleteRequest.class))).thenReturn(deleteResponse);
    // Exercise the route with a DELETE operation
    template.sendBodyAndHeader("direct:sampleInput", metacardIdList, "Operation", "DELETE");
    // Verify that the number of metacards in the exchange after the records
    // is identical to the input
    assertListSize(mockVerifierEndpoint.getExchanges(), 1);
    final Exchange exchange = mockVerifierEndpoint.getExchanges().get(0);
    final List<Update> cardsDeleted = (List<Update>) exchange.getIn().getBody();
    assertListSize(cardsDeleted, 2);
    mockVerifierEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) HashMap(java.util.HashMap) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) ArrayList(java.util.ArrayList) Update(ddf.catalog.operation.Update) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Exchange(org.apache.camel.Exchange) Metacard(ddf.catalog.data.Metacard) DeleteResponse(ddf.catalog.operation.DeleteResponse) DeleteResponseImpl(ddf.catalog.operation.impl.DeleteResponseImpl) ArrayList(java.util.ArrayList) List(java.util.List) DeleteRequest(ddf.catalog.operation.DeleteRequest) Test(org.junit.Test)

Example 17 with DeleteRequestImpl

use of ddf.catalog.operation.impl.DeleteRequestImpl in project ddf by codice.

the class FrameworkProducer method delete.

/**
     * Deletes metacard(s) in the catalog using the Catalog Framework.
     *
     * @param exchange
     *            The {@link org.apache.camel.Exchange} can contain a
     *            {@link org.apache.camel.Message} with a body of type {@link java.util.List} of
     *            {@link String} or a single {@link String}. Each String represents the ID of a
     *            Metacard to be deleted.
     * @throws ddf.catalog.source.SourceUnavailableException
     * @throws ddf.catalog.source.IngestException
     * @throws ddf.camel.component.catalog.framework.FrameworkProducerException
     */
private void delete(final Exchange exchange) throws SourceUnavailableException, IngestException, FrameworkProducerException {
    DeleteResponse deleteResponse = null;
    // read in data
    final List<String> metacardIdsToBeDeleted = readBodyDataAsMetacardIds(exchange);
    // process if data is valid
    if (!validateList(metacardIdsToBeDeleted, String.class)) {
        LOGGER.debug("Validation of Metacard id list failed");
        processCatalogResponse(deleteResponse, exchange);
        throw new FrameworkProducerException("Validation of Metacard id list failed");
    }
    LOGGER.debug("Validation of Metacard id list passed...");
    final String[] metacardIdsToBeDeletedArray = new String[metacardIdsToBeDeleted.size()];
    final DeleteRequest deleteRequest = new DeleteRequestImpl(metacardIdsToBeDeleted.toArray(metacardIdsToBeDeletedArray));
    final int expectedNumberOfDeletedMetacards = metacardIdsToBeDeleted.size();
    if (expectedNumberOfDeletedMetacards < 1) {
        LOGGER.debug("Empty list of Metacard id...nothing to process");
        processCatalogResponse(deleteResponse, exchange);
        return;
    }
    LOGGER.debug("Making DELETE call to Catalog Framework...");
    deleteResponse = catalogFramework.delete(deleteRequest);
    if (deleteResponse == null) {
        LOGGER.debug("DeleteResponse is null from catalog framework");
        processCatalogResponse(deleteResponse, exchange);
        return;
    }
    final List<Metacard> deletedMetacards = deleteResponse.getDeletedMetacards();
    if (deletedMetacards == null) {
        LOGGER.debug("DeleteResponse returned null metacards list");
        processCatalogResponse(deleteResponse, exchange);
        return;
    }
    final int numberOfDeletedMetacards = deletedMetacards.size();
    if (numberOfDeletedMetacards != expectedNumberOfDeletedMetacards) {
        LOGGER.debug("Expected {} metacards deleted but only {} were successfully deleted", expectedNumberOfDeletedMetacards, numberOfDeletedMetacards);
        processCatalogResponse(deleteResponse, exchange);
        return;
    }
    LOGGER.debug("Deleted {} metacards", numberOfDeletedMetacards);
    processCatalogResponse(deleteResponse, exchange);
}
Also used : Metacard(ddf.catalog.data.Metacard) DeleteResponse(ddf.catalog.operation.DeleteResponse) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) DeleteRequest(ddf.catalog.operation.DeleteRequest) Endpoint(org.apache.camel.Endpoint)

Example 18 with DeleteRequestImpl

use of ddf.catalog.operation.impl.DeleteRequestImpl in project ddf by codice.

the class RemoveAllCommand method executeRemoveAllFromStore.

private Object executeRemoveAllFromStore() throws Exception {
    CatalogFacade catalog = getCatalog();
    QueryRequest firstQuery = getIntendedQuery(filterBuilder, true);
    QueryRequest subsequentQuery = getIntendedQuery(filterBuilder, false);
    long totalAmountDeleted = 0;
    long start = System.currentTimeMillis();
    SourceResponse response;
    try {
        response = catalog.query(firstQuery);
    } catch (UnsupportedQueryException e) {
        firstQuery = getAlternateQuery(filterBuilder, true);
        subsequentQuery = getAlternateQuery(filterBuilder, false);
        response = catalog.query(firstQuery);
    }
    if (response == null) {
        printErrorMessage("No response from Catalog.");
        return null;
    }
    if (needsAlternateQueryAndResponse(response)) {
        firstQuery = getAlternateQuery(filterBuilder, true);
        subsequentQuery = getAlternateQuery(filterBuilder, false);
        response = catalog.query(firstQuery);
    }
    String totalAmount = getTotalAmount(response.getHits());
    while (response.getResults().size() > 0) {
        // Add metacard ids to string array
        List<String> ids = response.getResults().stream().filter(Objects::nonNull).map(Result::getMetacard).filter(Objects::nonNull).map(Metacard::getId).collect(Collectors.toList());
        // Delete the records
        DeleteRequestImpl request = new DeleteRequestImpl(ids.toArray(new String[ids.size()]));
        DeleteResponse deleteResponse = catalog.delete(request);
        int amountDeleted = deleteResponse.getDeletedMetacards().size();
        totalAmountDeleted += amountDeleted;
        console.print(String.format(PROGRESS_FORMAT, totalAmountDeleted, totalAmount));
        console.flush();
        // Break out if there are no more records to delete
        if (amountDeleted < batchSize || batchSize < 1) {
            break;
        }
        // Re-query when necessary
        response = catalog.query(subsequentQuery);
    }
    long end = System.currentTimeMillis();
    String info = String.format(" %d file(s) removed in %3.3f seconds%n", totalAmountDeleted, (end - start) / MS_PER_SECOND);
    LOGGER.info(info);
    LOGGER.info(totalAmountDeleted + " files removed using cache:removeAll command");
    console.println();
    console.print(info);
    return null;
}
Also used : DeleteResponse(ddf.catalog.operation.DeleteResponse) QueryRequest(ddf.catalog.operation.QueryRequest) SourceResponse(ddf.catalog.operation.SourceResponse) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) Objects(java.util.Objects) CatalogFacade(org.codice.ddf.commands.catalog.facade.CatalogFacade)

Example 19 with DeleteRequestImpl

use of ddf.catalog.operation.impl.DeleteRequestImpl in project ddf by codice.

the class RemoveCommand method executeRemoveFromStore.

private Object executeRemoveFromStore() throws Exception {
    CatalogFacade catalogProvider = getCatalog();
    if (hasFilter()) {
        QueryImpl query = new QueryImpl(getFilter());
        query.setRequestsTotalResultsCount(true);
        query.setPageSize(-1);
        Map<String, Serializable> properties = new HashMap<>();
        properties.put("mode", "native");
        SourceResponse queryResponse = catalogProvider.query(new QueryRequestImpl(query, properties));
        final List<String> idsFromFilteredQuery = queryResponse.getResults().stream().map(result -> result.getMetacard().getId()).collect(Collectors.toList());
        if (ids == null) {
            ids = idsFromFilteredQuery;
        } else {
            ids = ids.stream().filter(id -> idsFromFilteredQuery.contains(id)).collect(Collectors.toList());
        }
    }
    final int numberOfMetacardsToRemove = ids.size();
    if (numberOfMetacardsToRemove > 0) {
        printSuccessMessage("Found " + numberOfMetacardsToRemove + " metacards to remove.");
    } else {
        printErrorMessage("No records found meeting filter criteria.");
        return null;
    }
    DeleteRequestImpl request = new DeleteRequestImpl(ids.toArray(new String[numberOfMetacardsToRemove]));
    DeleteResponse response = catalogProvider.delete(request);
    if (response.getDeletedMetacards().size() > 0) {
        printSuccessMessage(ids + " successfully deleted.");
        LOGGER.info(ids + " removed using catalog:remove command");
    } else {
        printErrorMessage(ids + " could not be deleted.");
        LOGGER.info(ids + " could not be deleted using catalog:remove command");
    }
    return null;
}
Also used : QueryRequestImpl(ddf.catalog.operation.impl.QueryRequestImpl) Arrays(java.util.Arrays) QueryImpl(ddf.catalog.operation.impl.QueryImpl) LoggerFactory(org.slf4j.LoggerFactory) HashMap(java.util.HashMap) Argument(org.apache.karaf.shell.api.action.Argument) DeleteResponse(ddf.catalog.operation.DeleteResponse) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) Command(org.apache.karaf.shell.api.action.Command) List(java.util.List) SourceResponse(ddf.catalog.operation.SourceResponse) CollectionUtils(org.apache.commons.collections.CollectionUtils) Map(java.util.Map) Service(org.apache.karaf.shell.api.action.lifecycle.Service) CatalogFacade(org.codice.ddf.commands.catalog.facade.CatalogFacade) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) Option(org.apache.karaf.shell.api.action.Option) Serializable(java.io.Serializable) SourceResponse(ddf.catalog.operation.SourceResponse) HashMap(java.util.HashMap) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) QueryImpl(ddf.catalog.operation.impl.QueryImpl) DeleteResponse(ddf.catalog.operation.DeleteResponse) QueryRequestImpl(ddf.catalog.operation.impl.QueryRequestImpl) CatalogFacade(org.codice.ddf.commands.catalog.facade.CatalogFacade)

Example 20 with DeleteRequestImpl

use of ddf.catalog.operation.impl.DeleteRequestImpl in project ddf by codice.

the class MetacardApplication method init.

@Override
public void init() {
    get("/metacardtype", (req, res) -> {
        return util.getJson(util.getMetacardTypeMap());
    });
    get("/metacard/:id", (req, res) -> {
        String id = req.params(":id");
        return util.metacardToJson(id);
    });
    get("/metacard/:id/attribute/validation", (req, res) -> {
        String id = req.params(":id");
        return util.getJson(validator.getValidation(util.getMetacard(id)));
    });
    get("/metacard/:id/validation", (req, res) -> {
        String id = req.params(":id");
        return util.getJson(validator.getFullValidation(util.getMetacard(id)));
    });
    post("/metacards", APPLICATION_JSON, (req, res) -> {
        List<String> ids = JsonFactory.create().parser().parseList(String.class, req.body());
        List<Metacard> metacards = util.getMetacards(ids, "*").entrySet().stream().map(Map.Entry::getValue).map(Result::getMetacard).collect(Collectors.toList());
        return util.metacardsToJson(metacards);
    });
    delete("/metacards", APPLICATION_JSON, (req, res) -> {
        List<String> ids = JsonFactory.create().parser().parseList(String.class, req.body());
        DeleteResponse deleteResponse = catalogFramework.delete(new DeleteRequestImpl(new ArrayList<>(ids), Metacard.ID, null));
        if (deleteResponse.getProcessingErrors() != null && !deleteResponse.getProcessingErrors().isEmpty()) {
            res.status(500);
            return ImmutableMap.of("message", "Unable to archive metacards.");
        }
        return ImmutableMap.of("message", "Successfully archived metacards.");
    }, util::getJson);
    patch("/metacards", APPLICATION_JSON, (req, res) -> {
        List<MetacardChanges> metacardChanges = JsonFactory.createUseJSONDates().parser().parseList(MetacardChanges.class, req.body());
        UpdateResponse updateResponse = patchMetacards(metacardChanges);
        if (updateResponse.getProcessingErrors() != null && !updateResponse.getProcessingErrors().isEmpty()) {
            res.status(500);
            return updateResponse.getProcessingErrors();
        }
        return req.body();
    });
    put("/validate/attribute/:attribute", TEXT_PLAIN, (req, res) -> {
        String attribute = req.params(":attribute");
        String value = req.body();
        return util.getJson(validator.validateAttribute(attribute, value));
    });
    get("/history/:id", (req, res) -> {
        String id = req.params(":id");
        List<Result> queryResponse = getMetacardHistory(id);
        if (queryResponse.isEmpty()) {
            res.status(204);
            return "[]";
        }
        List<HistoryResponse> response = queryResponse.stream().map(Result::getMetacard).map(mc -> new HistoryResponse(mc.getId(), (String) mc.getAttribute(MetacardVersion.EDITED_BY).getValue(), (Date) mc.getAttribute(MetacardVersion.VERSIONED_ON).getValue())).sorted(Comparator.comparing(HistoryResponse::getVersioned)).collect(Collectors.toList());
        return util.getJson(response);
    });
    get("/history/revert/:id/:revertid", (req, res) -> {
        String id = req.params(":id");
        String revertId = req.params(":revertid");
        Metacard versionMetacard = util.getMetacard(revertId);
        List<Result> queryResponse = getMetacardHistory(id);
        if (queryResponse == null || queryResponse.isEmpty()) {
            throw new NotFoundException("Could not find metacard with id: " + id);
        }
        Optional<Metacard> contentVersion = queryResponse.stream().map(Result::getMetacard).filter(mc -> getVersionedOnDate(mc).isAfter(getVersionedOnDate(versionMetacard)) || getVersionedOnDate(mc).equals(getVersionedOnDate(versionMetacard))).filter(mc -> CONTENT_ACTIONS.contains(Action.ofMetacard(mc))).filter(mc -> mc.getResourceURI() != null).filter(mc -> ContentItem.CONTENT_SCHEME.equals(mc.getResourceURI().getScheme())).sorted(Comparator.comparing((Metacard mc) -> util.parseToDate(mc.getAttribute(MetacardVersion.VERSIONED_ON).getValue()))).findFirst();
        if (!contentVersion.isPresent()) {
            /* no content versions, just restore metacard */
            revertMetacard(versionMetacard, id, false);
        } else {
            revertContentandMetacard(contentVersion.get(), versionMetacard, id);
        }
        return util.metacardToJson(MetacardVersionImpl.toMetacard(versionMetacard, types));
    });
    get("/associations/:id", (req, res) -> {
        String id = req.params(":id");
        return util.getJson(associated.getAssociations(id));
    });
    put("/associations/:id", (req, res) -> {
        String id = req.params(":id");
        List<Associated.Edge> edges = JsonFactory.create().parser().parseList(Associated.Edge.class, req.body());
        associated.putAssociations(id, edges);
        return req.body();
    });
    post("/subscribe/:id", (req, res) -> {
        String email = getSubjectEmail();
        if (isEmpty(email)) {
            throw new NotFoundException("Login to subscribe to workspace.");
        }
        String id = req.params(":id");
        subscriptions.addEmail(id, email);
        return ImmutableMap.of("message", String.format("Successfully subscribed to id = %s.", id));
    }, util::getJson);
    post("/unsubscribe/:id", (req, res) -> {
        String email = getSubjectEmail();
        if (isEmpty(email)) {
            throw new NotFoundException("Login to un-subscribe from workspace.");
        }
        String id = req.params(":id");
        subscriptions.removeEmail(id, email);
        return ImmutableMap.of("message", String.format("Successfully un-subscribed to id = %s.", id));
    }, util::getJson);
    get("/workspaces/:id", (req, res) -> {
        String id = req.params(":id");
        String email = getSubjectEmail();
        Metacard metacard = util.getMetacard(id);
        // NOTE: the isEmpty is to guard against users with no email (such as guest).
        boolean isSubscribed = !isEmpty(email) && subscriptions.getEmails(metacard.getId()).contains(email);
        return ImmutableMap.builder().putAll(transformer.transform(metacard)).put("subscribed", isSubscribed).build();
    }, util::getJson);
    get("/workspaces", (req, res) -> {
        String email = getSubjectEmail();
        Map<String, Result> workspaceMetacards = util.getMetacardsByFilter(WorkspaceAttributes.WORKSPACE_TAG);
        // NOTE: the isEmpty is to guard against users with no email (such as guest).
        Set<String> ids = isEmpty(email) ? Collections.emptySet() : subscriptions.getSubscriptions(email);
        return workspaceMetacards.entrySet().stream().map(Map.Entry::getValue).map(Result::getMetacard).map(metacard -> {
            boolean isSubscribed = ids.contains(metacard.getId());
            try {
                return ImmutableMap.builder().putAll(transformer.transform(metacard)).put("subscribed", isSubscribed).build();
            } catch (RuntimeException e) {
                LOGGER.debug("Could not transform metacard. WARNING: This indicates there is invalid data in the system. Metacard title: '{}', id:'{}'", metacard.getTitle(), metacard.getId(), e);
            }
            return null;
        }).filter(Objects::nonNull).collect(Collectors.toList());
    }, util::getJson);
    post("/workspaces", APPLICATION_JSON, (req, res) -> {
        Map<String, Object> incoming = JsonFactory.create().parser().parseMap(req.body());
        Metacard saved = saveMetacard(transformer.transform(incoming));
        Map<String, Object> response = transformer.transform(saved);
        res.status(201);
        return util.getJson(response);
    });
    put("/workspaces/:id", APPLICATION_JSON, (req, res) -> {
        String id = req.params(":id");
        Map<String, Object> workspace = JsonFactory.create().parser().parseMap(req.body());
        Metacard metacard = transformer.transform(workspace);
        metacard.setAttribute(new AttributeImpl(Metacard.ID, id));
        Metacard updated = updateMetacard(id, metacard);
        return util.getJson(transformer.transform(updated));
    });
    delete("/workspaces/:id", APPLICATION_JSON, (req, res) -> {
        String id = req.params(":id");
        catalogFramework.delete(new DeleteRequestImpl(id));
        return ImmutableMap.of("message", "Successfully deleted.");
    }, util::getJson);
    get("/enumerations/metacardtype/:type", APPLICATION_JSON, (req, res) -> {
        return util.getJson(enumExtractor.getEnumerations(req.params(":type")));
    });
    get("/enumerations/attribute/:attribute", APPLICATION_JSON, (req, res) -> {
        return util.getJson(enumExtractor.getAttributeEnumerations(req.params(":attribute")));
    });
    get("/localcatalogid", (req, res) -> {
        return String.format("{\"%s\":\"%s\"}", "local-catalog-id", catalogFramework.getId());
    });
    after((req, res) -> {
        res.type(APPLICATION_JSON);
    });
    exception(IngestException.class, (ex, req, res) -> {
        res.status(404);
        res.header(CONTENT_TYPE, APPLICATION_JSON);
        LOGGER.debug("Failed to ingest metacard", ex);
        res.body(util.getJson(ImmutableMap.of("message", UPDATE_ERROR_MESSAGE)));
    });
    exception(NotFoundException.class, (ex, req, res) -> {
        res.status(404);
        res.header(CONTENT_TYPE, APPLICATION_JSON);
        LOGGER.debug("Failed to find metacard.", ex);
        res.body(util.getJson(ImmutableMap.of("message", ex.getMessage())));
    });
    exception(NumberFormatException.class, (ex, req, res) -> {
        res.status(400);
        res.header(CONTENT_TYPE, APPLICATION_JSON);
        res.body(util.getJson(ImmutableMap.of("message", "Invalid values for numbers")));
    });
    exception(RuntimeException.class, (ex, req, res) -> {
        LOGGER.debug("Exception occured.", ex);
        res.status(404);
        res.header(CONTENT_TYPE, APPLICATION_JSON);
        res.body(util.getJson(ImmutableMap.of("message", "Could not find what you were looking for")));
    });
}
Also used : CONTENT_TYPE(javax.ws.rs.core.HttpHeaders.CONTENT_TYPE) Spark.delete(spark.Spark.delete) Spark.patch(spark.Spark.patch) Date(java.util.Date) UpdateRequestImpl(ddf.catalog.operation.impl.UpdateRequestImpl) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) Spark.exception(spark.Spark.exception) LoggerFactory(org.slf4j.LoggerFactory) UpdateStorageRequestImpl(ddf.catalog.content.operation.impl.UpdateStorageRequestImpl) SparkApplication(spark.servlet.SparkApplication) AttributeType(ddf.catalog.data.AttributeType) ExperimentalEnumerationExtractor(org.codice.ddf.catalog.ui.metacard.enumerations.ExperimentalEnumerationExtractor) MetacardVersion(ddf.catalog.core.versioning.MetacardVersion) HistoryResponse(org.codice.ddf.catalog.ui.metacard.history.HistoryResponse) Map(java.util.Map) Action(ddf.catalog.core.versioning.MetacardVersion.Action) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) Spark.put(spark.Spark.put) SubjectUtils(ddf.security.SubjectUtils) APPLICATION_JSON(javax.ws.rs.core.MediaType.APPLICATION_JSON) MetacardVersionImpl(ddf.catalog.core.versioning.impl.MetacardVersionImpl) ImmutableSet(com.google.common.collect.ImmutableSet) AttributeDescriptor(ddf.catalog.data.AttributeDescriptor) StringUtils.isEmpty(org.apache.commons.lang.StringUtils.isEmpty) ImmutableMap(com.google.common.collect.ImmutableMap) WorkspaceAttributes(org.codice.ddf.catalog.ui.metacard.workspace.WorkspaceAttributes) ResourceRequestById(ddf.catalog.operation.impl.ResourceRequestById) Spark.after(spark.Spark.after) DeletedMetacard(ddf.catalog.core.versioning.DeletedMetacard) Set(java.util.Set) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) NotFoundException(javax.ws.rs.NotFoundException) MetacardType(ddf.catalog.data.MetacardType) Serializable(java.io.Serializable) ResourceNotFoundException(ddf.catalog.resource.ResourceNotFoundException) Objects(java.util.Objects) QueryResponse(ddf.catalog.operation.QueryResponse) List(java.util.List) Validator(org.codice.ddf.catalog.ui.metacard.validation.Validator) SubscriptionsPersistentStore(org.codice.ddf.catalog.ui.query.monitor.api.SubscriptionsPersistentStore) Optional(java.util.Optional) MetacardChanges(org.codice.ddf.catalog.ui.metacard.edit.MetacardChanges) UpdateResponse(ddf.catalog.operation.UpdateResponse) TEXT_PLAIN(javax.ws.rs.core.MediaType.TEXT_PLAIN) SecurityUtils(org.apache.shiro.SecurityUtils) ResourceResponse(ddf.catalog.operation.ResourceResponse) QueryRequestImpl(ddf.catalog.operation.impl.QueryRequestImpl) Spark.get(spark.Spark.get) ContentItemImpl(ddf.catalog.content.data.impl.ContentItemImpl) FilterBuilder(ddf.catalog.filter.FilterBuilder) SourceUnavailableException(ddf.catalog.source.SourceUnavailableException) CatalogFramework(ddf.catalog.CatalogFramework) AttributeImpl(ddf.catalog.data.impl.AttributeImpl) Spark.post(spark.Spark.post) HashMap(java.util.HashMap) Callable(java.util.concurrent.Callable) DeleteResponse(ddf.catalog.operation.DeleteResponse) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) SortBy(org.opengis.filter.sort.SortBy) EndpointUtil(org.codice.ddf.catalog.ui.util.EndpointUtil) ContentItem(ddf.catalog.content.data.ContentItem) Metacard(ddf.catalog.data.Metacard) AttributeChange(org.codice.ddf.catalog.ui.metacard.edit.AttributeChange) ByteSource(com.google.common.io.ByteSource) Result(ddf.catalog.data.Result) WorkspaceTransformer(org.codice.ddf.catalog.ui.metacard.workspace.WorkspaceTransformer) Associated(org.codice.ddf.catalog.ui.metacard.associations.Associated) CreateRequestImpl(ddf.catalog.operation.impl.CreateRequestImpl) CreateStorageRequestImpl(ddf.catalog.content.operation.impl.CreateStorageRequestImpl) QueryImpl(ddf.catalog.operation.impl.QueryImpl) Logger(org.slf4j.Logger) Security(org.codice.ddf.security.common.Security) JsonFactory(org.boon.json.JsonFactory) IngestException(ddf.catalog.source.IngestException) IOException(java.io.IOException) Subject(ddf.security.Subject) FederationException(ddf.catalog.federation.FederationException) TimeUnit(java.util.concurrent.TimeUnit) ResourceNotSupportedException(ddf.catalog.resource.ResourceNotSupportedException) ExecutionException(org.apache.shiro.subject.ExecutionException) Filter(org.opengis.filter.Filter) Comparator(java.util.Comparator) Collections(java.util.Collections) InputStream(java.io.InputStream) HistoryResponse(org.codice.ddf.catalog.ui.metacard.history.HistoryResponse) AttributeImpl(ddf.catalog.data.impl.AttributeImpl) ArrayList(java.util.ArrayList) NotFoundException(javax.ws.rs.NotFoundException) ResourceNotFoundException(ddf.catalog.resource.ResourceNotFoundException) Result(ddf.catalog.data.Result) UpdateResponse(ddf.catalog.operation.UpdateResponse) Associated(org.codice.ddf.catalog.ui.metacard.associations.Associated) DeleteRequestImpl(ddf.catalog.operation.impl.DeleteRequestImpl) MetacardChanges(org.codice.ddf.catalog.ui.metacard.edit.MetacardChanges) Date(java.util.Date) DeletedMetacard(ddf.catalog.core.versioning.DeletedMetacard) Metacard(ddf.catalog.data.Metacard) DeleteResponse(ddf.catalog.operation.DeleteResponse)

Aggregations

DeleteRequestImpl (ddf.catalog.operation.impl.DeleteRequestImpl)33 DeleteRequest (ddf.catalog.operation.DeleteRequest)21 Test (org.junit.Test)18 DeleteResponse (ddf.catalog.operation.DeleteResponse)17 ArrayList (java.util.ArrayList)17 Metacard (ddf.catalog.data.Metacard)15 HashMap (java.util.HashMap)11 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)9 CatalogFramework (ddf.catalog.CatalogFramework)8 Serializable (java.io.Serializable)8 List (java.util.List)8 Result (ddf.catalog.data.Result)7 QueryResponse (ddf.catalog.operation.QueryResponse)7 QueryImpl (ddf.catalog.operation.impl.QueryImpl)7 IngestException (ddf.catalog.source.IngestException)7 CreateRequestImpl (ddf.catalog.operation.impl.CreateRequestImpl)6 DeleteResponseImpl (ddf.catalog.operation.impl.DeleteResponseImpl)6 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)6 Filter (org.opengis.filter.Filter)6 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)5