Search in sources :

Example 1 with Operation

use of com.google.cloud.compute.v1.Operation in project ddf by codice.

the class TestCswCqlFilter method getOperation.

private static Operation getOperation() {
    List<DomainType> getRecordsParameters = new ArrayList<>(6);
    DomainType typeName = new DomainType();
    typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
    getRecordsParameters.add(typeName);
    DomainType outputSchema = new DomainType();
    outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    getRecordsParameters.add(outputSchema);
    DomainType constraintLang = new DomainType();
    constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
    getRecordsParameters.add(constraintLang);
    DomainType outputFormat = new DomainType();
    outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
    getRecordsParameters.add(outputFormat);
    DomainType resultType = new DomainType();
    resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
    getRecordsParameters.add(resultType);
    DomainType elementSetName = new DomainType();
    elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
    getRecordsParameters.add(elementSetName);
    Operation getRecords = new Operation();
    getRecords.setName(CswConstants.GET_RECORDS);
    getRecords.setParameter(getRecordsParameters);
    List<Operation> operations = new ArrayList<>(1);
    operations.add(getRecords);
    return getRecords;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 2 with Operation

use of com.google.cloud.compute.v1.Operation in project oxTrust by GluuFederation.

the class Scim2UserService method patchUser.

public User patchUser(String id, ScimPatchUser patchUser) throws Exception {
    for (Operation operation : patchUser.getOperatons()) {
        String val = operation.getOperationName();
        if (val.equalsIgnoreCase("replace")) {
            replaceUserPatch(operation, id);
        }
        if (val.equalsIgnoreCase("remove")) {
            removeUserPatch(operation, id);
        }
        if (val.equalsIgnoreCase("add")) {
            addUserPatch(operation, id);
        }
    }
    GluuCustomPerson gluuPerson = personService.getPersonByInum(id);
    User updatedUser = copyUtils2.copy(gluuPerson, null);
    return updatedUser;
}
Also used : GluuCustomPerson(org.gluu.oxtrust.model.GluuCustomPerson) User(org.gluu.oxtrust.model.scim2.User) ScimPatchUser(org.gluu.oxtrust.model.scim2.ScimPatchUser) Operation(org.gluu.oxtrust.model.scim2.Operation)

Example 3 with Operation

use of com.google.cloud.compute.v1.Operation in project ddf by codice.

the class TestCswFilterDelegate method getOperation.

private static Operation getOperation() {
    List<DomainType> getRecordsParameters = new ArrayList<>(6);
    DomainType typeName = new DomainType();
    typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
    getRecordsParameters.add(typeName);
    DomainType outputSchema = new DomainType();
    outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    getRecordsParameters.add(outputSchema);
    DomainType constraintLang = new DomainType();
    constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
    getRecordsParameters.add(constraintLang);
    DomainType outputFormat = new DomainType();
    outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
    getRecordsParameters.add(outputFormat);
    DomainType resultType = new DomainType();
    resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
    getRecordsParameters.add(resultType);
    DomainType elementSetName = new DomainType();
    elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
    getRecordsParameters.add(elementSetName);
    Operation getRecords = new Operation();
    getRecords.setName(CswConstants.GET_RECORDS);
    getRecords.setParameter(getRecordsParameters);
    List<Operation> operations = new ArrayList<>(1);
    operations.add(getRecords);
    return getRecords;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 4 with Operation

use of com.google.cloud.compute.v1.Operation in project ddf by codice.

the class TestCswEndpoint method verifyOperationsMetadata.

/**
     * Helper method to verify the OperationsMetadata section matches the endpoint's definition
     *
     * @param ct The CapabilitiesType to verify
     */
private void verifyOperationsMetadata(CapabilitiesType ct) {
    OperationsMetadata om = ct.getOperationsMetadata();
    List<Operation> opList = om.getOperation();
    ArrayList<String> opNames = new ArrayList<>();
    for (Operation op : opList) {
        opNames.add(op.getName());
        if (StringUtils.equals(CswConstants.TRANSACTION, op.getName()) || StringUtils.equals(CswConstants.GET_RECORDS, op.getName())) {
            for (DomainType parameter : op.getParameter()) {
                if (StringUtils.equals(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER, parameter.getName())) {
                    assertThat(parameter.getValue(), contains(CswConstants.CONSTRAINT_LANGUAGE_FILTER, CswConstants.CONSTRAINT_LANGUAGE_CQL));
                } else if (StringUtils.equals(CswConstants.TYPE_NAMES_PARAMETER, parameter.getName())) {
                    // TODO : Remove conditional when GMD Metacard Transformer is merged (DDF-1976)
                    if (StringUtils.equals(op.getName(), CswConstants.TRANSACTION)) {
                        assertThat(parameter.getValue(), contains(CswConstants.CSW_RECORD));
                    } else {
                        assertThat(parameter.getValue(), hasItems(CswConstants.CSW_RECORD, GmdConstants.GMD_METACARD_TYPE_NAME));
                    }
                }
            }
        }
    }
    assertThat(opNames.contains(CswConstants.GET_CAPABILITIES), is(true));
    assertThat(opNames.contains(CswConstants.DESCRIBE_RECORD), is(true));
    assertThat(opNames.contains(CswConstants.GET_RECORDS), is(true));
    assertThat(opNames.contains(CswConstants.GET_RECORD_BY_ID), is(true));
    assertThat(opNames.contains(CswConstants.TRANSACTION), is(true));
}
Also used : OperationsMetadata(net.opengis.ows.v_1_0_0.OperationsMetadata) DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 5 with Operation

use of com.google.cloud.compute.v1.Operation in project ddf by codice.

the class TestCswEndpoint method testGetCapabilitiesTypeFederatedCatalogs.

@Test
public void testGetCapabilitiesTypeFederatedCatalogs() {
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } 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 : 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) 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 (com.google.cloud.compute.v1.Operation)30 Operation (net.opengis.ows.v_1_0_0.Operation)15 InstancesClient (com.google.cloud.compute.v1.InstancesClient)13 DomainType (net.opengis.ows.v_1_0_0.DomainType)13 ArrayList (java.util.ArrayList)12 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)8 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)7 Instance (com.google.cloud.compute.v1.Instance)7 Test (org.junit.Test)7 InstanceTemplatesClient (com.google.cloud.compute.v1.InstanceTemplatesClient)6 NetworkInterface (com.google.cloud.compute.v1.NetworkInterface)6 OperationsMetadata (net.opengis.ows.v_1_0_0.OperationsMetadata)6 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)5 Operation (org.eclipse.bpmn2.Operation)5 InsertInstanceTemplateRequest (com.google.cloud.compute.v1.InsertInstanceTemplateRequest)4 InstanceTemplate (com.google.cloud.compute.v1.InstanceTemplate)4 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)4 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)4 Interface (org.eclipse.bpmn2.Interface)4 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)4