Search in sources :

Example 16 with Operation

use of org.gluu.oxtrust.model.scim2.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 17 with Operation

use of org.gluu.oxtrust.model.scim2.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)8 ArrayList (java.util.ArrayList)7 OperationsMetadata (net.opengis.ows.v_1_0_0.OperationsMetadata)5 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)5 User (org.gluu.oxtrust.model.scim2.User)4 LinkedHashMap (java.util.LinkedHashMap)3 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)3 PersonRequiredFieldsException (org.gluu.oxtrust.exception.PersonRequiredFieldsException)3 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)3 Map (java.util.Map)2 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 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)2 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)2 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)1 Metacard (ddf.catalog.data.Metacard)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1