/** * The datastore that this feature source originated from. * * <p>Subclasses may wish to extend this method in order to type narrow its return type. */ public ContentDataStore getDataStore() { return entry.getDataStore(); }
public PropertyFeatureSource(ContentEntry entry, Query query) { super(entry, query); this.store = (PropertyDataStore) entry.getDataStore(); this.typeName = entry.getTypeName(); }
PropertyFeatureStore(ContentEntry entry, Query query) throws IOException { super(entry, query); this.store = (PropertyDataStore) entry.getDataStore(); this.typeName = entry.getTypeName(); }
/** * Creates the new feature store. * * @param entry The datastore entry. * @param query The defining query. */ public JDBCFeatureSource(ContentEntry entry, Query query) throws IOException { super(entry, query); // TODO: cache this primaryKey = ((JDBCDataStore) entry.getDataStore()).getPrimaryKey(entry); }
public PropertyFeatureWriter( ContentFeatureSource source, ContentState contentState, Query query, boolean append) throws IOException { this.state = contentState; this.featureSource = source; PropertyDataStore store = (PropertyDataStore) contentState.getEntry().getDataStore(); String namespaceURI = store.getNamespaceURI(); String typeName = query.getTypeName(); File dir = store.dir; read = new File(store.dir, typeName + ".properties"); write = File.createTempFile(typeName + System.currentTimeMillis(), null, dir); // start reading delegate = new PropertyFeatureReader(namespaceURI, read); type = delegate.getFeatureType(); // open writer writer = new BufferedWriter(new FileWriter(write)); // write header writer.write("_="); writer.write(DataUtilities.encodeType(type)); } // constructor end
/** Sets the transaction associated with the state. */ @Override public void setTransaction(Transaction tx) { super.setTransaction(tx); if (tx != Transaction.AUTO_COMMIT) { synchronized (WFSRemoteTransactionState.class) { WFSDataStore dataStore = (WFSDataStore) entry.getDataStore(); WFSRemoteTransactionState remoteStateKeeper; remoteStateKeeper = (WFSRemoteTransactionState) tx.getState(dataStore); if (remoteStateKeeper == null) { remoteStateKeeper = new WFSRemoteTransactionState(dataStore); tx.putState(dataStore, remoteStateKeeper); } WFSLocalTransactionState localTransactionState = getLocalTransactionState(); remoteStateKeeper.watch(localTransactionState.getState()); } } } }
/** * The datastore that this feature source originated from. * <p> * Subclasses may wish to extend this method in order to type narrow its * return type. * </p> */ public ContentDataStore getDataStore() { return entry.getDataStore(); }
/** * <b>Precondition</b>: {@code entry.getDataStore() instanceof GeoGigDataStore} * * @param entry */ public GeogigFeatureSource(ContentEntry entry) { super(entry, Query.ALL); checkArgument(entry.getDataStore() instanceof GeoGigDataStore); }
ContentEntry entry = state.getEntry(); Name name = entry.getName(); ContentDataStore dataStore = entry.getDataStore(); ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(name); if (source instanceof ContentFeatureStore) {
/** * <b>Precondition</b>: {@code entry.getDataStore() instanceof GeoGigDataStore} */ public GeogigDiffFeatureSource(ContentEntry entry, String oldRoot) { super(entry, Query.ALL); checkNotNull(oldRoot); this.oldRoot = oldRoot; this.oldContext = null; checkArgument(entry.getDataStore() instanceof GeoGigDataStore); }
public GeogigDiffFeatureSource(ContentEntry entry, String oldRoot, Context oldContext) { super(entry, Query.ALL); checkNotNull(oldRoot); checkNotNull(oldContext); this.oldRoot = oldRoot; this.oldContext = oldContext; checkArgument(entry.getDataStore() instanceof GeoGigDataStore); }
/** * Creates the new feature store. * @param entry The datastore entry. * @param query The defining query. */ public JDBCFeatureSource(ContentEntry entry,Query query) throws IOException { super(entry,query); //TODO: cache this primaryKey = ((JDBCDataStore) entry.getDataStore()).getPrimaryKey(entry); }
/** * Creates the new feature store. * @param entry The datastore entry. * @param query The defining query. */ public JDBCFeatureSource(ContentEntry entry,Query query) throws IOException { super(entry,query); //TODO: cache this primaryKey = ((JDBCDataStore) entry.getDataStore()).getPrimaryKey(entry); }
/** * Closes the database connection with a call to * {@link JDBCDataStore#closeSafe(Connection)}. */ public void close() { ((JDBCDataStore)entry.getDataStore()).closeSafe(connection); super.close(); }
@Override public void close() throws IOException { if (!scrollIds.isEmpty()) { final ElasticDataStore dataStore; dataStore = (ElasticDataStore) contentState.getEntry().getDataStore(); dataStore.getClient().clearScroll(scrollIds); } delegate.close(); }
public CSVFeatureReader(ContentState contentState) throws IOException { this.state = contentState; CSVDataStore csv = (CSVDataStore) contentState.getEntry().getDataStore(); reader = csv.read(); // this may throw an IOException if it could not connect boolean header = reader.readHeaders(); if (! header ){ throw new IOException("Unable to read csv header"); } builder = new SimpleFeatureBuilder( state.getFeatureType() ); geometryFactory = JTSFactoryFinder.getGeometryFactory(null); row = 0; }
private void advanceScroll() throws IOException { final ElasticDataStore dataStore; dataStore = (ElasticDataStore) contentState.getEntry().getDataStore(); processResponse(dataStore.getClient().scroll(nextScrollId, dataStore.getScrollTime())); }
public MemoryFeatureWriterWithProvidedFIDSupport(ContentState state, Query query) throws IOException { this.state = state; featureType = state.getFeatureType(); String typeName = featureType.getTypeName(); MemoryDataStoreWithProvidedFIDSupport store = (MemoryDataStoreWithProvidedFIDSupport) state .getEntry().getDataStore(); contents = store.entry(typeName).getMemory(); iterator = contents.values().iterator(); }
public MemoryFeatureWriterWithProvidedFIDSupport(ContentState state, Query query) throws IOException { this.state = state; featureType = state.getFeatureType(); String typeName = featureType.getTypeName(); MemoryDataStoreWithProvidedFIDSupport store = (MemoryDataStoreWithProvidedFIDSupport) state .getEntry().getDataStore(); contents = store.entry(typeName).getMemory(); iterator = contents.values().iterator(); }
@Override public SimpleFeature next() throws IOException, IllegalArgumentException, NoSuchElementException { if (this.append) { this.builder.addAll(new Object[this.state.getEntry().getDataStore().getSchema(this.getFeatureType().getTypeName()).getAttributeCount()]); this.each = this.buildFeature(); return this.each; } this.checkPendingWrite(); return this.each = super.next(); }