Search in sources :

Example 11 with Operation

use of net.opengis.ows.v_1_0_0.Operation in project ddf by codice.

the class AbstractCswSource method canRetrieveResourceById.

/**
     * Determine if the resource should be retrieved using a ResourceReader or by calling
     * GetRecordById.
     */
private boolean canRetrieveResourceById() {
    OperationsMetadata operationsMetadata = capabilities.getOperationsMetadata();
    Operation getRecordByIdOp = getOperation(operationsMetadata, CswConstants.GET_RECORD_BY_ID);
    if (getRecordByIdOp != null) {
        DomainType getRecordByIdOutputSchemas = getParameter(getRecordByIdOp, CswConstants.OUTPUT_SCHEMA_PARAMETER);
        if (getRecordByIdOutputSchemas != null && getRecordByIdOutputSchemas.getValue() != null && getRecordByIdOutputSchemas.getValue().contains(OCTET_STREAM_OUTPUT_SCHEMA)) {
            return true;
        }
    }
    return false;
}
Also used : OperationsMetadata(net.opengis.ows.v_1_0_0.OperationsMetadata) DomainType(net.opengis.ows.v_1_0_0.DomainType) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 12 with Operation

use of net.opengis.ows.v_1_0_0.Operation in project ddf by codice.

the class TestCswEndpoint method testCapabilitiesFederatedCatalogs.

@Test
public void testCapabilitiesFederatedCatalogs() {
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gcr);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    assertThat(ct.getOperationsMetadata(), notNullValue());
    for (Operation operation : ct.getOperationsMetadata().getOperation()) {
        if (StringUtils.equals(operation.getName(), CswConstants.GET_RECORDS)) {
            for (DomainType constraint : operation.getConstraint()) {
                if (StringUtils.equals(constraint.getName(), CswConstants.FEDERATED_CATALOGS)) {
                    assertThat(constraint.getValue().size(), is(3));
                    return;
                }
            }
        }
    }
    fail("Didn't find [" + CswConstants.FEDERATED_CATALOGS + "] in request [" + CswConstants.GET_RECORDS + "]");
}
Also used : GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest) DomainType(net.opengis.ows.v_1_0_0.DomainType) CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Operation(net.opengis.ows.v_1_0_0.Operation) Test(org.junit.Test)

Aggregations

Operation (net.opengis.ows.v_1_0_0.Operation)10 DomainType (net.opengis.ows.v_1_0_0.DomainType)9 ArrayList (java.util.ArrayList)7 OperationsMetadata (net.opengis.ows.v_1_0_0.OperationsMetadata)5 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)3 QName (javax.xml.namespace.QName)2 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)2 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)2 GetCapabilitiesRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest)2 Test (org.junit.Test)2 Metacard (ddf.catalog.data.Metacard)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 HashSet (java.util.HashSet)1 JAXBElement (javax.xml.bind.JAXBElement)1 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)1 SearchResultsType (net.opengis.cat.csw.v_2_0_2.SearchResultsType)1 ComparisonOperatorType (net.opengis.filter.v_1_1_0.ComparisonOperatorType)1 ComparisonOperatorsType (net.opengis.filter.v_1_1_0.ComparisonOperatorsType)1 FilterCapabilities (net.opengis.filter.v_1_1_0.FilterCapabilities)1 LogicalOperators (net.opengis.filter.v_1_1_0.LogicalOperators)1