Package org.geotools.data.wfs.internal

Examples of org.geotools.data.wfs.internal.WFSConfig


        WFSDataStore wfsds = new WFSDataStore(wfs);
        return wfsds;
    }

    private WFSClient mockUpWfsClient() throws Exception {
        WFSConfig config = new WFSConfig();
        String baseDirectory = "GeoServer_2.0/1.1.0/";

        return new IntegrationTestWFSClient(baseDirectory, config);
    }
View Full Code Here


        InputStream stream = TestData.openStream(WFSTestData.class, capabilitiesFileName);
        GetCapabilitiesResponse response = new GetCapabilitiesResponse(response(stream));
        WFSGetCapabilities capabilities = response.getCapabilities();
        real.setCapabilities(capabilities);
        real.setConfig(new WFSConfig());
        return real;
    }
View Full Code Here

    }

    @Before
    public void setUp() throws Exception {
        wfs = new IntegrationTestWFSClient("GeoServer_1.7.x/1.0.0/", new WFSConfig());
        dataStore = new WFSDataStore(wfs);
    }
View Full Code Here

     */
    @Override
    public WFSDataStore createDataStore(final Map<String, Serializable> params)
            throws IOException {

        final WFSConfig config = WFSConfig.fromParams(params);

        {
            String user = config.getUser();
            String password = config.getPassword();
            if (((user == null) && (password != null))
                    || ((config.getPassword() == null) && (config.getUser() != null))) {
                throw new IOException(
                        "Cannot define only one of USERNAME or PASSWORD, must define both or neither");
            }
        }

        final HTTPClient http = new SimpleHttpClient();// new MultithreadedHttpClient();
        // TODO: let HTTPClient be configured for gzip
        // http.setTryGzip(tryGZIP);
        http.setUser(config.getUser());
        http.setPassword(config.getPassword());
        int timeoutMillis = config.getTimeoutMillis();
        http.setConnectTimeout(timeoutMillis / 1000);

        final URL capabilitiesURL = (URL) URL.lookUp(params);

        // WFSClient performs version negotiation and selects the correct strategy
        WFSClient wfsClient;
        try {
            wfsClient = new WFSClient(capabilitiesURL, http, config);
        } catch (ServiceException e) {
            throw new IOException(e);
        }

        WFSDataStore dataStore = new WFSDataStore(wfsClient);
        // factories
        dataStore.setFilterFactory(CommonFactoryFinder.getFilterFactory(null));
        dataStore.setGeometryFactory(new GeometryFactory(
                PackedCoordinateSequenceFactory.DOUBLE_FACTORY));
        dataStore.setFeatureTypeFactory(new FeatureTypeFactoryImpl());
        dataStore.setFeatureFactory(CommonFactoryFinder.getFeatureFactory(null));
        dataStore.setDataStoreFactory(this);
        dataStore.setNamespaceURI(config.getNamespaceOverride());

        return dataStore;
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.wfs.internal.WFSConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.