private void flushState(ContentDataStore contentDataStore, String nativeName) throws IOException { ContentFeatureSource featureSource; featureSource = contentDataStore.getFeatureSource(nativeName); featureSource.getState().flush(); }
/** * Delegates to {@link #getFeatureSource(Name, Transaction)} * * @since 2.5 * @see DataAccess#getFeatureSource(Name) */ public SimpleFeatureSource getFeatureSource(Name typeName) throws IOException { return getFeatureSource(typeName, Transaction.AUTO_COMMIT); }
/** * Helper method which gets a feature source ensuring that it is a feature store as well. If not * it throws an IOException. * * @param typeName The name of the feature source. * @param tx A transaction handle. * @throws IOException If the feature source is not a store. */ protected final ContentFeatureStore ensureFeatureStore(String typeName, Transaction tx) throws IOException { ContentFeatureSource featureSource = getFeatureSource(typeName, tx); if (!(featureSource instanceof ContentFeatureStore)) { throw new IOException(typeName + " is read only"); } return (ContentFeatureStore) featureSource; }
/** * Returns the feature type or schema matching the specified name. * * <p>This method calls through to <code>getFeatureSource(typeName).getSchema()</code> * * @see DataStore#getSchema(String) */ public final SimpleFeatureType getSchema(String typeName) throws IOException { ContentFeatureSource featureSource = getFeatureSource(typeName); return featureSource.getSchema(); }
/** * Returns the feature source matching the specified name. * * <p>Subclasses should not implement this method. However overriding in order to perform a type * narrowing to a subclasses of {@link ContentFeatureSource} is acceptable. * * @see DataStore#getFeatureSource(String) */ public ContentFeatureSource getFeatureSource(String typeName) throws IOException { return getFeatureSource(new NameImpl(null, typeName), Transaction.AUTO_COMMIT); }
/** * Returns the feature source matching the specified name and explicitly specifies a * transaction. * * <p>Subclasses should not implement this method. However overriding in order to perform a type * narrowing to a subclasses of {@link ContentFeatureSource} is acceptable. * * @see DataStore#getFeatureSource(String) */ public ContentFeatureSource getFeatureSource(String typeName, Transaction tx) throws IOException { return getFeatureSource(new NameImpl(null, typeName), tx); }
/** * Returns a feature reader for the specified query and transaction. * * <p>This method is not intended to be overridden and is marked final. This implementation * delegates to {@link FeatureCollection} and wraps an iterator in a {@link FeatureReader}. */ public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader( Query query, Transaction tx) throws IOException { if (query.getTypeName() == null) { throw new IllegalArgumentException("Query does not specify type."); } return getFeatureSource(query.getTypeName(), tx).getReader(query); }
Name name = entry.getName(); ContentDataStore dataStore = entry.getDataStore(); ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(name); if (source instanceof ContentFeatureStore) { store = (ContentFeatureStore) dataStore.getFeatureSource(name, transaction); writer = store.getWriter(Filter.INCLUDE, ContentDataStore.WRITER_COMMIT); } else {
/** * Helper method which gets a feature source ensuring that it is a feature * store as well. If not it throws an IOException. * * @param typeName The name of the feature source. * @param tx A transaction handle. * * @throws IOException If the feature source is not a store. * */ protected final ContentFeatureStore ensureFeatureStore(String typeName, Transaction tx) throws IOException { ContentFeatureSource featureSource = getFeatureSource(typeName,tx); if ( !( featureSource instanceof ContentFeatureStore)) { throw new IOException(typeName + " is read only" ); } return (ContentFeatureStore) featureSource; }
@Override public ContentFeatureSource getFeatureSource(final String typeName, final Transaction tx) throws IOException { return super.getFeatureSource(new NameImpl(null, typeName), tx); }
/** * Delegates to {@link #getFeatureSource(String)} with * {@code name.getLocalPart()} * * @since 2.5 * @see DataAccess#getFeatureSource(Name) */ public SimpleFeatureSource getFeatureSource(Name typeName) throws IOException { return getFeatureSource(typeName.getLocalPart()); }
/** * Returns the feature type or schema matching the specified name. * <p> * This method calls through to <code>getFeatureSource(typeName).getSchema()</code> * </p> * * @see DataStore#getSchema(String) */ public final SimpleFeatureType getSchema(String typeName) throws IOException { ContentFeatureSource featureSource = getFeatureSource(typeName); return featureSource.getSchema(); }
/** * Returns the feature source matching the specified name. * <p> * Subclasses should not implement this method. However overriding in order * to perform a type narrowing to a subclasses of {@link ContentFeatureSource} * is acceptable. * </p> * * @see DataStore#getFeatureSource(String) */ public ContentFeatureSource getFeatureSource(String typeName) throws IOException { return getFeatureSource(new NameImpl(namespaceURI,typeName), Transaction.AUTO_COMMIT); }
/** * Returns the feature source matching the specified name and explicitly * specifies a transaction. * <p> * Subclasses should not implement this method. However overriding in order * to perform a type narrowing to a subclasses of {@link ContentFeatureSource} * is acceptable. * </p> * * @see DataStore#getFeatureSource(String) */ public ContentFeatureSource getFeatureSource(String typeName, Transaction tx) throws IOException { return getFeatureSource( name(typeName), tx ); }
/** * Returns a feature reader for the specified query and transaction. * <p> * This method is not intended to be overridden and is marked final. This * implementation delegates to {@link FeatureCollection} and wraps an iterator * in a {@link FeatureReader}. * </p> */ public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(Query query, Transaction tx) throws IOException { if ( query.getTypeName() == null ) { throw new IllegalArgumentException( "Query does not specify type."); } return getFeatureSource(query.getTypeName(),tx).getReader( query ); }
@Override public ContentFeatureSource getFeatureSource(Name name, Transaction tx) throws IOException { final ElasticLayerConfiguration layerConfig = layerConfigurations.get(name.getLocalPart()); if (layerConfig != null) { docTypes.put(name, layerConfig.getDocType()); } final ContentFeatureSource featureSource = super.getFeatureSource(name, tx); featureSource.getEntry().getState(Transaction.AUTO_COMMIT).flush(); return featureSource; }
Name name = entry.getName(); ContentDataStore dataStore = entry.getDataStore(); ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(name); if (source instanceof ContentFeatureStore) { store = (ContentFeatureStore) dataStore.getFeatureSource(name); writer = store.getWriter(Filter.INCLUDE); } else {