use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceBindingType in project ddf by codice.
the class RegistryPackageWebConverterTest method getSecondServiceBinding.
private ServiceBindingType getSecondServiceBinding() {
ServiceBindingType binding = RIM_FACTORY.createServiceBindingType();
binding.setId("urn:registry:federation:method:soap13");
binding.setService("urn:service:id0");
binding.setAccessURI("some:access:URI:any:URI");
binding.setTargetBinding("some:target:binding:reference:URI");
binding.getSlot().add(stHelper.create("queryAddress", "https://some/address/here", "xs:anyURI"));
binding.getSlot().add(stHelper.create("ingestAddress", "https://some/address/here", "xs:anyURI"));
binding.getSlot().add(stHelper.create("eventAddress", "https://some/address/here", "xs:anyURI"));
binding.getSlot().add(stHelper.create("bindingType", "soap13", "xs:string"));
binding.getSlot().add(stHelper.create("serviceType", "SOAP", "xs:string"));
binding.getSlot().add(stHelper.create("endpointDocumentation", "https://some/path/to/docs.html", "xs:anyURI"));
binding.setName(istHelper.create("Soap Federation Method"));
binding.setDescription(istHelper.create("This is the Soap federation method."));
binding.setVersionInfo(getVersionInfo("1.3"));
binding.getSpecificationLink().add(getSecondSpecificationLink());
return binding;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceBindingType in project ddf by codice.
the class RegistryPackageConverter method parseRegistryService.
private static void parseRegistryService(ServiceType service, MetacardImpl metacard) throws RegistryConversionException {
validateIdentifiable(service);
String xmlServiceBindingsTypesAttributeName = METACARD_XML_NAME_MAP.get(RegistryObjectMetacardType.SERVICE_BINDING_TYPES);
String xmlServiceBindingsAttributeName = METACARD_XML_NAME_MAP.get(RegistryObjectMetacardType.SERVICE_BINDINGS);
List<String> serviceBindings = new ArrayList<>();
List<String> serviceBindingTypes = new ArrayList<>();
List<String> bindings = new ArrayList<>();
List<String> bindingTypes = new ArrayList<>();
for (ServiceBindingType binding : service.getServiceBinding()) {
bindings.clear();
bindingTypes.clear();
Map<String, List<SlotType1>> slotMap = SLOT_TYPE_HELPER.getNameSlotMapDuplicateSlotNamesAllowed(binding.getSlot());
if (slotMap.containsKey(xmlServiceBindingsTypesAttributeName)) {
List<SlotType1> slots = slotMap.get(xmlServiceBindingsTypesAttributeName);
for (SlotType1 slot : slots) {
bindingTypes.addAll(SLOT_TYPE_HELPER.getStringValues(slot));
}
}
if (slotMap.containsKey(xmlServiceBindingsAttributeName)) {
List<SlotType1> slots = slotMap.get(xmlServiceBindingsAttributeName);
for (SlotType1 slot : slots) {
bindings.addAll(SLOT_TYPE_HELPER.getStringValues(slot));
}
}
serviceBindingTypes.addAll(bindingTypes);
serviceBindings.addAll(bindings);
}
metacard.setAttribute(RegistryObjectMetacardType.SERVICE_BINDING_TYPES, (Serializable) serviceBindingTypes);
metacard.setAttribute(RegistryObjectMetacardType.SERVICE_BINDINGS, (Serializable) serviceBindings);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceBindingType in project ddf by codice.
the class RegistryPackageTypeHelperTest method testGetBindingTypesFromRegistryObjectList.
@Test
public void testGetBindingTypesFromRegistryObjectList() throws Exception {
RegistryObjectListType registryObjectList = ((RegistryPackageType) registryObject).getRegistryObjectList();
List<ServiceBindingType> bindings = rptHelper.getBindingTypes(registryObjectList);
assertBindings(bindings);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceBindingType in project ddf by codice.
the class RegistryPackageTypeHelperTest method assertBindings.
private void assertBindings(List<ServiceBindingType> bindings) {
// Values from xml file
int expectedSize = 2;
int numberOfSlots = 4;
String expectedName = "CSW Federation Method";
String expectedDescription = "This is the CSW federation method.";
String expectedVersion = "2.0.2";
String cswUrlSlotName = "cswUrl";
String cswUrlSlotValue = "https://some/address/here";
String bindingTypeSlotName = "bindingType";
String bindingTypeSlotValue = "Csw_Federated_Source";
String serviceTypeSlotName = "serviceType";
String serviceTypeSlotValue = "REST";
String endpointDocumentationSlotName = "endpointDocumentation";
String endpointDocumentationSlotValue = "https://some/path/to/docs.html";
assertThat(bindings, hasSize(expectedSize));
ServiceBindingType binding = bindings.get(0);
assertThat(binding.isSetAccessURI(), is(false));
assertThat(binding.isSetName(), is(true));
assertIst(binding.getName(), expectedName);
assertThat(binding.isSetDescription(), is(true));
assertIst(binding.getDescription(), expectedDescription);
assertThat(binding.isSetVersionInfo(), is(true));
assertThat(binding.getVersionInfo().getVersionName(), is(equalTo(expectedVersion)));
assertThat(binding.isSetSlot(), is(true));
assertThat(binding.getSlot(), hasSize(numberOfSlots));
Map<String, List<SlotType1>> slotMap = stHelper.getNameSlotMapDuplicateSlotNamesAllowed(binding.getSlot());
assertThat(slotMap, hasKey(cswUrlSlotName));
assertSlotValue(slotMap.get(cswUrlSlotName).get(0), 1, cswUrlSlotValue);
assertThat(slotMap, hasKey(bindingTypeSlotName));
assertSlotValue(slotMap.get(bindingTypeSlotName).get(0), 1, bindingTypeSlotValue);
assertThat(slotMap, hasKey(serviceTypeSlotName));
assertSlotValue(slotMap.get(serviceTypeSlotName).get(0), 1, serviceTypeSlotValue);
assertThat(slotMap, hasKey(endpointDocumentationSlotName));
assertSlotValue(slotMap.get(endpointDocumentationSlotName).get(0), 1, endpointDocumentationSlotValue);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.ServiceBindingType in project ddf by codice.
the class RegistryPackageWebConverterTest method getFirstServiceBinding.
private ServiceBindingType getFirstServiceBinding() {
ServiceBindingType binding = RIM_FACTORY.createServiceBindingType();
binding.setId("urn:registry:federation:method:csw");
binding.setService("urn:service:id0");
binding.getSlot().add(stHelper.create("cswUrl", "https://some/address/here", "xs:anyURI"));
binding.getSlot().add(stHelper.create("bindingType", "Csw_Federated_Source", "xs:string"));
binding.getSlot().add(stHelper.create("serviceType", "REST", "xs:string"));
binding.getSlot().add(stHelper.create("endpointDocumentation", "https://some/path/to/docs.html", "xs:anyURI"));
binding.setName(istHelper.create("CSW Federation Method"));
binding.setDescription(istHelper.create("This is the CSW federation method."));
binding.setVersionInfo(getVersionInfo("2.0.2"));
binding.getSpecificationLink().add(getFirstSpecificationLink());
return binding;
}
Aggregations