use of org.n52.shetland.ogc.ows.OwsOperationsMetadata in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseOperationMetadata.
private OwsOperationsMetadata parseOperationMetadata(OperationsMetadata operationsMetadata) {
if (operationsMetadata == null) {
return null;
}
List<OwsOperation> operations = parseOperations(operationsMetadata.getOperationArray());
List<OwsDomain> parameters = parseDomains(operationsMetadata.getParameterArray());
List<OwsDomain> constraints = parseDomains(operationsMetadata.getConstraintArray());
OwsOperationMetadataExtension extension = parseOperationsMetadataExtension(operationsMetadata.getExtendedCapabilities());
return new OwsOperationsMetadata(operations, parameters, constraints, extension);
}
use of org.n52.shetland.ogc.ows.OwsOperationsMetadata in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeOperationsMetadata.
private OperationsMetadata encodeOperationsMetadata(OwsOperationsMetadata om) throws EncodingException {
OperationsMetadata xom = OperationsMetadata.Factory.newInstance(getXmlOptions());
om.getOperations().forEach(x -> encodeOwsOperation(x, xom.addNewOperation()));
om.getConstraints().forEach(x -> encodeOwsDomain(x, xom.addNewConstraint()));
om.getParameters().forEach(x -> encodeOwsDomain(x, xom.addNewParameter()));
if (om.getExtension().isPresent()) {
xom.setExtendedCapabilities(encodeOwsOperationsMetadataExtension(om.getExtension().get()));
}
return xom;
}
use of org.n52.shetland.ogc.ows.OwsOperationsMetadata 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.OwsOperationsMetadata 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.OwsOperationsMetadata in project arctic-sea by 52North.
the class OwsEncoderv110 method encode.
@Override
public XmlObject encode(Object element, EncodingContext additionalValues) throws EncodingException {
if (element instanceof OwsServiceIdentification) {
return encodeServiceIdentification((OwsServiceIdentification) element);
} else if (element instanceof OwsServiceProvider) {
return encodeServiceProvider((OwsServiceProvider) element);
} else if (element instanceof OwsOperationsMetadata) {
return encodeOperationsMetadata((OwsOperationsMetadata) element);
} else if (element instanceof OwsExceptionReport) {
if (isEncodeExceptionsOnly(additionalValues) && !((OwsExceptionReport) element).getExceptions().isEmpty()) {
return encodeOwsException(((OwsExceptionReport) element).getExceptions().get(0));
}
return encodeOwsExceptionReport((OwsExceptionReport) element);
} else if (element instanceof OwsMetadata) {
MetadataType metadataType = MetadataType.Factory.newInstance(getXmlOptions());
encodeOwsMetadata((OwsMetadata) element, metadataType);
return metadataType;
} else if (element instanceof OwsDomain) {
DomainType domainType = DomainType.Factory.newInstance(getXmlOptions());
encodeOwsDomain((OwsDomain) element, domainType);
return domainType;
} else if (element instanceof OwsAcceptVersions) {
return encodeAcceptVersions((OwsAcceptVersions) element);
} else if (element instanceof OwsSections) {
return encodeSections((OwsSections) element);
}
throw new UnsupportedEncoderInputException(this, element);
}
Aggregations