public String getNativeName() { return delegate.getNativeName(); }
@Override protected Name getTemporaryName( FeatureTypeInfo info, DataAccess<? extends FeatureType, ? extends Feature> dataAccess, FeatureTypeCallback initializer) throws IOException { if (VT_NAME.equals(info.getNativeName())) { counter.incrementAndGet(); } return super.getTemporaryName(info, dataAccess, initializer); } };
@Override public void dispose( FeatureTypeInfo info, DataAccess<? extends FeatureType, ? extends Feature> dataAccess, Name temporaryName) throws IOException { JDBCDataStore ds = (JDBCDataStore) dataAccess; if (temporaryName != null) { ds.dropVirtualTable(temporaryName.getLocalPart()); } else { ds.dropVirtualTable(info.getNativeName()); } } }
try { String nativeName = ft.getNativeName(); if (nativeName != null) { flushState(contentDataStore, nativeName);
LOGGER.warning( "Ignoring feature type: '" + featureType.getNativeName() + "', error occured loading schema: " + e.getMessage());
final String typeName = info.getNativeName(); final String alias = info.getName(); final SimpleFeatureType nativeFeatureType = dataStore.getSchema(typeName);
private String buildLayerIdentifier(LayerInfo geogigLayer) { FeatureTypeInfo resource = (FeatureTypeInfo) geogigLayer.getResource(); DataStoreInfo store = resource.getStore(); Map<String, Serializable> connectionParameters = store.getConnectionParameters(); final String repositoryId = (String) connectionParameters.get(REPOSITORY.key); Serializable refSpec = connectionParameters.get(BRANCH.key); if (refSpec == null) { refSpec = connectionParameters.get(HEAD.key); } StringBuilder identifier = new StringBuilder(repositoryId).append(':').append(resource.getNativeName()); if (refSpec != null) { identifier.append(':').append(refSpec); } return identifier.toString(); } }
public List<Join> getJoins() { List<Join> joins = new ArrayList(); setupPrimary(); // unroll the contents of the join filters and rewrite them and and assign to correct // feature type List<Filter> joinFilters = rewriteAndSortJoinFilters(this.joinFilters); // do same for other secondary filters List<Filter> otherFilters = rewriteAndSortOtherFilters(this.filters); for (int i = 0; i < featureTypes.size(); i++) { String nativeName = featureTypes.get(i).getNativeName(); Join join = new Join(nativeName, joinFilters.get(i + 1)); if (aliases != null) { join.setAlias(aliases.get(i)); } if (otherFilters.get(i + 1) != null) { join.setFilter(otherFilters.get(i + 1)); } joins.add(join); } return joins; }
@Override public void validate(IValidatable<String> validatable) { String csqName = (String) validatable.getValue(); final DataStoreInfo store = getCatalog().getStore(storeId, DataStoreInfo.class); List<FeatureTypeInfo> ftis = getCatalog().getResourcesByStore(store, FeatureTypeInfo.class); for (FeatureTypeInfo curr : ftis) { StoredQueryConfiguration config = curr.getMetadata() .get( FeatureTypeInfo.STORED_QUERY_CONFIGURATION, StoredQueryConfiguration.class); if (config != null) { if (curr.getNativeName().equals(csqName)) { Map<String, Object> map = new HashMap<>(); map.put("name", csqName); map.put("dataStore", store.getName()); IValidationError err = new ValidationError("duplicateSqlViewName") .addKey("duplicateSqlViewName") .setVariables(map); validatable.error(err); return; } } } } }
@Before public void setup() { lakes = createNiceMock(FeatureTypeInfo.class); expect(lakes.prefixedName()).andReturn("gs:Lakes").anyTimes(); expect(lakes.getNativeName()).andReturn("Lakes").anyTimes(); expect(lakes.getName()).andReturn("Lakes").anyTimes(); forests = createNiceMock(FeatureTypeInfo.class); expect(forests.prefixedName()).andReturn("gs:Forests").anyTimes(); expect(forests.getNativeName()).andReturn("Forests").anyTimes(); expect(forests.getName()).andReturn("Forests").anyTimes(); buildings = createNiceMock(FeatureTypeInfo.class); expect(buildings.prefixedName()).andReturn("gs:Buildings").anyTimes(); expect(buildings.getNativeName()).andReturn("Buildings").anyTimes(); expect(buildings.getName()).andReturn("Buildings").anyTimes(); replay(lakes, forests, buildings); }
featureTypesByNativeName.put(ftInfo.getNativeName(), ftInfo);
if (dataAccess instanceof DataStore) { String typeName = ftInfo.getName(); if (ftInfo.getNativeName() != null) { typeName = ftInfo.getNativeName(); dataAccess.getFeatureSource(new NameImpl(ftInfo.getNativeName())); if (featureSource != null) { cb.setupMetadata(ftInfo, featureSource);
if (gtda instanceof DataStore) { String typeName = featureType.getName(); if(featureType.getNativeName() != null) { typeName = featureType.getNativeName(); gtda.getFeatureSource(new NameImpl(featureType.getNativeName())); if (featureSource != null) { cb.setupMetadata(featureType, featureSource);
new HashMap<String, FeatureTypeInfo>(); for (FeatureTypeInfo ftInfo : catalog.getFeatureTypesByDataStore(info)) { featureTypesByNativeName.put(ftInfo.getNativeName(), ftInfo);
if(fti.getNativeName() != null) { builder.setName(fti.getNativeName()); } else { builder.setName(fti.getName());
if (fti.getNativeName() != null) { builder.setName(fti.getNativeName()); } else { builder.setName(fti.getName());
@Test public void testSuccessAndCleanup() throws SchedulerException { dataUtil.setConfigurationAttribute(config, ATT_DB_NAME, DB_NAME); dataUtil.setConfigurationAttribute(config, ATT_TABLE_NAME, TABLE_NAME); dataUtil.setConfigurationAttribute(config, ATT_LAYER, LAYER_NAME); config = dao.save(config); Trigger trigger = TriggerBuilder.newTrigger().forJob(batch.getId().toString()).startNow().build(); scheduler.scheduleJob(trigger); while (scheduler.getTriggerState(trigger.getKey()) != TriggerState.NONE) {} assertNotNull(catalog.getLayerByName(LAYER_NAME)); assertNotNull(catalog.getStoreByName(WORKSPACE, DB_NAME, DataStoreInfo.class)); FeatureTypeInfo fti = catalog.getResourceByName(LAYER_NAME, FeatureTypeInfo.class); assertNotNull(fti); assertEquals(TABLE_NAME, fti.getNativeName()); taskUtil.cleanup(config); assertNull(catalog.getLayerByName(LAYER_NAME)); assertNull(catalog.getStoreByName(WORKSPACE, ATT_DB_NAME, DataStoreInfo.class)); assertNull(catalog.getResourceByName(LAYER_NAME, FeatureTypeInfo.class)); }
FeatureTypeInfo fti = catalog.getResourceByName(LAYER_NAME, FeatureTypeInfo.class); assertNotNull(fti); assertEquals(SqlUtil.notQualified(VIEW_NAME), fti.getNativeName());
FeatureTypeInfo fti = catalog.getResourceByName(LAYER_NAME, FeatureTypeInfo.class); assertNotNull(fti); assertEquals(SqlUtil.notQualified(VIEW_NAME), fti.getNativeName());