private RemoteWMTS getRemoteWmts( String remoteWmtsId ) throws ResourceInitException { RemoteOWS wmts = workspace.getResource( RemoteOWSProvider.class, remoteWmtsId ); if ( !( wmts instanceof RemoteWMTS ) ) { String msg = "The remote WMTS id " + remoteWmtsId + " must correspond to a WMTS instance (was " + wmts.getClass().getSimpleName() + ")"; throw new ResourceInitException( msg ); } return (RemoteWMTS) wmts; }
workspace.initAll(); } catch ( ResourceInitException e1 ) { LOG.error( "Initialization of secure proxy failed: {}", e1.getLocalizedMessage() ); LOG.trace( "Stack trace: ", e ); return;
@Override public T build() { final T t = getBean( clazz, beanName ); try { wireMetadata( t.getClass(), t ); } catch ( Exception e ) { LOG.debug( "Couldn't inject metadata.", e ); throw new ResourceInitException( "Couldn't inject metadata.", e ); } return t; } }
workspace.initAll(); } catch ( ResourceInitException e ) { LOG.error( "Initialization failed: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace: ", e ); return null;
@Override public void init() { try { getConnection().close(); } catch ( SQLException e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
CommandUtils.printHelp( options, FeatureTypesToLayerTree.class.getSimpleName(), null, null ); } catch ( ResourceInitException e ) { LOG.info( "The feature store could not be loaded: '{}'", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } catch ( FileNotFoundException e ) {
private void checkConnection( ConnectionProvider conn ) { if ( conn == null ) { String msg = "Unable to create SqlFeatureStore: Connection with identifier " + config.getJDBCConnId().getValue() + " is not available."; LOG.error( msg ); throw new ResourceInitException( msg ); } }
@Override public ProcessProvider build() { try { XMLStreamReader xmlStream = XMLInputFactory.newInstance().createXMLStreamReader( metadata.getLocation().getAsStream() ); while ( xmlStream.getEventType() != XMLStreamConstants.END_DOCUMENT ) { if ( xmlStream.isStartElement() && "Process".equals( xmlStream.getLocalName() ) ) { return new StyleProcessProvider( xmlStream.getAttributeValue( null, "id" ), metadata ); } else { xmlStream.next(); } } } catch ( Exception e ) { throw new ResourceInitException( "Error parsing style process provider configuration '" + metadata.getIdentifier() + "': " + e.getMessage(), e ); } throw new ResourceInitException( "Could not parse style process configuration." ); }
@Override public ResourceBuilder<ConnectionProvider> prepare() { try { final Object cfg = unmarshall( JAXB_PACKAGE, SCHEMA_URL, location.getAsStream(), workspace ); return new DataSourceConnectionProviderBuilder( (DataSourceConnectionProvider) cfg, this, workspace ); } catch ( Exception e ) { LOG.error( e.getLocalizedMessage(), e ); throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
throw new ResourceInitException( "Couldn't fetch bean with type '" + className + "' and name '" + beanName + "' from ApplicationContext.", e ); switch ( beans.size() ) { case 0: throw new ResourceInitException( "No beans of type " + className + " found in ApplicationContext." ); case 1: className, conventionalBeanName ); } else { throw new ResourceInitException( "Multiple beans of type " + className + " are found in ApplicationContext, none of them bares the conventional name '" + conventionalBeanName throw new ResourceInitException( "Multiple beans of type " + className + " are found in ApplicationContext." );
@Override public SQLDialect createDialect( final Connection conn ) { Statement stmt = null; ResultSet rs = null; String version = null; try { version = determinePostGISVersion( conn, LOG ); } catch ( Exception e ) { LOG.trace( e.getMessage(), e ); throw new ResourceInitException( e.getMessage(), e ); } finally { close( rs, stmt, null, LOG ); } return new PostGISDialect( version ); }
@Override public RemoteOWS build() { WMTSClient client = null; try { client = createClient(); } catch ( Exception e ) { String msg = "Could not create WMTS client for Remote WMTS store config at '" + metadata.getIdentifier() + "': " + e.getLocalizedMessage(); throw new ResourceInitException( msg, e ); } return new RemoteWMTS( client, metadata ); }
@Override public ResourceBuilder<ConnectionProvider> prepare() { try { JDBCConnection cfg = (JDBCConnection) JAXBUtils.unmarshall( "org.deegree.db.legacy.jaxb", SCHEMA_URL, location.getAsStream(), workspace ); return new LegacyConnectionProviderBuilder( cfg, this, workspace ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public TileStore build() { try { String wmsId = config.getRemoteWMSId(); RemoteOWS wms = workspace.getResource( RemoteOWSProvider.class, wmsId ); if ( !( wms instanceof RemoteWMS ) ) { throw new ResourceInitException( "The remote wms id " + wmsId + " must correspond to a WMS instance (was " + wms.getClass().getSimpleName() + ")" ); } TileDataSetBuilder builder = new TileDataSetBuilder( config, (RemoteWMS) wms, workspace ); Map<String, TileDataSet> map = builder.extractTileDataSets(); return new GenericTileStore( map, metadata ); } catch ( Exception e ) { String msg = "Unable to create RemoteWMSTileStore: " + e.getMessage(); throw new ResourceInitException( msg, e ); } }
@Override public TileStore build() { try { GdalTileDataSetMapBuilder builder = new GdalTileDataSetMapBuilder( workspace, metadata.getLocation(), cfg ); Map<String, TileDataSet> map = builder.buildTileDataSetMap(); return new GenericTileStore( map, metadata ); } catch ( Exception e ) { e.printStackTrace(); throw new ResourceInitException( "Unable to build GDALTileStore: " + e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<FeatureStore> prepare() { try { MemoryFeatureStoreConfig config = (MemoryFeatureStoreConfig) unmarshall( "org.deegree.feature.persistence.memory.jaxb", CONFIG_SCHEMA, location.getAsStream(), workspace ); dependencies.add( new DefaultResourceIdentifier<ConnectionProvider>( ConnectionProviderProvider.class, "LOCK_DB" ) ); return new MemoryFeatureStoreBuilder( this, config, workspace ); } catch ( Exception e ) { throw new ResourceInitException( e.getLocalizedMessage(), e ); } }
@Override public ResourceBuilder<ApplicationContextHolder> prepare() { BootstrapApplicationContextHolderConfig config; try { config = (BootstrapApplicationContextHolderConfig) JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, CONFIG_SCHEMA, location.getAsStream(), workspace ); } catch ( Exception e ) { LOG.trace( "Stack trace:", e ); throw new ResourceInitException( e.getLocalizedMessage(), e ); } return new BootstrapApplicationContextHolderBuilder( workspace.getModuleClassLoader(), this, config ); } }
throw new ResourceInitException( msg, e );
return new IncorporealResourceLocation<ConnectionProvider>( bos.toByteArray(), rid ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to create synthetic connection provider: " + e.getLocalizedMessage(), e );