Skip to content

Commit

Permalink
Merge branch 'feature/5.x' into 5.x/proxy_cache_hibernate_5
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Hollmann committed Jan 25, 2018
2 parents e3effe4 + 7d58b32 commit e15c292
Show file tree
Hide file tree
Showing 65 changed files with 1,000 additions and 689 deletions.
8 changes: 4 additions & 4 deletions coding/kvp/pom.xml
Expand Up @@ -48,14 +48,14 @@
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
Expand Down
Expand Up @@ -64,7 +64,6 @@
import org.n52.shetland.ogc.gml.time.TimeInstant;
import org.n52.shetland.ogc.gml.time.TimePeriod;
import org.n52.shetland.ogc.ows.OWSConstants;
import org.n52.shetland.ogc.ows.exception.OptionNotSupportedException;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.ows.service.OwsServiceRequest;
import org.n52.shetland.ogc.sos.ResultFilter;
Expand Down
Expand Up @@ -28,8 +28,8 @@
*/
package org.n52.sos.netcdf.oceansites;

import org.n52.shetland.ogc.OGCConstants;
import org.n52.janmayen.http.MediaType;
import org.n52.shetland.ogc.OGCConstants;

import com.google.common.base.Strings;
import com.google.common.collect.ImmutableListMultimap;
Expand Down
Expand Up @@ -41,6 +41,12 @@

import javax.inject.Inject;

import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.PrecisionModel;
import org.n52.faroe.annotation.Setting;
import org.n52.iceland.convert.RequestResponseModifier;
import org.n52.iceland.convert.RequestResponseModifierFacilitator;
Expand All @@ -65,7 +71,6 @@
import org.n52.shetland.ogc.ows.exception.MissingParameterValueException;
import org.n52.shetland.ogc.ows.exception.NoApplicableCodeException;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.ows.extension.Extension;
import org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest;
import org.n52.shetland.ogc.ows.service.GetCapabilitiesResponse;
import org.n52.shetland.ogc.ows.service.OwsServiceRequest;
Expand Down Expand Up @@ -118,18 +123,11 @@
import org.n52.shetland.util.ReferencedEnvelope;
import org.n52.sos.service.ProcedureDescriptionSettings;
import org.n52.sos.util.GeometryHandler;
import org.n52.sos.util.JTSConverter;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.PrecisionModel;

/**
* Class that transforms geometries in the requests to the stored EPSG code and
Expand Down Expand Up @@ -757,8 +755,8 @@ private void checkRequestIfCrsIsSetAndSupported(OwsServiceRequest request) throw
* If an error occurs when parsing the request
*/
private int getCrsFrom(OwsServiceRequest request) throws OwsExceptionReport {
Optional<?> crsExtension =
request.getExtension(OWSConstants.AdditionalRequestParams.crs).map(Extension::getValue);
Optional<?> crsExtension = request.getExtension(OWSConstants.AdditionalRequestParams.crs).map((extension) ->
extension.getValue());

if (crsExtension.isPresent()) {
return getCrs(crsExtension.get());
Expand Down Expand Up @@ -872,7 +870,7 @@ private void preProcessSpatialFilters(List<SpatialFilter> spatialFilters) throws
* If the transformation fails
*/
private void preProcessSpatialFilter(SpatialFilter spatialFilter) throws OwsExceptionReport {
spatialFilter.setGeometry(JTSConverter.convert(getGeomtryHandler().transformToStorageEpsg(spatialFilter.getGeometry())));
spatialFilter.setGeometry(getGeomtryHandler().transformToStorageEpsg(spatialFilter.getGeometry()));

}

Expand Down
Expand Up @@ -392,7 +392,7 @@ public void deleteStaticCapabilities(String identifier) throws NoSuchExtensionEx
}

private static <T extends Extension<?>> Collector<T, ?, Map<String, T>> swesExtensionCollector() {
return toMap(Extension<?>::getIdentifier, Function.identity());
return toMap(Extension::getIdentifier, Function.identity());
}

private static class StaticCapabilitiesImpl implements StaticCapabilities {
Expand Down
Expand Up @@ -37,11 +37,11 @@
import java.util.Set;
import java.util.stream.Stream;

import org.n52.shetland.ogc.ows.OwsDomain;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.sos.Sos1Constants;
import org.n52.shetland.ogc.sos.Sos2Constants;
import org.n52.shetland.ogc.sos.SosConstants;
import org.n52.shetland.ogc.ows.OwsDomain;
import org.n52.shetland.ogc.ows.exception.OwsExceptionReport;
import org.n52.shetland.ogc.sos.request.GetFeatureOfInterestRequest;
import org.n52.shetland.ogc.sos.response.GetFeatureOfInterestResponse;
import org.n52.sos.util.SosHelper;
Expand Down
Expand Up @@ -26,34 +26,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*/
/**
* Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* If the program is linked with libraries which are licensed under one of
* the following licenses, the combination of the program with the linked
* library is not considered a "derivative work" of the program:
*
* - Apache License, version 2.0
* - Apache Software License, version 1.0
* - GNU Lesser General Public License, version 3
* - Mozilla Public License, versions 1.0, 1.1 and 2.0
* - Common Development and Distribution License (CDDL), version 1.0
*
* Therefore the distribution of the program linked with libraries licensed
* under the aforementioned licenses, is permitted by the copyright holders
* if the distribution is compliant with both the GNU General Public
* License version 2 and the aforementioned licenses.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*/
package org.n52.sos.event.events;

import org.n52.shetland.ogc.sos.request.InsertResultRequest;
Expand Down
Expand Up @@ -111,12 +111,11 @@ public ImmutableSet<IPAddressRange> getAllowedAddresses() {
@Setting(TRANSACTIONAL_ALLOWED_IPS)
public void setTransactionalAllowedIps(final String txAllowedIps) throws ConfigurationError {
if (!Strings.isNullOrEmpty(txAllowedIps)) {
final Builder<IPAddressRange> builder = ImmutableSet.builder();
Builder<IPAddressRange> builder = ImmutableSet.builder();
for (final String splitted : txAllowedIps.split(",")) {
final String trimmed = splitted.trim();
final String cidrAddress = trimmed.contains("/") ? trimmed : trimmed + "/32";
String trimmed = splitted.trim();
try {
builder.add(new IPAddressRange(cidrAddress));
builder.add(new IPAddressRange(trimmed));
} catch (final IllegalArgumentException e) {
throw new ConfigurationError(
"Transactional allowed address is not a valid CIDR range or IP address", e);
Expand Down

0 comments on commit e15c292

Please sign in to comment.