public void removeSchema(String typeName) throws IOException { delegate.removeSchema(typeName); } }
public void removeSchema(Name typeName) throws IOException { delegate.removeSchema(typeName); }
@Override public void removeSchema(String name) throws IOException { getDataStore(name).removeSchema(name); } }
@Override public void removeSchema(Name typeName) throws IOException { FeatureTypeMapper mapper = getMapper(typeName); if (mapper == null) { throw new IOException("No wrapper found for " + typeName); } else { String mappedName = mapper.getMappedName(); datastore.removeSchema(mappedName); } }
public void removeType(String typeName) throws IOException { Utilities.ensureNonNull("featureType", typeName); checkStore(); getTileIndexStore().removeSchema(typeName); removeTypeName(typeName); }
private void dropSchema(DataStore ds, String featureTypeName) throws Exception { // @todo this needs implementation in geotools SimpleFeatureType schema = ds.getSchema(featureTypeName); if (schema != null) { try { ds.removeSchema(featureTypeName); } catch (Exception e) { LOGGER.warning( "Unable to dropSchema " + featureTypeName + " from datastore " + ds.getClass()); } } else { LOGGER.warning( "Unable to dropSchema " + featureTypeName + " as it does not appear to exist in dataStore"); } }
@Override public void createSchema(DataStore datastore, SimpleFeatureType sft) throws IOException { String typeName = sft.getTypeName(); if (datastore.getSchema(typeName) != null) { System.out.println("'" + typeName + "' feature type already exists - deleting existing schema"); datastore.removeSchema(typeName); System.out.println("Please re-run quick start"); throw new RuntimeException("Deleted existing scheme, please re-run quick start"); } super.createSchema(datastore, sft); }
dataStore.removeSchema(name); } catch (IllegalArgumentException e) { LOG.warn("Could not remove schema. Probably, it has not existed yet.");
public void cleanup(DataStore datastore, String typeName, boolean cleanup) { if (datastore != null) { try { if (cleanup) { System.out.println("Cleaning up test data"); if (datastore instanceof GeoMesaDataStore) { ((GeoMesaDataStore) datastore).delete(); } else { ((SimpleFeatureStore) datastore.getFeatureSource(typeName)).removeFeatures(Filter.INCLUDE); datastore.removeSchema(typeName); } } } catch (Exception e) { System.err.println("Exception cleaning up test data: " + e.toString()); } finally { // make sure that we dispose of the datastore when we're done with it datastore.dispose(); } } } }
/** Helper method that create a new table on DB to store resource informations */ private void createFeatureType(DataStore dataStore, boolean forceDelete) throws Exception { boolean exists = dataStore.getNames().contains(new NameImpl(STORE_SCHEMA_NAME)); // Schema exists if (exists) { // Delete of exist is required, and then create a new one if (forceDelete) { dataStore.removeSchema(STORE_SCHEMA_NAME); SimpleFeatureType schema = DataUtilities.createType(STORE_SCHEMA_NAME, STORE_SCHEMA); dataStore.createSchema(schema); } // Schema not exists, create a new one } else { SimpleFeatureType schema = DataUtilities.createType(STORE_SCHEMA_NAME, STORE_SCHEMA); dataStore.createSchema(schema); } }
@Override protected ProcessStatusStore buildStore() throws IOException { setupDataStore(); if (Arrays.asList(datastore.getTypeNames()).contains(getStatusTable())) { datastore.removeSchema(getStatusTable()); } statusStore = new JDBCStatusStore(datastore); return statusStore; }