public LocalWorkspaceCallback(GeoServer gs) { this.gs = gs; catalog = gs.getCatalog(); }
public ServicePersister(List<XStreamServiceLoader> loaders, GeoServer geoServer) { this.loaders = loaders; this.geoServer = geoServer; this.resourceLoader = geoServer.getCatalog().getResourceLoader(); }
@Override public void initialize(GeoServer geoServer) throws Exception { loader.initializeDefaultStyles(geoServer.getCatalog()); } }
public UpdateSequenceListener(GeoServer geoServer) { this.geoServer = geoServer; geoServer.getCatalog().addListener(this); geoServer.addListener(this); }
/** * Find the file that should provide the user information. * * @throws ConfigurationException if the user configuration file does not exist and cannot be * created * @throws IOException if an error occurs while opening the user configuration file */ private Resource getUserFile() throws ConfigurationException, IOException { GeoServerResourceLoader loader = geoServer.getCatalog().getResourceLoader(); return loader.get("security/users.properties"); }
@Override public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { int i = propertyNames.indexOf("featureTypeCacheSize"); if (i > -1) { Number featureTypeCacheSize = (Number) newValues.get(i); gs.getCatalog() .getResourcePool() .setFeatureTypeCacheSize(featureTypeCacheSize.intValue()); } gs.getCatalog() .getResourcePool() .setCoverageExecutor( global.getCoverageAccess().getThreadPoolExecutor()); } });
/** Returns a list of available services for a layer name */ public List<String> getServicesForLayerName(String layerName) { ResourceInfo resource = geoServer.getCatalog().getLayerByName(layerName).getResource(); return getServicesForResource(resource); }
/** * Hook for subclasses to configure the xstream. * * <p>The most common use is to do some aliasing or omit some fields. */ protected void initXStreamPersister(XStreamPersister xp, GeoServer gs) { xp.setGeoServer(gs); xp.setCatalog(gs.getCatalog()); xp.getXStream().alias(filenameBase, getServiceClass()); }
public void reload() throws Exception { destroy(); // reload catalog, make sure we reload the underlying catalog, not any wrappers Catalog catalog = geoserver.getCatalog(); if (catalog instanceof Wrapper) { catalog = ((Wrapper) geoserver.getCatalog()).unwrap(Catalog.class); } XStreamPersister xp = xpf.createXMLPersister(); xp.setCatalog(catalog); loadCatalog(catalog, xp); loadGeoServer(geoserver, xp); reloadInitializers(geoserver); }
MetadataLinkInfo ml = gs.getCatalog().getFactory().createMetadataLink(); ml.setAbout((String) metadataLink.get("about")); ml.setMetadataType((String) metadataLink.get("metadataType"));
@Test public void testContextStartup() { GeoServer config = (GeoServer) applicationContext.getBean("geoServer"); assertNotNull( config.getCatalog() .getFeatureTypeByName( MockData.BUILDINGS.getNamespaceURI(), MockData.BUILDINGS.getLocalPart())); assertNotNull( config.getCatalog() .getFeatureTypeByName( MockData.BASIC_POLYGONS.getNamespaceURI(), MockData.BASIC_POLYGONS.getLocalPart())); } }
MetadataLinkInfo ml = gs.getCatalog().getFactory().createMetadataLink(); ml.setAbout((String) metadataLink.get("about")); ml.setMetadataType((String) metadataLink.get("metadataType"));
final int cacheSize = global.getFeatureTypeCacheSize(); if (cacheSize > 0) { gs.getCatalog().getResourcePool().setFeatureTypeCacheSize(cacheSize); gs.getCatalog().getResourcePool().setEntityResolverProvider(resolverProvider);
@Test public void testPropertyDataStoreRelativeUrl() throws IOException { // create dir File testDS = new File(testData.getDataDirectoryRoot(), "testDS").getCanonicalFile(); testDS.mkdir(); HashMap params = new HashMap(); params.put(PropertyDataStoreFactory.DIRECTORY.key, "file:./testDS"); params.put(PropertyDataStoreFactory.NAMESPACE.key, "http://www.geotools.org/test"); DataStoreInfoImpl info = new DataStoreInfoImpl(getGeoServer().getCatalog()); info.setConnectionParameters(params); DataAccessFactory f = getGeoServer().getCatalog().getResourcePool().getDataStoreFactory(info); assertNotNull(f); assertTrue(f instanceof PropertyDataStoreFactory); DataAccess store = getGeoServer().getCatalog().getResourcePool().getDataStore(info); assertEquals( testDS.toURI().toString().toLowerCase(), store.getInfo().getSource().toString().replace("/./", "/").toLowerCase()); } }
try { XStreamPersister xp = xpf.createXMLPersister(); xp.setCatalog(geoserver.getCatalog()); loadGeoServer(geoserver, xp);
gs.getCatalog().getResourcePool().setCoverageExecutor(executor);
Class<T> serviceClass, String workspace, GeoServer geoServer) { Catalog catalog = geoServer.getCatalog();
workspace != null ? geoServer.getCatalog().getWorkspaceByName(workspace) : null;
public XmlSchemaEncoder(String mimeType, GeoServer gs, FeatureTypeSchemaBuilder schemaBuilder) { super(gs, mimeType); this.catalog = gs.getCatalog(); this.resourceLoader = catalog.getResourceLoader(); this.schemaBuilder = schemaBuilder; }
private CloseableIterator<DataStoreInfo> getDataStores() { Catalog catalog = parent.getGeoServer().getCatalog(); Filter filter = Predicates.acceptAll(); CloseableIterator<DataStoreInfo> stores = catalog.list(DataStoreInfo.class, filter); return stores; } }