use of org.n52.shetland.ogc.ows.OwsAddress in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseContact.
private OwsContact parseContact(ContactType contactInfo) {
if (contactInfo == null) {
return null;
}
OwsOnlineResource onlineResource = parseOnlineResource(contactInfo.getOnlineResource());
String hoursOfService = contactInfo.getHoursOfService();
String contactInstructions = contactInfo.getContactInstructions();
OwsAddress address = parseAddress(contactInfo.getAddress());
OwsPhone phone = parsePhone(contactInfo.getPhone());
return new OwsContact(phone, address, onlineResource, hoursOfService, contactInstructions);
}
use of org.n52.shetland.ogc.ows.OwsAddress in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseAddress.
private OwsAddress parseAddress(AddressType address) {
if (address == null) {
return null;
}
List<String> deliveryPoint = Optional.ofNullable(address.getDeliveryPointArray()).map(Arrays::stream).orElseGet(Stream::empty).map(Strings::emptyToNull).filter(Objects::nonNull).collect(toList());
List<String> electronicMailAddress = Optional.ofNullable(address.getElectronicMailAddressArray()).map(Arrays::stream).orElseGet(Stream::empty).map(Strings::emptyToNull).filter(Objects::nonNull).collect(toList());
String city = address.getCity();
String administrativeArea = address.getAdministrativeArea();
String postalCode = address.getPostalCode();
String country = address.getCountry();
return new OwsAddress(deliveryPoint, city, administrativeArea, postalCode, country, electronicMailAddress);
}
use of org.n52.shetland.ogc.ows.OwsAddress in project arctic-sea by 52North.
the class OwsServiceProviderFactory method create.
@Override
protected OwsServiceProvider create(Locale language) throws ConfigurationError {
// TODO organisation name is missing
String organisationName = null;
OwsOnlineResource onlineResource = null;
if (site != null) {
onlineResource = new OwsOnlineResource(site);
}
OwsCode roleCode = null;
if (role != null) {
roleCode = new OwsCode(role, roleCodespace);
}
OwsOnlineResource providerSite = null;
if (onlineResoureHref != null) {
providerSite = new OwsOnlineResource(onlineResoureHref, onlineResoureTitle);
}
OwsAddress address = null;
if (anyNonNull(deliveryPoint, city, administrativeArea, postalCode, country, electronicMailAddress)) {
address = new OwsAddress(deliveryPoint, city, administrativeArea, postalCode, country, electronicMailAddress);
}
OwsPhone owsPhone = null;
if (anyNonNull(phone, facsimile)) {
owsPhone = new OwsPhone(phone, facsimile);
}
OwsContact contactInfo = null;
if (anyNonNull(owsPhone, address, onlineResource, hoursOfService, contactInstructions)) {
contactInfo = new OwsContact(owsPhone, address, onlineResource, hoursOfService, contactInstructions);
}
OwsResponsibleParty serviceContact = new OwsResponsibleParty(individualName, organisationName, positionName, contactInfo, roleCode);
return new OwsServiceProvider(name, providerSite, serviceContact);
}
Aggregations