@Override public String mimeType(Version version) { if (version != null && version.equals(VERSION_11)) { return MIMETYPE_11; } return MIMETYPE_10; }
public boolean equals(Object obj) { if (!(obj instanceof Service)) { return false; } Service other = (Service) obj; if (!id.equals(other.id)) { return false; } if (version == null) { if (other.version != null) { return false; } } else { if (!version.equals(other.version)) { return false; } } return operations.equals(other.operations); }
Service s = (Service) itr.next(); if (version.equals(s.getVersion())) { continue;
XmlRequestReader r = (XmlRequestReader) itr.next(); if (r.getVersion() == null || version.equals(r.getVersion())) { continue;
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof StyleInfo)) return false; final StyleInfo other = (StyleInfo) obj; if (filename == null) { if (other.getFilename() != null) return false; } else if (!filename.equals(other.getFilename())) return false; if (id == null) { if (other.getId() != null) return false; } else if (!id.equals(other.getId())) return false; if (name == null) { if (other.getName() != null) return false; } else if (!name.equals(other.getName())) return false; if (workspace == null) { if (other.getWorkspace() != null) return false; } else if (!workspace.equals(other.getWorkspace())) return false; if (format == null) { if (other.getFormat() != null) return false; } else { if (!format.equals(other.getFormat())) return false; } if (languageVersion == null) { if (other.getFormatVersion() != null) return false; } else if (!languageVersion.equals(other.getFormatVersion())) return false; return true; }
Service service = (Service) s.next(); if (version.equals(service.getVersion())) { found = true;
public static Version find(String capsVersion) { if (capsVersion == null) { throw new IllegalArgumentException(); } Version v = new Version(capsVersion); if (v1_0_0.equals(v)) { return v1_0_0; } if (v1_1_0.equals(v)) { return v1_1_0; } if (v2_0_0.equals(v)) { return v2_0_0; } throw new IllegalArgumentException(); }
@Override public Configuration getWfsConfiguration() { return Versions.v1_0_0.equals(getServiceVersion()) ? WFS_1_0_CONFIGURATION : WFS_1_1_CONFIGURATION; }
@Override public Configuration getFilterConfiguration() { return Versions.v1_0_0.equals(getServiceVersion()) ? FILTER_1_0_CONFIGURATION : FILTER_1_1_CONFIGURATION; }
@Override public boolean supports(ResultType resultType) { switch (resultType) { case RESULTS: return true; case HITS: return Versions.v1_0_0.equals(getServiceVersion()) ? false : true; default: return false; } }
public boolean canSort() { final Version capsVersion = new Version(capabilities.getVersion()); // currently on version 1.1.0 supports native sorting if (Versions.v1_1_0.equals(capsVersion)) { return true; } else { return false; } }
@Override public List<String> getClientSupportedOutputFormats(WFSOperationType operation) { List<WFSResponseFactory> operationResponseFactories; operationResponseFactories = WFSExtensions.findResponseFactories(operation); List<String> outputFormats = new LinkedList<String>(); for (WFSResponseFactory factory : operationResponseFactories) { List<String> factoryFormats = factory.getSupportedOutputFormats(); outputFormats.addAll(factoryFormats); } final boolean wfs1_0 = Versions.v1_0_0.equals(serviceVersion); if (GET_FEATURE.equals(operation)) { for (String preferred : wfs1_0 ? PREFFERRED_GETFEATURE_FORMATS_10 : PREFFERRED_GETFEATURE_FORMATS) { boolean hasFormat = outputFormats.remove(preferred); if (hasFormat) { outputFormats.add(0, preferred); break; } } } return outputFormats; }
Configuration config(SldTransformContext context) { if (context.version().equals(SldTransformContext.V_110)) { return new org.geotools.filter.v1_1.OGCConfiguration(); } else { return new org.geotools.filter.v1_0.OGCConfiguration(); } } }
@Override public WFSServiceInfo getServiceInfo() { final String schemaLocation; if (Versions.v1_1_0.equals(getServiceVersion())) { schemaLocation = "http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"; } else { schemaLocation = "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"; } URL getCapsUrl = getOperationURL(GET_CAPABILITIES, GET); return new CapabilitiesServiceInfo(schemaLocation, getCapsUrl, capabilities); }
@Override public Set<String> getSupportedCRSIdentifiers(QName typeName) { FeatureTypeInfo featureTypeInfo = getFeatureTypeInfo(typeName); String defaultSRS = featureTypeInfo.getDefaultSRS(); List<String> otherSRS = featureTypeInfo.getOtherSRS(); Set<String> ftypeCrss = new HashSet<String>(); ftypeCrss.add(defaultSRS); ftypeCrss.addAll(otherSRS); final boolean wfs2_0 = Versions.v2_0_0.equals(getServiceVersion()); if (wfs2_0) { OperationType operationMetadata = getOperationMetadata(GET_FEATURE); final String operationParameter = "SrsName"; Set<String> globalSrsNames = findParameters(operationMetadata, operationParameter); ftypeCrss.addAll(globalSrsNames); } return ftypeCrss; }
final boolean wfs1_0 = Versions.v1_0_0.equals(serviceVersion); switch (operation) { case GET_FEATURE:
/** @see WFSStrategy#getSupportedCRSIdentifiers */ @Override public Set<String> getSupportedCRSIdentifiers(QName typeName) { FeatureTypeInfo featureTypeInfo = getFeatureTypeInfo(typeName); String defaultSRS = featureTypeInfo.getDefaultSRS(); List<String> otherSRS = featureTypeInfo.getOtherSRS(); Set<String> ftypeCrss = new HashSet<String>(); ftypeCrss.add(defaultSRS); if (!config.isUseDefaultSrs()) { ftypeCrss.addAll(otherSRS); } final boolean wfs1_1 = Versions.v1_1_0.equals(getServiceVersion()); if (wfs1_1) { OperationType operationMetadata = getOperationMetadata(GET_FEATURE); final String operationParameter = "SrsName"; Set<String> globalSrsNames = findParameters(operationMetadata, operationParameter); ftypeCrss.addAll(globalSrsNames); } return ftypeCrss; }
@Override protected EObject createDescribeFeatureTypeRequestPost(DescribeFeatureTypeRequest request) { final Wfs20Factory factory = Wfs20Factory.eINSTANCE; DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType(); Version version = getServiceVersion(); dft.setService("WFS"); dft.setVersion(version.toString()); dft.setHandle(request.getHandle()); if (Versions.v1_0_0.equals(version)) { dft.setOutputFormat(null); } QName typeName = request.getTypeName(); @SuppressWarnings("unchecked") List<QName> typeNames = dft.getTypeName(); typeNames.add(typeName); return dft; }
@Override protected DescribeFeatureTypeType createDescribeFeatureTypeRequestPost( DescribeFeatureTypeRequest request) { final WfsFactory factory = WfsFactory.eINSTANCE; DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType(); Version version = getServiceVersion(); dft.setService("WFS"); dft.setVersion(version.toString()); dft.setHandle(request.getHandle()); if (Versions.v1_0_0.equals(version)) { dft.setOutputFormat(null); } QName typeName = request.getTypeName(); @SuppressWarnings("unchecked") List<QName> typeNames = dft.getTypeName(); typeNames.add(typeName); return dft; }
if (Versions.v1_0_0.equals(getServiceVersion())) { SpatialCapabilities spatialCaps = filterCapabilities.getSpatialCapabilities(); if (spatialCaps != null) {