WFSDataStore extends ContentDataStore { @Override protected List<Name> createTypeNames() throws IOException { String namespaceURI = getNamespaceURI(); Set<QName> remoteTypeNames = client.getRemoteTypeNames(); List<Name> names = new ArrayList<Name>(remoteTypeNames.size()); for (QName remoteTypeName : remoteTypeNames) { String localTypeName = remoteTypeName.getLocalPart(); if (!XMLConstants.DEFAULT_NS_PREFIX.equals(remoteTypeName.getPrefix())) { localTypeName = remoteTypeName.getPrefix() + "_" + localTypeName; } Name typeName = new NameImpl(namespaceURI==null? remoteTypeName.getNamespaceURI() : namespaceURI, localTypeName); names.add(typeName); this.names.put(typeName, remoteTypeName); } for(Entry<String, String> e : configuredStoredQueries.entrySet()) { String name = e.getKey(); String storedQueryId = e.getValue(); Name typeName = new NameImpl(namespaceURI, name); names.add(typeName); this.names.put(typeName, getStoredQueryReturnType(storedQueryId)); } return names; } WFSDataStore(final WFSClient client); @Override WFSServiceInfo getInfo(); QName getRemoteTypeName(Name localTypeName); ListStoredQueriesResponseType getStoredQueryListResponse(); boolean supportsStoredQueries(); FeatureType getRemoteFeatureType(final QName remoteTypeName); StoredQueryDescriptionType getStoredQueryDescriptionType(String storedQueryId); SimpleFeatureType getRemoteSimpleFeatureType(final QName remoteTypeName); WFSClient getWfsClient(); Name addStoredQuery(String localName, String storedQueryId); QName getStoredQueryReturnType(String storedQueryId); SimpleFeatureType getStoredQuerySchema(String storedQueryId); Map<String, String> getConfiguredStoredQueries(); void removeStoredQuery(String localName); static final String STORED_QUERY_CONFIGURATION_HINT; }
@Test public void testCreateTypeNames() throws Exception { List<Name> names = dataStore.createTypeNames(); assertNotNull(names); assertEquals(2, names.size()); assertTrue(names.contains(simpleTypeName1)); assertTrue(names.contains(simpleTypeName2)); }
@Test public void testCreateTypeNamesNS() throws Exception { final String nsOverride = "http: dataStore.setNamespaceURI(nsOverride); List<Name> names = dataStore.createTypeNames(); assertNotNull(names); assertEquals(2, names.size()); assertTrue(names.contains(new NameImpl(nsOverride, simpleTypeName1.getLocalPart()))); assertTrue(names.contains(new NameImpl(nsOverride, simpleTypeName2.getLocalPart()))); }