use of org.talend.esb.servicelocator.client.internal.endpoint.EntryType in project tesb-rt-se by Talend.
the class SLPropertiesConverter method createEntry.
private static EntryType createEntry(SLProperties props, String name) {
EntryType entry = new EntryType();
entry.setKey(name);
List<String> jaxbValues = entry.getValue();
Collection<String> values = props.getValues(name);
for (String value : values) {
jaxbValues.add(value);
}
return entry;
}
use of org.talend.esb.servicelocator.client.internal.endpoint.EntryType in project tesb-rt-se by Talend.
the class SLPropertiesConverterTest method slProperties2JAXBSlPropertiesType.
@Test
public void slProperties2JAXBSlPropertiesType() throws Exception {
SLPropertiesImpl props = new SLPropertiesImpl();
props.addProperty(KEY_1, VALUE_1, VALUE_2);
props.addProperty(KEY_2, VALUE_2, VALUE_3);
ServiceLocatorPropertiesType jaxbProperties = SLPropertiesConverter.toServiceLocatorPropertiesType(props);
List<EntryType> entries = jaxbProperties.getEntry();
List<String> values = entries.get(0).getValue();
assertEquals(VALUE_1, values.get(0));
}
use of org.talend.esb.servicelocator.client.internal.endpoint.EntryType in project tesb-rt-se by Talend.
the class SLPropertiesConverter method toSLProperties.
public static SLProperties toSLProperties(ServiceLocatorPropertiesType props) {
SLPropertiesImpl slProperties = new SLPropertiesImpl();
for (EntryType entry : props.getEntry()) {
String key = entry.getKey();
List<String> values = entry.getValue();
slProperties.addProperty(key, values);
}
return slProperties;
}
use of org.talend.esb.servicelocator.client.internal.endpoint.EntryType in project tesb-rt-se by Talend.
the class SLPropertiesConverter method toServiceLocatorPropertiesType.
public static ServiceLocatorPropertiesType toServiceLocatorPropertiesType(SLProperties props) {
ObjectFactory of = new ObjectFactory();
ServiceLocatorPropertiesType slPropertiesType = of.createServiceLocatorPropertiesType();
List<EntryType> entries = slPropertiesType.getEntry();
for (String name : props.getPropertyNames()) {
entries.add(createEntry(props, name));
}
return slPropertiesType;
}
Aggregations