org.geoserver.config.GeoServer.getCatalog()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(254)

本文整理了Java中org.geoserver.config.GeoServer.getCatalog()方法的一些代码示例,展示了GeoServer.getCatalog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoServer.getCatalog()方法的具体详情如下:
包路径:org.geoserver.config.GeoServer
类名称:GeoServer
方法名:getCatalog

GeoServer.getCatalog介绍

[英]The catalog.
[中]目录。

代码示例

代码示例来源:origin: geoserver/geoserver

public LocalWorkspaceCallback(GeoServer gs) {
  this.gs = gs;
  catalog = gs.getCatalog();
}

代码示例来源:origin: geoserver/geoserver

public ServicePersister(List<XStreamServiceLoader> loaders, GeoServer geoServer) {
  this.loaders = loaders;
  this.geoServer = geoServer;
  this.resourceLoader = geoServer.getCatalog().getResourceLoader();
}

代码示例来源:origin: geoserver/geoserver

@Override
  public void initialize(GeoServer geoServer) throws Exception {
    loader.initializeDefaultStyles(geoServer.getCatalog());
  }
}

代码示例来源:origin: geoserver/geoserver

public UpdateSequenceListener(GeoServer geoServer) {
  this.geoServer = geoServer;
  geoServer.getCatalog().addListener(this);
  geoServer.addListener(this);
}

代码示例来源:origin: geoserver/geoserver

/**
 * 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");
}

代码示例来源:origin: geoserver/geoserver

@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());
  }
});

代码示例来源:origin: geoserver/geoserver

/** 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);
}

代码示例来源:origin: geoserver/geoserver

/**
 * 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());
}

代码示例来源:origin: geoserver/geoserver

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);
}

代码示例来源:origin: geoserver/geoserver

MetadataLinkInfo ml = gs.getCatalog().getFactory().createMetadataLink();
ml.setAbout((String) metadataLink.get("about"));
ml.setMetadataType((String) metadataLink.get("metadataType"));

代码示例来源:origin: geoserver/geoserver

@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()));
  }
}

代码示例来源:origin: geoserver/geoserver

MetadataLinkInfo ml = gs.getCatalog().getFactory().createMetadataLink();
ml.setAbout((String) metadataLink.get("about"));
ml.setMetadataType((String) metadataLink.get("metadataType"));

代码示例来源:origin: geoserver/geoserver

final int cacheSize = global.getFeatureTypeCacheSize();
if (cacheSize > 0) {
  gs.getCatalog().getResourcePool().setFeatureTypeCacheSize(cacheSize);
gs.getCatalog().getResourcePool().setEntityResolverProvider(resolverProvider);

代码示例来源:origin: geoserver/geoserver

@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());
  }
}

代码示例来源:origin: geoserver/geoserver

try {
  XStreamPersister xp = xpf.createXMLPersister();
  xp.setCatalog(geoserver.getCatalog());
  loadGeoServer(geoserver, xp);

代码示例来源:origin: geoserver/geoserver

gs.getCatalog().getResourcePool().setCoverageExecutor(executor);

代码示例来源:origin: geoserver/geoserver

Class<T> serviceClass, String workspace, GeoServer geoServer) {
Catalog catalog = geoServer.getCatalog();

代码示例来源:origin: geoserver/geoserver

workspace != null ? geoServer.getCatalog().getWorkspaceByName(workspace) : null;

代码示例来源:origin: org.geoserver/gs-wfs

public XmlSchemaEncoder(String mimeType, GeoServer gs, FeatureTypeSchemaBuilder schemaBuilder) {
  super(gs, mimeType);
  this.catalog = gs.getCatalog();
  this.resourceLoader = catalog.getResourceLoader();
  this.schemaBuilder = schemaBuilder;
}

代码示例来源:origin: org.geoserver.web/gs-web-core

private CloseableIterator<DataStoreInfo> getDataStores() {
    Catalog catalog = parent.getGeoServer().getCatalog();
    Filter filter = Predicates.acceptAll();
    CloseableIterator<DataStoreInfo> stores = catalog.list(DataStoreInfo.class, filter);
    return stores;
  }
}

相关文章