private Collection<FeatureType> getFeatureTypesWithMetadata() { final Collection<FeatureType> sortedFts = new LinkedHashSet<FeatureType>(); for ( final DatasetMetadata datasetMetadata : mdProvider.getDatasetMetadata() ) { final QName ftName = datasetMetadata.getQName(); final FeatureStore fs = service.getStore( ftName ); if ( fs != null ) { if ( fs.isMapped( ftName ) ) { sortedFts.add( service.lookupFeatureType( ftName ) ); } } else { LOG.warn( "Found metadata for feature type '" + ftName + "', but feature type is not available from any store." ); } } return sortedFts; }
private Collection<FeatureType> getAllFeatureTypes() { Comparator<FeatureType> comp = new Comparator<FeatureType>() { @Override public int compare( FeatureType ftMd1, FeatureType ftMd2 ) { QName a = ftMd1.getName(); QName b = ftMd2.getName(); int order = a.getNamespaceURI().compareTo( b.getNamespaceURI() ); if ( order == 0 ) { order = a.getLocalPart().compareTo( b.getLocalPart() ); } return order; } }; Collection<FeatureType> sortedFts = new TreeSet<FeatureType>( comp ); for ( FeatureType ft : service.getFeatureTypes() ) { FeatureStore fs = service.getStore( ft.getName() ); if ( fs.isMapped( ft.getName() ) ) { sortedFts.add( ft ); } } return sortedFts; }