use of org.n52.shetland.ogc.ows.exception.OwsExceptionReport in project arctic-sea by 52North.
the class ComparisonFilterTest method testCopyOf_like.
@Test
public void testCopyOf_like() throws OwsExceptionReport {
ComparisonFilter original = new ComparisonFilter(FilterConstants.ComparisonOperator.PropertyIsLike, "vr", "val", "up", "escape");
original.setMatchCase(false);
original.setSingleChar("single");
original.setWildCard("wild");
ComparisonFilter copy = original.copy();
Assert.assertThat(copy.getEscapeString(), is(original.getEscapeString()));
Assert.assertThat(copy.getSingleChar(), is(original.getSingleChar()));
Assert.assertThat(copy.getValue(), is(original.getValue()));
Assert.assertThat(copy.getValueReference(), is(original.getValueReference()));
Assert.assertThat(copy.getValueUpper(), is(original.getValueUpper()));
Assert.assertThat(copy.getWildCard(), is(original.getWildCard()));
Assert.assertThat(copy, is(not(original)));
Assert.assertThat("copy is not equal to original, equal to is not implemented", not(copy.equals(original)));
}
use of org.n52.shetland.ogc.ows.exception.OwsExceptionReport in project arctic-sea by 52North.
the class AbstractGetCapabilitiesHandler method createCapabilities.
private OwsCapabilities createCapabilities(GetCapabilitiesRequest request, String service, String version) throws OwsExceptionReport {
Set<CapabilitiesSection> sections = getRequestedSections(request);
Locale requestedLocale = getRequestedLocale(request);
String updateSequence = null;
OwsServiceIdentification serviceIdentification = null;
if (sections.contains(CapabilitiesSection.ServiceIdentification)) {
serviceIdentification = getServiceIdentification(service, requestedLocale);
}
OwsServiceProvider serviceProvider = null;
if (sections.contains(CapabilitiesSection.ServiceProvider)) {
serviceProvider = getServiceProvider(service, requestedLocale);
}
OwsOperationsMetadata operationsMetadata = null;
if (sections.contains(CapabilitiesSection.OperationsMetadata)) {
operationsMetadata = getOperations(service, version);
}
Set<String> languages = null;
if (sections.contains(CapabilitiesSection.Languages)) {
languages = getLanguages();
}
T contents = null;
if (sections.contains(CapabilitiesSection.Contents)) {
contents = createContents(service, version);
}
Collection<OwsCapabilitiesExtension> extensions = getExtensions(request, service, version);
OwsCapabilities capabilities = new OwsCapabilities(service, version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, languages, extensions);
return createCapabilities(capabilities, contents);
}
use of org.n52.shetland.ogc.ows.exception.OwsExceptionReport in project arctic-sea by 52North.
the class AbstractGetCapabilitiesHandler method getOperations.
private OwsOperationsMetadata getOperations(String service, String version) throws OwsExceptionReport {
Collection<OwsDomain> parameters = getCommonParameters(service);
Collection<OwsDomain> constraints = null;
Collection<OwsOperation> operations = new LinkedList<>();
OwsOperationMetadataExtension extension = getOperationsMetadataExtension(service, version);
for (RequestOperatorKey operatorKey : requestOperatorRepository.getActiveRequestOperatorKeys(new OwsServiceKey(service, version))) {
Optional.ofNullable(requestOperatorRepository.getRequestOperator(operatorKey).getOperationMetadata(service, version)).ifPresent(operations::add);
}
return new OwsOperationsMetadata(operations, parameters, constraints, extension);
}
use of org.n52.shetland.ogc.ows.exception.OwsExceptionReport in project arctic-sea by 52North.
the class GenericServiceOperator method receiveRequest.
/**
* {@inheritDoc}
*
* @throws OperationNotSupportedException if no matching
* {@link RequestOperator} could be
* found or if the operator returned
* a {@code null}-response.
*/
@Override
public OwsServiceResponse receiveRequest(OwsServiceRequest request) throws OwsExceptionReport {
String operationName = request.getOperationName();
RequestOperator operator = this.requestOperatorRepository.getRequestOperator(this.key, operationName);
if (operator == null) {
throw new OperationNotSupportedException(operationName);
}
OwsServiceResponse response = operator.receiveRequest(request);
if (response == null) {
throw new OperationNotSupportedException(operationName);
}
return response;
}
use of org.n52.shetland.ogc.ows.exception.OwsExceptionReport in project arctic-sea by 52North.
the class GenericRequestOperator method receiveRequest.
@Override
public OwsServiceResponse receiveRequest(final OwsServiceRequest abstractRequest) throws OwsExceptionReport {
this.eventBus.submit(new RequestEvent(abstractRequest));
if (requestType.isAssignableFrom(abstractRequest.getClass())) {
Q request = requestType.cast(abstractRequest);
checkForModifierAndProcess(request);
this.validator.validate(request);
A response = receive(request);
this.eventBus.submit(new ResponseEvent(response));
checkForModifierAndProcess(request, response);
return response;
} else {
throw new OperationNotSupportedException(abstractRequest.getOperationName());
}
}
Aggregations