@Override public void startup( Workspace workspace ) { this.workspace = workspace; super.startup( workspace ); }
@Override public ResourceMetadata<OWSMetadataProvider> add( ResourceLocation<OWSMetadataProvider> location ) { // else new locations will be filtered out super.read( Collections.singletonList( location ) ); return metadataMap.get( location.getIdentifier() ); }
@Override public void startup( Workspace workspace ) { this.workspace = workspace; super.startup( workspace ); }
@Override public ResourceMetadata<T> add( ResourceLocation<T> location ) { read( Collections.singletonList( location ) ); return metadataMap.get( location.getIdentifier() ); }
@Override public void startup( Workspace workspace ) { // Check for legacy JDBC drivers and warn if some are found in modules directory ClassLoader moduleClassLoader = workspace.getModuleClassLoader(); for ( Driver d : ServiceLoader.load( Driver.class, moduleClassLoader ) ) { warnIfDriversAreRegisteredInModulesClassLoader( moduleClassLoader, d ); } super.startup( workspace ); }
@Override protected void read( List<ResourceLocation<OWSMetadataProvider>> list ) { list = new ArrayList<ResourceLocation<OWSMetadataProvider>>( list ); ListIterator<ResourceLocation<OWSMetadataProvider>> iter = list.listIterator(); while ( iter.hasNext() ) { ResourceLocation<OWSMetadataProvider> loc = iter.next(); if ( !loc.getIdentifier().getId().endsWith( "_metadata" ) ) { iter.remove(); } } super.read( list ); }
@Override public void startup( Workspace workspace ) { try { if ( workspace instanceof DefaultWorkspace ) { File dir = new File( ( (DefaultWorkspace) workspace ).getLocation(), getMetadata().getWorkspacePath() ); bboxCache = new BBoxPropertiesCache( new File( dir, BBOX_CACHE_FILE ) ); } // else? } catch ( IOException e ) { LOG.error( "Unable to initialize global envelope cache: " + e.getMessage(), e ); } super.startup( workspace ); }
@Override protected void read( List<ResourceLocation<TileStore>> list ) { ListIterator<ResourceLocation<TileStore>> iter = list.listIterator(); while ( iter.hasNext() ) { ResourceLocation<TileStore> loc = iter.next(); if ( loc.getIdentifier().getId().startsWith( "tilematrixset" ) ) { iter.remove(); } } super.read( list ); }
@Override protected void read( List<ResourceLocation<OWS>> list ) { ListIterator<ResourceLocation<OWS>> iter = list.listIterator(); while ( iter.hasNext() ) { ResourceLocation<OWS> loc = iter.next(); if ( loc.getIdentifier().getId().endsWith( "_metadata" ) ) { iter.remove(); } if ( loc.getIdentifier().getId().equals( "metadata" ) | loc.getIdentifier().getId().equals( "main" ) ) { iter.remove(); } } super.read( list ); }
@Override public void find() { LOG.info( "--------------------------------------------------------------------------------" ); LOG.info( "Scanning for {}.", metadata.getName() ); LOG.info( "--------------------------------------------------------------------------------" ); List<ResourceLocation<T>> list = workspace.getLocationHandler().findResourceLocations( metadata ); read( list ); Iterator<ResourceProvider<T>> iter = nsToProvider.values().iterator(); while ( iter.hasNext() ) { ResourceProvider<T> prov = iter.next(); try { for ( ResourceMetadata<T> md : prov.getAdditionalResources( workspace ) ) { // only overrides if the resource has not been overridden if ( !metadataMap.containsKey( md.getIdentifier() ) ) { metadataMap.put( md.getIdentifier(), md ); } } } catch ( Exception e ) { LOG.error( "Unable to obtain additional resources from {}: {}", prov.getClass().getSimpleName(), e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } } }