use of org.eclipse.bpmn2.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;
}
use of org.eclipse.bpmn2.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;
}
use of org.eclipse.bpmn2.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;
}
use of org.eclipse.bpmn2.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));
}
use of org.eclipse.bpmn2.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 + "]");
}
Aggregations