* @see WFSStrategy#createGetFeatureRequest(WFS_1_1_0_DataStore, WFSProtocol, Query, String)
*/
@SuppressWarnings("unchecked")
public RequestComponents createGetFeatureRequest(WFSProtocol wfs, GetFeature query)
throws IOException {
final WfsFactory factory = WfsFactory.eINSTANCE;
GetFeatureType getFeature = factory.createGetFeatureType();
getFeature.setService("WFS");
getFeature.setVersion(wfs.getServiceVersion().toString());
getFeature.setOutputFormat(query.getOutputFormat());
getFeature.setHandle("GeoTools " + GeoTools.getVersion() + " WFS DataStore");
Integer maxFeatures = query.getMaxFeatures();
if (maxFeatures != null) {
getFeature.setMaxFeatures(BigInteger.valueOf(maxFeatures.intValue()));
}
ResultType resultType = query.getResultType();
getFeature.setResultType(RESULTS == resultType ? RESULTS_LITERAL : HITS_LITERAL);
QueryType wfsQuery = factory.createQueryType();
wfsQuery.setTypeName(Collections.singletonList(query.getTypeName()));
Filter serverFilter = query.getFilter();
if (!Filter.INCLUDE.equals(serverFilter)) {
wfsQuery.setFilter(serverFilter);