@Test public void testCreateDataStore() throws IOException { DataAccess<FeatureType, Feature> ds = factory.createDataStore(params); assertNotNull(ds); FeatureSource<FeatureType, Feature> mappedSource = ds.getFeatureSource(mappedTypeName); assertNotNull(mappedSource); assertSame(ds, mappedSource.getDataStore()); ds.dispose(); }
public DataAccess<FeatureType, Feature> createDataStore(Map params) throws IOException { Set<FeatureTypeMapping> mappings; AppSchemaDataAccess dataStore; URL configFileUrl = (URL) AppSchemaDataAccessFactory.URL.lookUp(params); XMLConfigDigester configReader = new XMLConfigDigester(); AppSchemaDataAccessDTO config = configReader.parse(configFileUrl); List<String> includes = config.getIncludes(); for (Iterator<String> it = includes.iterator(); it.hasNext();) { String parentLocation; parentLocation = DataUtilities.urlToFile(configFileUrl).getParent(); File includedConfig = new File(parentLocation, it.next()); if (!includedConfig.exists()) { throw new RuntimeException( "Please check that the includedTypes location is correct: \n '" + includedConfig.getPath() + "' doesn't exist!"); } URL relatedConfigURL = DataUtilities.fileToURL(includedConfig); params.put("url", relatedConfigURL); createDataStore(params); } mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); return dataStore; }
AppSchemaDataAccessFactory implements DataAccessFactory { public DataAccess<FeatureType, Feature> createDataStore(Map params) throws IOException { Set<FeatureTypeMapping> mappings; AppSchemaDataAccess dataStore; URL configFileUrl = (URL) AppSchemaDataAccessFactory.URL.lookUp(params); XMLConfigDigester configReader = new XMLConfigDigester(); AppSchemaDataAccessDTO config = configReader.parse(configFileUrl); List<String> includes = config.getIncludes(); for (Iterator<String> it = includes.iterator(); it.hasNext();) { String parentLocation; parentLocation = DataUtilities.urlToFile(configFileUrl).getParent(); File includedConfig = new File(parentLocation, it.next()); if (!includedConfig.exists()) { throw new RuntimeException( "Please check that the includedTypes location is correct: \n '" + includedConfig.getPath() + "' doesn't exist!"); } URL relatedConfigURL = DataUtilities.fileToURL(includedConfig); params.put("url", relatedConfigURL); createDataStore(params); } mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); return dataStore; } }
AppSchemaDataAccessFactory implements DataAccessFactory { public DataAccess<FeatureType, Feature> createDataStore(Map params) throws IOException { Set<FeatureTypeMapping> mappings; AppSchemaDataAccess dataStore; URL configFileUrl = (URL) AppSchemaDataAccessFactory.URL.lookUp(params); XMLConfigDigester configReader = new XMLConfigDigester(); AppSchemaDataAccessDTO config = configReader.parse(configFileUrl); List<String> includes = config.getIncludes(); for (Iterator<String> it = includes.iterator(); it.hasNext();) { String parentLocation; parentLocation = DataUtilities.urlToFile(configFileUrl).getParent(); File includedConfig = new File(parentLocation, it.next()); if (!includedConfig.exists()) { throw new RuntimeException( "Please check that the includedTypes location is correct: \n '" + includedConfig.getPath() + "' doesn't exist!"); } URL relatedConfigURL = DataUtilities.fileToURL(includedConfig); params.put("url", relatedConfigURL); createDataStore(params); } mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); return dataStore; } AppSchemaDataAccessFactory(); }
AppSchemaDataAccessFactory implements DataAccessFactory { public DataAccess<FeatureType, Feature> createDataStore(Map params) throws IOException { Set<FeatureTypeMapping> mappings; AppSchemaDataAccess dataStore; URL configFileUrl = (URL) AppSchemaDataAccessFactory.URL.lookUp(params); XMLConfigDigester configReader = new XMLConfigDigester(); AppSchemaDataAccessDTO config = configReader.parse(configFileUrl); List<String> includes = config.getIncludes(); for (Iterator<String> it = includes.iterator(); it.hasNext();) { String parentLocation; parentLocation = DataUtilities.urlToFile(configFileUrl).getParent(); File includedConfig = new File(parentLocation, it.next()); if (!includedConfig.exists()) { throw new RuntimeException( "Please check that the includedTypes location is correct: \n '" + includedConfig.getPath() + "' doesn't exist!"); } URL relatedConfigURL = DataUtilities.fileToURL(includedConfig); params.put("url", relatedConfigURL); createDataStore(params); } mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); return dataStore; } AppSchemaDataAccessFactory(); DataAccess<FeatureType, Feature> createDataStore(Map params); DataStore createNewDataStore(Map params); String getDisplayName(); String getDescription(); DataStoreFactorySpi.Param[] getParametersInfo(); boolean canProcess(Map params); boolean isAvailable(); Map getImplementationHints(); }
AppSchemaDataAccessFactory implements DataAccessFactory { public DataAccess<FeatureType, Feature> createDataStore(Map params) throws IOException { Set<FeatureTypeMapping> mappings; AppSchemaDataAccess dataStore; URL configFileUrl = (URL) AppSchemaDataAccessFactory.URL.lookUp(params); XMLConfigDigester configReader = new XMLConfigDigester(); AppSchemaDataAccessDTO config = configReader.parse(configFileUrl); List<String> includes = config.getIncludes(); for (Iterator<String> it = includes.iterator(); it.hasNext();) { String parentLocation; parentLocation = DataUtilities.urlToFile(configFileUrl).getParent(); File includedConfig = new File(parentLocation, it.next()); if (!includedConfig.exists()) { throw new RuntimeException( "Please check that the includedTypes location is correct: \n '" + includedConfig.getPath() + "' doesn't exist!"); } URL relatedConfigURL = DataUtilities.fileToURL(includedConfig); params.put("url", relatedConfigURL); createDataStore(params); } mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); return dataStore; } AppSchemaDataAccessFactory(); DataAccess<FeatureType, Feature> createDataStore(Map params); DataStore createNewDataStore(Map params); String getDisplayName(); String getDescription(); DataStoreFactorySpi.Param[] getParametersInfo(); boolean canProcess(Map params); boolean isAvailable(); Map getImplementationHints(); static final String DBTYPE_STRING; static final DataAccessFactory.Param DBTYPE; static final DataAccessFactory.Param URL; }