private RemoteWMTSConfig unmarshall( InputStream in ) throws ResourceInitException, JAXBException { return (RemoteWMTSConfig) JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), in, workspace ); }
@Override public ResourceMetadata<T> read( Workspace workspace, ResourceLocation<T> location ) { if ( !getNamespace().equals( location.getNamespace() ) ) { return null; } return createFromLocation( workspace, location ); }
private RemoteWMTSTileStoreJAXB unmarshallConfig() throws JAXBException { return (RemoteWMTSTileStoreJAXB) unmarshall( JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); }
@Override public ResourceBuilder<FeatureStore> prepare() { try { ShapeFeatureStoreConfig config = (ShapeFeatureStoreConfig) JAXBUtils.unmarshall( ShapeFeatureStoreProvider.CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new ShapeFeatureStoreBuilder( config, location, this ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<RenderableStore> prepare() { try { RenderableFileStoreConfig config = (RenderableFileStoreConfig) unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new FileRenderableStoreBuilder( config, this ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<BatchedMTStore> prepare() { try { BatchedMTFileStoreConfig config = (BatchedMTFileStoreConfig) JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new BatchedMTFileStoreBuilder( config, this ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to parse config: " + e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<LayerStore> prepare() { try { GDALLayers cfg; cfg = (GDALLayers) JAXBUtils.unmarshall( "org.deegree.layer.persistence.gdal.jaxb", provider.getSchema(), location.getAsStream(), workspace ); return new GdalLayerStoreBuilder( cfg, workspace, this ); } catch ( Exception e ) { throw new ResourceInitException( "Error while creating GDAL layers: " + e.getLocalizedMessage(), e ); } } }
@Override public ResourceBuilder<OWSMetadataProvider> prepare() { try { JAXBElement<DeegreeServicesMetadataType> md; md = (JAXBElement<DeegreeServicesMetadataType>) unmarshall( "org.deegree.services.jaxb.metadata", provider.getSchema(), location.getAsStream(), workspace ); return new DefaultOwsMetadataProviderBuilder( md, this ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to read service metadata config: " + e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<TileMatrixSet> prepare() { TileMatrixSetConfig cfg = null; try { cfg = (TileMatrixSetConfig) unmarshall( "org.deegree.tile.tilematrixset.jaxb", provider.getSchema(), location.getAsStream(), workspace ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } return new DefaultTileMatrixSetBuilder( cfg, this ); }
@Override public ResourceBuilder<TileMatrixSet> prepare() { try { GeoTIFFTileMatrixSetConfig cfg = (GeoTIFFTileMatrixSetConfig) JAXBUtils.unmarshall( "org.deegree.tile.tilematrixset.geotiff.jaxb", provider.getSchema(), location.getAsStream(), workspace ); return new GeoTiffTileMatrixSetBuilder( cfg, this ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<TileMatrixSet> prepare() { try { InputStream is = location.getAsStream(); URL schemaUrl = provider.getSchema(); GdalTileMatrixSetConfig cfg = (GdalTileMatrixSetConfig) unmarshall( JAXB_PACKAGE, schemaUrl, is, workspace ); return new GdalTileMatrixSetBuilder( cfg, this ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<ProcessProvider> prepare() { try { ProcessDefinition config = (ProcessDefinition) unmarshall( JAXB_CONFIG_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new JavaProcessProviderBuilder( config, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( "Problem when building process provider: " + e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<MetadataStore<? extends MetadataRecord>> prepare() { try { ISOMemoryMetadataStoreConfig config = (ISOMemoryMetadataStoreConfig) unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new IsoMemoryMetadataStoreBuilder( config, this ); } catch ( Exception e ) { String msg = "Error setting up iso memory meatadata store from configuration: " + e.getMessage(); throw new ResourceInitException( msg, e ); } }
@Override public ResourceBuilder<RemoteOWS> prepare() { try { org.deegree.remoteows.wms_new.jaxb.RemoteWMS cfg; cfg = (org.deegree.remoteows.wms_new.jaxb.RemoteWMS) unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new RemoteWmsBuilder( cfg, this ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to prepare " + location.getIdentifier() + ": " + e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<RenderableStore> prepare() { try { RenderableSQLStoreConfig config = (RenderableSQLStoreConfig) JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); dependencies.add( new DefaultResourceIdentifier<ConnectionProvider>( ConnectionProviderProvider.class, config.getJDBCConnId() ) ); return new SqlRenderableStoreBuilder( config, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<TileStore> prepare() { try { org.deegree.tile.persistence.cache.jaxb.CachingTileStore cfg; cfg = (org.deegree.tile.persistence.cache.jaxb.CachingTileStore) unmarshall( "org.deegree.tile.persistence.cache.jaxb", provider.getSchema(), location.getAsStream(), workspace ); String tsid = cfg.getTileStoreId(); dependencies.add( new DefaultResourceIdentifier<TileStore>( TileStoreProvider.class, tsid ) ); return new CachingTileStoreBuilder( cfg, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( "Could not prepare tile store: " + e.getLocalizedMessage(), e ); } }
@Override public PyramidCoverageBuilder prepare() { Pyramid config; try { config = (Pyramid) unmarshall( "org.deegree.coverage.persistence.pyramid.jaxb", provider.getSchema(), location.getAsStream(), workspace ); return new PyramidCoverageBuilder( this, config ); } catch ( JAXBException e ) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
@Override public DefaultCoverageBuilder prepare() { try { Object config = JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); return new DefaultCoverageBuilder( config, this ); } catch ( Exception e ) { throw new ResourceInitException( "IO-Error while creating coverage store.", e ); } }
@Override public ResourceBuilder<LayerStore> prepare() { try { RemoteWMSLayers cfg = (RemoteWMSLayers) unmarshall( "org.deegree.layer.persistence.remotewms.jaxb", provider.getSchema(), location.getAsStream(), workspace ); String id = cfg.getRemoteWMSId(); dependencies.add( new DefaultResourceIdentifier<RemoteOWS>( RemoteOWSProvider.class, id ) ); return new RemoteWmsLayerStoreBuilder( cfg, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( "Could not parse remote WMS layer store config.", e ); } }
@Override public ResourceBuilder<TileStore> prepare() { try { RemoteWMSTileStoreJAXB config = (RemoteWMSTileStoreJAXB) unmarshall( JAXB_PACKAGE, provider.getSchema(), location.getAsStream(), workspace ); String wmsId = config.getRemoteWMSId(); dependencies.add( new DefaultResourceIdentifier<RemoteOWS>( RemoteOWSProvider.class, wmsId ) ); return new RemoteWmsTileStoreBuilder( config, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to prepare " + location.getIdentifier() + ": " + e.getLocalizedMessage(), e ); } }