private void flushState(ContentDataStore contentDataStore, String nativeName) throws IOException { ContentFeatureSource featureSource; featureSource = contentDataStore.getFeatureSource(nativeName); featureSource.getState().flush(); }
@Override protected boolean canDelegate(FeatureVisitor visitor) { return ReTypingFeatureCollection.isTypeCompatible(visitor, target); }
@Override public SimpleFeatureSource getFeatureSource(Name typeName) throws IOException { final SimpleFeatureSource fs = super.getFeatureSource(typeName); return wrapFeatureSource(fs); }
@Override public SimpleFeatureCollection subCollection(Filter filter) { SimpleFeatureCollection delegateCollection = delegate.subCollection(filter); return new ReTypingFeatureCollection(delegateCollection, target); }
new FilteringFeatureCollection<T, F>(collection, writeQuery.getFilter()); if (filtered.size() < collection.size()) { String typeName = getSchema().getName().getLocalPart(); if (policy.response == Response.CHALLENGE) {
/** * 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(); }
/** * Adds an listener or observer to the feature source. * * <p>Listeners are stored on a per-transaction basis. */ public final void addFeatureListener(FeatureListener listener) { entry.getState(transaction).addListener(listener); }
/** Removes a listener from the feature source. */ public final void removeFeatureListener(FeatureListener listener) { entry.getState(transaction).removeListener(listener); }
@Override /** * We are already holding onto our transaction from ContentState; however this method does check * that the transaction is correct. */ public synchronized void setTransaction(Transaction transaction) { if (this.transaction != null && transaction == null) { // clear ContentEntry transaction to fix GEOT-3315 state.getEntry().clearTransaction(this.transaction); } this.transaction = transaction; }
/** * The current state for the feature source. * * <p>This value is derived from current transaction of the feature source. * * @see {@link #setTransaction(Transaction)}. */ public ContentState getState() { return entry.getState(transaction); }
@Override protected boolean handleVisitor(Query query, FeatureVisitor visitor) throws IOException { return super.handleVisitor(query, visitor); } }
/** * Returns the feature collection if the features of the feature source which meet the specified * query criteria. */ public final ContentFeatureCollection getFeatures(Query query) throws IOException { query = joinQuery(query); return new ContentFeatureCollection(this, query); }
@Override public void commit() throws IOException { store.getState().fireBatchFeatureEvent(true); }
/** * Returns a feature writer 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 FeatureWriter}. */ public FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter( String typeName, Filter filter, Transaction tx) throws IOException { ContentFeatureStore featureStore = ensureFeatureStore(typeName, tx); return featureStore.getWriter(filter, WRITER_UPDATE | WRITER_ADD); }
/** * Returns a feature writer for the specified type name and transaction. * * <p>This method is convenience for <code>getFeatureWriter(typeName,Filter.INCLUDE,tx)</code>. */ public final FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter( String typeName, Transaction tx) throws IOException { return getFeatureWriter(typeName, Filter.INCLUDE, tx); }
SimpleFeatureTypeBuilder.retype( sfc.getSchema(), mixed.getPropertyNames()); ReTypingFeatureCollection retyped = new ReTypingFeatureCollection(sfc, target); return (FeatureCollection) SecuredObjects.secure(retyped, policy); } else {
/** Returns the feature collection of all the features of the feature source. */ public final ContentFeatureCollection getFeatures() throws IOException { Query query = joinQuery(Query.ALL); return new ContentFeatureCollection(this, query); }
@Override public void rollback() throws IOException { store.getState().fireBatchFeatureEvent(false); }
protected boolean canDelegate(FeatureVisitor visitor) { return ReTypingFeatureCollection.isTypeCompatible(visitor, readSchema); } }
@Override public SimpleFeatureSource getFeatureSource(String typeName) throws IOException { final SimpleFeatureSource fs = super.getFeatureSource(typeName); return wrapFeatureSource(fs); }