public void watch(WFSContentState localState) { Name typeName = localState.getEntry().getName(); localStates.put(typeName, localState); } }
/** * 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(); }
@Override protected SimpleFeatureType buildFeatureType() throws IOException { String typeName = getEntry().getTypeName(); String namespace = getEntry().getName().getNamespaceURI(); String typeSpec = property("_"); try { return DataUtilities.createType(namespace, typeName, typeSpec); } catch (SchemaException e) { java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", e); throw new DataSourceException(typeName + " schema not available", e); } }
public PropertyFeatureSource(ContentEntry entry, Query query) { super(entry, query); this.store = (PropertyDataStore) entry.getDataStore(); this.typeName = entry.getTypeName(); }
@Override protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException { ContentState state = entry.getState(null); SimpleFeatureType type = state.getFeatureType(); if (type == null) { type = schemaStore.retrieveSchema(entry.getName()); if (type != null) { state.setFeatureType(type); } } String collectionName = type != null ? collectionNameFromType(type) : entry.getTypeName(); return new MongoFeatureStore(entry, null, dataStoreDB.getCollection(collectionName)); }
/** * 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); }
public String toString() { return "ContentEntry " + getTypeName(); } }
ContentFeatureStore store; ContentEntry entry = state.getEntry(); Name name = entry.getName(); ContentDataStore dataStore = entry.getDataStore(); ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(name); if (source instanceof ContentFeatureStore) {
ContentEntry entry = new ContentEntry(dataStore, new NameImpl("test")); ContentState state = entry.getState(transaction); new DiffTransactionState(state); assertSame(state, entry.getState(transaction)); ContentState stateForClosedTransaction = entry.getState(transaction); assertNotSame(stateForClosedTransaction, state); } catch (IOException e) {
synchronized (this) { if (!entries.containsKey(tn)) { entry = new ContentEntry(this, tn); entries.put(tn, entry);
public void dispose() { for (ContentEntry entry : entries.values()) { entry.dispose(); } entries.clear(); }
/** * Sets the flag which will expose columns which compose a tables identifying or primary key, * through feature type attributes. * * <p>Note: setting this flag which affect all feature sources created from or working against * the current transaction. */ public void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns) { ((JDBCState) entry.getState(transaction)) .setExposePrimaryKeyColumns(exposePrimaryKeyColumns); }
@Override protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException { File file = new File(this.dir, entry.getTypeName() + ".properties"); if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } if (file.canWrite()) { return new PropertyFeatureStore(entry, Query.ALL); } else { return new PropertyFeatureSource(entry, Query.ALL); } }
PropertyFeatureStore(ContentEntry entry, Query query) throws IOException { super(entry, query); this.store = (PropertyDataStore) entry.getDataStore(); this.typeName = entry.getTypeName(); }
public CSVFeatureSource(CSVDataStore datastore, Query query) { this(new ContentEntry(datastore, datastore.getTypeName()), query); }
public void dispose() { for ( ContentEntry entry : entries.values() ) { entry.dispose(); } }
/** * Access MemoryState for typeName. * * <p>Technically this is accessing the MemoryState for {@link Transaction#AUTO_COMMIT}, which * is the definitive storage for the feature content. * * @param typeName * @return MemoryState storing feature (by FeatureID) * @throws IOException If typeName cannot be found */ protected MemoryEntry entry(String typeName) throws IOException { synchronized (entries) { for (ContentEntry entry : this.entries.values()) { if (entry.getName().getLocalPart().equals(typeName)) { return (MemoryEntry) entry; } } } throw new IOException("Type name " + typeName + " not found"); }
/** * 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); }
VirtualTable virtualTable = getDataStore().getVirtualTables().get(entry.getTypeName()); String tableName = entry.getName().getLocalPart(); tb.setName(tableName); if (entry.getName().getNamespaceURI() != null) { tb.setNamespaceURI(entry.getName().getNamespaceURI()); } else {